@longzai-intelligence-dependencies/cli 0.0.9 → 0.0.11

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/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env bun
2
- import{c as e,d as t,l as n,n as r,t as i,u as a}from"./node-DubwMwJb.js";import{createRequire as o}from"node:module";import s,{homedir as c}from"node:os";import{promisify as l}from"node:util";import*as u from"fs";import{readdir as d,readdirSync as f,realpath as p,realpathSync as m,stat as h,statSync as g}from"fs";import{basename as _,dirname as v,isAbsolute as y,normalize as b,posix as x,relative as S,resolve as C,sep as w}from"path";import{createRequire as T}from"module";import{existsSync as E,lstatSync as D,promises as O,readFileSync as k,readdirSync as A}from"node:fs";import{basename as j,dirname as ee,isAbsolute as te,join as M,relative as N,resolve as P}from"node:path";import{pathToFileURL as F}from"node:url";import{fileURLToPath as ne}from"url";import{AsyncLocalStorage as re}from"node:async_hooks";import"node:stream";import{execFile as ie}from"node:child_process";import I from"node:process";import{Buffer as L}from"node:buffer";import R from"node:http";import ae from"node:https";import"node:zlib";import"node:net";import*as oe from"node:fs/promises";import{readFile as se,writeFile as z}from"node:fs/promises";function ce(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function le(e,t=`|`){return e.map(e=>Ne(e)).join(t)}function ue(e,t){return typeof t==`bigint`?t.toString():t}var de=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function B(e){return new de(e)}function fe(e){return e==null}function pe(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function me(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function he(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ge(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function _e(e){return ge(e._zod.def)??e._zod.def.shape}function ve(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return he(this,t,e),e},enumerable:!0,configurable:!0})}function ye(e,t,n){t in e?he(e,t,n):e[t]=n}function be(e,t,n,r){let i=_e(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?ve(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):ye(e,a,r?r(n.value,a):n.value))}}function xe(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?ve(e,n,()=>t[n]):ye(e,n,r.value))}}function Se(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ce(e){return JSON.stringify(e)}function we(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Te=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Ee(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const De=/* @__PURE__*/ B(()=>{if(xt.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Oe(e){if(Ee(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Ee(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ke(e){return Oe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Ae=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Me(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function V(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 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 Ne(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Pe(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}const Fe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ie={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function Le(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return be(i,e,Re(e,t)),Me(e,Se(n,{shape:i,checks:[]}))}function Re(e,t){let n=_e(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function ze(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Re(e,t)),a={};return be(a,e,Reflect.ownKeys(_e(e)).filter(e=>!i.has(e))),Me(e,Se(n,{shape:a,checks:[]}))}function Be(e,t){if(!Oe(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=_e(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Me(e,Se(e._zod.def,{shape:Ve(e,t)}))}function Ve(e,t){let n={};return be(n,e,Reflect.ownKeys(_e(e))),xe(n,t),n}function He(e,t){if(!Oe(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Me(e,Se(e._zod.def,{shape:Ve(e,t)}))}function Ue(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return be(n,e,Reflect.ownKeys(_e(e))),be(n,t,Reflect.ownKeys(_e(t))),Me(e,Se(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function We(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Re(t,n)):void 0,o={};return be(o,t,Reflect.ownKeys(_e(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Me(t,Se(t._zod.def,{shape:o,checks:[]}))}function Ge(e,t,n){let r=n?new Set(Re(t,n)):void 0,i={};return be(i,t,Reflect.ownKeys(_e(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Me(t,Se(t._zod.def,{shape:i}))}function Ke(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function qe(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Je(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ye(e){return typeof e==`string`?e:e?.message}function Xe(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Ze(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Qe(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Ye(e.inst?._zod.def?.error?.(e))??Ye(a?.(e))??Ye(t?.error?.(e))??Ye(n.customError?.(e))??Ye(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}const $e=/[\uD800-\uDBFF]/;function et(e){let t=e.length;if(!$e.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function tt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function nt(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 t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function rt(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function it(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):ct(e,n,r.value)}}function at(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function ot(e,t,n){return at(e,t,n,!1)}/* @__NO_SIDE_EFFECTS__ */
3
- function st(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return at(this,n,r(this))},set(e){at(this,n,e)}})}return t}function ct(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:at(this,t,n.bind(this))},set(e){at(this,t,e)}})}function lt(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let ut,dt=!1;const ft={configurable:!0,get(){dt=!0}};function H(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&ut!==e._zod?ut=void 0:(ut=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,ft);let e=dt;dt=!1;try{let r=n(this);return dt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),dt||=e,r}catch(n){throw delete this[t],dt||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function pt(e,t,n,r){let i=lt(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function mt(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var ht;const gt={value:void 0,enumerable:!1};let _t=`captureStackTrace`in Error?Error:null;function vt(e){let t=_t;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return _t=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}/* @__NO_SIDE_EFFECTS__ */
4
- function U(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){gt.value=new a(r);try{Object.defineProperty(n,"_zod",gt)}finally{gt.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),it(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?vt(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var yt=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},bt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ht=globalThis).__zod_globalConfig??(ht.__zod_globalConfig={});const xt=globalThis.__zod_globalConfig;function St(e){return e&&Object.assign(xt,e),xt}function Ct(){let e=this._zod;return e.message??=JSON.stringify(e.def,ue,2),e.message}function wt(e){this._zod.message=e}const Tt={get:Ct,set:wt,enumerable:!0,configurable:!0},Et={value:void 0,enumerable:!1},Dt=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),Ot=(e,t)=>{e.name=`$ZodError`,Et.value=t,Object.defineProperty(e,"issues",Et),Et.value=void 0,Object.defineProperty(e,"message",Tt);let n=Object.getPrototypeOf(e);Dt.has(n)||(Dt.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},kt=/* @__PURE__ */ U(`$ZodError`,Ot),At=/* @__PURE__ */ U(`$ZodError`,Ot,void 0,{Parent:Error});function jt(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Mt(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?jt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Nt(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Pt(e,t){return{callee:t?.callee??e,Err:t?.Err}}const Ft=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new yt;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Qe(e,o,St())));throw Te(n,a?.callee??t),n}return s.value};return t},It=/* @__PURE__*/ Ft(At),Lt=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Qe(e,o,St())));throw Te(n,a?.callee??t),n}return s.value};return t},Rt=/* @__PURE__*/ Lt(At),zt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new yt;return a.issues.length?Bt(e,a.issues,i):{success:!0,data:a.value}};function Bt(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Qe(e,n,St()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const Vt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Bt(e,a.issues,i):{success:!0,data:a.value}},Ht=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),Ut=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),Wt=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Ht)return!0;if(r.definite===!0&&n===void 0)return!1}return Gt(e,t,n)});function Gt(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Ut]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new yt;return a.issues.length===0}const Kt=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},qt=e=>{let t=Ft(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Pt(n,a))};return n},Jt=e=>{let t=Ft(e),n=(e,r,i,a)=>t(e,r,i,Pt(n,a));return n},Yt=e=>{let t=Lt(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Pt(n,a))};return n},Xt=e=>{let t=Lt(e),n=async(e,r,i,a)=>await t(e,r,i,Pt(n,a));return n},Zt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return zt(e)(t,n,i)},Qt=e=>(t,n,r)=>zt(e)(t,n,r),$t=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Vt(e)(t,n,i)},en=e=>async(t,n,r)=>Vt(e)(t,n,r),tn=/^[cC][0-9a-z]{6,}$/,nn=/^[0-9a-z]+$/,rn=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,an=/^[0-9a-vA-V]{20}$/,on=/^[A-Za-z0-9]{27}$/,sn=/^[a-zA-Z0-9_-]{21}$/;function cn(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const ln=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,un=/^([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})$/,dn=e=>e?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)$/,fn=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function pn(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}const mn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,hn=/^(([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}|:))$/,gn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,_n=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,vn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,yn=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,bn=/^https?$/,xn=/^\+[1-9]\d{6,14}$/,Sn=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Cn(e){return RegExp(`^${e}$`)}const wn=/*@__PURE__*/ Cn(Sn);function Tn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function En(e){return RegExp(`^${Tn(e)}$`)}function Dn(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Tn({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Tn({precision:e.precision})}`:n;return RegExp(`^${Sn}T(?:${r})$`)}const On=/^[\s\S]{0,}$/,kn=/^-?\d+$/,An=/^-?\d+(?:\.\d+)?$/,jn=/^(?:true|false)$/i,Mn=/^[^A-Z]*$/,Nn=/^[^a-z]*$/,Pn=/*@__PURE__*/ U(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Fn=e=>{let t=e.value;return!fe(t)&&t.length!==void 0},In={number:`number`,bigint:`bigint`,object:`date`},Ln=/*@__PURE__*/ U(`$ZodCheckLessThan`,(e,t)=>{Pn.init(e,t);let n=In[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:In[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Rn=/*@__PURE__*/ U(`$ZodCheckGreaterThan`,(e,t)=>{Pn.init(e,t);let n=In[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:In[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zn=/*@__PURE__*/ U(`$ZodCheckMultipleOf`,(e,t)=>{Pn.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):me(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Bn=/*@__PURE__*/ U(`$ZodCheckNumberFormat`,(e,t)=>{Pn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Fe[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Vn=/*@__PURE__*/ U(`$ZodCheckMaxLength`,(e,t)=>{var n;Pn.init(e,t),(n=e._zod.def).when??(n.when=Fn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?et(r):i)<=t.maximum)return;let a=tt(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Hn=/*@__PURE__*/ U(`$ZodCheckMinLength`,(e,t)=>{var n;Pn.init(e,t),(n=e._zod.def).when??(n.when=Fn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?et(r):i)>=t.minimum)return;let a=tt(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Un=/*@__PURE__*/ U(`$ZodCheckLengthEquals`,(e,t)=>{var n;Pn.init(e,t),(n=e._zod.def).when??(n.when=Fn),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?et(r):i;if(a===t.length)return;let o=tt(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Wn=/*@__PURE__*/ U(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Pn.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Gn=/*@__PURE__*/ U(`$ZodCheckRegex`,(e,t)=>{Wn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Kn=/*@__PURE__*/ U(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Mn,Wn.init(e,t)}),qn=/*@__PURE__*/ U(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Nn,Wn.init(e,t)}),Jn=/*@__PURE__*/ U(`$ZodCheckIncludes`,(e,t)=>{Pn.init(e,t);let n=je(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Yn=/*@__PURE__*/ U(`$ZodCheckStartsWith`,(e,t)=>{Pn.init(e,t);let n=RegExp(`^${je(t.prefix)}.*`);t.pattern??=n,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})}}),Xn=/*@__PURE__*/ U(`$ZodCheckEndsWith`,(e,t)=>{Pn.init(e,t);let n=RegExp(`.*${je(t.suffix)}$`);t.pattern??=n,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 Zn(e,t,n){e.issues.length&&t.issues.push(...Je(n,e.issues))}const Qn=/*@__PURE__*/ U(`$ZodCheckProperties`,(e,t)=>{Pn.init(e,t),ot(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:`object`,code:`invalid_type`,input:r.value,inst:e});return}n??=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]);let i=r.value,a;for(let[e,t]of n){let n=t._zod.run({value:i[e],issues:[]},{});n instanceof Promise?(a??=[],a.push(n.then(t=>Zn(t,r,e)))):Zn(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),$n=/*@__PURE__*/ U(`$ZodCheckOverwrite`,(e,t)=>{Pn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var er=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
2
+ import{c as e,d as t,l as n,n as r,t as i,u as a}from"./node-DXqQUCDJ.js";import{createRequire as o}from"node:module";import s,{homedir as c}from"node:os";import{promisify as l}from"node:util";import*as u from"fs";import{readdir as d,readdirSync as f,realpath as p,realpathSync as m,stat as h,statSync as g}from"fs";import{basename as _,dirname as v,isAbsolute as y,normalize as b,posix as x,relative as S,resolve as C,sep as w}from"path";import{createRequire as T}from"module";import{existsSync as E,lstatSync as D,promises as O,readFileSync as k,readdirSync as A}from"node:fs";import{basename as ee,dirname as te,isAbsolute as ne,join as j,relative as re,resolve as M}from"node:path";import{pathToFileURL as N}from"node:url";import{fileURLToPath as ie}from"url";import{AsyncLocalStorage as P}from"node:async_hooks";import"node:stream";import{execFile as ae}from"node:child_process";import F from"node:process";import{Buffer as I}from"node:buffer";import L from"node:http";import oe from"node:https";import"node:zlib";import"node:net";import*as se from"node:fs/promises";import{readFile as ce,writeFile as R}from"node:fs/promises";function le(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function ue(e,t=`|`){return e.map(e=>Pe(e)).join(t)}function de(e,t){return typeof t==`bigint`?t.toString():t}var fe=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function z(e){return new fe(e)}function pe(e){return e==null}function me(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function he(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function ge(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function _e(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function ve(e){return _e(e._zod.def)??e._zod.def.shape}function ye(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return ge(this,t,e),e},enumerable:!0,configurable:!0})}function be(e,t,n){t in e?ge(e,t,n):e[t]=n}function xe(e,t,n,r){let i=ve(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?ye(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):be(e,a,r?r(n.value,a):n.value))}}function Se(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?ye(e,n,()=>t[n]):be(e,n,r.value))}}function Ce(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function we(e){return JSON.stringify(e)}function Te(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Ee=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function De(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const Oe=/* @__PURE__*/ z(()=>{if(St.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function ke(e){if(De(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return De(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Ae(e){return ke(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const je=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function Me(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ne(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function B(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 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 Pe(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Fe(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}const Ie={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Le={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function Re(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return xe(i,e,ze(e,t)),Ne(e,Ce(n,{shape:i,checks:[]}))}function ze(e,t){let n=ve(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Be(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(ze(e,t)),a={};return xe(a,e,Reflect.ownKeys(ve(e)).filter(e=>!i.has(e))),Ne(e,Ce(n,{shape:a,checks:[]}))}function Ve(e,t){if(!ke(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=ve(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ne(e,Ce(e._zod.def,{shape:He(e,t)}))}function He(e,t){let n={};return xe(n,e,Reflect.ownKeys(ve(e))),Se(n,t),n}function Ue(e,t){if(!ke(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ne(e,Ce(e._zod.def,{shape:He(e,t)}))}function We(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return xe(n,e,Reflect.ownKeys(ve(e))),xe(n,t,Reflect.ownKeys(ve(t))),Ne(e,Ce(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ge(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(ze(t,n)):void 0,o={};return xe(o,t,Reflect.ownKeys(ve(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Ne(t,Ce(t._zod.def,{shape:o,checks:[]}))}function Ke(e,t,n){let r=n?new Set(ze(t,n)):void 0,i={};return xe(i,t,Reflect.ownKeys(ve(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Ne(t,Ce(t._zod.def,{shape:i}))}function qe(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Je(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Ye(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Xe(e){return typeof e==`string`?e:e?.message}function Ze(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Qe(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function $e(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Xe(e.inst?._zod.def?.error?.(e))??Xe(a?.(e))??Xe(t?.error?.(e))??Xe(n.customError?.(e))??Xe(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}const et=/[\uD800-\uDBFF]/;function tt(e){let t=e.length;if(!et.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function nt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function rt(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 t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function it(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function at(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):lt(e,n,r.value)}}function ot(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function st(e,t,n){return ot(e,t,n,!1)}/* @__NO_SIDE_EFFECTS__ */
3
+ function ct(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return ot(this,n,r(this))},set(e){ot(this,n,e)}})}return t}function lt(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:ot(this,t,n.bind(this))},set(e){ot(this,t,e)}})}function ut(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let dt,ft=!1;const pt={configurable:!0,get(){ft=!0}};function V(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&dt!==e._zod?dt=void 0:(dt=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,pt);let e=ft;ft=!1;try{let r=n(this);return ft?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),ft||=e,r}catch(n){throw delete this[t],ft||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function mt(e,t,n,r){let i=ut(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function ht(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var gt;const _t={value:void 0,enumerable:!1};let vt=`captureStackTrace`in Error?Error:null;function yt(e){let t=vt;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return vt=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}/* @__NO_SIDE_EFFECTS__ */
4
+ function H(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){_t.value=new a(r);try{Object.defineProperty(n,"_zod",_t)}finally{_t.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),at(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?yt(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var bt=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},xt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(gt=globalThis).__zod_globalConfig??(gt.__zod_globalConfig={});const St=globalThis.__zod_globalConfig;function Ct(e){return e&&Object.assign(St,e),St}function wt(){let e=this._zod;return e.message??=JSON.stringify(e.def,de,2),e.message}function Tt(e){this._zod.message=e}const Et={get:wt,set:Tt,enumerable:!0,configurable:!0},Dt={value:void 0,enumerable:!1},Ot=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),kt=(e,t)=>{e.name=`$ZodError`,Dt.value=t,Object.defineProperty(e,"issues",Dt),Dt.value=void 0,Object.defineProperty(e,"message",Et);let n=Object.getPrototypeOf(e);Ot.has(n)||(Ot.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},At=/* @__PURE__ */ H(`$ZodError`,kt),jt=/* @__PURE__ */ H(`$ZodError`,kt,void 0,{Parent:Error});function Mt(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Nt(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Mt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Pt(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Ft(e,t){return{callee:t?.callee??e,Err:t?.Err}}const It=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new bt;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>$e(e,o,Ct())));throw Ee(n,a?.callee??t),n}return s.value};return t},Lt=/* @__PURE__*/ It(jt),Rt=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>$e(e,o,Ct())));throw Ee(n,a?.callee??t),n}return s.value};return t},zt=/* @__PURE__*/ Rt(jt),Bt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new bt;return a.issues.length?Vt(e,a.issues,i):{success:!0,data:a.value}};function Vt(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>$e(e,n,Ct()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const Ht=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Vt(e,a.issues,i):{success:!0,data:a.value}},Ut=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),Wt=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),Gt=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Ut)return!0;if(r.definite===!0&&n===void 0)return!1}return Kt(e,t,n)});function Kt(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Wt]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new bt;return a.issues.length===0}const qt=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Jt=e=>{let t=It(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Ft(n,a))};return n},Yt=e=>{let t=It(e),n=(e,r,i,a)=>t(e,r,i,Ft(n,a));return n},Xt=e=>{let t=Rt(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Ft(n,a))};return n},Zt=e=>{let t=Rt(e),n=async(e,r,i,a)=>await t(e,r,i,Ft(n,a));return n},Qt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Bt(e)(t,n,i)},$t=e=>(t,n,r)=>Bt(e)(t,n,r),en=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ht(e)(t,n,i)},tn=e=>async(t,n,r)=>Ht(e)(t,n,r),nn=/^[cC][0-9a-z]{6,}$/,rn=/^[0-9a-z]+$/,an=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,on=/^[0-9a-vA-V]{20}$/,sn=/^[A-Za-z0-9]{27}$/,cn=/^[a-zA-Z0-9_-]{21}$/;function ln(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const un=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dn=/^([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})$/,fn=e=>e?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)$/,pn=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function mn(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}const hn=/^(?:(?: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])$/,gn=/^(([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}|:))$/,_n=/^((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])$/,vn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,bn=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,xn=/^https?$/,Sn=/^\+[1-9]\d{6,14}$/,Cn=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function wn(e){return RegExp(`^${e}$`)}const Tn=/*@__PURE__*/ wn(Cn);function En(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Dn(e){return RegExp(`^${En(e)}$`)}function On(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${En({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${En({precision:e.precision})}`:n;return RegExp(`^${Cn}T(?:${r})$`)}const kn=/^[\s\S]{0,}$/,An=/^-?\d+$/,jn=/^-?\d+(?:\.\d+)?$/,Mn=/^(?:true|false)$/i,Nn=/^[^A-Z]*$/,Pn=/^[^a-z]*$/,Fn=/*@__PURE__*/ H(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),In=e=>{let t=e.value;return!pe(t)&&t.length!==void 0},Ln={number:`number`,bigint:`bigint`,object:`date`},Rn=/*@__PURE__*/ H(`$ZodCheckLessThan`,(e,t)=>{Fn.init(e,t);let n=Ln[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Ln[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zn=/*@__PURE__*/ H(`$ZodCheckGreaterThan`,(e,t)=>{Fn.init(e,t);let n=Ln[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Ln[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Bn=/*@__PURE__*/ H(`$ZodCheckMultipleOf`,(e,t)=>{Fn.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):he(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Vn=/*@__PURE__*/ H(`$ZodCheckNumberFormat`,(e,t)=>{Fn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Ie[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Hn=/*@__PURE__*/ H(`$ZodCheckMaxLength`,(e,t)=>{var n;Fn.init(e,t),(n=e._zod.def).when??(n.when=In),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?tt(r):i)<=t.maximum)return;let a=nt(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Un=/*@__PURE__*/ H(`$ZodCheckMinLength`,(e,t)=>{var n;Fn.init(e,t),(n=e._zod.def).when??(n.when=In),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?tt(r):i)>=t.minimum)return;let a=nt(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Wn=/*@__PURE__*/ H(`$ZodCheckLengthEquals`,(e,t)=>{var n;Fn.init(e,t),(n=e._zod.def).when??(n.when=In),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?tt(r):i;if(a===t.length)return;let o=nt(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Gn=/*@__PURE__*/ H(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Fn.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Kn=/*@__PURE__*/ H(`$ZodCheckRegex`,(e,t)=>{Gn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),qn=/*@__PURE__*/ H(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Nn,Gn.init(e,t)}),Jn=/*@__PURE__*/ H(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Pn,Gn.init(e,t)}),Yn=/*@__PURE__*/ H(`$ZodCheckIncludes`,(e,t)=>{Fn.init(e,t);let n=Me(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Xn=/*@__PURE__*/ H(`$ZodCheckStartsWith`,(e,t)=>{Fn.init(e,t);let n=RegExp(`^${Me(t.prefix)}.*`);t.pattern??=n,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})}}),Zn=/*@__PURE__*/ H(`$ZodCheckEndsWith`,(e,t)=>{Fn.init(e,t);let n=RegExp(`.*${Me(t.suffix)}$`);t.pattern??=n,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 Qn(e,t,n){e.issues.length&&t.issues.push(...Ye(n,e.issues))}const $n=/*@__PURE__*/ H(`$ZodCheckProperties`,(e,t)=>{Fn.init(e,t),st(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:`object`,code:`invalid_type`,input:r.value,inst:e});return}n??=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]);let i=r.value,a;for(let[e,t]of n){let n=t._zod.run({value:i[e],issues:[]},{});n instanceof Promise?(a??=[],a.push(n.then(t=>Qn(t,r,e)))):Qn(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),er=/*@__PURE__*/ H(`$ZodCheckOverwrite`,(e,t)=>{Fn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var tr=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
5
5
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
6
- `)}\n};`)(...Object.values(this.closed))}};const tr={major:4,minor:6,patch:7},nr=/*@__PURE__*/ U(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tr;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Ke(t),a;for(let o of n){if(o._zod.def.when){if(qe(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new yt;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Ze(t.issues,n,e),i||=Ke(t,n))});else{if(t.issues.length===n)continue;Ze(t.issues,n,e),i||=Ke(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Ke(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new yt;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new yt;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return ot(this,`~standard`,ar(this))},set"~standard"(e){at(this,`~standard`,e)}}),rr=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Qe(e,t,St()))}:{value:e.value};async function ir(e,t){let n={async:!0};return rr(await e._zod.run({value:t,issues:[]},n),n)}function ar(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return rr(r,n)}catch{}return ir(e,t)},vendor:`zod`,version:1}}const or=/*@__PURE__*/ U(`$ZodString`,(e,t)=>{nr.init(e,t),e._zod.pattern=t.pattern??On,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),sr=/*@__PURE__*/ U(`$ZodStringFormat`,(e,t)=>{Wn.init(e,t),or.init(e,t)}),cr=/*@__PURE__*/ U(`$ZodGUID`,(e,t)=>{t.pattern??=un,sr.init(e,t)}),lr=/*@__PURE__*/ U(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=dn(e)}else t.pattern??=dn();sr.init(e,t)}),ur=/*@__PURE__*/ U(`$ZodEmail`,(e,t)=>{t.pattern??=fn,sr.init(e,t)});function dr(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function fr(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?dr(e)||2:pr(e,t)}function pr(e,t){if(!t.normalize&&t.protocol?.source===bn.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}const mr=/[\t\n\r]/g;function hr(e){return e.replace(mr,``)}function gr(e,t){return t.lastIndex=0,t.test(e.hostname)}function _r(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}const vr=/*@__PURE__*/ U(`$ZodURL`,(e,t)=>{sr.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=fr(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=hr(r);return}t.hostname&&!gr(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!_r(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:hr(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),yr=/*@__PURE__*/ U(`$ZodEmoji`,(e,t)=>{t.pattern??=pn(),sr.init(e,t)}),br=/*@__PURE__*/ U(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?sn:cn(t.length),sr.init(e,t)}),xr=/*@__PURE__*/ U(`$ZodCUID`,(e,t)=>{t.pattern??=tn,sr.init(e,t)}),Sr=/*@__PURE__*/ U(`$ZodCUID2`,(e,t)=>{t.pattern??=nn,sr.init(e,t)}),Cr=/*@__PURE__*/ U(`$ZodULID`,(e,t)=>{t.pattern??=rn,sr.init(e,t)}),wr=/*@__PURE__*/ U(`$ZodXID`,(e,t)=>{t.pattern??=an,sr.init(e,t)}),Tr=/*@__PURE__*/ U(`$ZodKSUID`,(e,t)=>{t.pattern??=on,sr.init(e,t)}),Er=/*@__PURE__*/ U(`$ZodISODateTime`,(e,t)=>{t.pattern??=Dn(t),sr.init(e,t)}),Dr=/*@__PURE__*/ U(`$ZodISODate`,(e,t)=>{t.pattern??=wn,sr.init(e,t)}),Or=/*@__PURE__*/ U(`$ZodISOTime`,(e,t)=>{t.pattern??=En(t),sr.init(e,t)}),kr=/*@__PURE__*/ U(`$ZodISODuration`,(e,t)=>{t.pattern??=ln,sr.init(e,t)}),Ar=/*@__PURE__*/ U(`$ZodIPv4`,(e,t)=>{t.pattern??=mn,sr.init(e,t)}),jr=/^[0-9a-fA-F:.]+$/;function Mr(e){return jr.test(e)?dr(`http://[${e}]`):!1}const Nr=/*@__PURE__*/ U(`$ZodIPv6`,(e,t)=>{t.pattern??=hn,sr.init(e,t),e._zod.check=n=>{Mr(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Pr=/*@__PURE__*/ U(`$ZodCIDRv4`,(e,t)=>{t.pattern??=gn,sr.init(e,t)});function Fr(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Mr(n)}const Ir=/*@__PURE__*/ U(`$ZodCIDRv6`,(e,t)=>{t.pattern??=_n,sr.init(e,t),e._zod.check=n=>{Fr(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Lr(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Rr=/^[0-9a-zA-Z+/]*={0,2}$/,zr=/*@__PURE__*/ U(`$ZodBase64`,(e,t)=>{t.pattern??=Rr,sr.init(e,t),e._zod.check=n=>{Lr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Br=/^[A-Za-z0-9_-]*$/;function Vr(e){if(!Br.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Lr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Hr=/*@__PURE__*/ U(`$ZodBase64URL`,(e,t)=>{t.pattern??=Br,sr.init(e,t),e._zod.check=n=>{Vr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Ur=/*@__PURE__*/ U(`$ZodE164`,(e,t)=>{t.pattern??=xn,sr.init(e,t)});function Wr(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Gr=/*@__PURE__*/ U(`$ZodJWT`,(e,t)=>{sr.init(e,t),e._zod.check=n=>{Wr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Kr=/*@__PURE__*/ U(`$ZodNumber`,(e,t)=>{nr.init(e,t),e._zod.pattern=An,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),qr=/*@__PURE__*/ U(`$ZodNumberFormat`,(e,t)=>{Bn.init(e,t),Kr.init(e,t)}),Jr=/*@__PURE__*/ U(`$ZodBoolean`,(e,t)=>{nr.init(e,t),e._zod.pattern=jn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Yr=/*@__PURE__*/ U(`$ZodUnknown`,(e,t)=>{nr.init(e,t),e._zod.parse=e=>e}),Xr=/*@__PURE__*/ U(`$ZodNever`,(e,t)=>{nr.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Zr(e,t){let n=Xe(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of Xe(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Ze(n.issues,t,e),n}}return i(n,a)}}const Qr=e=>Array.isArray(e)?e.length:-1;function $r(e,t,n){e.issues.length&&t.issues.push(...Je(n,e.issues)),t.value[n]=e.value}const ei=/*@__PURE__*/ U(`$ZodArray`,(e,t)=>{nr.init(e,t);let n=xt.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>$r(t,r,e)));else if($r(c,r,e),s&&c.issues.length!==0&&Ke(c))break}return o.length?Promise.all(o).then(()=>r):r},Zr(e,Qr)});function ti(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Je(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}const ni=[];function ri(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:ni,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Pe(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function ii(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Ke(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>ti(e,n,i,t,d,f))):ti(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const ai=/*@__PURE__*/ U(`$ZodObject`,(e,t)=>{nr.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=B(()=>ri(t));H(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||he(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=Ee,o=t.catchall,s,c=xt.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Ke(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>ti(n,t,e,r,a,o))):ti(s,t,e,r,a,o)}return o?ii(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),oi=/*@__PURE__*/ U(`$ZodObjectJIT`,(e,t)=>{ai.init(e,t);let n=e._zod.parse,r=B(()=>ri(t)),i=xt.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new er([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
6
+ `)}\n};`)(...Object.values(this.closed))}};const nr={major:4,minor:6,patch:7},rr=/*@__PURE__*/ H(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=nr;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=qe(t),a;for(let o of n){if(o._zod.def.when){if(Je(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new bt;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Qe(t.issues,n,e),i||=qe(t,n))});else{if(t.issues.length===n)continue;Qe(t.issues,n,e),i||=qe(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(qe(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new bt;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new bt;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return st(this,`~standard`,or(this))},set"~standard"(e){ot(this,`~standard`,e)}}),ir=(e,t)=>e.issues.length?{issues:e.issues.map(e=>$e(e,t,Ct()))}:{value:e.value};async function ar(e,t){let n={async:!0};return ir(await e._zod.run({value:t,issues:[]},n),n)}function or(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return ir(r,n)}catch{}return ar(e,t)},vendor:`zod`,version:1}}const sr=/*@__PURE__*/ H(`$ZodString`,(e,t)=>{rr.init(e,t),e._zod.pattern=t.pattern??kn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),cr=/*@__PURE__*/ H(`$ZodStringFormat`,(e,t)=>{Gn.init(e,t),sr.init(e,t)}),lr=/*@__PURE__*/ H(`$ZodGUID`,(e,t)=>{t.pattern??=dn,cr.init(e,t)}),ur=/*@__PURE__*/ H(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=fn(e)}else t.pattern??=fn();cr.init(e,t)}),dr=/*@__PURE__*/ H(`$ZodEmail`,(e,t)=>{t.pattern??=pn,cr.init(e,t)});function fr(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function pr(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?fr(e)||2:mr(e,t)}function mr(e,t){if(!t.normalize&&t.protocol?.source===xn.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}const hr=/[\t\n\r]/g;function gr(e){return e.replace(hr,``)}function _r(e,t){return t.lastIndex=0,t.test(e.hostname)}function vr(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}const yr=/*@__PURE__*/ H(`$ZodURL`,(e,t)=>{cr.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=pr(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=gr(r);return}t.hostname&&!_r(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!vr(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:gr(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),br=/*@__PURE__*/ H(`$ZodEmoji`,(e,t)=>{t.pattern??=mn(),cr.init(e,t)}),xr=/*@__PURE__*/ H(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?cn:ln(t.length),cr.init(e,t)}),Sr=/*@__PURE__*/ H(`$ZodCUID`,(e,t)=>{t.pattern??=nn,cr.init(e,t)}),Cr=/*@__PURE__*/ H(`$ZodCUID2`,(e,t)=>{t.pattern??=rn,cr.init(e,t)}),wr=/*@__PURE__*/ H(`$ZodULID`,(e,t)=>{t.pattern??=an,cr.init(e,t)}),Tr=/*@__PURE__*/ H(`$ZodXID`,(e,t)=>{t.pattern??=on,cr.init(e,t)}),Er=/*@__PURE__*/ H(`$ZodKSUID`,(e,t)=>{t.pattern??=sn,cr.init(e,t)}),Dr=/*@__PURE__*/ H(`$ZodISODateTime`,(e,t)=>{t.pattern??=On(t),cr.init(e,t)}),Or=/*@__PURE__*/ H(`$ZodISODate`,(e,t)=>{t.pattern??=Tn,cr.init(e,t)}),kr=/*@__PURE__*/ H(`$ZodISOTime`,(e,t)=>{t.pattern??=Dn(t),cr.init(e,t)}),Ar=/*@__PURE__*/ H(`$ZodISODuration`,(e,t)=>{t.pattern??=un,cr.init(e,t)}),jr=/*@__PURE__*/ H(`$ZodIPv4`,(e,t)=>{t.pattern??=hn,cr.init(e,t)}),Mr=/^[0-9a-fA-F:.]+$/;function Nr(e){return Mr.test(e)?fr(`http://[${e}]`):!1}const Pr=/*@__PURE__*/ H(`$ZodIPv6`,(e,t)=>{t.pattern??=gn,cr.init(e,t),e._zod.check=n=>{Nr(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Fr=/*@__PURE__*/ H(`$ZodCIDRv4`,(e,t)=>{t.pattern??=_n,cr.init(e,t)});function Ir(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Nr(n)}const Lr=/*@__PURE__*/ H(`$ZodCIDRv6`,(e,t)=>{t.pattern??=vn,cr.init(e,t),e._zod.check=n=>{Ir(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Rr(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const zr=/^[0-9a-zA-Z+/]*={0,2}$/,Br=/*@__PURE__*/ H(`$ZodBase64`,(e,t)=>{t.pattern??=zr,cr.init(e,t),e._zod.check=n=>{Rr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Vr=/^[A-Za-z0-9_-]*$/;function Hr(e){if(!Vr.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Rr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Ur=/*@__PURE__*/ H(`$ZodBase64URL`,(e,t)=>{t.pattern??=Vr,cr.init(e,t),e._zod.check=n=>{Hr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Wr=/*@__PURE__*/ H(`$ZodE164`,(e,t)=>{t.pattern??=Sn,cr.init(e,t)});function Gr(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Kr=/*@__PURE__*/ H(`$ZodJWT`,(e,t)=>{cr.init(e,t),e._zod.check=n=>{Gr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),qr=/*@__PURE__*/ H(`$ZodNumber`,(e,t)=>{rr.init(e,t),e._zod.pattern=jn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Jr=/*@__PURE__*/ H(`$ZodNumberFormat`,(e,t)=>{Vn.init(e,t),qr.init(e,t)}),Yr=/*@__PURE__*/ H(`$ZodBoolean`,(e,t)=>{rr.init(e,t),e._zod.pattern=Mn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Xr=/*@__PURE__*/ H(`$ZodUnknown`,(e,t)=>{rr.init(e,t),e._zod.parse=e=>e}),Zr=/*@__PURE__*/ H(`$ZodNever`,(e,t)=>{rr.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Qr(e,t){let n=Ze(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of Ze(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Qe(n.issues,t,e),n}}return i(n,a)}}const $r=e=>Array.isArray(e)?e.length:-1;function ei(e,t,n){e.issues.length&&t.issues.push(...Ye(n,e.issues)),t.value[n]=e.value}const ti=/*@__PURE__*/ H(`$ZodArray`,(e,t)=>{rr.init(e,t);let n=St.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>ei(t,r,e)));else if(ei(c,r,e),s&&c.issues.length!==0&&qe(c))break}return o.length?Promise.all(o).then(()=>r):r},Qr(e,$r)});function ni(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Ye(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}const ri=[];function ii(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:ri,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Fe(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function ai(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(qe(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>ni(e,n,i,t,d,f))):ni(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const oi=/*@__PURE__*/ H(`$ZodObject`,(e,t)=>{rr.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=z(()=>ii(t));V(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||ge(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=De,o=t.catchall,s,c=St.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(qe(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>ni(n,t,e,r,a,o))):ni(s,t,e,r,a,o)}return o?ai(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),si=/*@__PURE__*/ H(`$ZodObjectJIT`,(e,t)=>{oi.init(e,t);let n=e._zod.parse,r=z(()=>ii(t)),i=St.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new tr([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
7
7
  let ${e}_ab = false;
8
8
  for (let i = 0; i < ${e}.issues.length; i++) {
9
9
  const iss = ${e}.issues[i];
@@ -14,7 +14,7 @@ function U(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=
14
14
  if (${e}_ab && ctx && ctx.abortEarly) {
15
15
  payload.value = newResult;
16
16
  return payload;
17
- }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:Ce(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
17
+ }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:we(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
18
18
  const ${n}_present = ${i};
19
19
  if (!${n}.issues.length || ${n}_present) {
20
20
  if (${n}.issues.length) {${c(n,r)}
@@ -53,86 +53,86 @@ function U(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=
53
53
  newResult[${r}] = ${n}.value;
54
54
  }
55
55
 
56
- `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=Ee,c=!xt.jitless,l=c&&De.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?ii([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function si(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Ke(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Qe(e,r,St())))}),t)}const ci=/*@__PURE__*/ U(`$ZodUnion`,(e,t)=>{nr.init(e,t),H(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),H(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),H(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),H(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>pe(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>si(t,r,e,i)):si(o,r,e,i)}}),li=/*@__PURE__*/ U(`$ZodIntersection`,(e,t)=>{nr.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>di(e,t,n)):di(e,i,a)}});function ui(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Oe(e)&&Oe(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=ui(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=ui(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function di(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=ui(t.value,n.value);if(!c.valid){if(Ke(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const fi=/*@__PURE__*/ U(`$ZodTuple`,(e,t)=>{nr.init(e,t);let n=t.items,r=xt.memoizer;r?.attach(e),e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=r?r.alloc(e,i,[],a):[];let s=[],c=pi(n,`optin`),l=pi(n,`optout`);if(!t.rest){if(o.length<c)return i.issues.push({code:`too_small`,minimum:c,inclusive:!0,input:o,inst:e,origin:`array`}),i;o.length>n.length&&i.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:o,inst:e,origin:`array`})}let u=Array(n.length),d=t.rest?a?.abortEarly:void 0,f=!1;for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:o[e],issues:[]},a);t instanceof Promise?s.push(t.then(t=>{u[e]=t})):(u[e]=t,d&&!f&&t.issues.length&&(f=Ke(t)))}if(t.rest&&!f){let e=n.length-1,r=o.slice(n.length),c=i.issues.length;for(let n of r){if(d&&i.issues.length!==c){if(Ke(i,c))break;c=i.issues.length}e++;let r=t.rest._zod.run({value:n,issues:[]},a);r instanceof Promise?s.push(r.then(t=>mi(t,i,e))):mi(r,i,e)}}return s.length?Promise.all(s).then(()=>hi(u,i,n,o,l)):hi(u,i,n,o,l)}});function pi(e,t){for(let n=e.length-1;n>=0;n--)if(!(t===`optin`?e[n]._zod.optin!==void 0:e[n]._zod.optout===`optional`))return n+1;return 0}function mi(e,t,n){e.issues.length&&t.issues.push(...Je(n,e.issues)),t.value[n]=e.value}function hi(e,t,n,r,i){for(let a=0;a<n.length;a++){let o=e[a],s=a<r.length;if(!s&&a>=i&&n[a]._zod.optin===`optional`){t.value.length=a;break}if(o.issues.length){if(!s&&a>=i){t.value.length=a;break}t.issues.push(...Je(a,o.issues))}t.value[a]=o.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}const gi=/*@__PURE__*/ U(`$ZodRecord`,(e,t)=>{nr.init(e,t);let n=xt.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Oe(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=/* @__PURE__ */ new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Qe(e,i,St())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Je(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Je(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&An.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>Qe(e,i,St())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Je(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Je(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),_i=/*@__PURE__*/ U(`$ZodEnum`,(e,t)=>{nr.init(e,t);let n=ce(t.entries),r=new Set(n);e._zod.values=r,H(e,`pattern`,e=>{let t=ce(e.def.entries).filter(e=>Ae.has(typeof e));return RegExp(t.length?`^(${t.map(e=>je(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),vi=/*@__PURE__*/ U(`$ZodLiteral`,(e,t)=>{nr.init(e,t);let n=new Set(t.values);e._zod.values=n,H(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?je(e):e?je(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),yi=/*@__PURE__*/ U(`$ZodTransform`,(e,t)=>{nr.init(e,t),e._zod.optin=`optional`,xt.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new bt(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new yt;return n.value=i,n}});function bi(e,t){return e.value=t.issues.length?void 0:t.value,e}const xi=/*@__PURE__*/ U(`$ZodOptional`,(e,t)=>{nr.init(e,t),H(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,H(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),H(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${pe(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>bi(e,t)):bi(e,r)}return t.innerType._zod.run(e,n)}}),Si=/*@__PURE__*/ U(`$ZodExactOptional`,(e,t)=>{xi.init(e,t),H(e,`values`,e=>e.def.innerType._zod.values),H(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ci=/*@__PURE__*/ U(`$ZodNullable`,(e,t)=>{nr.init(e,t),H(e,`optin`,e=>e.def.innerType._zod.optin),H(e,`optout`,e=>e.def.innerType._zod.optout),H(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${pe(t.source)}|null)$`):void 0}),H(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),wi=/*@__PURE__*/ U(`$ZodDefault`,(e,t)=>{nr.init(e,t),e._zod.optin=`defaulted`,H(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ti(e,t)):Ti(r,t)}});function Ti(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ei=/*@__PURE__*/ U(`$ZodPrefault`,(e,t)=>{nr.init(e,t),e._zod.optin=`defaulted`,H(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Di=/*@__PURE__*/ U(`$ZodNonOptional`,(e,t)=>{nr.init(e,t),H(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Oi(t,e)):Oi(i,e)}});function Oi(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function ki(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Qe(e,r,St()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const Ai=/*@__PURE__*/ U(`$ZodCatch`,(e,t)=>{nr.init(e,t),H(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),H(e,`optout`,e=>e.def.innerType._zod.optout),H(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>ki(e,r,t,n)):ki(e,r,t,n)}}),ji=/*@__PURE__*/ U(`$ZodPipe`,(e,t)=>{nr.init(e,t),H(e,`values`,e=>e.def.in._zod.values),H(e,`optin`,e=>e.def.in._zod.optin),H(e,`optout`,e=>e.def.out._zod.optout),H(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Mi(e,t.in,n)):Mi(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Mi(e,t.out,n)):Mi(r,t.out,n)}});function Mi(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Ni=/*@__PURE__*/ U(`$ZodReadonly`,(e,t)=>{nr.init(e,t),H(e,`propValues`,e=>e.def.innerType._zod.propValues),H(e,`values`,e=>e.def.innerType._zod.values),H(e,`optin`,e=>e.def.innerType?._zod?.optin),H(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Pi):Pi(r)}});function Pi(e){return e.memo||(e.value=Object.freeze(e.value)),e}const Fi=/*@__PURE__*/ U(`$ZodFunction`,(e,t)=>(nr.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return Object.defineProperty(function(...n){let r=e._def.input?It(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?It(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return Object.defineProperty(async function(...n){let r=e._def.input?await Rt(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await Rt(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(t,n)=>typeof t.value==`function`?(t.value=e._def.output&&e._def.output._zod.def.type===`promise`?e.implementAsync(t.value):e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new fi({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),Ii=/*@__PURE__*/ U(`$ZodCustom`,(e,t)=>{Pn.init(e,t),nr.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Li(t,n,r,e));Li(i,n,r,e)}});function Li(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(rt(e))}}var Ri=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};const zi=`~memo`,Bi=[];function Vi(e){return typeof e==`object`&&!!e}function Hi(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const Ui=/*@__PURE__*/ new WeakMap;function Wi(e,t,n){let r=Ui.get(e);if(r!==void 0)return r?2:0;if(t.has(e))return 2;t.add(e);let i=0,a=e=>{if(i!==2&&e?._zod){let r=Wi(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=0;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?1:o.value?._zod?Wi(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=ge(c);s(e?o(e,!0):1),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Wi(r,t,!1):1);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Gi(e,i)}function Gi(e,t){return t!==1&&Ui.set(e,t===2),t}function Ki(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let qi;const Ji=[],Yi={alloc(e,t,n){let r=qi;if(!r)return n;qi=void 0;let i={value:n,issues:null};return r.set(t.value,i),Ji.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Zi(n,e.value))throw new Ri;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Wi(e,/* @__PURE__ */ new Set,!1);if(i===0)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===2||r?n=!0:r=!0}let l=s.value;if(!Vi(l))return t(s,c);let u=c[zi];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[zi]=u);let d;i===c?d=a:(d=Ki(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Hi(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;qi=d;let p=Ji.length,m=t(s,c);qi=void 0;let h=Ji.length>p?Ji.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Hi(e.issues):Bi),e)):(h&&(h.issues=m.issues.length?Hi(m.issues):Bi),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Xi(){return Yi}function Zi(e,t){let n=e[zi]?.backEdges;return n!==void 0&&Vi(t)&&n.has(t)}const Qi=()=>{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(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(nt(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Ne(e.values[0])}`:`Invalid option: expected one of ${le(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${le(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function $i(){return{localeError:Qi()}}var ea,ta=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function na(){return new ta}(ea=globalThis).__zod_globalRegistry??(ea.__zod_globalRegistry=na());const ra=globalThis.__zod_globalRegistry;function ia(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
57
- function aa(e,t){return new e(ia({type:`string`,...V(t)}))}// @__NO_SIDE_EFFECTS__
58
- function oa(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
59
- function sa(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
60
- function ca(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
61
- function la(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...V(t)})}// @__NO_SIDE_EFFECTS__
62
- function ua(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...V(t)})}// @__NO_SIDE_EFFECTS__
63
- function da(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...V(t)})}// @__NO_SIDE_EFFECTS__
64
- function fa(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
65
- function pa(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
66
- function ma(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
67
- function ha(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
68
- function ga(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
69
- function _a(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
70
- function va(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
71
- function ya(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
72
- function ba(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
73
- function xa(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
74
- function Sa(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
75
- function Ca(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
76
- function wa(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
77
- function Ta(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
78
- function Ea(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
79
- function Da(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...V(t)})}// @__NO_SIDE_EFFECTS__
80
- function Oa(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...V(t)})}// @__NO_SIDE_EFFECTS__
81
- function ka(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...V(t)})}// @__NO_SIDE_EFFECTS__
82
- function Aa(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...V(t)})}// @__NO_SIDE_EFFECTS__
83
- function ja(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...V(t)})}// @__NO_SIDE_EFFECTS__
84
- function Ma(e,t){return new e(ia({type:`number`,coerce:!0,checks:[],...V(t)}))}// @__NO_SIDE_EFFECTS__
85
- function Na(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...V(t)})}// @__NO_SIDE_EFFECTS__
86
- function Pa(e,t){return new e({type:`boolean`,...V(t)})}// @__NO_SIDE_EFFECTS__
87
- function Fa(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
88
- function Ia(e,t){return new e({type:`never`,...V(t)})}// @__NO_SIDE_EFFECTS__
89
- function La(e,t){return new Ln({check:`less_than`,...V(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
90
- function Ra(e,t){return new Ln({check:`less_than`,...V(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
91
- function za(e,t){return new Rn({check:`greater_than`,...V(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
92
- function Ba(e,t){return new Rn({check:`greater_than`,...V(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
93
- function Va(e,t){return new zn({check:`multiple_of`,...V(t),value:e})}// @__NO_SIDE_EFFECTS__
94
- function Ha(e,t){return new Vn({check:`max_length`,...V(t),maximum:e})}// @__NO_SIDE_EFFECTS__
95
- function Ua(e,t){return new Hn({check:`min_length`,...V(t),minimum:e})}// @__NO_SIDE_EFFECTS__
96
- function Wa(e,t){return new Un({check:`length_equals`,...V(t),length:e})}// @__NO_SIDE_EFFECTS__
97
- function Ga(e,t){return new Gn({check:`string_format`,format:`regex`,...V(t),pattern:e})}// @__NO_SIDE_EFFECTS__
98
- function Ka(e){return new Kn({check:`string_format`,format:`lowercase`,...V(e)})}// @__NO_SIDE_EFFECTS__
99
- function qa(e){return new qn({check:`string_format`,format:`uppercase`,...V(e)})}// @__NO_SIDE_EFFECTS__
100
- function Ja(e,t){return new Jn({check:`string_format`,format:`includes`,...V(t),includes:e})}// @__NO_SIDE_EFFECTS__
101
- function Ya(e,t){return new Yn({check:`string_format`,format:`starts_with`,...V(t),prefix:e})}// @__NO_SIDE_EFFECTS__
102
- function Xa(e,t){return new Xn({check:`string_format`,format:`ends_with`,...V(t),suffix:e})}// @__NO_SIDE_EFFECTS__
103
- function Za(e,t){return new Qn({check:`properties`,shape:e,...V(t)})}// @__NO_SIDE_EFFECTS__
104
- function Qa(e){return new $n({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
105
- function $a(e){return/* @__PURE__ */ Qa(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
106
- function eo(){return/* @__PURE__ */ Qa(e=>e.trim())}// @__NO_SIDE_EFFECTS__
107
- function to(){return/* @__PURE__ */ Qa(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
108
- function no(){return/* @__PURE__ */ Qa(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
109
- function ro(){return/* @__PURE__ */ Qa(e=>we(e))}// @__NO_SIDE_EFFECTS__
110
- function io(e,t,n){return new e({type:`array`,element:t,...V(n)})}// @__NO_SIDE_EFFECTS__
111
- function ao(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...V(n)})}// @__NO_SIDE_EFFECTS__
112
- function oo(e,t){let n=/* @__PURE__ */ so(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(rt(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(rt(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
113
- function so(e,t){let n=new Pn({check:`custom`,...V(t)});return n._zod.check=e,n}function co(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&he(e,t,n[t]);return e}function lo(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??ra,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function uo(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function fo(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,fo(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&co(o.schema,c),t.io===`input`&&So(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function po(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function mo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${po(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+po(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
56
+ `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=De,c=!St.jitless,l=c&&Oe.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?ai([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function ci(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!qe(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>$e(e,r,Ct())))}),t)}const li=/*@__PURE__*/ H(`$ZodUnion`,(e,t)=>{rr.init(e,t),V(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),V(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),V(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),V(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>me(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>ci(t,r,e,i)):ci(o,r,e,i)}}),ui=/*@__PURE__*/ H(`$ZodIntersection`,(e,t)=>{rr.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>fi(e,t,n)):fi(e,i,a)}});function di(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ke(e)&&ke(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=di(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=di(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function fi(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=di(t.value,n.value);if(!c.valid){if(qe(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const pi=/*@__PURE__*/ H(`$ZodTuple`,(e,t)=>{rr.init(e,t);let n=t.items,r=St.memoizer;r?.attach(e),e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=r?r.alloc(e,i,[],a):[];let s=[],c=mi(n,`optin`),l=mi(n,`optout`);if(!t.rest){if(o.length<c)return i.issues.push({code:`too_small`,minimum:c,inclusive:!0,input:o,inst:e,origin:`array`}),i;o.length>n.length&&i.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:o,inst:e,origin:`array`})}let u=Array(n.length),d=t.rest?a?.abortEarly:void 0,f=!1;for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:o[e],issues:[]},a);t instanceof Promise?s.push(t.then(t=>{u[e]=t})):(u[e]=t,d&&!f&&t.issues.length&&(f=qe(t)))}if(t.rest&&!f){let e=n.length-1,r=o.slice(n.length),c=i.issues.length;for(let n of r){if(d&&i.issues.length!==c){if(qe(i,c))break;c=i.issues.length}e++;let r=t.rest._zod.run({value:n,issues:[]},a);r instanceof Promise?s.push(r.then(t=>hi(t,i,e))):hi(r,i,e)}}return s.length?Promise.all(s).then(()=>gi(u,i,n,o,l)):gi(u,i,n,o,l)}});function mi(e,t){for(let n=e.length-1;n>=0;n--)if(!(t===`optin`?e[n]._zod.optin!==void 0:e[n]._zod.optout===`optional`))return n+1;return 0}function hi(e,t,n){e.issues.length&&t.issues.push(...Ye(n,e.issues)),t.value[n]=e.value}function gi(e,t,n,r,i){for(let a=0;a<n.length;a++){let o=e[a],s=a<r.length;if(!s&&a>=i&&n[a]._zod.optin===`optional`){t.value.length=a;break}if(o.issues.length){if(!s&&a>=i){t.value.length=a;break}t.issues.push(...Ye(a,o.issues))}t.value[a]=o.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}const _i=/*@__PURE__*/ H(`$ZodRecord`,(e,t)=>{rr.init(e,t);let n=St.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!ke(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=/* @__PURE__ */ new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>$e(e,i,Ct())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Ye(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Ye(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&jn.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>$e(e,i,Ct())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Ye(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Ye(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),vi=/*@__PURE__*/ H(`$ZodEnum`,(e,t)=>{rr.init(e,t);let n=le(t.entries),r=new Set(n);e._zod.values=r,V(e,`pattern`,e=>{let t=le(e.def.entries).filter(e=>je.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Me(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),yi=/*@__PURE__*/ H(`$ZodLiteral`,(e,t)=>{rr.init(e,t);let n=new Set(t.values);e._zod.values=n,V(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Me(e):e?Me(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),bi=/*@__PURE__*/ H(`$ZodTransform`,(e,t)=>{rr.init(e,t),e._zod.optin=`optional`,St.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new xt(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new bt;return n.value=i,n}});function xi(e,t){return e.value=t.issues.length?void 0:t.value,e}const Si=/*@__PURE__*/ H(`$ZodOptional`,(e,t)=>{rr.init(e,t),V(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,V(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),V(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${me(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>xi(e,t)):xi(e,r)}return t.innerType._zod.run(e,n)}}),Ci=/*@__PURE__*/ H(`$ZodExactOptional`,(e,t)=>{Si.init(e,t),V(e,`values`,e=>e.def.innerType._zod.values),V(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),wi=/*@__PURE__*/ H(`$ZodNullable`,(e,t)=>{rr.init(e,t),V(e,`optin`,e=>e.def.innerType._zod.optin),V(e,`optout`,e=>e.def.innerType._zod.optout),V(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${me(t.source)}|null)$`):void 0}),V(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Ti=/*@__PURE__*/ H(`$ZodDefault`,(e,t)=>{rr.init(e,t),e._zod.optin=`defaulted`,V(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ei(e,t)):Ei(r,t)}});function Ei(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Di=/*@__PURE__*/ H(`$ZodPrefault`,(e,t)=>{rr.init(e,t),e._zod.optin=`defaulted`,V(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Oi=/*@__PURE__*/ H(`$ZodNonOptional`,(e,t)=>{rr.init(e,t),V(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ki(t,e)):ki(i,e)}});function ki(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Ai(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>$e(e,r,Ct()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const ji=/*@__PURE__*/ H(`$ZodCatch`,(e,t)=>{rr.init(e,t),V(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),V(e,`optout`,e=>e.def.innerType._zod.optout),V(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Ai(e,r,t,n)):Ai(e,r,t,n)}}),Mi=/*@__PURE__*/ H(`$ZodPipe`,(e,t)=>{rr.init(e,t),V(e,`values`,e=>e.def.in._zod.values),V(e,`optin`,e=>e.def.in._zod.optin),V(e,`optout`,e=>e.def.out._zod.optout),V(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ni(e,t.in,n)):Ni(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ni(e,t.out,n)):Ni(r,t.out,n)}});function Ni(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Pi=/*@__PURE__*/ H(`$ZodReadonly`,(e,t)=>{rr.init(e,t),V(e,`propValues`,e=>e.def.innerType._zod.propValues),V(e,`values`,e=>e.def.innerType._zod.values),V(e,`optin`,e=>e.def.innerType?._zod?.optin),V(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Fi):Fi(r)}});function Fi(e){return e.memo||(e.value=Object.freeze(e.value)),e}const Ii=/*@__PURE__*/ H(`$ZodFunction`,(e,t)=>(rr.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return Object.defineProperty(function(...n){let r=e._def.input?Lt(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?Lt(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return Object.defineProperty(async function(...n){let r=e._def.input?await zt(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await zt(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(t,n)=>typeof t.value==`function`?(t.value=e._def.output&&e._def.output._zod.def.type===`promise`?e.implementAsync(t.value):e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new pi({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),Li=/*@__PURE__*/ H(`$ZodCustom`,(e,t)=>{Fn.init(e,t),rr.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Ri(t,n,r,e));Ri(i,n,r,e)}});function Ri(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(it(e))}}var zi=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};const Bi=`~memo`,Vi=[];function Hi(e){return typeof e==`object`&&!!e}function Ui(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const Wi=/*@__PURE__*/ new WeakMap;function Gi(e,t,n){let r=Wi.get(e);if(r!==void 0)return r?2:0;if(t.has(e))return 2;t.add(e);let i=0,a=e=>{if(i!==2&&e?._zod){let r=Gi(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=0;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?1:o.value?._zod?Gi(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=_e(c);s(e?o(e,!0):1),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Gi(r,t,!1):1);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Ki(e,i)}function Ki(e,t){return t!==1&&Wi.set(e,t===2),t}function qi(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let Ji;const Yi=[],Xi={alloc(e,t,n){let r=Ji;if(!r)return n;Ji=void 0;let i={value:n,issues:null};return r.set(t.value,i),Yi.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Qi(n,e.value))throw new zi;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Gi(e,/* @__PURE__ */ new Set,!1);if(i===0)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===2||r?n=!0:r=!0}let l=s.value;if(!Hi(l))return t(s,c);let u=c[Bi];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[Bi]=u);let d;i===c?d=a:(d=qi(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Ui(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;Ji=d;let p=Yi.length,m=t(s,c);Ji=void 0;let h=Yi.length>p?Yi.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Ui(e.issues):Vi),e)):(h&&(h.issues=m.issues.length?Ui(m.issues):Vi),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Zi(){return Xi}function Qi(e,t){let n=e[Bi]?.backEdges;return n!==void 0&&Hi(t)&&n.has(t)}const $i=()=>{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(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(rt(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Pe(e.values[0])}`:`Invalid option: expected one of ${ue(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${ue(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function ea(){return{localeError:$i()}}var ta,na=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ra(){return new na}(ta=globalThis).__zod_globalRegistry??(ta.__zod_globalRegistry=ra());const ia=globalThis.__zod_globalRegistry;function aa(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
57
+ function oa(e,t){return new e(aa({type:`string`,...B(t)}))}// @__NO_SIDE_EFFECTS__
58
+ function sa(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
59
+ function ca(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
60
+ function la(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
61
+ function ua(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...B(t)})}// @__NO_SIDE_EFFECTS__
62
+ function da(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...B(t)})}// @__NO_SIDE_EFFECTS__
63
+ function fa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...B(t)})}// @__NO_SIDE_EFFECTS__
64
+ function pa(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
65
+ function ma(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
66
+ function ha(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
67
+ function ga(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
68
+ function _a(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
69
+ function va(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
70
+ function ya(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
71
+ function ba(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
72
+ function xa(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
73
+ function Sa(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
74
+ function Ca(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
75
+ function wa(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
76
+ function Ta(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
77
+ function Ea(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
78
+ function Da(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
79
+ function Oa(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
80
+ function ka(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...B(t)})}// @__NO_SIDE_EFFECTS__
81
+ function Aa(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...B(t)})}// @__NO_SIDE_EFFECTS__
82
+ function ja(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...B(t)})}// @__NO_SIDE_EFFECTS__
83
+ function Ma(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...B(t)})}// @__NO_SIDE_EFFECTS__
84
+ function Na(e,t){return new e(aa({type:`number`,coerce:!0,checks:[],...B(t)}))}// @__NO_SIDE_EFFECTS__
85
+ function Pa(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...B(t)})}// @__NO_SIDE_EFFECTS__
86
+ function Fa(e,t){return new e({type:`boolean`,...B(t)})}// @__NO_SIDE_EFFECTS__
87
+ function Ia(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
88
+ function La(e,t){return new e({type:`never`,...B(t)})}// @__NO_SIDE_EFFECTS__
89
+ function Ra(e,t){return new Rn({check:`less_than`,...B(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
90
+ function za(e,t){return new Rn({check:`less_than`,...B(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
91
+ function Ba(e,t){return new zn({check:`greater_than`,...B(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
92
+ function Va(e,t){return new zn({check:`greater_than`,...B(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
93
+ function Ha(e,t){return new Bn({check:`multiple_of`,...B(t),value:e})}// @__NO_SIDE_EFFECTS__
94
+ function Ua(e,t){return new Hn({check:`max_length`,...B(t),maximum:e})}// @__NO_SIDE_EFFECTS__
95
+ function Wa(e,t){return new Un({check:`min_length`,...B(t),minimum:e})}// @__NO_SIDE_EFFECTS__
96
+ function Ga(e,t){return new Wn({check:`length_equals`,...B(t),length:e})}// @__NO_SIDE_EFFECTS__
97
+ function Ka(e,t){return new Kn({check:`string_format`,format:`regex`,...B(t),pattern:e})}// @__NO_SIDE_EFFECTS__
98
+ function qa(e){return new qn({check:`string_format`,format:`lowercase`,...B(e)})}// @__NO_SIDE_EFFECTS__
99
+ function Ja(e){return new Jn({check:`string_format`,format:`uppercase`,...B(e)})}// @__NO_SIDE_EFFECTS__
100
+ function Ya(e,t){return new Yn({check:`string_format`,format:`includes`,...B(t),includes:e})}// @__NO_SIDE_EFFECTS__
101
+ function Xa(e,t){return new Xn({check:`string_format`,format:`starts_with`,...B(t),prefix:e})}// @__NO_SIDE_EFFECTS__
102
+ function Za(e,t){return new Zn({check:`string_format`,format:`ends_with`,...B(t),suffix:e})}// @__NO_SIDE_EFFECTS__
103
+ function Qa(e,t){return new $n({check:`properties`,shape:e,...B(t)})}// @__NO_SIDE_EFFECTS__
104
+ function $a(e){return new er({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
105
+ function eo(e){return/* @__PURE__ */ $a(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
106
+ function to(){return/* @__PURE__ */ $a(e=>e.trim())}// @__NO_SIDE_EFFECTS__
107
+ function no(){return/* @__PURE__ */ $a(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
108
+ function ro(){return/* @__PURE__ */ $a(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
109
+ function io(){return/* @__PURE__ */ $a(e=>Te(e))}// @__NO_SIDE_EFFECTS__
110
+ function ao(e,t,n){return new e({type:`array`,element:t,...B(n)})}// @__NO_SIDE_EFFECTS__
111
+ function oo(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...B(n)})}// @__NO_SIDE_EFFECTS__
112
+ function so(e,t){let n=/* @__PURE__ */ co(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(it(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(it(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
113
+ function co(e,t){let n=new Fn({check:`custom`,...B(t)});return n._zod.check=e,n}function lo(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&ge(e,t,n[t]);return e}function uo(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??ia,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function fo(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function po(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,po(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&lo(o.schema,c),t.io===`input`&&Co(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function mo(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function ho(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${mo(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+mo(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
114
114
 
115
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function ho(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;ho(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const go=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),_o=[`oneOf`,`anyOf`];function vo(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function yo(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!go.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??vo(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}he(n,r,e.length===1?e[0]:yo(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=vo(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function bo(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of go)if(t in e)return;let n=t.filter(e=>_o.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=yo(t);else{let e=n[0],i=_o.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>yo([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,co(e,r))}function xo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):co(i,s),co(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())ho(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])bo(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}co(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,he(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:wo(t,`input`,e.processors),output:wo(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function So(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return So(r.element,n);if(r.type===`set`)return So(r.valueType,n);if(r.type===`lazy`)return So(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return So(r.innerType,n);if(r.type===`intersection`)return So(r.left,n)||So(r.right,n);if(r.type===`record`||r.type===`map`)return So(r.keyType,n)||So(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:So(r.in,n)||So(r.out,n);if(r.type===`object`){for(let e in r.shape)if(So(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(So(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(So(e,n))return!0;return!!(r.rest&&So(r.rest,n))}return!1}const Co=(e,t={})=>n=>{let r=lo({...n,processors:t});return fo(e,r),mo(r,e),xo(r,e)},wo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=lo({...i??{},target:a,io:t,processors:n});return fo(e,o),mo(o,e),xo(o,e)},To=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Eo=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Do=(e,t)=>{To(e,`minimum`,t),Eo(e,`maximum`,t)},Oo=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},ko=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},Ao=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},jo=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Mo=(e,t)=>To(e,`minimum`,t.minimum),No=(e,t)=>Eo(e,`maximum`,t.maximum),Po=e=>(t,n)=>{jo(t,n.format);let[r,i]=e[n.format];To(t,`minimum`,r),Eo(t,`maximum`,i)},Fo={greater_than:(e,t)=>To(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Eo(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Oo(e,t.value),number_format:Po(Fe),bigint_format:Po(Ie),min_length:Mo,max_length:No,length_equals:(e,t)=>Do(e,t.length),min_size:Mo,max_size:No,size_equals:(e,t)=>Do(e,t.size),string_format:(e,t)=>{jo(e,t.format),t.pattern&&ko(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Ao(e,t.mime)};function Io(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Fo[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&To(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&To(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Eo(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Eo(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Oo(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Ao(t,i.mime);for(let e of i.patterns??[])ko(t,e);return t}const Lo={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ro=/* @__PURE__ */ new Map([[Rr,vn],[Br,yn]]),zo=e=>Ro.get(e)??e,Bo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Io(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Lo[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(zo);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Vo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Io(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):uo(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Ho=(e,t,n,r)=>{n.type=`boolean`},Uo=(e,t,n,r)=>{n.not={}},Wo=(e,t,n,r)=>{let i=e._zod.def,a=ce(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Go=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(uo(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(uo(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Ko=(e,t,n,r)=>{uo(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},qo=(e,t,n,r)=>{uo(e,t,n,r,`Function types cannot be represented in JSON Schema`)},Jo=(e,t,n,r)=>{uo(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Yo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Io(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=fo(a.element,t,{...r,path:[...r.path,`items`]})};function Xo(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Xo(t.out):t.type===`catch`?Xo(t.innerType):e._zod.optin}const Zo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&uo(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)he(i.properties,e,fo(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Xo(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=fo(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Qo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>fo(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},$o=(e,t,n,r)=>{let i=e._zod.def,a=fo(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=fo(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},es=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>fo(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?fo(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?Xo(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=Io(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function ts(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=ts(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>ts(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?An:kn).source)),p}const ns=/* @__PURE__ */ new WeakMap;function rs(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of ns.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=ts(t,a,/* @__PURE__ */ new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}const is=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Io(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=fo(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)he(i.patternProperties,zo(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=fo(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=ns.get(t);n||(n=[],ns.set(t,n),t.deferred.push(()=>rs(t))),n.push(e)}i.additionalProperties=fo(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Xo(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},as=(e,t,n,r)=>{let i=e._zod.def,a=fo(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},os=(e,t,n,r)=>{let i=e._zod.def;fo(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ss=Symbol();function cs(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(uo(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),ss):JSON.parse(o)}const ls=(e,t,n,r)=>{let i=e._zod.def;fo(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=cs(i.defaultValue,e,t,n,r);o!==ss&&(n.default=o)},us=(e,t,n,r)=>{let i=e._zod.def;fo(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=cs(i.defaultValue,e,t,n,r);o!==ss&&(n._prefault=o)},ds=(e,t,n,r)=>{let i=e._zod.def;fo(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{uo(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},fs=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;fo(o,t,r);let s=t.seen.get(e);s.ref=o},ps=(e,t,n,r)=>{let i=e._zod.def;fo(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},ms=(e,t,n,r)=>{let i=e._zod.def;fo(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},hs=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function gs(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}const _s=/*@__PURE__*/ U(`ZodError`,(e,t)=>{kt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);hs.has(n)||(hs.add(n),gs(n,`format`,e=>t=>Nt(e,t)),gs(n,`flatten`,e=>t=>Mt(e,t)),gs(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ue,2)}),gs(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ue,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),vs=/* @__PURE__ */ Ft(_s),ys=/* @__PURE__ */ Lt(_s),bs=/* @__PURE__ */ zt(_s),xs=/* @__PURE__ */ Vt(_s),Ss=/* @__PURE__ */ qt(_s),Cs=/* @__PURE__ */ Jt(_s),ws=/* @__PURE__ */ Yt(_s),Ts=/* @__PURE__ */ Xt(_s),Es=/* @__PURE__ */ Zt(_s),Ds=/* @__PURE__ */ Qt(_s),Os=/* @__PURE__ */ $t(_s),ks=/* @__PURE__ */ en(_s);function As(){xt.localeError||St($i())}function js(){xt.memoizer||St({memoizer:Xi()})}const Ms=/*@__PURE__*/ U(`ZodType`,(e,t)=>(As(),nr.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Se(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Me(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(nl(e,t))},superRefine(e,t){return this.check(rl(e,t))},overwrite(e){return this.check(/* @__PURE__ */ Qa(e))},optional(){return Ic(this)},exactOptional(){return Rc(this)},nullable(){return Bc(this)},nullish(){return Ic(Bc(this))},nonoptional(e){return Kc(this,e)},array(){return gc(this)},or(e){return Sc([this,e])},and(e){return wc(this,e)},transform(e){return Xc(this,Pc(e))},default(e){return Hc(this,e)},prefault(e){return Wc(this,e)},catch(e){return Jc(this,e)},pipe(e){return Xc(this,e)},readonly(){return Qc(this)},describe(e){let t=this.clone();return ra.add(t,{description:e}),t},meta(...e){if(e.length===0)return ra.get(this);let t=this.clone();return ra.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return ot(this,`~standard`,{...ar(this),jsonSchema:{input:wo(this,`input`),output:wo(this,`output`)}})},set"~standard"(e){at(this,`~standard`,e)},parse:function e(t,n){return vs(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await ys(this,t,n,{callee:e})},safeParse(e,t){return bs(this,e,t)},async safeParseAsync(e,t){return xs(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){at(this,`spa`,e)},validate(e,t){return Wt(this,e,t)},validateAsync(e,t){return Kt(this,e,t)},encode:function e(t,n){return Ss(this,t,n,{callee:e})},decode:function e(t,n){return Cs(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await ws(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Ts(this,t,n,{callee:e})},safeEncode(e,t){return Es(this,e,t)},safeDecode(e,t){return Ds(this,e,t)},async safeEncodeAsync(e,t){return Os(this,e,t)},async safeDecodeAsync(e,t){return ks(this,e,t)},toJSONSchema(e){return Co(this,{})(e)},get description(){return ra.get(this)?.description},get _def(){return this._zod.def}}),Ns=/*@__PURE__*/ U(`_ZodString`,(e,t)=>{or.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bo(e,t,n,r)},/*@__PURE__*/ st({format:e=>Io(e).format??null,minLength:e=>Io(e).minimum??null,maxLength:e=>Io(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ Ga(...e))},includes(...e){return this.check(/* @__PURE__ */ Ja(...e))},startsWith(...e){return this.check(/* @__PURE__ */ Ya(...e))},endsWith(...e){return this.check(/* @__PURE__ */ Xa(...e))},min(...e){return this.check(/* @__PURE__ */ Ua(...e))},max(...e){return this.check(/* @__PURE__ */ Ha(...e))},length(...e){return this.check(/* @__PURE__ */ Wa(...e))},nonempty(...e){return this.check(/* @__PURE__ */ Ua(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ Ka(e))},uppercase(e){return this.check(/* @__PURE__ */ qa(e))},trim(){return this.check(/* @__PURE__ */ eo())},normalize(...e){return this.check(/* @__PURE__ */ $a(...e))},toLowerCase(){return this.check(/* @__PURE__ */ to())},toUpperCase(){return this.check(/* @__PURE__ */ no())},slugify(){return this.check(/* @__PURE__ */ ro())}})),Ps=/*@__PURE__*/ U(`ZodString`,(e,t)=>{or.init(e,t),Ns.init(e,t)},{email(e){return this.check(/* @__PURE__ */ oa(Vs,e))},url(e){return this.check(/* @__PURE__ */ fa(Ws,e))},jwt(e){return this.check(/* @__PURE__ */ Da(ac,e))},emoji(e){return this.check(/* @__PURE__ */ pa(Gs,e))},guid(e){return this.check(/* @__PURE__ */ sa(Hs,e))},uuid(e){return this.check(/* @__PURE__ */ ca(Us,e))},uuidv4(e){return this.check(/* @__PURE__ */ la(Us,e))},uuidv6(e){return this.check(/* @__PURE__ */ ua(Us,e))},uuidv7(e){return this.check(/* @__PURE__ */ da(Us,e))},nanoid(e){return this.check(/* @__PURE__ */ ma(Ks,e))},cuid(e){return this.check(/* @__PURE__ */ ha(qs,e))},cuid2(e){return this.check(/* @__PURE__ */ ga(Js,e))},ulid(e){return this.check(/* @__PURE__ */ _a(Ys,e))},base64(e){return this.check(/* @__PURE__ */ wa(nc,e))},base64url(e){return this.check(/* @__PURE__ */ Ta(rc,e))},xid(e){return this.check(/* @__PURE__ */ va(Xs,e))},ksuid(e){return this.check(/* @__PURE__ */ ya(Zs,e))},ipv4(e){return this.check(/* @__PURE__ */ ba(Qs,e))},ipv6(e){return this.check(/* @__PURE__ */ xa($s,e))},cidrv4(e){return this.check(/* @__PURE__ */ Sa(ec,e))},cidrv6(e){return this.check(/* @__PURE__ */ Ca(tc,e))},e164(e){return this.check(/* @__PURE__ */ Ea(ic,e))},datetime(e){return this.check(/* @__PURE__ */ Oa(Ls,e))},date(e){return this.check(/* @__PURE__ */ ka(Rs,e))},time(e){return this.check(/* @__PURE__ */ Aa(zs,e))},duration(e){return this.check(/* @__PURE__ */ ja(Bs,e))}});function Fs(e){return/* @__PURE__ */ aa(Ps,e)}const Is=/*@__PURE__*/ U(`ZodStringFormat`,(e,t)=>{sr.init(e,t),Ns.init(e,t)}),Ls=/*@__PURE__*/ U(`ZodISODateTime`,(e,t)=>{Er.init(e,t),Is.init(e,t)}),Rs=/*@__PURE__*/ U(`ZodISODate`,(e,t)=>{Dr.init(e,t),Is.init(e,t)}),zs=/*@__PURE__*/ U(`ZodISOTime`,(e,t)=>{Or.init(e,t),Is.init(e,t)}),Bs=/*@__PURE__*/ U(`ZodISODuration`,(e,t)=>{kr.init(e,t),Is.init(e,t)}),Vs=/*@__PURE__*/ U(`ZodEmail`,(e,t)=>{ur.init(e,t),Is.init(e,t)}),Hs=/*@__PURE__*/ U(`ZodGUID`,(e,t)=>{cr.init(e,t),Is.init(e,t)}),Us=/*@__PURE__*/ U(`ZodUUID`,(e,t)=>{lr.init(e,t),Is.init(e,t)}),Ws=/*@__PURE__*/ U(`ZodURL`,(e,t)=>{vr.init(e,t),Is.init(e,t)}),Gs=/*@__PURE__*/ U(`ZodEmoji`,(e,t)=>{yr.init(e,t),Is.init(e,t)}),Ks=/*@__PURE__*/ U(`ZodNanoID`,(e,t)=>{br.init(e,t),Is.init(e,t)}),qs=/*@__PURE__*/ U(`ZodCUID`,(e,t)=>{xr.init(e,t),Is.init(e,t)}),Js=/*@__PURE__*/ U(`ZodCUID2`,(e,t)=>{Sr.init(e,t),Is.init(e,t)}),Ys=/*@__PURE__*/ U(`ZodULID`,(e,t)=>{Cr.init(e,t),Is.init(e,t)}),Xs=/*@__PURE__*/ U(`ZodXID`,(e,t)=>{wr.init(e,t),Is.init(e,t)}),Zs=/*@__PURE__*/ U(`ZodKSUID`,(e,t)=>{Tr.init(e,t),Is.init(e,t)}),Qs=/*@__PURE__*/ U(`ZodIPv4`,(e,t)=>{Ar.init(e,t),Is.init(e,t)}),$s=/*@__PURE__*/ U(`ZodIPv6`,(e,t)=>{Nr.init(e,t),Is.init(e,t)}),ec=/*@__PURE__*/ U(`ZodCIDRv4`,(e,t)=>{Pr.init(e,t),Is.init(e,t)}),tc=/*@__PURE__*/ U(`ZodCIDRv6`,(e,t)=>{Ir.init(e,t),Is.init(e,t)}),nc=/*@__PURE__*/ U(`ZodBase64`,(e,t)=>{zr.init(e,t),Is.init(e,t)}),rc=/*@__PURE__*/ U(`ZodBase64URL`,(e,t)=>{Hr.init(e,t),Is.init(e,t)}),ic=/*@__PURE__*/ U(`ZodE164`,(e,t)=>{Ur.init(e,t),Is.init(e,t)}),ac=/*@__PURE__*/ U(`ZodJWT`,(e,t)=>{Gr.init(e,t),Is.init(e,t)}),oc=/*@__PURE__*/ U(`ZodNumber`,(e,t)=>{Kr.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vo(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ st({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Io(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Io(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Io(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Io(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ za(e,t))},gte(e,t){return this.check(/* @__PURE__ */ Ba(e,t))},min(e,t){return this.check(/* @__PURE__ */ Ba(e,t))},lt(e,t){return this.check(/* @__PURE__ */ La(e,t))},lte(e,t){return this.check(/* @__PURE__ */ Ra(e,t))},max(e,t){return this.check(/* @__PURE__ */ Ra(e,t))},int(e){return this.check(cc(e))},safe(e){return this.check(cc(e))},positive(e){return this.check(/* @__PURE__ */ za(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ Ba(0,e))},negative(e){return this.check(/* @__PURE__ */ La(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ Ra(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ Va(e,t))},step(e,t){return this.check(/* @__PURE__ */ Va(e,t))},finite(){return this}})),sc=/*@__PURE__*/ U(`ZodNumberFormat`,(e,t)=>{qr.init(e,t),oc.init(e,t)});function cc(e){return/* @__PURE__ */ Na(sc,e)}const lc=/*@__PURE__*/ U(`ZodBoolean`,(e,t)=>{Jr.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ho(e,t,n,r)});function uc(e){return/* @__PURE__ */ Pa(lc,e)}const dc=/*@__PURE__*/ U(`ZodUnknown`,(e,t)=>{Yr.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function fc(){return/* @__PURE__ */ Fa(dc)}const pc=/*@__PURE__*/ U(`ZodNever`,(e,t)=>{Xr.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uo(e,t,n,r)});function mc(e){return/* @__PURE__ */ Ia(pc,e)}const hc=/*@__PURE__*/ U(`ZodArray`,(e,t)=>{js(),ei.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ Ua(e,t))},nonempty(e){return this.check(/* @__PURE__ */ Ua(1,e))},max(e,t){return this.check(/* @__PURE__ */ Ha(e,t))},length(e,t){return this.check(/* @__PURE__ */ Wa(e,t))},unwrap(){return this.element}});function gc(e,t){return/* @__PURE__ */ io(hc,e,t)}const _c=/*@__PURE__*/ U(`ZodObject`,(e,t)=>{js(),oi.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zo(e,t,n,r),pt(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Ac(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Se(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Se(this._zod.def,{catchall:fc()}))},loose(){return this.clone(Se(this._zod.def,{catchall:fc()}))},strict(){return this.clone(Se(this._zod.def,{catchall:mc()}))},strip(){return this.clone(Se(this._zod.def,{catchall:void 0}))},extend(e){return Be(this,e)},safeExtend(e){return He(this,e)},merge(e){return Ue(this,e)},pick(e){return Le(this,e)},omit(e){return ze(this,e)},partial(...e){return We(Fc,this,e[0])},exactPartial(...e){return We(Lc,this,e[0],`exactPartial`)},required(...e){return Ge(Gc,this,e[0])}});function vc(e,t){let n={type:`object`,shape:e??{},...V(t)};return new _c(n)}function yc(e,t){return new _c({type:`object`,shape:e,catchall:mc(),...V(t)})}function bc(e,t){return new _c({type:`object`,shape:e,catchall:fc(),...V(t)})}const xc=/*@__PURE__*/ U(`ZodUnion`,(e,t)=>{ci.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qo(e,t,n,r),e.options=t.options});function Sc(e,t){return new xc({type:`union`,options:e,...V(t)})}const Cc=/*@__PURE__*/ U(`ZodIntersection`,(e,t)=>{li.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$o(e,t,n,r)});function wc(e,t){return new Cc({type:`intersection`,left:e,right:t})}const Tc=/*@__PURE__*/ U(`ZodTuple`,(e,t)=>{js(),fi.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>es(e,t,n,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw Error(`.partial() cannot be used on tuple schemas containing refinements`);return this.clone({...e,items:e.items.map(e=>new Fc({type:`optional`,innerType:e}))})}});function Ec(e,t,n){let r=t instanceof nr;return new Tc({type:`tuple`,items:e,rest:r?t:null,...V(r?n:t)})}const Dc=/*@__PURE__*/ U(`ZodRecord`,(e,t)=>{js(),gi.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>is(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Oc(e,t,n){return!t||!t._zod?new Dc({type:`record`,keyType:Fs(),valueType:e,...V(t)}):new Dc({type:`record`,keyType:e,valueType:t,...V(n)})}const kc=/*@__PURE__*/ U(`ZodEnum`,(e,t)=>{_i.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wo(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new kc({...t,checks:[],...V(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new kc({...t,checks:[],...V(r),entries:i})}});function Ac(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new kc({type:`enum`,entries:n,...V(t)})}const jc=/*@__PURE__*/ U(`ZodLiteral`,(e,t)=>{vi.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Go(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Mc(e,t){return new jc({type:`literal`,values:Array.isArray(e)?e:[e],...V(t)})}const Nc=/*@__PURE__*/ U(`ZodTransform`,(e,t)=>{js(),yi.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new bt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(rt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(rt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Pc(e){return new Nc({type:`transform`,transform:e})}const Fc=/*@__PURE__*/ U(`ZodOptional`,(e,t)=>{xi.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ms(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ic(e){return new Fc({type:`optional`,innerType:e})}const Lc=/*@__PURE__*/ U(`ZodExactOptional`,(e,t)=>{Si.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ms(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Rc(e){return new Lc({type:`optional`,innerType:e})}const zc=/*@__PURE__*/ U(`ZodNullable`,(e,t)=>{Ci.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>as(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bc(e){return new zc({type:`nullable`,innerType:e})}const Vc=/*@__PURE__*/ U(`ZodDefault`,(e,t)=>{wi.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ls(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Hc(e,t){return new Vc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ke(t)}})}const Uc=/*@__PURE__*/ U(`ZodPrefault`,(e,t)=>{Ei.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>us(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Wc(e,t){return new Uc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ke(t)}})}const Gc=/*@__PURE__*/ U(`ZodNonOptional`,(e,t)=>{Di.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>os(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Kc(e,t){return new Gc({type:`nonoptional`,innerType:e,...V(t)})}const qc=/*@__PURE__*/ U(`ZodCatch`,(e,t)=>{Ai.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ds(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Jc(e,t){return new qc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:mt(t)})}const Yc=/*@__PURE__*/ U(`ZodPipe`,(e,t)=>{ji.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fs(e,t,n,r),e.in=t.in,e.out=t.out});function Xc(e,t){return new Yc({type:`pipe`,in:e,out:t})}const Zc=/*@__PURE__*/ U(`ZodReadonly`,(e,t)=>{Ni.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ps(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qc(e){return new Zc({type:`readonly`,innerType:e})}const $c=/*@__PURE__*/ U(`ZodFunction`,(e,t)=>{Fi.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qo(e,t,n,r)});function el(e){return new $c({type:`function`,input:Array.isArray(e?.input)?Ec(e?.input):e?.input??gc(fc()),output:e?.output??fc()})}const tl=/*@__PURE__*/ U(`ZodCustom`,(e,t)=>{Ii.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ko(e,t,n,r)});function nl(e,t={}){return/* @__PURE__ */ ao(tl,e,t)}function rl(e,t){return/* @__PURE__ */ oo(e,t)}const il=/*@__PURE__*/ U(`ZodInstanceOf`,(e,t)=>{tl.init(e,t)},{properties(e,t){return this.check(/* @__PURE__ */ Za(e,t))}});function al(e,t={}){let n=new il({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...V(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function ol(e){return/* @__PURE__ */ Ma(oc,e)}function sl(e,t){return Ac(e,{error:`${t}必须是以下值之一: ${e.join(`, `)}`})}fc().refine(e=>typeof e==`number`&&!Number.isNaN(e),{error:`数字不能为 NaN`}),Oc(Fs(),fc()),el();const cl=e=>`cause`in e&&e.cause!==void 0?e.cause:e;function ll(e){if(e instanceof Error)return e;if(typeof e==`string`)return Error(e);if(typeof e==`object`&&e&&`message`in e){let t=e.message,n=cl(e),r=Error(String(t),{cause:n});return`name`in e&&typeof e.name==`string`&&(r.name=e.name),`stack`in e&&typeof e.stack==`string`&&(r.stack=e.stack),r}return typeof e==`object`&&e?Error(String(e),{cause:e}):Error(String(e))}const ul=e=>typeof e==`object`&&!!e&&`cause`in e,dl=e=>!ul(e)||e.cause===void 0||e.cause===null?null:{cause:e.cause},fl=(e,t)=>{let n=ll(e),r=[],i=/* @__PURE__ */ new Set([n]),a=n;for(let e=0;e<t;e+=1){let e=dl(a);if(e===null)return{top:n,causes:r,truncation:null};let t=e.cause;if(typeof t==`object`&&t&&i.has(t))return{top:n,causes:r,truncation:`cycle`};i.add(t),r.push(t),a=t}return dl(a)===null?{top:n,causes:r,truncation:null}:{top:n,causes:r,truncation:`depth`}},pl=e=>{if(e instanceof Error)return{name:e.name,message:e.message,...typeof e.stack==`string`&&e.stack.length>0?{stack:e.stack}:{}};if(typeof e==`object`&&e&&`message`in e){let t=`name`in e&&typeof e.name==`string`?e.name:`Error`,n=`stack`in e&&typeof e.stack==`string`&&e.stack.length>0?e.stack:void 0;return{name:t,message:String(e.message),...n===void 0?{}:{stack:n}}}return{name:`Error`,message:String(e)}};function ml(e,t){let n=t?.maxDepth??10,r=fl(e,n);return[pl(r.top),...r.causes.map(e=>pl(e))]}const hl=sl([`VALIDATION`,`NETWORK`,`TIMEOUT`,`NOT_FOUND`,`PERMISSION`,`CONFLICT`,`CONFIGURATION`,`EXTERNAL`,`INTERNAL`],`错误分类`);hl.options,vc({code:Fs(),category:hl,message:Fs(),context:Oc(Fs(),fc()).optional(),cause:al(Error).optional()}),vc({code:Fs(),category:hl,message:Fs(),context:Oc(Fs(),fc()).optional(),cause:Fs().optional()}),vc({success:Mc(!1),error:fc()});const gl={debug:0,info:1,warn:2,error:3};function _l(){return`${Date.now().toString(36)}-${Math.random().toString(36).substring(2,15)}`}function vl(){return Math.random().toString(36).substring(2,18)}var yl=/* @__PURE__ */ n(((e,t)=>{let n=e=>e&&typeof e.message==`string`,r=e=>{if(!e)return;let t=e.cause;if(typeof t==`function`){let t=e.cause();return n(t)?t:void 0}return n(t)?t:void 0},i=(e,t)=>{if(!n(e))return``;let a=e.stack||``;if(t.has(e))return a+`
115
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function go(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;go(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const _o=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),vo=[`oneOf`,`anyOf`];function yo(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function bo(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!_o.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??yo(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}ge(n,r,e.length===1?e[0]:bo(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=yo(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function xo(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of _o)if(t in e)return;let n=t.filter(e=>vo.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=bo(t);else{let e=n[0],i=vo.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>bo([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,lo(e,r))}function So(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):lo(i,s),lo(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())go(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])xo(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}lo(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,ge(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:To(t,`input`,e.processors),output:To(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Co(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Co(r.element,n);if(r.type===`set`)return Co(r.valueType,n);if(r.type===`lazy`)return Co(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Co(r.innerType,n);if(r.type===`intersection`)return Co(r.left,n)||Co(r.right,n);if(r.type===`record`||r.type===`map`)return Co(r.keyType,n)||Co(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Co(r.in,n)||Co(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Co(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Co(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Co(e,n))return!0;return!!(r.rest&&Co(r.rest,n))}return!1}const wo=(e,t={})=>n=>{let r=uo({...n,processors:t});return po(e,r),ho(r,e),So(r,e)},To=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=uo({...i??{},target:a,io:t,processors:n});return po(e,o),ho(o,e),So(o,e)},Eo=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Do=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Oo=(e,t)=>{Eo(e,`minimum`,t),Do(e,`maximum`,t)},ko=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Ao=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},jo=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Mo=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},No=(e,t)=>Eo(e,`minimum`,t.minimum),Po=(e,t)=>Do(e,`maximum`,t.maximum),Fo=e=>(t,n)=>{Mo(t,n.format);let[r,i]=e[n.format];Eo(t,`minimum`,r),Do(t,`maximum`,i)},Io={greater_than:(e,t)=>Eo(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Do(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ko(e,t.value),number_format:Fo(Ie),bigint_format:Fo(Le),min_length:No,max_length:Po,length_equals:(e,t)=>Oo(e,t.length),min_size:No,max_size:Po,size_equals:(e,t)=>Oo(e,t.size),string_format:(e,t)=>{Mo(e,t.format),t.pattern&&Ao(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>jo(e,t.mime)};function Lo(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Io[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Eo(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Eo(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Do(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Do(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ko(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&jo(t,i.mime);for(let e of i.patterns??[])Ao(t,e);return t}const Ro={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},zo=/* @__PURE__ */ new Map([[zr,yn],[Vr,bn]]),Bo=e=>zo.get(e)??e,Vo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Lo(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ro[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Bo);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Ho=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Lo(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):fo(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Uo=(e,t,n,r)=>{n.type=`boolean`},Wo=(e,t,n,r)=>{n.not={}},Go=(e,t,n,r)=>{let i=e._zod.def,a=le(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Ko=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(fo(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(fo(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},qo=(e,t,n,r)=>{fo(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Jo=(e,t,n,r)=>{fo(e,t,n,r,`Function types cannot be represented in JSON Schema`)},Yo=(e,t,n,r)=>{fo(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Xo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Lo(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=po(a.element,t,{...r,path:[...r.path,`items`]})};function Zo(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Zo(t.out):t.type===`catch`?Zo(t.innerType):e._zod.optin}const Qo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&fo(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)ge(i.properties,e,po(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Zo(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=po(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},$o=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>po(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},es=(e,t,n,r)=>{let i=e._zod.def,a=po(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=po(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},ts=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>po(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?po(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?Zo(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=Lo(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function ns(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=ns(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>ns(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?jn:An).source)),p}const rs=/* @__PURE__ */ new WeakMap;function is(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of rs.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=ns(t,a,/* @__PURE__ */ new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}const as=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Lo(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=po(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)ge(i.patternProperties,Bo(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=po(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=rs.get(t);n||(n=[],rs.set(t,n),t.deferred.push(()=>is(t))),n.push(e)}i.additionalProperties=po(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Zo(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},os=(e,t,n,r)=>{let i=e._zod.def,a=po(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ss=(e,t,n,r)=>{let i=e._zod.def;po(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},cs=Symbol();function ls(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(fo(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),cs):JSON.parse(o)}const us=(e,t,n,r)=>{let i=e._zod.def;po(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=ls(i.defaultValue,e,t,n,r);o!==cs&&(n.default=o)},ds=(e,t,n,r)=>{let i=e._zod.def;po(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=ls(i.defaultValue,e,t,n,r);o!==cs&&(n._prefault=o)},fs=(e,t,n,r)=>{let i=e._zod.def;po(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{fo(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},ps=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;po(o,t,r);let s=t.seen.get(e);s.ref=o},ms=(e,t,n,r)=>{let i=e._zod.def;po(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},hs=(e,t,n,r)=>{let i=e._zod.def;po(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},gs=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function _s(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}const vs=/*@__PURE__*/ H(`ZodError`,(e,t)=>{At.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);gs.has(n)||(gs.add(n),_s(n,`format`,e=>t=>Pt(e,t)),_s(n,`flatten`,e=>t=>Nt(e,t)),_s(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,de,2)}),_s(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,de,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),ys=/* @__PURE__ */ It(vs),bs=/* @__PURE__ */ Rt(vs),xs=/* @__PURE__ */ Bt(vs),Ss=/* @__PURE__ */ Ht(vs),Cs=/* @__PURE__ */ Jt(vs),ws=/* @__PURE__ */ Yt(vs),Ts=/* @__PURE__ */ Xt(vs),Es=/* @__PURE__ */ Zt(vs),Ds=/* @__PURE__ */ Qt(vs),Os=/* @__PURE__ */ $t(vs),ks=/* @__PURE__ */ en(vs),As=/* @__PURE__ */ tn(vs);function js(){St.localeError||Ct(ea())}function Ms(){St.memoizer||Ct({memoizer:Zi()})}const Ns=/*@__PURE__*/ H(`ZodType`,(e,t)=>(js(),rr.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Ce(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ne(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(nl(e,t))},superRefine(e,t){return this.check(rl(e,t))},overwrite(e){return this.check(/* @__PURE__ */ $a(e))},optional(){return Ic(this)},exactOptional(){return Rc(this)},nullable(){return Bc(this)},nullish(){return Ic(Bc(this))},nonoptional(e){return Kc(this,e)},array(){return gc(this)},or(e){return Sc([this,e])},and(e){return wc(this,e)},transform(e){return Xc(this,Pc(e))},default(e){return Hc(this,e)},prefault(e){return Wc(this,e)},catch(e){return Jc(this,e)},pipe(e){return Xc(this,e)},readonly(){return Qc(this)},describe(e){let t=this.clone();return ia.add(t,{description:e}),t},meta(...e){if(e.length===0)return ia.get(this);let t=this.clone();return ia.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return st(this,`~standard`,{...or(this),jsonSchema:{input:To(this,`input`),output:To(this,`output`)}})},set"~standard"(e){ot(this,`~standard`,e)},parse:function e(t,n){return ys(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await bs(this,t,n,{callee:e})},safeParse(e,t){return xs(this,e,t)},async safeParseAsync(e,t){return Ss(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ot(this,`spa`,e)},validate(e,t){return Gt(this,e,t)},validateAsync(e,t){return qt(this,e,t)},encode:function e(t,n){return Cs(this,t,n,{callee:e})},decode:function e(t,n){return ws(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Ts(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Es(this,t,n,{callee:e})},safeEncode(e,t){return Ds(this,e,t)},safeDecode(e,t){return Os(this,e,t)},async safeEncodeAsync(e,t){return ks(this,e,t)},async safeDecodeAsync(e,t){return As(this,e,t)},toJSONSchema(e){return wo(this,{})(e)},get description(){return ia.get(this)?.description},get _def(){return this._zod.def}}),Ps=/*@__PURE__*/ H(`_ZodString`,(e,t)=>{sr.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vo(e,t,n,r)},/*@__PURE__*/ ct({format:e=>Lo(e).format??null,minLength:e=>Lo(e).minimum??null,maxLength:e=>Lo(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ Ka(...e))},includes(...e){return this.check(/* @__PURE__ */ Ya(...e))},startsWith(...e){return this.check(/* @__PURE__ */ Xa(...e))},endsWith(...e){return this.check(/* @__PURE__ */ Za(...e))},min(...e){return this.check(/* @__PURE__ */ Wa(...e))},max(...e){return this.check(/* @__PURE__ */ Ua(...e))},length(...e){return this.check(/* @__PURE__ */ Ga(...e))},nonempty(...e){return this.check(/* @__PURE__ */ Wa(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ qa(e))},uppercase(e){return this.check(/* @__PURE__ */ Ja(e))},trim(){return this.check(/* @__PURE__ */ to())},normalize(...e){return this.check(/* @__PURE__ */ eo(...e))},toLowerCase(){return this.check(/* @__PURE__ */ no())},toUpperCase(){return this.check(/* @__PURE__ */ ro())},slugify(){return this.check(/* @__PURE__ */ io())}})),Fs=/*@__PURE__*/ H(`ZodString`,(e,t)=>{sr.init(e,t),Ps.init(e,t)},{email(e){return this.check(/* @__PURE__ */ sa(Vs,e))},url(e){return this.check(/* @__PURE__ */ pa(Ws,e))},jwt(e){return this.check(/* @__PURE__ */ Oa(ac,e))},emoji(e){return this.check(/* @__PURE__ */ ma(Gs,e))},guid(e){return this.check(/* @__PURE__ */ ca(Hs,e))},uuid(e){return this.check(/* @__PURE__ */ la(Us,e))},uuidv4(e){return this.check(/* @__PURE__ */ ua(Us,e))},uuidv6(e){return this.check(/* @__PURE__ */ da(Us,e))},uuidv7(e){return this.check(/* @__PURE__ */ fa(Us,e))},nanoid(e){return this.check(/* @__PURE__ */ ha(Ks,e))},cuid(e){return this.check(/* @__PURE__ */ ga(qs,e))},cuid2(e){return this.check(/* @__PURE__ */ _a(Js,e))},ulid(e){return this.check(/* @__PURE__ */ va(Ys,e))},base64(e){return this.check(/* @__PURE__ */ Ta(nc,e))},base64url(e){return this.check(/* @__PURE__ */ Ea(rc,e))},xid(e){return this.check(/* @__PURE__ */ ya(Xs,e))},ksuid(e){return this.check(/* @__PURE__ */ ba(Zs,e))},ipv4(e){return this.check(/* @__PURE__ */ xa(Qs,e))},ipv6(e){return this.check(/* @__PURE__ */ Sa($s,e))},cidrv4(e){return this.check(/* @__PURE__ */ Ca(ec,e))},cidrv6(e){return this.check(/* @__PURE__ */ wa(tc,e))},e164(e){return this.check(/* @__PURE__ */ Da(ic,e))},datetime(e){return this.check(/* @__PURE__ */ ka(Ls,e))},date(e){return this.check(/* @__PURE__ */ Aa(Rs,e))},time(e){return this.check(/* @__PURE__ */ ja(zs,e))},duration(e){return this.check(/* @__PURE__ */ Ma(Bs,e))}});function U(e){return/* @__PURE__ */ oa(Fs,e)}const Is=/*@__PURE__*/ H(`ZodStringFormat`,(e,t)=>{cr.init(e,t),Ps.init(e,t)}),Ls=/*@__PURE__*/ H(`ZodISODateTime`,(e,t)=>{Dr.init(e,t),Is.init(e,t)}),Rs=/*@__PURE__*/ H(`ZodISODate`,(e,t)=>{Or.init(e,t),Is.init(e,t)}),zs=/*@__PURE__*/ H(`ZodISOTime`,(e,t)=>{kr.init(e,t),Is.init(e,t)}),Bs=/*@__PURE__*/ H(`ZodISODuration`,(e,t)=>{Ar.init(e,t),Is.init(e,t)}),Vs=/*@__PURE__*/ H(`ZodEmail`,(e,t)=>{dr.init(e,t),Is.init(e,t)}),Hs=/*@__PURE__*/ H(`ZodGUID`,(e,t)=>{lr.init(e,t),Is.init(e,t)}),Us=/*@__PURE__*/ H(`ZodUUID`,(e,t)=>{ur.init(e,t),Is.init(e,t)}),Ws=/*@__PURE__*/ H(`ZodURL`,(e,t)=>{yr.init(e,t),Is.init(e,t)}),Gs=/*@__PURE__*/ H(`ZodEmoji`,(e,t)=>{br.init(e,t),Is.init(e,t)}),Ks=/*@__PURE__*/ H(`ZodNanoID`,(e,t)=>{xr.init(e,t),Is.init(e,t)}),qs=/*@__PURE__*/ H(`ZodCUID`,(e,t)=>{Sr.init(e,t),Is.init(e,t)}),Js=/*@__PURE__*/ H(`ZodCUID2`,(e,t)=>{Cr.init(e,t),Is.init(e,t)}),Ys=/*@__PURE__*/ H(`ZodULID`,(e,t)=>{wr.init(e,t),Is.init(e,t)}),Xs=/*@__PURE__*/ H(`ZodXID`,(e,t)=>{Tr.init(e,t),Is.init(e,t)}),Zs=/*@__PURE__*/ H(`ZodKSUID`,(e,t)=>{Er.init(e,t),Is.init(e,t)}),Qs=/*@__PURE__*/ H(`ZodIPv4`,(e,t)=>{jr.init(e,t),Is.init(e,t)}),$s=/*@__PURE__*/ H(`ZodIPv6`,(e,t)=>{Pr.init(e,t),Is.init(e,t)}),ec=/*@__PURE__*/ H(`ZodCIDRv4`,(e,t)=>{Fr.init(e,t),Is.init(e,t)}),tc=/*@__PURE__*/ H(`ZodCIDRv6`,(e,t)=>{Lr.init(e,t),Is.init(e,t)}),nc=/*@__PURE__*/ H(`ZodBase64`,(e,t)=>{Br.init(e,t),Is.init(e,t)}),rc=/*@__PURE__*/ H(`ZodBase64URL`,(e,t)=>{Ur.init(e,t),Is.init(e,t)}),ic=/*@__PURE__*/ H(`ZodE164`,(e,t)=>{Wr.init(e,t),Is.init(e,t)}),ac=/*@__PURE__*/ H(`ZodJWT`,(e,t)=>{Kr.init(e,t),Is.init(e,t)}),oc=/*@__PURE__*/ H(`ZodNumber`,(e,t)=>{qr.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ho(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ ct({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Lo(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Lo(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Lo(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Lo(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ Ba(e,t))},gte(e,t){return this.check(/* @__PURE__ */ Va(e,t))},min(e,t){return this.check(/* @__PURE__ */ Va(e,t))},lt(e,t){return this.check(/* @__PURE__ */ Ra(e,t))},lte(e,t){return this.check(/* @__PURE__ */ za(e,t))},max(e,t){return this.check(/* @__PURE__ */ za(e,t))},int(e){return this.check(cc(e))},safe(e){return this.check(cc(e))},positive(e){return this.check(/* @__PURE__ */ Ba(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ Va(0,e))},negative(e){return this.check(/* @__PURE__ */ Ra(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ za(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ Ha(e,t))},step(e,t){return this.check(/* @__PURE__ */ Ha(e,t))},finite(){return this}})),sc=/*@__PURE__*/ H(`ZodNumberFormat`,(e,t)=>{Jr.init(e,t),oc.init(e,t)});function cc(e){return/* @__PURE__ */ Pa(sc,e)}const lc=/*@__PURE__*/ H(`ZodBoolean`,(e,t)=>{Yr.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uo(e,t,n,r)});function uc(e){return/* @__PURE__ */ Fa(lc,e)}const dc=/*@__PURE__*/ H(`ZodUnknown`,(e,t)=>{Xr.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function fc(){return/* @__PURE__ */ Ia(dc)}const pc=/*@__PURE__*/ H(`ZodNever`,(e,t)=>{Zr.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wo(e,t,n,r)});function mc(e){return/* @__PURE__ */ La(pc,e)}const hc=/*@__PURE__*/ H(`ZodArray`,(e,t)=>{Ms(),ti.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ Wa(e,t))},nonempty(e){return this.check(/* @__PURE__ */ Wa(1,e))},max(e,t){return this.check(/* @__PURE__ */ Ua(e,t))},length(e,t){return this.check(/* @__PURE__ */ Ga(e,t))},unwrap(){return this.element}});function gc(e,t){return/* @__PURE__ */ ao(hc,e,t)}const _c=/*@__PURE__*/ H(`ZodObject`,(e,t)=>{Ms(),si.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qo(e,t,n,r),mt(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Ac(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Ce(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Ce(this._zod.def,{catchall:fc()}))},loose(){return this.clone(Ce(this._zod.def,{catchall:fc()}))},strict(){return this.clone(Ce(this._zod.def,{catchall:mc()}))},strip(){return this.clone(Ce(this._zod.def,{catchall:void 0}))},extend(e){return Ve(this,e)},safeExtend(e){return Ue(this,e)},merge(e){return We(this,e)},pick(e){return Re(this,e)},omit(e){return Be(this,e)},partial(...e){return Ge(Fc,this,e[0])},exactPartial(...e){return Ge(Lc,this,e[0],`exactPartial`)},required(...e){return Ke(Gc,this,e[0])}});function vc(e,t){let n={type:`object`,shape:e??{},...B(t)};return new _c(n)}function yc(e,t){return new _c({type:`object`,shape:e,catchall:mc(),...B(t)})}function bc(e,t){return new _c({type:`object`,shape:e,catchall:fc(),...B(t)})}const xc=/*@__PURE__*/ H(`ZodUnion`,(e,t)=>{li.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$o(e,t,n,r),e.options=t.options});function Sc(e,t){return new xc({type:`union`,options:e,...B(t)})}const Cc=/*@__PURE__*/ H(`ZodIntersection`,(e,t)=>{ui.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>es(e,t,n,r)});function wc(e,t){return new Cc({type:`intersection`,left:e,right:t})}const Tc=/*@__PURE__*/ H(`ZodTuple`,(e,t)=>{Ms(),pi.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ts(e,t,n,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw Error(`.partial() cannot be used on tuple schemas containing refinements`);return this.clone({...e,items:e.items.map(e=>new Fc({type:`optional`,innerType:e}))})}});function Ec(e,t,n){let r=t instanceof rr;return new Tc({type:`tuple`,items:e,rest:r?t:null,...B(r?n:t)})}const Dc=/*@__PURE__*/ H(`ZodRecord`,(e,t)=>{Ms(),_i.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>as(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Oc(e,t,n){return!t||!t._zod?new Dc({type:`record`,keyType:U(),valueType:e,...B(t)}):new Dc({type:`record`,keyType:e,valueType:t,...B(n)})}const kc=/*@__PURE__*/ H(`ZodEnum`,(e,t)=>{vi.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Go(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new kc({...t,checks:[],...B(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new kc({...t,checks:[],...B(r),entries:i})}});function Ac(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new kc({type:`enum`,entries:n,...B(t)})}const jc=/*@__PURE__*/ H(`ZodLiteral`,(e,t)=>{yi.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ko(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Mc(e,t){return new jc({type:`literal`,values:Array.isArray(e)?e:[e],...B(t)})}const Nc=/*@__PURE__*/ H(`ZodTransform`,(e,t)=>{Ms(),bi.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new xt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(it(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(it(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Pc(e){return new Nc({type:`transform`,transform:e})}const Fc=/*@__PURE__*/ H(`ZodOptional`,(e,t)=>{Si.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ic(e){return new Fc({type:`optional`,innerType:e})}const Lc=/*@__PURE__*/ H(`ZodExactOptional`,(e,t)=>{Ci.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Rc(e){return new Lc({type:`optional`,innerType:e})}const zc=/*@__PURE__*/ H(`ZodNullable`,(e,t)=>{wi.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>os(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bc(e){return new zc({type:`nullable`,innerType:e})}const Vc=/*@__PURE__*/ H(`ZodDefault`,(e,t)=>{Ti.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>us(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Hc(e,t){return new Vc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ae(t)}})}const Uc=/*@__PURE__*/ H(`ZodPrefault`,(e,t)=>{Di.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ds(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Wc(e,t){return new Uc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ae(t)}})}const Gc=/*@__PURE__*/ H(`ZodNonOptional`,(e,t)=>{Oi.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ss(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Kc(e,t){return new Gc({type:`nonoptional`,innerType:e,...B(t)})}const qc=/*@__PURE__*/ H(`ZodCatch`,(e,t)=>{ji.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Jc(e,t){return new qc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:ht(t)})}const Yc=/*@__PURE__*/ H(`ZodPipe`,(e,t)=>{Mi.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ps(e,t,n,r),e.in=t.in,e.out=t.out});function Xc(e,t){return new Yc({type:`pipe`,in:e,out:t})}const Zc=/*@__PURE__*/ H(`ZodReadonly`,(e,t)=>{Pi.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ms(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qc(e){return new Zc({type:`readonly`,innerType:e})}const $c=/*@__PURE__*/ H(`ZodFunction`,(e,t)=>{Ii.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jo(e,t,n,r)});function el(e){return new $c({type:`function`,input:Array.isArray(e?.input)?Ec(e?.input):e?.input??gc(fc()),output:e?.output??fc()})}const tl=/*@__PURE__*/ H(`ZodCustom`,(e,t)=>{Li.init(e,t),Ns.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qo(e,t,n,r)});function nl(e,t={}){return/* @__PURE__ */ oo(tl,e,t)}function rl(e,t){return/* @__PURE__ */ so(e,t)}const il=/*@__PURE__*/ H(`ZodInstanceOf`,(e,t)=>{tl.init(e,t)},{properties(e,t){return this.check(/* @__PURE__ */ Qa(e,t))}});function al(e,t={}){let n=new il({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...B(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function ol(e){return/* @__PURE__ */ Na(oc,e)}function sl(e,t){return Ac(e,{error:`${t}必须是以下值之一: ${e.join(`, `)}`})}fc().refine(e=>typeof e==`number`&&!Number.isNaN(e),{error:`数字不能为 NaN`}),Oc(U(),fc()),el();const cl=e=>`cause`in e&&e.cause!==void 0?e.cause:e;function ll(e){if(e instanceof Error)return e;if(typeof e==`string`)return Error(e);if(typeof e==`object`&&e&&`message`in e){let t=e.message,n=cl(e),r=Error(String(t),{cause:n});return`name`in e&&typeof e.name==`string`&&(r.name=e.name),`stack`in e&&typeof e.stack==`string`&&(r.stack=e.stack),r}return typeof e==`object`&&e?Error(String(e),{cause:e}):Error(String(e))}const ul=e=>typeof e==`object`&&!!e&&`cause`in e,dl=e=>!ul(e)||e.cause===void 0||e.cause===null?null:{cause:e.cause},fl=(e,t)=>{let n=ll(e),r=[],i=/* @__PURE__ */ new Set([n]),a=n;for(let e=0;e<t;e+=1){let e=dl(a);if(e===null)return{top:n,causes:r,truncation:null};let t=e.cause;if(typeof t==`object`&&t&&i.has(t))return{top:n,causes:r,truncation:`cycle`};i.add(t),r.push(t),a=t}return dl(a)===null?{top:n,causes:r,truncation:null}:{top:n,causes:r,truncation:`depth`}},pl=e=>{if(e instanceof Error)return{name:e.name,message:e.message,...typeof e.stack==`string`&&e.stack.length>0?{stack:e.stack}:{}};if(typeof e==`object`&&e&&`message`in e){let t=`name`in e&&typeof e.name==`string`?e.name:`Error`,n=`stack`in e&&typeof e.stack==`string`&&e.stack.length>0?e.stack:void 0;return{name:t,message:String(e.message),...n===void 0?{}:{stack:n}}}return{name:`Error`,message:String(e)}};function ml(e,t){let n=t?.maxDepth??10,r=fl(e,n);return[pl(r.top),...r.causes.map(e=>pl(e))]}const hl=sl([`VALIDATION`,`NETWORK`,`TIMEOUT`,`NOT_FOUND`,`PERMISSION`,`CONFLICT`,`CONFIGURATION`,`EXTERNAL`,`INTERNAL`],`错误分类`);hl.options,vc({code:U(),category:hl,message:U(),context:Oc(U(),fc()).optional(),cause:al(Error).optional()}),vc({code:U(),category:hl,message:U(),context:Oc(U(),fc()).optional(),cause:U().optional()}),vc({success:Mc(!1),error:fc()});const gl={debug:0,info:1,warn:2,error:3};function _l(){return`${Date.now().toString(36)}-${Math.random().toString(36).substring(2,15)}`}function vl(){return Math.random().toString(36).substring(2,18)}var yl=/* @__PURE__ */ n(((e,t)=>{let n=e=>e&&typeof e.message==`string`,r=e=>{if(!e)return;let t=e.cause;if(typeof t==`function`){let t=e.cause();return n(t)?t:void 0}return n(t)?t:void 0},i=(e,t)=>{if(!n(e))return``;let a=e.stack||``;if(t.has(e))return a+`
116
116
  causes have become circular...`;let o=r(e);return o?(t.add(e),a+`
117
- caused by: `+i(o,t)):a},a=e=>i(e,/* @__PURE__ */ new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?``:e.message||``;if(t.has(e))return a+`: ...`;let s=r(e);if(s){t.add(e);let n=typeof e.cause==`function`;return a+(n?``:`: `)+o(s,t,n)}return a};t.exports={isErrorLike:n,getErrorCause:r,stackWithCauses:a,messageWithCauses:e=>o(e,/* @__PURE__ */ new Set)}})),bl=/* @__PURE__ */ n(((e,t)=>{let n=Symbol(`circular-ref-tag`),r=Symbol(`pino-raw-err-ref`),i=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[r]},set:function(e){this[r]=e}}});Object.defineProperty(i,r,{writable:!0,value:{}}),t.exports={pinoErrProto:i,pinoErrorSymbols:{seen:n,rawSymbol:r}}})),xl=/* @__PURE__ */ n(((e,t)=>{t.exports=l;let{messageWithCauses:n,stackWithCauses:r,isErrorLike:i}=yl(),{pinoErrProto:a,pinoErrorSymbols:o}=bl(),{seen:s}=o,{toString:c}=Object.prototype;function l(e){if(!i(e))return e;e[s]=void 0;let t=Object.create(a);t.type=c.call(e.constructor)===`[object Function]`?e.constructor.name:e.name,t.message=n(e),t.stack=r(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(e=>l(e)));for(let n in e)if(t[n]===void 0){let r=e[n];i(r)?n!==`cause`&&!Object.prototype.hasOwnProperty.call(r,s)&&(t[n]=l(r)):t[n]=r}return delete e[s],t.raw=e,t}})),Sl=/* @__PURE__ */ n(((e,t)=>{t.exports=s;let{isErrorLike:n}=yl(),{pinoErrProto:r,pinoErrorSymbols:i}=bl(),{seen:a}=i,{toString:o}=Object.prototype;function s(e){if(!n(e))return e;e[a]=void 0;let t=Object.create(r);t.type=o.call(e.constructor)===`[object Function]`?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(e=>s(e))),n(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,a)&&(t.cause=s(e.cause));for(let r in e)if(t[r]===void 0){let i=e[r];n(i)?Object.prototype.hasOwnProperty.call(i,a)||(t[r]=s(i)):t[r]=i}return delete e[a],t.raw=e,t}})),Cl=/* @__PURE__ */ n(((e,t)=>{t.exports={mapHttpRequest:a,reqSerializer:i};let n=Symbol(`pino-raw-req-ref`),r=Object.create({},{id:{enumerable:!0,writable:!0,value:``},method:{enumerable:!0,writable:!0,value:``},url:{enumerable:!0,writable:!0,value:``},query:{enumerable:!0,writable:!0,value:``},params:{enumerable:!0,writable:!0,value:``},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:``},remotePort:{enumerable:!0,writable:!0,value:``},raw:{enumerable:!1,get:function(){return this[n]},set:function(e){this[n]=e}}});Object.defineProperty(r,n,{writable:!0,value:{}});function i(e){let t=e.info||e.socket,n=Object.create(r);if(n.id=typeof e.id==`function`?e.id():e.id||(e.info?e.info.id:void 0),n.method=e.method,e.originalUrl)n.url=e.originalUrl;else{let t=e.path;n.url=typeof t==`string`?t:e.url?e.url.path||e.url:void 0}return e.query&&(n.query=e.query),e.params&&(n.params=e.params),n.headers=e.headers,n.remoteAddress=t&&t.remoteAddress,n.remotePort=t&&t.remotePort,n.raw=e.raw||e,n}function a(e){return{req:i(e)}}})),wl=/* @__PURE__ */ n(((e,t)=>{t.exports={mapHttpResponse:a,resSerializer:i};let n=Symbol(`pino-raw-res-ref`),r=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:``},raw:{enumerable:!1,get:function(){return this[n]},set:function(e){this[n]=e}}});Object.defineProperty(r,n,{writable:!0,value:{}});function i(e){let t=Object.create(r);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function a(e){return{res:i(e)}}})),Tl=/* @__PURE__ */ n(((e,t)=>{let n=xl(),r=Sl(),i=Cl(),a=wl();t.exports={err:n,errWithCause:r,mapHttpRequest:i.mapHttpRequest,mapHttpResponse:a.mapHttpResponse,req:i.reqSerializer,res:a.resSerializer,wrapErrorSerializer:function(e){return e===n?e:function(t){return e(n(t))}},wrapRequestSerializer:function(e){return e===i.reqSerializer?e:function(t){return e(i.reqSerializer(t))}},wrapResponseSerializer:function(e){return e===a.resSerializer?e:function(t){return e(a.resSerializer(t))}}}})),El=/* @__PURE__ */ n(((e,t)=>{let n=a(`node:util`),r=n.getCallSites??n.getCallSite;function i(e,t){return t}t.exports=function(){if(r)return r().slice(2).map(e=>e.scriptName);let e=Error.prepareStackTrace;Error.prepareStackTrace=i;let t=(/* @__PURE__ */ Error()).stack;if(Error.prepareStackTrace=e,!Array.isArray(t))return;let n=t.slice(2),a=[];for(let e of n)e&&a.push(e.getFileName());return a}})),Dl=/* @__PURE__ */ n(((e,t)=>{function n(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){let t=[];for(let r=0;r<e.length;r++)t[r]=n(e[r]);return t}if(typeof e==`object`){let t=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=n(e[r]));return t}return e}function r(e){let t=[],n=``,r=!1,i=!1,a=``;for(let o=0;o<e.length;o++){let s=e[o];!r&&s===`.`?n&&=(t.push(n),``):s===`[`?(n&&=(t.push(n),``),r=!0):s===`]`&&r?(t.push(n),n=``,r=!1,i=!1):(s===`"`||s===`'`)&&r?i?s===a?(i=!1,a=``):n+=s:(i=!0,a=s):n+=s}return n&&t.push(n),t}function i(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(typeof r!=`object`||!r||!(n in r)||typeof r[n]!=`object`||r[n]===null)return!1;r=r[n]}let i=t[t.length-1];if(i===`*`){if(Array.isArray(r))for(let e=0;e<r.length;e++)r[e]=n;else if(typeof r==`object`&&r)for(let e in r)Object.prototype.hasOwnProperty.call(r,e)&&(r[e]=n)}else typeof r==`object`&&r&&i in r&&Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n);return!0}function a(e,t){let n=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(typeof n!=`object`||!n||!(r in n)||typeof n[r]!=`object`||n[r]===null)return!1;n=n[r]}let r=t[t.length-1];if(r===`*`){if(Array.isArray(n))for(let e=0;e<n.length;e++)n[e]=void 0;else if(typeof n==`object`&&n)for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&delete n[e]}else typeof n==`object`&&n&&r in n&&Object.prototype.hasOwnProperty.call(n,r)&&delete n[r];return!0}let o=Symbol(`PATH_NOT_FOUND`);function s(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||!n||!(e in n))return o;n=n[e]}return n}function c(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||!n)return;n=n[e]}return n}function l(e,t,n,c=!1){for(let l of t){let t=r(l);if(t.includes(`*`))u(e,t,n,l,c);else if(c)a(e,t);else{let r=s(e,t);if(r===o)continue;i(e,t,typeof n==`function`?n(r,t):n)}}}function u(e,t,n,r,i=!1){let a=t.indexOf(`*`);if(a===t.length-1){let r=t.slice(0,-1),a=e;for(let e of r){if(typeof a!=`object`||!a||!a)return;a=a[e]}if(Array.isArray(a)){if(i)for(let e=0;e<a.length;e++)a[e]=void 0;else for(let e=0;e<a.length;e++){let t=[...r,e.toString()],i=typeof n==`function`?n(a[e],t):n;a[e]=i}}else if(typeof a==`object`&&a){if(i){let e=[];for(let t in a)Object.prototype.hasOwnProperty.call(a,t)&&e.push(t);for(let t of e)delete a[t]}else for(let e in a){let t=[...r,e],i=typeof n==`function`?n(a[e],t):n;a[e]=i}}}else d(e,t,n,a,r,i)}function d(e,t,n,r,o,s=!1){let l=t.slice(0,r),d=t.slice(r+1),f=[];function p(e,t){if(t===l.length){if(Array.isArray(e))for(let n=0;n<e.length;n++)f[t]=n.toString(),p(e[n],t+1);else if(typeof e==`object`&&e)for(let n in e)f[t]=n,p(e[n],t+1)}else if(t<l.length){let n=l[t];e&&typeof e==`object`&&e&&n in e&&(f[t]=n,p(e[n],t+1))}else if(d.includes(`*`))u(e,d,typeof n==`function`?(e,r)=>n(e,[...f.slice(0,t),...r]):n,o,s);else if(s)a(e,d);else{let r=typeof n==`function`?n(c(e,d),[...f.slice(0,t),...d]):n;i(e,d,r)}}if(l.length===0)p(e,0);else{let t=e;for(let e=0;e<l.length;e++){let n=l[e];if(typeof t!=`object`||!t||!t)return;t=t[n],f[e]=n}t!=null&&p(t,l.length)}}function f(e){if(e.length===0)return null;let t=/* @__PURE__ */ new Map;for(let n of e){let e=r(n),i=t;for(let t=0;t<e.length;t++){let n=e[t];i.has(n)||i.set(n,/* @__PURE__ */ new Map),i=i.get(n)}}return t}function p(e,t){if(!t)return e;function n(e,t,r=0){if(!t||t.size===0||typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let r=[];for(let i=0;i<e.length;i++){let a=i.toString();t.has(a)||t.has(`*`)?r[i]=n(e[i],t.get(a)||t.get(`*`)):r[i]=e[i]}return r}let i=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=t.has(r)||t.has(`*`)?n(e[r],t.get(r)||t.get(`*`)):e[r]);return i}return n(e,t)}function m(e){if(typeof e!=`string`)throw Error(`Paths must be (non-empty) strings`);if(e===``)throw Error(`Invalid redaction path ()`);if(e.includes(`..`)||e.includes(`,`))throw Error(`Invalid redaction path (${e})`);let t=0,n=!1,r=``;for(let i=0;i<e.length;i++){let a=e[i];if((a===`"`||a===`'`)&&t>0)n?a===r&&(n=!1,r=``):(n=!0,r=a);else if(a===`[`&&!n)t++;else if(a===`]`&&!n&&(t--,t<0))throw Error(`Invalid redaction path (${e})`)}if(t!==0)throw Error(`Invalid redaction path (${e})`)}function h(e){if(!Array.isArray(e))throw TypeError(`paths must be an array`);for(let t of e)m(t)}function g(e={}){let{paths:t=[],censor:r=`[REDACTED]`,serialize:i=JSON.stringify,strict:a=!0,remove:o=!1}=e;h(t);let s=f(t);return function(e){if(a&&(typeof e!=`object`||!e)&&(typeof e!=`object`||!e))return i?i(e):e;let c=p(e,s),u=e,d=r;return typeof r==`function`&&(d=r),l(c,t,d,o),i===!1?(c.restore=function(){return n(u)},c):typeof i==`function`?i(c):JSON.stringify(c)}}t.exports=g})),Ol=/* @__PURE__ */ n(((e,t)=>{let n=Symbol(`pino.setLevel`),r=Symbol(`pino.getLevel`),i=Symbol(`pino.levelVal`),a=Symbol(`pino.levelComp`),o=Symbol(`pino.useLevelLabels`),s=Symbol(`pino.useOnlyCustomLevels`),c=Symbol(`pino.mixin`),l=Symbol(`pino.lsCache`),u=Symbol(`pino.chindings`),d=Symbol(`pino.asJson`),f=Symbol(`pino.write`),p=Symbol(`pino.redactFmt`),m=Symbol(`pino.time`),h=Symbol(`pino.timeSliceIndex`),g=Symbol(`pino.stream`),_=Symbol(`pino.stringify`),v=Symbol(`pino.stringifySafe`),y=Symbol(`pino.stringifiers`),b=Symbol(`pino.end`),x=Symbol(`pino.formatOpts`),S=Symbol(`pino.messageKey`),C=Symbol(`pino.errorKey`),w=Symbol(`pino.nestedKey`),T=Symbol(`pino.nestedKeyStr`),E=Symbol(`pino.mixinMergeStrategy`),D=Symbol(`pino.msgPrefix`),O=Symbol(`pino.wildcardFirst`),k=Symbol.for(`pino.serializers`),A=Symbol.for(`pino.formatters`),j=Symbol.for(`pino.hooks`);t.exports={setLevelSym:n,getLevelSym:r,levelValSym:i,levelCompSym:a,useLevelLabelsSym:o,mixinSym:c,lsCacheSym:l,chindingsSym:u,asJsonSym:d,writeSym:f,serializersSym:k,redactFmtSym:p,timeSym:m,timeSliceIndexSym:h,streamSym:g,stringifySym:_,stringifySafeSym:v,stringifiersSym:y,endSym:b,formatOptsSym:x,messageKeySym:S,errorKeySym:C,nestedKeySym:w,wildcardFirstSym:O,needsMetadataGsym:Symbol.for(`pino.metadata`),useOnlyCustomLevelsSym:s,formattersSym:A,hooksSym:j,nestedKeyStrSym:T,mixinMergeStrategySym:E,msgPrefixSym:D,transportUsesMultistreamSym:Symbol.for(`pino.transport.usesMultistream`)}})),kl=/* @__PURE__ */ n(((e,t)=>{let n=Dl(),{redactFmtSym:r,wildcardFirstSym:i}=Ol(),a=/[^.[\]]+|\[([^[\]]*?)\]/g,o=`[Redacted]`;function s(e,t){let{paths:o,censor:s,remove:l}=c(e),u=o.reduce((e,t)=>{a.lastIndex=0;let n=a.exec(t),r=a.exec(t),o=n[1]===void 0?n[0]:n[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,`$1`);if(o===`*`&&(o=i),r===null)return e[o]=null,e;if(e[o]===null)return e;let{index:s}=r,c=`${t.substr(s,t.length-1)}`;return e[o]=e[o]||[],o!==i&&e[o].length===0&&e[o].push(...e[i]||[]),o===i&&Object.keys(e).forEach(function(t){e[t]&&e[t].push(c)}),e[o].push(c),e},Object.create(null)),d=Object.assign(Object.create(null),{[r]:n({paths:o,censor:s,serialize:t,strict:!1,remove:l})}),f=(...e)=>t(typeof s==`function`?s(...e):s);return[...Object.keys(u),...Object.getOwnPropertySymbols(u)].reduce((e,r)=>{if(u[r]===null)e[r]=e=>f(e,[r]);else{let i=typeof s==`function`?(e,t)=>s(e,[r,...t]):s;e[r]=n({paths:u[r],censor:i,serialize:t,strict:!1,remove:l})}return e},d)}function c(e){if(Array.isArray(e))return e={paths:e,censor:o},e;let{paths:t,censor:n=o,remove:r}=e;if(Array.isArray(t)===!1)throw Error(`pino – redact must contain an array of strings`);return r===!0&&(n=void 0),{paths:t,censor:n,remove:r}}t.exports=s})),Al=/* @__PURE__ */ n(((e,t)=>{let n=()=>``,r=()=>`,"time":${Date.now()}`,i=()=>`,"time":${Math.round(Date.now()/1e3)}`,a=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,o=1000000000n,s=BigInt(Date.now())*1000000n,c=process.hrtime.bigint();t.exports={nullTime:n,epochTime:r,unixTime:i,isoTime:a,isoTimeNano:()=>{let e=process.hrtime.bigint()-c,t=s+e,n=t/o,r=t%o,i=Number(n*1000n+r/1000000n),a=new Date(i);return`,"time":"${a.getUTCFullYear()}-${(a.getUTCMonth()+1).toString().padStart(2,`0`)}-${a.getUTCDate().toString().padStart(2,`0`)}T${a.getUTCHours().toString().padStart(2,`0`)}:${a.getUTCMinutes().toString().padStart(2,`0`)}:${a.getUTCSeconds().toString().padStart(2,`0`)}.${r.toString().padStart(9,`0`)}Z"`}}})),jl=/* @__PURE__ */ n(((e,t)=>{function n(e){try{return JSON.stringify(e)}catch{return`"[Circular]"`}}t.exports=r;function r(e,t,r){var i=r&&r.stringify||n,a=1;if(typeof e==`object`&&e){var o=t.length+a;if(o===1)return e;var s=Array(o);s[0]=i(e);for(var c=1;c<o;c++)s[c]=i(t[c]);return s.join(` `)}if(typeof e!=`string`)return e;var l=t.length;if(l===0)return e;for(var u=``,d=1-a,f=-1,p=e&&e.length||0,m=0;m<p;){if(e.charCodeAt(m)===37&&m+1<p){switch(f=f>-1?f:0,e.charCodeAt(m+1)){case 100:case 102:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Number(t[d]),f=m+2,m++;break;case 105:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Math.floor(Number(t[d])),f=m+2,m++;break;case 79:case 111:case 106:if(d>=l||t[d]===void 0)break;f<m&&(u+=e.slice(f,m));var h=typeof t[d];if(h===`string`){u+=`'`+t[d]+`'`,f=m+2,m++;break}if(h===`function`){u+=t[d].name||`<anonymous>`,f=m+2,m++;break}u+=i(t[d]),f=m+2,m++;break;case 115:if(d>=l)break;f<m&&(u+=e.slice(f,m)),u+=String(t[d]),f=m+2,m++;break;case 37:f<m&&(u+=e.slice(f,m)),u+=`%`,f=m+2,m++,d--}++d}++m}return f===-1?e:(f<p&&(u+=e.slice(f)),u)}})),Ml=/* @__PURE__ */ n(((e,t)=>{if(typeof SharedArrayBuffer<`u`&&typeof Atomics<`u`){let e=new Int32Array(new SharedArrayBuffer(4));function n(t){if(!(t>0&&t<1/0))throw typeof t!=`number`&&typeof t!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);Atomics.wait(e,0,0,Number(t))}t.exports=n}else{function e(e){if(!(e>0&&e<1/0))throw typeof e!=`number`&&typeof e!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);let t=Date.now()+Number(e);for(;t>Date.now(););}t.exports=e}})),Nl=/* @__PURE__ */ n(((e,t)=>{let n=a(`fs`),r=a(`events`),i=a(`util`).inherits,o=a(`path`),s=Ml(),c=a(`assert`),l=Buffer.allocUnsafe(0),u=`buffer`,d=`utf8`,[f,p]=(process.versions.node||`0.0`).split(`.`).map(Number),m=f>=22&&p>=7;function h(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(n,r){if(n){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount(`error`)>0&&t.emit(`error`,n)}):t.emit(`error`,n);return}let i=t._reopening;t.fd=r,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit(`ready`)):t.emit(`ready`),!t.destroyed&&(!t._writing&&t._len>t.minLength||t._flushPending?t._actualWrite():i&&process.nextTick(()=>t.emit(`drain`)))}let i=t.append?`a`:`w`,a=t.mode;if(t.sync)try{t.mkdir&&n.mkdirSync(o.dirname(e),{recursive:!0}),r(null,n.openSync(e,i,a))}catch(e){throw r(e),e}else t.mkdir?n.mkdir(o.dirname(e),{recursive:!0},t=>{if(t)return r(t);n.open(e,i,a,r)}):n.open(e,i,a,r)}function g(e){if(!(this instanceof g))return new g(e);let{fd:t,dest:r,minLength:i,maxLength:a,maxWrite:o,periodicFlush:c,sync:f,append:p=!0,mkdir:m,retryEAGAIN:y,fsync:S,contentMode:A,mode:j}=e||{};t||=r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=a||0,this.maxWrite=o||16384,this._periodicFlush=c||0,this._periodicFlushTimer=void 0,this.sync=f||!1,this.writable=!0,this._fsync=S||!1,this.append=p||!1,this.mode=j,this.retryEAGAIN=y||(()=>!0),this.mkdir=m||!1;let ee,te;if(A===u)this._writingBuf=l,this.write=x,this.flush=w,this.flushSync=E,this._actualWrite=O,ee=()=>n.writeSync(this.fd,this._writingBuf),te=()=>n.write(this.fd,this._writingBuf,this.release);else if(A===void 0||A===d)this._writingBuf=``,this.write=b,this.flush=C,this.flushSync=T,this._actualWrite=D,ee=()=>Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`),te=()=>Buffer.isBuffer(this._writingBuf)?n.write(this.fd,this._writingBuf,this.release):n.write(this.fd,this._writingBuf,`utf8`,this.release);else throw Error(`SonicBoom supports "${d}" and "${u}", but passed ${A}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)h(t,this);else throw Error(`SonicBoom supports only file descriptors and files`);if(this.minLength>=this.maxWrite)throw Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(e,t)=>{if(e){if((e.code===`EAGAIN`||e.code===`EBUSY`)&&this.retryEAGAIN(e,this._writingBuf.length,this._len-this._writingBuf.length)){if(this.sync)try{s(100),this.release(void 0,0)}catch(e){this.release(e)}else setTimeout(te,100)}else this._writing=!1,this.emit(`error`,e);return}this.emit(`write`,t);let r=_(this._writingBuf,this._len,t);if(this._len=r.len,this._writingBuf=r.writingBuf,this._writingBuf.length){if(!this.sync){te();return}try{do{let e=ee(),t=_(this._writingBuf,this._len,e);this._len=t.len,this._writingBuf=t.writingBuf}while(this._writingBuf.length)}catch(e){this.release(e);return}}this._fsync&&n.fsyncSync(this.fd);let i=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):i>this.minLength?this._actualWrite():this._ending?i>0?this._actualWrite():(this._writing=!1,k(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(v,this)):this.emit(`drain`))},this.on(`newListener`,function(e){e===`drain`&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function _(e,t,n){return typeof e==`string`&&(e=Buffer.from(e)),t=Math.max(t-n,0),e=e.subarray(n),{writingBuf:e,len:t}}function v(e){e.listenerCount(`drain`)>0&&(e._asyncDrainScheduled=!1,e.emit(`drain`))}i(g,r);function y(e,t){return e.length===0?l:e.length===1?e[0]:Buffer.concat(e,t)}function b(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);e=``+e;let t=Buffer.byteLength(e),n=this._len+t,r=this._bufs;return this.maxLength&&n>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(r.length===0||Buffer.byteLength(r[r.length-1])+t>this.maxWrite?r.push(e):r[r.length-1]+=e,this._len=n,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function x(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);let t=this._len+e.length,n=this._bufs,r=this._lens;return this.maxLength&&t>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(n.length===0||r[r.length-1]+e.length>this.maxWrite?(n.push([e]),r.push(e.length)):(n[n.length-1].push(e),r[r.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function S(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{n.fsync(this.fd,t=>{this._flushPending=!1,e(t)})}catch(t){e(t)}this.off(`error`,r)},r=n=>{this._flushPending=!1,e(n),this.off(`drain`,t)};this.once(`drain`,t),this.once(`error`,r)}function C(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0?e?.():(e&&S.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(``),this._actualWrite()))}function w(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0?e?.():(e&&S.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite()))}g.prototype.reopen=function(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{this.reopen(e)});return}if(this._ending)return;if(!this.file)throw Error(`Unable to reopen a file descriptor, you must pass a file to SonicBoom`);if(e&&(this.file=e),this._reopening=!0,this._writing)return;let t=this.fd;this.once(`ready`,()=>{t!==this.fd&&n.close(t,e=>{if(e)return this.emit(`error`,e)})}),h(this.file,this)},g.prototype.end=function(){if(this.destroyed)throw Error(`SonicBoom destroyed`);this._opening?this.once(`ready`,()=>{this.end()}):this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():k(this)))};function T(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this.fd<0)throw Error(`sonic boom is not ready yet`);!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf=``);let e=``;for(;this._bufs.length||e.length;){e.length<=0&&(e=this._bufs[0]);try{let t=Buffer.isBuffer(e)?n.writeSync(this.fd,e):n.writeSync(this.fd,e,`utf8`),r=_(e,this._len,t);e=r.writingBuf,this._len=r.len,e.length<=0&&this._bufs.shift()}catch(t){if((t.code===`EAGAIN`||t.code===`EBUSY`)&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;s(100)}}try{n.fsyncSync(this.fd)}catch{}}function E(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this.fd<0)throw Error(`sonic boom is not ready yet`);!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=l);let e=l;for(;this._bufs.length||e.length;){e.length<=0&&(e=y(this._bufs[0],this._lens[0]));try{let t=n.writeSync(this.fd,e);e=e.subarray(t),this._len=Math.max(this._len-t,0),e.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(t){if((t.code===`EAGAIN`||t.code===`EBUSY`)&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;s(100)}}}g.prototype.destroy=function(){this.destroyed||k(this)};function D(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||``,this.sync)try{e(null,Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`))}catch(t){e(t)}else n.write(this.fd,this._writingBuf,e)}function O(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:y(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,n.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else m&&(this._writingBuf=Buffer.from(this._writingBuf)),n.write(this.fd,this._writingBuf,e)}function k(e){if(e.fd===-1){e.once(`ready`,k.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],c(typeof e.fd==`number`,`sonic.fd must be a number, got ${typeof e.fd}`);try{n.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?n.close(e.fd,r):r()}function r(t){t?e.emit(`error`,t):(e._ending&&!e._writing&&e.emit(`finish`),e.emit(`close`))}}g.SonicBoom=g,g.default=g,t.exports=g})),Pl=/* @__PURE__ */ n(((e,t)=>{let n={exit:[],beforeExit:[]},r={exit:c,beforeExit:l},i;function a(){i===void 0&&(i=new FinalizationRegistry(d))}function o(e){n[e].length>0||process.on(e,r[e])}function s(e){n[e].length>0||(process.removeListener(e,r[e]),n.exit.length===0&&n.beforeExit.length===0&&(i=void 0))}function c(){u(`exit`)}function l(){u(`beforeExit`)}function u(e){for(let t of n[e]){let n=t.deref(),r=t.fn;
117
+ caused by: `+i(o,t)):a},a=e=>i(e,/* @__PURE__ */ new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?``:e.message||``;if(t.has(e))return a+`: ...`;let s=r(e);if(s){t.add(e);let n=typeof e.cause==`function`;return a+(n?``:`: `)+o(s,t,n)}return a};t.exports={isErrorLike:n,getErrorCause:r,stackWithCauses:a,messageWithCauses:e=>o(e,/* @__PURE__ */ new Set)}})),bl=/* @__PURE__ */ n(((e,t)=>{let n=Symbol(`circular-ref-tag`),r=Symbol(`pino-raw-err-ref`),i=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[r]},set:function(e){this[r]=e}}});Object.defineProperty(i,r,{writable:!0,value:{}}),t.exports={pinoErrProto:i,pinoErrorSymbols:{seen:n,rawSymbol:r}}})),xl=/* @__PURE__ */ n(((e,t)=>{t.exports=l;let{messageWithCauses:n,stackWithCauses:r,isErrorLike:i}=yl(),{pinoErrProto:a,pinoErrorSymbols:o}=bl(),{seen:s}=o,{toString:c}=Object.prototype;function l(e){if(!i(e))return e;e[s]=void 0;let t=Object.create(a);t.type=c.call(e.constructor)===`[object Function]`?e.constructor.name:e.name,t.message=n(e),t.stack=r(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(e=>l(e)));for(let n in e)if(t[n]===void 0){let r=e[n];i(r)?n!==`cause`&&!Object.prototype.hasOwnProperty.call(r,s)&&(t[n]=l(r)):t[n]=r}return delete e[s],t.raw=e,t}})),Sl=/* @__PURE__ */ n(((e,t)=>{t.exports=s;let{isErrorLike:n}=yl(),{pinoErrProto:r,pinoErrorSymbols:i}=bl(),{seen:a}=i,{toString:o}=Object.prototype;function s(e){if(!n(e))return e;e[a]=void 0;let t=Object.create(r);t.type=o.call(e.constructor)===`[object Function]`?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(e=>s(e))),n(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,a)&&(t.cause=s(e.cause));for(let r in e)if(t[r]===void 0){let i=e[r];n(i)?Object.prototype.hasOwnProperty.call(i,a)||(t[r]=s(i)):t[r]=i}return delete e[a],t.raw=e,t}})),Cl=/* @__PURE__ */ n(((e,t)=>{t.exports={mapHttpRequest:a,reqSerializer:i};let n=Symbol(`pino-raw-req-ref`),r=Object.create({},{id:{enumerable:!0,writable:!0,value:``},method:{enumerable:!0,writable:!0,value:``},url:{enumerable:!0,writable:!0,value:``},query:{enumerable:!0,writable:!0,value:``},params:{enumerable:!0,writable:!0,value:``},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:``},remotePort:{enumerable:!0,writable:!0,value:``},raw:{enumerable:!1,get:function(){return this[n]},set:function(e){this[n]=e}}});Object.defineProperty(r,n,{writable:!0,value:{}});function i(e){let t=e.info||e.socket,n=Object.create(r);if(n.id=typeof e.id==`function`?e.id():e.id||(e.info?e.info.id:void 0),n.method=e.method,e.originalUrl)n.url=e.originalUrl;else{let t=e.path;n.url=typeof t==`string`?t:e.url?e.url.path||e.url:void 0}return e.query&&(n.query=e.query),e.params&&(n.params=e.params),n.headers=e.headers,n.remoteAddress=t&&t.remoteAddress,n.remotePort=t&&t.remotePort,n.raw=e.raw||e,n}function a(e){return{req:i(e)}}})),wl=/* @__PURE__ */ n(((e,t)=>{t.exports={mapHttpResponse:a,resSerializer:i};let n=Symbol(`pino-raw-res-ref`),r=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:``},raw:{enumerable:!1,get:function(){return this[n]},set:function(e){this[n]=e}}});Object.defineProperty(r,n,{writable:!0,value:{}});function i(e){let t=Object.create(r);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function a(e){return{res:i(e)}}})),Tl=/* @__PURE__ */ n(((e,t)=>{let n=xl(),r=Sl(),i=Cl(),a=wl();t.exports={err:n,errWithCause:r,mapHttpRequest:i.mapHttpRequest,mapHttpResponse:a.mapHttpResponse,req:i.reqSerializer,res:a.resSerializer,wrapErrorSerializer:function(e){return e===n?e:function(t){return e(n(t))}},wrapRequestSerializer:function(e){return e===i.reqSerializer?e:function(t){return e(i.reqSerializer(t))}},wrapResponseSerializer:function(e){return e===a.resSerializer?e:function(t){return e(a.resSerializer(t))}}}})),El=/* @__PURE__ */ n(((e,t)=>{let n=a(`node:util`),r=n.getCallSites??n.getCallSite;function i(e,t){return t}t.exports=function(){if(r)return r().slice(2).map(e=>e.scriptName);let e=Error.prepareStackTrace;Error.prepareStackTrace=i;let t=(/* @__PURE__ */ Error()).stack;if(Error.prepareStackTrace=e,!Array.isArray(t))return;let n=t.slice(2),a=[];for(let e of n)e&&a.push(e.getFileName());return a}})),Dl=/* @__PURE__ */ n(((e,t)=>{function n(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){let t=[];for(let r=0;r<e.length;r++)t[r]=n(e[r]);return t}if(typeof e==`object`){let t=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=n(e[r]));return t}return e}function r(e){let t=[],n=``,r=!1,i=!1,a=``;for(let o=0;o<e.length;o++){let s=e[o];!r&&s===`.`?n&&=(t.push(n),``):s===`[`?(n&&=(t.push(n),``),r=!0):s===`]`&&r?(t.push(n),n=``,r=!1,i=!1):(s===`"`||s===`'`)&&r?i?s===a?(i=!1,a=``):n+=s:(i=!0,a=s):n+=s}return n&&t.push(n),t}function i(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(typeof r!=`object`||!r||!(n in r)||typeof r[n]!=`object`||r[n]===null)return!1;r=r[n]}let i=t[t.length-1];if(i===`*`){if(Array.isArray(r))for(let e=0;e<r.length;e++)r[e]=n;else if(typeof r==`object`&&r)for(let e in r)Object.prototype.hasOwnProperty.call(r,e)&&(r[e]=n)}else typeof r==`object`&&r&&i in r&&Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n);return!0}function a(e,t){let n=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(typeof n!=`object`||!n||!(r in n)||typeof n[r]!=`object`||n[r]===null)return!1;n=n[r]}let r=t[t.length-1];if(r===`*`){if(Array.isArray(n))for(let e=0;e<n.length;e++)n[e]=void 0;else if(typeof n==`object`&&n)for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&delete n[e]}else typeof n==`object`&&n&&r in n&&Object.prototype.hasOwnProperty.call(n,r)&&delete n[r];return!0}let o=Symbol(`PATH_NOT_FOUND`);function s(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||!n||!(e in n))return o;n=n[e]}return n}function c(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||!n)return;n=n[e]}return n}function l(e,t,n,c=!1){for(let l of t){let t=r(l);if(t.includes(`*`))u(e,t,n,l,c);else if(c)a(e,t);else{let r=s(e,t);if(r===o)continue;i(e,t,typeof n==`function`?n(r,t):n)}}}function u(e,t,n,r,i=!1){let a=t.indexOf(`*`);if(a===t.length-1){let r=t.slice(0,-1),a=e;for(let e of r){if(typeof a!=`object`||!a||!a)return;a=a[e]}if(Array.isArray(a)){if(i)for(let e=0;e<a.length;e++)a[e]=void 0;else for(let e=0;e<a.length;e++){let t=[...r,e.toString()],i=typeof n==`function`?n(a[e],t):n;a[e]=i}}else if(typeof a==`object`&&a){if(i){let e=[];for(let t in a)Object.prototype.hasOwnProperty.call(a,t)&&e.push(t);for(let t of e)delete a[t]}else for(let e in a){let t=[...r,e],i=typeof n==`function`?n(a[e],t):n;a[e]=i}}}else d(e,t,n,a,r,i)}function d(e,t,n,r,o,s=!1){let l=t.slice(0,r),d=t.slice(r+1),f=[];function p(e,t){if(t===l.length){if(Array.isArray(e))for(let n=0;n<e.length;n++)f[t]=n.toString(),p(e[n],t+1);else if(typeof e==`object`&&e)for(let n in e)f[t]=n,p(e[n],t+1)}else if(t<l.length){let n=l[t];e&&typeof e==`object`&&e&&n in e&&(f[t]=n,p(e[n],t+1))}else if(d.includes(`*`))u(e,d,typeof n==`function`?(e,r)=>n(e,[...f.slice(0,t),...r]):n,o,s);else if(s)a(e,d);else{let r=typeof n==`function`?n(c(e,d),[...f.slice(0,t),...d]):n;i(e,d,r)}}if(l.length===0)p(e,0);else{let t=e;for(let e=0;e<l.length;e++){let n=l[e];if(typeof t!=`object`||!t||!t)return;t=t[n],f[e]=n}t!=null&&p(t,l.length)}}function f(e){if(e.length===0)return null;let t=/* @__PURE__ */ new Map;for(let n of e){let e=r(n),i=t;for(let t=0;t<e.length;t++){let n=e[t];i.has(n)||i.set(n,/* @__PURE__ */ new Map),i=i.get(n)}}return t}function p(e,t){if(!t)return e;function n(e,t,r=0){if(!t||t.size===0||typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let r=[];for(let i=0;i<e.length;i++){let a=i.toString();t.has(a)||t.has(`*`)?r[i]=n(e[i],t.get(a)||t.get(`*`)):r[i]=e[i]}return r}let i=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=t.has(r)||t.has(`*`)?n(e[r],t.get(r)||t.get(`*`)):e[r]);return i}return n(e,t)}function m(e){if(typeof e!=`string`)throw Error(`Paths must be (non-empty) strings`);if(e===``)throw Error(`Invalid redaction path ()`);if(e.includes(`..`)||e.includes(`,`))throw Error(`Invalid redaction path (${e})`);let t=0,n=!1,r=``;for(let i=0;i<e.length;i++){let a=e[i];if((a===`"`||a===`'`)&&t>0)n?a===r&&(n=!1,r=``):(n=!0,r=a);else if(a===`[`&&!n)t++;else if(a===`]`&&!n&&(t--,t<0))throw Error(`Invalid redaction path (${e})`)}if(t!==0)throw Error(`Invalid redaction path (${e})`)}function h(e){if(!Array.isArray(e))throw TypeError(`paths must be an array`);for(let t of e)m(t)}function g(e={}){let{paths:t=[],censor:r=`[REDACTED]`,serialize:i=JSON.stringify,strict:a=!0,remove:o=!1}=e;h(t);let s=f(t);return function(e){if(a&&(typeof e!=`object`||!e)&&(typeof e!=`object`||!e))return i?i(e):e;let c=p(e,s),u=e,d=r;return typeof r==`function`&&(d=r),l(c,t,d,o),i===!1?(c.restore=function(){return n(u)},c):typeof i==`function`?i(c):JSON.stringify(c)}}t.exports=g})),Ol=/* @__PURE__ */ n(((e,t)=>{let n=Symbol(`pino.setLevel`),r=Symbol(`pino.getLevel`),i=Symbol(`pino.levelVal`),a=Symbol(`pino.levelComp`),o=Symbol(`pino.useLevelLabels`),s=Symbol(`pino.useOnlyCustomLevels`),c=Symbol(`pino.mixin`),l=Symbol(`pino.lsCache`),u=Symbol(`pino.chindings`),d=Symbol(`pino.asJson`),f=Symbol(`pino.write`),p=Symbol(`pino.redactFmt`),m=Symbol(`pino.time`),h=Symbol(`pino.timeSliceIndex`),g=Symbol(`pino.stream`),_=Symbol(`pino.stringify`),v=Symbol(`pino.stringifySafe`),y=Symbol(`pino.stringifiers`),b=Symbol(`pino.end`),x=Symbol(`pino.formatOpts`),S=Symbol(`pino.messageKey`),C=Symbol(`pino.errorKey`),w=Symbol(`pino.nestedKey`),T=Symbol(`pino.nestedKeyStr`),E=Symbol(`pino.mixinMergeStrategy`),D=Symbol(`pino.msgPrefix`),O=Symbol(`pino.wildcardFirst`),k=Symbol.for(`pino.serializers`),A=Symbol.for(`pino.formatters`),ee=Symbol.for(`pino.hooks`);t.exports={setLevelSym:n,getLevelSym:r,levelValSym:i,levelCompSym:a,useLevelLabelsSym:o,mixinSym:c,lsCacheSym:l,chindingsSym:u,asJsonSym:d,writeSym:f,serializersSym:k,redactFmtSym:p,timeSym:m,timeSliceIndexSym:h,streamSym:g,stringifySym:_,stringifySafeSym:v,stringifiersSym:y,endSym:b,formatOptsSym:x,messageKeySym:S,errorKeySym:C,nestedKeySym:w,wildcardFirstSym:O,needsMetadataGsym:Symbol.for(`pino.metadata`),useOnlyCustomLevelsSym:s,formattersSym:A,hooksSym:ee,nestedKeyStrSym:T,mixinMergeStrategySym:E,msgPrefixSym:D,transportUsesMultistreamSym:Symbol.for(`pino.transport.usesMultistream`)}})),kl=/* @__PURE__ */ n(((e,t)=>{let n=Dl(),{redactFmtSym:r,wildcardFirstSym:i}=Ol(),a=/[^.[\]]+|\[([^[\]]*?)\]/g,o=`[Redacted]`;function s(e,t){let{paths:o,censor:s,remove:l}=c(e),u=o.reduce((e,t)=>{a.lastIndex=0;let n=a.exec(t),r=a.exec(t),o=n[1]===void 0?n[0]:n[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,`$1`);if(o===`*`&&(o=i),r===null)return e[o]=null,e;if(e[o]===null)return e;let{index:s}=r,c=`${t.substr(s,t.length-1)}`;return e[o]=e[o]||[],o!==i&&e[o].length===0&&e[o].push(...e[i]||[]),o===i&&Object.keys(e).forEach(function(t){e[t]&&e[t].push(c)}),e[o].push(c),e},Object.create(null)),d=Object.assign(Object.create(null),{[r]:n({paths:o,censor:s,serialize:t,strict:!1,remove:l})}),f=(...e)=>t(typeof s==`function`?s(...e):s);return[...Object.keys(u),...Object.getOwnPropertySymbols(u)].reduce((e,r)=>{if(u[r]===null)e[r]=e=>f(e,[r]);else{let i=typeof s==`function`?(e,t)=>s(e,[r,...t]):s;e[r]=n({paths:u[r],censor:i,serialize:t,strict:!1,remove:l})}return e},d)}function c(e){if(Array.isArray(e))return e={paths:e,censor:o},e;let{paths:t,censor:n=o,remove:r}=e;if(Array.isArray(t)===!1)throw Error(`pino – redact must contain an array of strings`);return r===!0&&(n=void 0),{paths:t,censor:n,remove:r}}t.exports=s})),Al=/* @__PURE__ */ n(((e,t)=>{let n=()=>``,r=()=>`,"time":${Date.now()}`,i=()=>`,"time":${Math.round(Date.now()/1e3)}`,a=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,o=1000000000n,s=BigInt(Date.now())*1000000n,c=process.hrtime.bigint();t.exports={nullTime:n,epochTime:r,unixTime:i,isoTime:a,isoTimeNano:()=>{let e=process.hrtime.bigint()-c,t=s+e,n=t/o,r=t%o,i=Number(n*1000n+r/1000000n),a=new Date(i);return`,"time":"${a.getUTCFullYear()}-${(a.getUTCMonth()+1).toString().padStart(2,`0`)}-${a.getUTCDate().toString().padStart(2,`0`)}T${a.getUTCHours().toString().padStart(2,`0`)}:${a.getUTCMinutes().toString().padStart(2,`0`)}:${a.getUTCSeconds().toString().padStart(2,`0`)}.${r.toString().padStart(9,`0`)}Z"`}}})),jl=/* @__PURE__ */ n(((e,t)=>{function n(e){try{return JSON.stringify(e)}catch{return`"[Circular]"`}}t.exports=r;function r(e,t,r){var i=r&&r.stringify||n,a=1;if(typeof e==`object`&&e){var o=t.length+a;if(o===1)return e;var s=Array(o);s[0]=i(e);for(var c=1;c<o;c++)s[c]=i(t[c]);return s.join(` `)}if(typeof e!=`string`)return e;var l=t.length;if(l===0)return e;for(var u=``,d=1-a,f=-1,p=e&&e.length||0,m=0;m<p;){if(e.charCodeAt(m)===37&&m+1<p){switch(f=f>-1?f:0,e.charCodeAt(m+1)){case 100:case 102:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Number(t[d]),f=m+2,m++;break;case 105:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Math.floor(Number(t[d])),f=m+2,m++;break;case 79:case 111:case 106:if(d>=l||t[d]===void 0)break;f<m&&(u+=e.slice(f,m));var h=typeof t[d];if(h===`string`){u+=`'`+t[d]+`'`,f=m+2,m++;break}if(h===`function`){u+=t[d].name||`<anonymous>`,f=m+2,m++;break}u+=i(t[d]),f=m+2,m++;break;case 115:if(d>=l)break;f<m&&(u+=e.slice(f,m)),u+=String(t[d]),f=m+2,m++;break;case 37:f<m&&(u+=e.slice(f,m)),u+=`%`,f=m+2,m++,d--}++d}++m}return f===-1?e:(f<p&&(u+=e.slice(f)),u)}})),Ml=/* @__PURE__ */ n(((e,t)=>{if(typeof SharedArrayBuffer<`u`&&typeof Atomics<`u`){let e=new Int32Array(new SharedArrayBuffer(4));function n(t){if(!(t>0&&t<1/0))throw typeof t!=`number`&&typeof t!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);Atomics.wait(e,0,0,Number(t))}t.exports=n}else{function e(e){if(!(e>0&&e<1/0))throw typeof e!=`number`&&typeof e!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);let t=Date.now()+Number(e);for(;t>Date.now(););}t.exports=e}})),Nl=/* @__PURE__ */ n(((e,t)=>{let n=a(`fs`),r=a(`events`),i=a(`util`).inherits,o=a(`path`),s=Ml(),c=a(`assert`),l=Buffer.allocUnsafe(0),u=`buffer`,d=`utf8`,[f,p]=(process.versions.node||`0.0`).split(`.`).map(Number),m=f>=22&&p>=7;function h(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(n,r){if(n){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount(`error`)>0&&t.emit(`error`,n)}):t.emit(`error`,n);return}let i=t._reopening;t.fd=r,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit(`ready`)):t.emit(`ready`),!t.destroyed&&(!t._writing&&t._len>t.minLength||t._flushPending?t._actualWrite():i&&process.nextTick(()=>t.emit(`drain`)))}let i=t.append?`a`:`w`,a=t.mode;if(t.sync)try{t.mkdir&&n.mkdirSync(o.dirname(e),{recursive:!0}),r(null,n.openSync(e,i,a))}catch(e){throw r(e),e}else t.mkdir?n.mkdir(o.dirname(e),{recursive:!0},t=>{if(t)return r(t);n.open(e,i,a,r)}):n.open(e,i,a,r)}function g(e){if(!(this instanceof g))return new g(e);let{fd:t,dest:r,minLength:i,maxLength:a,maxWrite:o,periodicFlush:c,sync:f,append:p=!0,mkdir:m,retryEAGAIN:y,fsync:S,contentMode:A,mode:ee}=e||{};t||=r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=a||0,this.maxWrite=o||16384,this._periodicFlush=c||0,this._periodicFlushTimer=void 0,this.sync=f||!1,this.writable=!0,this._fsync=S||!1,this.append=p||!1,this.mode=ee,this.retryEAGAIN=y||(()=>!0),this.mkdir=m||!1;let te,ne;if(A===u)this._writingBuf=l,this.write=x,this.flush=w,this.flushSync=E,this._actualWrite=O,te=()=>n.writeSync(this.fd,this._writingBuf),ne=()=>n.write(this.fd,this._writingBuf,this.release);else if(A===void 0||A===d)this._writingBuf=``,this.write=b,this.flush=C,this.flushSync=T,this._actualWrite=D,te=()=>Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`),ne=()=>Buffer.isBuffer(this._writingBuf)?n.write(this.fd,this._writingBuf,this.release):n.write(this.fd,this._writingBuf,`utf8`,this.release);else throw Error(`SonicBoom supports "${d}" and "${u}", but passed ${A}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)h(t,this);else throw Error(`SonicBoom supports only file descriptors and files`);if(this.minLength>=this.maxWrite)throw Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(e,t)=>{if(e){if((e.code===`EAGAIN`||e.code===`EBUSY`)&&this.retryEAGAIN(e,this._writingBuf.length,this._len-this._writingBuf.length)){if(this.sync)try{s(100),this.release(void 0,0)}catch(e){this.release(e)}else setTimeout(ne,100)}else this._writing=!1,this.emit(`error`,e);return}this.emit(`write`,t);let r=_(this._writingBuf,this._len,t);if(this._len=r.len,this._writingBuf=r.writingBuf,this._writingBuf.length){if(!this.sync){ne();return}try{do{let e=te(),t=_(this._writingBuf,this._len,e);this._len=t.len,this._writingBuf=t.writingBuf}while(this._writingBuf.length)}catch(e){this.release(e);return}}this._fsync&&n.fsyncSync(this.fd);let i=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):i>this.minLength?this._actualWrite():this._ending?i>0?this._actualWrite():(this._writing=!1,k(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(v,this)):this.emit(`drain`))},this.on(`newListener`,function(e){e===`drain`&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function _(e,t,n){return typeof e==`string`&&(e=Buffer.from(e)),t=Math.max(t-n,0),e=e.subarray(n),{writingBuf:e,len:t}}function v(e){e.listenerCount(`drain`)>0&&(e._asyncDrainScheduled=!1,e.emit(`drain`))}i(g,r);function y(e,t){return e.length===0?l:e.length===1?e[0]:Buffer.concat(e,t)}function b(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);e=``+e;let t=Buffer.byteLength(e),n=this._len+t,r=this._bufs;return this.maxLength&&n>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(r.length===0||Buffer.byteLength(r[r.length-1])+t>this.maxWrite?r.push(e):r[r.length-1]+=e,this._len=n,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function x(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);let t=this._len+e.length,n=this._bufs,r=this._lens;return this.maxLength&&t>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(n.length===0||r[r.length-1]+e.length>this.maxWrite?(n.push([e]),r.push(e.length)):(n[n.length-1].push(e),r[r.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function S(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{n.fsync(this.fd,t=>{this._flushPending=!1,e(t)})}catch(t){e(t)}this.off(`error`,r)},r=n=>{this._flushPending=!1,e(n),this.off(`drain`,t)};this.once(`drain`,t),this.once(`error`,r)}function C(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0?e?.():(e&&S.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(``),this._actualWrite()))}function w(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0?e?.():(e&&S.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite()))}g.prototype.reopen=function(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{this.reopen(e)});return}if(this._ending)return;if(!this.file)throw Error(`Unable to reopen a file descriptor, you must pass a file to SonicBoom`);if(e&&(this.file=e),this._reopening=!0,this._writing)return;let t=this.fd;this.once(`ready`,()=>{t!==this.fd&&n.close(t,e=>{if(e)return this.emit(`error`,e)})}),h(this.file,this)},g.prototype.end=function(){if(this.destroyed)throw Error(`SonicBoom destroyed`);this._opening?this.once(`ready`,()=>{this.end()}):this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():k(this)))};function T(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this.fd<0)throw Error(`sonic boom is not ready yet`);!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf=``);let e=``;for(;this._bufs.length||e.length;){e.length<=0&&(e=this._bufs[0]);try{let t=Buffer.isBuffer(e)?n.writeSync(this.fd,e):n.writeSync(this.fd,e,`utf8`),r=_(e,this._len,t);e=r.writingBuf,this._len=r.len,e.length<=0&&this._bufs.shift()}catch(t){if((t.code===`EAGAIN`||t.code===`EBUSY`)&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;s(100)}}try{n.fsyncSync(this.fd)}catch{}}function E(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this.fd<0)throw Error(`sonic boom is not ready yet`);!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=l);let e=l;for(;this._bufs.length||e.length;){e.length<=0&&(e=y(this._bufs[0],this._lens[0]));try{let t=n.writeSync(this.fd,e);e=e.subarray(t),this._len=Math.max(this._len-t,0),e.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(t){if((t.code===`EAGAIN`||t.code===`EBUSY`)&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;s(100)}}}g.prototype.destroy=function(){this.destroyed||k(this)};function D(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||``,this.sync)try{e(null,Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`))}catch(t){e(t)}else n.write(this.fd,this._writingBuf,e)}function O(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:y(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,n.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else m&&(this._writingBuf=Buffer.from(this._writingBuf)),n.write(this.fd,this._writingBuf,e)}function k(e){if(e.fd===-1){e.once(`ready`,k.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],c(typeof e.fd==`number`,`sonic.fd must be a number, got ${typeof e.fd}`);try{n.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?n.close(e.fd,r):r()}function r(t){t?e.emit(`error`,t):(e._ending&&!e._writing&&e.emit(`finish`),e.emit(`close`))}}g.SonicBoom=g,g.default=g,t.exports=g})),Pl=/* @__PURE__ */ n(((e,t)=>{let n={exit:[],beforeExit:[]},r={exit:c,beforeExit:l},i;function a(){i===void 0&&(i=new FinalizationRegistry(d))}function o(e){n[e].length>0||process.on(e,r[e])}function s(e){n[e].length>0||(process.removeListener(e,r[e]),n.exit.length===0&&n.beforeExit.length===0&&(i=void 0))}function c(){u(`exit`)}function l(){u(`beforeExit`)}function u(e){for(let t of n[e]){let n=t.deref(),r=t.fn;
118
118
  /* istanbul ignore else */
119
- n!==void 0&&r(n,e)}n[e]=[]}function d(e){for(let t of[`exit`,`beforeExit`]){let r=n[t].indexOf(e);n[t].splice(r,r+1),s(t)}}function f(e,t,r){if(t===void 0)throw Error(`the object can't be undefined`);o(e);let s=new WeakRef(t);s.fn=r,a(),i.register(t,s),n[e].push(s)}function p(e,t){f(`exit`,e,t)}function m(e,t){f(`beforeExit`,e,t)}function h(e){if(i!==void 0){i.unregister(e);for(let t of[`exit`,`beforeExit`])n[t]=n[t].filter(t=>{let n=t.deref();return n&&n!==e}),s(t)}}t.exports={register:p,registerBeforeExit:m,unregister:h}})),Fl=/* @__PURE__ */ n(((e,t)=>{t.exports={name:`thread-stream`,version:`4.2.0`,description:`A streaming way to send data to a Node.js Worker Thread`,main:`index.js`,types:`index.d.ts`,engines:{node:`>=20`},dependencies:{"real-require":`^1.0.0`},devDependencies:{"@types/node":`^25.0.2`,"@yao-pkg/pkg":`^6.0.0`,borp:`^1.0.0`,desm:`^1.3.0`,eslint:`^9.39.1`,fastbench:`^1.0.1`,neostandard:`^0.13.0`,"pino-elasticsearch":`^9.0.0`,"sonic-boom":`^5.0.0`,"ts-node":`^10.8.0`,typescript:`~5.7.3`},scripts:{build:`tsc --noEmit`,lint:`eslint`,test:`npm run lint && npm run build && npm run transpile && borp --pattern "test/*.test.{js,mjs}"`,"test:ci":`npm run lint && npm run transpile && borp --pattern "test/*.test.{js,mjs}"`,"test:yarn":`npm run transpile && borp --pattern "test/*.test.js"`,transpile:`sh ./test/ts/transpile.sh`},repository:{type:`git`,url:`git+https://github.com/mcollina/thread-stream.git`},keywords:[`worker`,`thread`,`threads`,`stream`],author:`Matteo Collina <hello@matteocollina.com>`,license:`MIT`,bugs:{url:`https://github.com/mcollina/thread-stream/issues`},homepage:`https://github.com/mcollina/thread-stream#readme`}})),Il=/* @__PURE__ */ n(((e,t)=>{let n=1e4;function r(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=()=>{let i=Atomics.load(e,t);if(i===r){a(null,`ok`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let c=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),l=Atomics.waitAsync(e,t,i,c);l.async?l.value.then(s):setImmediate(s)};s()}function i(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=()=>{if(Atomics.load(e,t)!==r){a(null,`ok`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let i=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),c=Atomics.waitAsync(e,t,r,i);c.async?c.value.then(e=>{e===`ok`?a(null,`ok`):s()}):setImmediate(s)};s()}t.exports={wait:r,waitDiff:i}})),Ll=/* @__PURE__ */ n(((e,t)=>{t.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}})),Rl=/* @__PURE__ */ n(((e,t)=>{let{version:n}=Fl(),{EventEmitter:r}=a(`events`),{Worker:i}=a(`worker_threads`),{join:o}=a(`path`),{pathToFileURL:s}=a(`url`),{wait:c}=Il(),{WRITE_INDEX:l,READ_INDEX:u,SEQ_INDEX:d}=Ll(),f=a(`buffer`),p=a(`assert`),m=Symbol(`kImpl`),h=f.constants.MAX_STRING_LENGTH;function g(){}function _(e,t){Atomics.add(e[m].state,d,1),t(),Atomics.add(e[m].state,d,1),Atomics.notify(e[m].state,d)}function v(e){_(e,()=>{Atomics.store(e[m].state,u,0),Atomics.store(e[m].state,l,0)})}var y=class{constructor(e){this._value=e}deref(){return this._value}},b=class{register(){}unregister(){}};let x=process.env.NODE_V8_COVERAGE?b:global.FinalizationRegistry||b,S=process.env.NODE_V8_COVERAGE?y:global.WeakRef||y,C=new x(e=>{e.exited||e.terminate()});function w(e,t){let{filename:r,workerData:a}=t,c=(`__bundlerPathsOverrides`in globalThis?globalThis.__bundlerPathsOverrides:{})[`thread-stream-worker`]||o(__dirname,`lib`,`worker.js`),l=new i(c,{...t.workerOpts,name:t.workerOpts?.name||`thread-stream`,trackUnmanagedFds:!1,workerData:{filename:r.indexOf(`file://`)===0?r:s(r).href,dataBuf:e[m].dataBuf,stateBuf:e[m].stateBuf,workerData:{$context:{threadStreamVersion:n},...a}}});return l.stream=new y(e),l.on(`message`,D),l.on(`exit`,O),C.register(e,l),l}function T(e){p(!e[m].sync),e[m].needDrain&&(e[m].needDrain=!1,e.emit(`drain`))}function E(e){for(;;){let t=Atomics.load(e[m].state,l),n=e[m].data.length-t;if(n>0){if(e[m].bufLen===0){e[m].flushing=!1,e[m].ending?F(e):e[m].needDrain&&process.nextTick(T,e);return}P(e,n,g)}else{if(n===0){if(t===0&&e[m].bufLen===0)return;j(e,()=>{e.destroyed||(v(e),E(e))});return}N(e,/* @__PURE__ */ Error(`overwritten`));return}}}function D(e){let t=this.stream.deref();if(t===void 0)this.exited=!0,this.terminate();else if(e?.code!=null)switch(e.code){case`READY`:this.stream=new S(t),j(t,()=>{t[m].ready=!0,t.emit(`ready`)});break;case`ERROR`:N(t,e.err);break;case`EVENT`:Array.isArray(e.args)?t.emit(e.name,...e.args):t.emit(e.name,e.args);break;case`FLUSHED`:{if(e.context!==`thread-stream`){N(t,/* @__PURE__ */ Error(`this should not happen: `+e.code));break}let n=t[m].flushCallbacks.get(e.id);n&&(t[m].flushCallbacks.delete(e.id),process.nextTick(n));break}case`WARNING`:process.emitWarning(e.err);break;default:N(t,/* @__PURE__ */ Error(`this should not happen: `+e.code))}}function O(e){let t=this.stream.deref();t!==void 0&&(C.unregister(t),t.worker.exited=!0,t.worker.off(`exit`,O),N(t,e===0?null:/* @__PURE__ */ Error(`the worker thread exited`)))}var k=class extends r{constructor(e={}){if(super(),e.bufferSize<4)throw Error(`bufferSize must at least fit a 4-byte utf-8 char`);this[m]={},this[m].stateBuf=new SharedArrayBuffer(128),this[m].state=new Int32Array(this[m].stateBuf),this[m].dataBuf=new SharedArrayBuffer(e.bufferSize||4194304),this[m].data=Buffer.from(this[m].dataBuf),this[m].sync=e.sync||!1,this[m].ending=!1,this[m].ended=!1,this[m].needDrain=!1,this[m].destroyed=!1,this[m].flushing=!1,this[m].ready=!1,this[m].finished=!1,this[m].errored=null,this[m].closed=!1,this[m].buf=[],this[m].bufHead=0,this[m].bufLen=0,this[m].flushCallbacks=/* @__PURE__ */ new Map,this[m].nextFlushId=0,this.worker=w(this,e),this.on(`message`,(e,t)=>{this.worker.postMessage(e,t)})}write(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);if(this[m].destroyed)return M(this,/* @__PURE__ */ Error(`the worker has exited`)),!1;if(this[m].ending)return M(this,/* @__PURE__ */ Error(`the worker is ending`)),!1;if(this[m].flushing&&this[m].bufLen+t.length>=h)try{ne(this),this[m].flushing=!0}catch(e){return N(this,e),!1}if(this[m].buf.push(t),this[m].bufLen+=t.length,this[m].sync)try{return ne(this),!0}catch(e){return N(this,e),!1}return this[m].flushing||(this[m].flushing=!0,setImmediate(E,this)),this[m].needDrain=this[m].data.length-this[m].bufLen-Atomics.load(this[m].state,l)<=0,!this[m].needDrain}end(){this[m].destroyed||(this[m].ending=!0,F(this))}flush(e){e=typeof e==`function`?e:g,A(this,t=>{t?process.nextTick(e,t):ee(this,e)})}flushSync(){this[m].destroyed||(ne(this),re(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[m].ready}get destroyed(){return this[m].destroyed}get closed(){return this[m].closed}get writable(){return!this[m].destroyed&&!this[m].ending}get writableEnded(){return this[m].ending}get writableFinished(){return this[m].finished}get writableNeedDrain(){return this[m].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[m].errored}};function A(e,t){e[m].destroyed?process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`)):!e[m].sync&&(e[m].flushing||e[m].bufLen>0)?setImmediate(A,e,t):j(e,t)}function j(e,t){let n=Atomics.load(e[m].state,l);c(e[m].state,u,n,1/0,(n,r)=>{n?(N(e,n),t(n)):r===`ok`?t():j(e,t)})}function ee(e,t){if(e[m].destroyed){process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`));return}if(!e[m].ready){let n=()=>{i(),ee(e,t)},r=()=>{i(),process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`))},i=()=>{e.off(`ready`,n),e.off(`close`,r)};e.once(`ready`,n),e.once(`close`,r);return}let n=++e[m].nextFlushId;e[m].flushCallbacks.set(n,t);try{e.worker.postMessage({code:`FLUSH`,context:`thread-stream`,id:n})}catch(r){e[m].flushCallbacks.delete(n),N(e,r),process.nextTick(t,r)}}function te(e,t){let n=e[m].flushCallbacks;if(n.size===0)return;let r=t||/* @__PURE__ */ Error(`the worker has exited`);for(let e of n.values())process.nextTick(e,r);n.clear()}function M(e,t){setImmediate(()=>{e.emit(`error`,t)})}function N(e,t){e[m].destroyed||(e[m].destroyed=!0,te(e,t),t&&(e[m].errored=t,M(e,t)),e.worker.exited?setImmediate(()=>{e[m].closed=!0,e.emit(`close`)}):e.worker.terminate().catch(()=>{}).then(()=>{e[m].closed=!0,e.emit(`close`)}))}function P(e,t,n){let r=Atomics.load(e[m].state,l),i=t;for(;i>0&&e[m].bufLen!==0;){let t=e[m].bufHead,n=e[m].buf[t];n.length<=i?(n.copy(e[m].data,r),r+=n.length,i-=n.length,e[m].bufLen-=n.length,e[m].bufHead=t+1,e[m].bufHead===e[m].buf.length?(e[m].buf.length=0,e[m].bufHead=0):e[m].bufHead>=1024&&e[m].bufHead*2>=e[m].buf.length&&(e[m].buf.splice(0,e[m].bufHead),e[m].bufHead=0)):(n.copy(e[m].data,r,0,i),e[m].buf[t]=n.subarray(i),e[m].bufLen-=i,r+=i,i=0)}return _(e,()=>{Atomics.store(e[m].state,l,r)}),n(),!0}function F(e){if(!(e[m].ended||!e[m].ending||e[m].flushing)){e[m].ended=!0;try{e.flushSync();let t=Atomics.load(e[m].state,u);_(e,()=>{Atomics.store(e[m].state,l,-1)});let n=0;for(;t!==-1;){if(Atomics.wait(e[m].state,u,t,1e3),t=Atomics.load(e[m].state,u),t===-2){N(e,/* @__PURE__ */ Error(`end() failed`));return}if(++n===10){N(e,/* @__PURE__ */ Error(`end() took too long (10s)`));return}}process.nextTick(()=>{e[m].finished=!0,e.emit(`finish`)})}catch(t){N(e,t)}}}function ne(e){let t=()=>{e[m].ending?F(e):e[m].needDrain&&process.nextTick(T,e)};for(e[m].flushing=!1;e[m].bufLen!==0;){let n=Atomics.load(e[m].state,l),r=e[m].data.length-n;if(r===0)re(e),v(e);else{if(r<0)throw Error(`overwritten`);P(e,r,t)}}}function re(e){if(e[m].flushing)throw Error(`unable to flush while flushing`);let t=Atomics.load(e[m].state,l),n=0;for(;;){let r=Atomics.load(e[m].state,u);if(r===-2)throw Error(`_flushSync failed`);if(r!==t)Atomics.wait(e[m].state,u,r,1e3);else break;if(++n===10)throw Error(`_flushSync took too long (10s)`)}}t.exports=k})),zl=/* @__PURE__ */ n(((e,t)=>{let{createRequire:n}=a(`module`),{existsSync:r}=a(`node:fs`),i=El(),{join:o,isAbsolute:s,sep:c}=a(`node:path`),{fileURLToPath:l}=a(`node:url`),u=Ml(),d=Pl(),f=Rl(),{transportUsesMultistreamSym:p}=Ol();function m(e){d.register(e,b),d.registerBeforeExit(e,x),e.on(`close`,function(){d.unregister(e)})}function h(){let e=process.execArgv;for(let t=0;t<e.length;t++){let n=e[t];if(n===`--import`||n===`--require`||n===`-r`||n.startsWith(`--import=`)||n.startsWith(`--require=`)||n.startsWith(`-r=`))return!0}return!1}function g(e){let t=e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!t)return e;let n=[],r=!1;for(let e=0;e<t.length;e++){let i=t[e];if(i===`--require`||i===`-r`||i===`--import`){let a=t[e+1];if(a&&_(a)){r=!0,e++;continue}n.push(i),a&&(n.push(a),e++)}else(i.startsWith(`--require=`)||i.startsWith(`-r=`)||i.startsWith(`--import=`))&&_(i.slice(i.indexOf(`=`)+1))?r=!0:n.push(i)}return r?n.join(` `):e}function _(e){let t=v(e);if(!t)return!1;let n=t;if(n.startsWith(`file://`))try{n=l(n)}catch{return!1}return s(n)&&!r(n)}function v(e){let t=e[0],n=e[e.length-1];return t===`"`&&n===`"`||t===`'`&&n===`'`?e.slice(1,-1):e}function y(e,t,n,r,i){if(!n.execArgv&&h()&&a.main===void 0&&(n={...n,execArgv:[]}),!n.env&&process.env.NODE_OPTIONS){let e=g(process.env.NODE_OPTIONS);e!==process.env.NODE_OPTIONS&&(n={...n,env:{...process.env,NODE_OPTIONS:e}})}n={...n,name:i};let o=new f({filename:e,workerData:t,workerOpts:n,sync:r});o.on(`ready`,s),o.on(`close`,function(){process.removeListener(`exit`,c)}),process.on(`exit`,c);function s(){process.removeListener(`exit`,c),o.unref(),n.autoEnd!==!1&&m(o)}function c(){
119
+ n!==void 0&&r(n,e)}n[e]=[]}function d(e){for(let t of[`exit`,`beforeExit`]){let r=n[t].indexOf(e);n[t].splice(r,r+1),s(t)}}function f(e,t,r){if(t===void 0)throw Error(`the object can't be undefined`);o(e);let s=new WeakRef(t);s.fn=r,a(),i.register(t,s),n[e].push(s)}function p(e,t){f(`exit`,e,t)}function m(e,t){f(`beforeExit`,e,t)}function h(e){if(i!==void 0){i.unregister(e);for(let t of[`exit`,`beforeExit`])n[t]=n[t].filter(t=>{let n=t.deref();return n&&n!==e}),s(t)}}t.exports={register:p,registerBeforeExit:m,unregister:h}})),Fl=/* @__PURE__ */ n(((e,t)=>{t.exports={name:`thread-stream`,version:`4.2.0`,description:`A streaming way to send data to a Node.js Worker Thread`,main:`index.js`,types:`index.d.ts`,engines:{node:`>=20`},dependencies:{"real-require":`^1.0.0`},devDependencies:{"@types/node":`^25.0.2`,"@yao-pkg/pkg":`^6.0.0`,borp:`^1.0.0`,desm:`^1.3.0`,eslint:`^9.39.1`,fastbench:`^1.0.1`,neostandard:`^0.13.0`,"pino-elasticsearch":`^9.0.0`,"sonic-boom":`^5.0.0`,"ts-node":`^10.8.0`,typescript:`~5.7.3`},scripts:{build:`tsc --noEmit`,lint:`eslint`,test:`npm run lint && npm run build && npm run transpile && borp --pattern "test/*.test.{js,mjs}"`,"test:ci":`npm run lint && npm run transpile && borp --pattern "test/*.test.{js,mjs}"`,"test:yarn":`npm run transpile && borp --pattern "test/*.test.js"`,transpile:`sh ./test/ts/transpile.sh`},repository:{type:`git`,url:`git+https://github.com/mcollina/thread-stream.git`},keywords:[`worker`,`thread`,`threads`,`stream`],author:`Matteo Collina <hello@matteocollina.com>`,license:`MIT`,bugs:{url:`https://github.com/mcollina/thread-stream/issues`},homepage:`https://github.com/mcollina/thread-stream#readme`}})),Il=/* @__PURE__ */ n(((e,t)=>{let n=1e4;function r(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=()=>{let i=Atomics.load(e,t);if(i===r){a(null,`ok`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let c=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),l=Atomics.waitAsync(e,t,i,c);l.async?l.value.then(s):setImmediate(s)};s()}function i(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=()=>{if(Atomics.load(e,t)!==r){a(null,`ok`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let i=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),c=Atomics.waitAsync(e,t,r,i);c.async?c.value.then(e=>{e===`ok`?a(null,`ok`):s()}):setImmediate(s)};s()}t.exports={wait:r,waitDiff:i}})),Ll=/* @__PURE__ */ n(((e,t)=>{t.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}})),Rl=/* @__PURE__ */ n(((e,t)=>{let{version:n}=Fl(),{EventEmitter:r}=a(`events`),{Worker:i}=a(`worker_threads`),{join:o}=a(`path`),{pathToFileURL:s}=a(`url`),{wait:c}=Il(),{WRITE_INDEX:l,READ_INDEX:u,SEQ_INDEX:d}=Ll(),f=a(`buffer`),p=a(`assert`),m=Symbol(`kImpl`),h=f.constants.MAX_STRING_LENGTH;function g(){}function _(e,t){Atomics.add(e[m].state,d,1),t(),Atomics.add(e[m].state,d,1),Atomics.notify(e[m].state,d)}function v(e){_(e,()=>{Atomics.store(e[m].state,u,0),Atomics.store(e[m].state,l,0)})}var y=class{constructor(e){this._value=e}deref(){return this._value}},b=class{register(){}unregister(){}};let x=process.env.NODE_V8_COVERAGE?b:global.FinalizationRegistry||b,S=process.env.NODE_V8_COVERAGE?y:global.WeakRef||y,C=new x(e=>{e.exited||e.terminate()});function w(e,t){let{filename:r,workerData:a}=t,c=(`__bundlerPathsOverrides`in globalThis?globalThis.__bundlerPathsOverrides:{})[`thread-stream-worker`]||o(__dirname,`lib`,`worker.js`),l=new i(c,{...t.workerOpts,name:t.workerOpts?.name||`thread-stream`,trackUnmanagedFds:!1,workerData:{filename:r.indexOf(`file://`)===0?r:s(r).href,dataBuf:e[m].dataBuf,stateBuf:e[m].stateBuf,workerData:{$context:{threadStreamVersion:n},...a}}});return l.stream=new y(e),l.on(`message`,D),l.on(`exit`,O),C.register(e,l),l}function T(e){p(!e[m].sync),e[m].needDrain&&(e[m].needDrain=!1,e.emit(`drain`))}function E(e){for(;;){let t=Atomics.load(e[m].state,l),n=e[m].data.length-t;if(n>0){if(e[m].bufLen===0){e[m].flushing=!1,e[m].ending?N(e):e[m].needDrain&&process.nextTick(T,e);return}M(e,n,g)}else{if(n===0){if(t===0&&e[m].bufLen===0)return;ee(e,()=>{e.destroyed||(v(e),E(e))});return}re(e,/* @__PURE__ */ Error(`overwritten`));return}}}function D(e){let t=this.stream.deref();if(t===void 0)this.exited=!0,this.terminate();else if(e?.code!=null)switch(e.code){case`READY`:this.stream=new S(t),ee(t,()=>{t[m].ready=!0,t.emit(`ready`)});break;case`ERROR`:re(t,e.err);break;case`EVENT`:Array.isArray(e.args)?t.emit(e.name,...e.args):t.emit(e.name,e.args);break;case`FLUSHED`:{if(e.context!==`thread-stream`){re(t,/* @__PURE__ */ Error(`this should not happen: `+e.code));break}let n=t[m].flushCallbacks.get(e.id);n&&(t[m].flushCallbacks.delete(e.id),process.nextTick(n));break}case`WARNING`:process.emitWarning(e.err);break;default:re(t,/* @__PURE__ */ Error(`this should not happen: `+e.code))}}function O(e){let t=this.stream.deref();t!==void 0&&(C.unregister(t),t.worker.exited=!0,t.worker.off(`exit`,O),re(t,e===0?null:/* @__PURE__ */ Error(`the worker thread exited`)))}var k=class extends r{constructor(e={}){if(super(),e.bufferSize<4)throw Error(`bufferSize must at least fit a 4-byte utf-8 char`);this[m]={},this[m].stateBuf=new SharedArrayBuffer(128),this[m].state=new Int32Array(this[m].stateBuf),this[m].dataBuf=new SharedArrayBuffer(e.bufferSize||4194304),this[m].data=Buffer.from(this[m].dataBuf),this[m].sync=e.sync||!1,this[m].ending=!1,this[m].ended=!1,this[m].needDrain=!1,this[m].destroyed=!1,this[m].flushing=!1,this[m].ready=!1,this[m].finished=!1,this[m].errored=null,this[m].closed=!1,this[m].buf=[],this[m].bufHead=0,this[m].bufLen=0,this[m].flushCallbacks=/* @__PURE__ */ new Map,this[m].nextFlushId=0,this.worker=w(this,e),this.on(`message`,(e,t)=>{this.worker.postMessage(e,t)})}write(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);if(this[m].destroyed)return j(this,/* @__PURE__ */ Error(`the worker has exited`)),!1;if(this[m].ending)return j(this,/* @__PURE__ */ Error(`the worker is ending`)),!1;if(this[m].flushing&&this[m].bufLen+t.length>=h)try{ie(this),this[m].flushing=!0}catch(e){return re(this,e),!1}if(this[m].buf.push(t),this[m].bufLen+=t.length,this[m].sync)try{return ie(this),!0}catch(e){return re(this,e),!1}return this[m].flushing||(this[m].flushing=!0,setImmediate(E,this)),this[m].needDrain=this[m].data.length-this[m].bufLen-Atomics.load(this[m].state,l)<=0,!this[m].needDrain}end(){this[m].destroyed||(this[m].ending=!0,N(this))}flush(e){e=typeof e==`function`?e:g,A(this,t=>{t?process.nextTick(e,t):te(this,e)})}flushSync(){this[m].destroyed||(ie(this),P(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[m].ready}get destroyed(){return this[m].destroyed}get closed(){return this[m].closed}get writable(){return!this[m].destroyed&&!this[m].ending}get writableEnded(){return this[m].ending}get writableFinished(){return this[m].finished}get writableNeedDrain(){return this[m].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[m].errored}};function A(e,t){e[m].destroyed?process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`)):!e[m].sync&&(e[m].flushing||e[m].bufLen>0)?setImmediate(A,e,t):ee(e,t)}function ee(e,t){let n=Atomics.load(e[m].state,l);c(e[m].state,u,n,1/0,(n,r)=>{n?(re(e,n),t(n)):r===`ok`?t():ee(e,t)})}function te(e,t){if(e[m].destroyed){process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`));return}if(!e[m].ready){let n=()=>{i(),te(e,t)},r=()=>{i(),process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`))},i=()=>{e.off(`ready`,n),e.off(`close`,r)};e.once(`ready`,n),e.once(`close`,r);return}let n=++e[m].nextFlushId;e[m].flushCallbacks.set(n,t);try{e.worker.postMessage({code:`FLUSH`,context:`thread-stream`,id:n})}catch(r){e[m].flushCallbacks.delete(n),re(e,r),process.nextTick(t,r)}}function ne(e,t){let n=e[m].flushCallbacks;if(n.size===0)return;let r=t||/* @__PURE__ */ Error(`the worker has exited`);for(let e of n.values())process.nextTick(e,r);n.clear()}function j(e,t){setImmediate(()=>{e.emit(`error`,t)})}function re(e,t){e[m].destroyed||(e[m].destroyed=!0,ne(e,t),t&&(e[m].errored=t,j(e,t)),e.worker.exited?setImmediate(()=>{e[m].closed=!0,e.emit(`close`)}):e.worker.terminate().catch(()=>{}).then(()=>{e[m].closed=!0,e.emit(`close`)}))}function M(e,t,n){let r=Atomics.load(e[m].state,l),i=t;for(;i>0&&e[m].bufLen!==0;){let t=e[m].bufHead,n=e[m].buf[t];n.length<=i?(n.copy(e[m].data,r),r+=n.length,i-=n.length,e[m].bufLen-=n.length,e[m].bufHead=t+1,e[m].bufHead===e[m].buf.length?(e[m].buf.length=0,e[m].bufHead=0):e[m].bufHead>=1024&&e[m].bufHead*2>=e[m].buf.length&&(e[m].buf.splice(0,e[m].bufHead),e[m].bufHead=0)):(n.copy(e[m].data,r,0,i),e[m].buf[t]=n.subarray(i),e[m].bufLen-=i,r+=i,i=0)}return _(e,()=>{Atomics.store(e[m].state,l,r)}),n(),!0}function N(e){if(!(e[m].ended||!e[m].ending||e[m].flushing)){e[m].ended=!0;try{e.flushSync();let t=Atomics.load(e[m].state,u);_(e,()=>{Atomics.store(e[m].state,l,-1)});let n=0;for(;t!==-1;){if(Atomics.wait(e[m].state,u,t,1e3),t=Atomics.load(e[m].state,u),t===-2){re(e,/* @__PURE__ */ Error(`end() failed`));return}if(++n===10){re(e,/* @__PURE__ */ Error(`end() took too long (10s)`));return}}process.nextTick(()=>{e[m].finished=!0,e.emit(`finish`)})}catch(t){re(e,t)}}}function ie(e){let t=()=>{e[m].ending?N(e):e[m].needDrain&&process.nextTick(T,e)};for(e[m].flushing=!1;e[m].bufLen!==0;){let n=Atomics.load(e[m].state,l),r=e[m].data.length-n;if(r===0)P(e),v(e);else{if(r<0)throw Error(`overwritten`);M(e,r,t)}}}function P(e){if(e[m].flushing)throw Error(`unable to flush while flushing`);let t=Atomics.load(e[m].state,l),n=0;for(;;){let r=Atomics.load(e[m].state,u);if(r===-2)throw Error(`_flushSync failed`);if(r!==t)Atomics.wait(e[m].state,u,r,1e3);else break;if(++n===10)throw Error(`_flushSync took too long (10s)`)}}t.exports=k})),zl=/* @__PURE__ */ n(((e,t)=>{let{createRequire:n}=a(`module`),{existsSync:r}=a(`node:fs`),i=El(),{join:o,isAbsolute:s,sep:c}=a(`node:path`),{fileURLToPath:l}=a(`node:url`),u=Ml(),d=Pl(),f=Rl(),{transportUsesMultistreamSym:p}=Ol();function m(e){d.register(e,b),d.registerBeforeExit(e,x),e.on(`close`,function(){d.unregister(e)})}function h(){let e=process.execArgv;for(let t=0;t<e.length;t++){let n=e[t];if(n===`--import`||n===`--require`||n===`-r`||n.startsWith(`--import=`)||n.startsWith(`--require=`)||n.startsWith(`-r=`))return!0}return!1}function g(e){let t=e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!t)return e;let n=[],r=!1;for(let e=0;e<t.length;e++){let i=t[e];if(i===`--require`||i===`-r`||i===`--import`){let a=t[e+1];if(a&&_(a)){r=!0,e++;continue}n.push(i),a&&(n.push(a),e++)}else(i.startsWith(`--require=`)||i.startsWith(`-r=`)||i.startsWith(`--import=`))&&_(i.slice(i.indexOf(`=`)+1))?r=!0:n.push(i)}return r?n.join(` `):e}function _(e){let t=v(e);if(!t)return!1;let n=t;if(n.startsWith(`file://`))try{n=l(n)}catch{return!1}return s(n)&&!r(n)}function v(e){let t=e[0],n=e[e.length-1];return t===`"`&&n===`"`||t===`'`&&n===`'`?e.slice(1,-1):e}function y(e,t,n,r,i){if(!n.execArgv&&h()&&a.main===void 0&&(n={...n,execArgv:[]}),!n.env&&process.env.NODE_OPTIONS){let e=g(process.env.NODE_OPTIONS);e!==process.env.NODE_OPTIONS&&(n={...n,env:{...process.env,NODE_OPTIONS:e}})}n={...n,name:i};let o=new f({filename:e,workerData:t,workerOpts:n,sync:r});o.on(`ready`,s),o.on(`close`,function(){process.removeListener(`exit`,c)}),process.on(`exit`,c);function s(){process.removeListener(`exit`,c),o.unref(),n.autoEnd!==!1&&m(o)}function c(){
120
120
  /* istanbul ignore next */
121
- o.closed||(o.flushSync(),u(100),o.end())}return o}function b(e){e.ref(),e.flushSync(),e.end(),e.once(`close`,function(){e.unref()})}function x(e){e.flushSync()}function S(e){let{pipeline:t,targets:r,levels:a,dedupe:l,worker:u={},caller:d=i(),sync:f=!1}=e,m={...e.options},h=!1,g=typeof d==`string`?[d]:d,_=typeof globalThis==`object`&&Object.prototype.hasOwnProperty.call(globalThis,`__bundlerPathsOverrides`)&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides==`object`?globalThis.__bundlerPathsOverrides:Object.create(null),v=e.target;if(v&&r)throw Error(`only one of target or targets can be specified`);if(r){v=_[`pino-worker`]||o(__dirname,`worker.js`),m.targets=r.filter(e=>e.target).map(e=>({...e,target:S(e.target)})),m.pipelines=r.filter(e=>e.pipeline).map(e=>e.pipeline.map(t=>({...t,level:e.level,target:S(t.target)})));let e=m.targets.some(e=>e.level!=null),t=m.pipelines.some(e=>e.some(e=>e.level!=null));h=m.targets.length+m.pipelines.length>1||e||t}else t&&(v=_[`pino-worker`]||o(__dirname,`worker.js`),m.pipelines=[t.map(e=>({...e,target:S(e.target)}))]);a&&(m.levels=a),l&&(m.dedupe=l),m.pinoWillSendConfig=!0;let b=r||t?`pino.transport`:v,x=y(S(v),m,u,f,b);return h&&(x[p]=!0),x;function S(e){if(e=_[e]||e,s(e)||e.indexOf(`file://`)===0)return e;if(e===`pino/file`)return o(__dirname,`..`,`file.js`);let t;for(let r of g)try{let i=r===`node:repl`?process.cwd()+c:r;t=n(i).resolve(e);break}catch{continue}if(!t)throw Error(`unable to determine transport target for "${e}"`);return t}}t.exports=S})),Bl=/* @__PURE__ */ n(((e,t)=>{let n=a(`node:diagnostics_channel`),r=jl(),{mapHttpRequest:i,mapHttpResponse:o}=Tl(),s=Nl(),c=Pl(),{lsCacheSym:l,chindingsSym:u,writeSym:d,serializersSym:f,formatOptsSym:p,endSym:m,stringifiersSym:h,stringifySym:g,stringifySafeSym:_,wildcardFirstSym:v,nestedKeySym:y,formattersSym:b,messageKeySym:x,errorKeySym:S,nestedKeyStrSym:C,msgPrefixSym:w}=Ol(),{isMainThread:T}=a(`worker_threads`),E=zl(),[D]=process.versions.node.split(`.`).map(e=>Number(e)),O=n.tracingChannel(`pino_asJson`),k=D>=25?e=>JSON.stringify(e):ee;function A(){}function j(e,t){return t?function(...r){t.call(this,r,n,e)}:n;function n(t,...n){if(typeof t==`object`){let a=t;t!==null&&(t.method&&t.headers&&t.socket?t=i(t):typeof t.setHeader==`function`&&(t=o(t)));let s;a===null&&n.length===0?s=[null]:(a=n.shift(),s=n),typeof this[w]==`string`&&a!=null&&(a=this[w]+a),this[d](t,r(a,s,this[p]),e)}else{let i=t===void 0?n.shift():t;typeof this[w]==`string`&&i!=null&&(i=this[w]+i),this[d](null,r(i,n,this[p]),e)}}}function ee(e){let t=``,n=0,r=!1,i=255,a=e.length;if(a>100)return JSON.stringify(e);for(var o=0;o<a&&i>=32;o++)i=e.charCodeAt(o),(i===34||i===92)&&(t+=e.slice(n,o)+`\\`,n=o,r=!0);return r?t+=e.slice(n):t=e,i<32?JSON.stringify(e):`"`+t+`"`}function te(e,t,n,r){if(O.hasSubscribers===!1)return M.call(this,e,t,n,r);let i={instance:this,arguments};return O.traceSync(M,i,this,e,t,n,r)}function M(e,t,n,r){let i=this[g],a=this[_],o=this[h],s=this[m],c=this[u],d=this[f],p=this[b],w=this[x],T=this[S],E=this[l][n]+r;E+=c;let D;p.log&&(e=p.log(e));let O=o[v],A=``;for(let t in e)if(D=e[t],Object.prototype.hasOwnProperty.call(e,t)&&D!==void 0){d[t]?D=d[t](D):t===T&&d.err&&(D=d.err(D));let e=o[t]||O;switch(typeof D){case`undefined`:case`function`:continue;case`number`:Number.isFinite(D)===!1&&(D=null);case`boolean`:e&&(D=e(D));break;case`string`:D=(e||k)(D);break;default:D=(e||i)(D,a)}if(D===void 0)continue;let n=k(t);A+=`,`+n+`:`+D}let j=``;if(t!==void 0){D=d[w]?d[w](t):t;let e=o[w]||O;switch(typeof D){case`function`:break;case`number`:Number.isFinite(D)===!1&&(D=null);case`boolean`:e&&(D=e(D)),j=`,"`+w+`":`+D;break;case`string`:D=(e||k)(D),j=`,"`+w+`":`+D;break;default:D=(e||i)(D,a),j=`,"`+w+`":`+D}}return this[y]&&A?E+this[C]+A.slice(1)+`}`+j+s:E+A+j+s}function N(e,t){let n,r=e[u],i=e[g],a=e[_],o=e[h],s=o[v],c=e[f],l=e[b].bindings;t=l(t);for(let e in t)if(n=t[e],((e.length<5||e!==`level`&&e!==`serializers`&&e!==`formatters`&&e!==`customLevels`)&&t.hasOwnProperty(e)&&n!==void 0)===!0){if(n=c[e]?c[e](n):n,n=(o[e]||s||i)(n,a),n===void 0)continue;r+=`,`+k(e)+`:`+n}return r}function P(e){return e.write!==e.constructor.prototype.write}function F(e){let t=new s(e);return t.on(`error`,n),!e.sync&&T&&(c.register(t,ne),t.on(`close`,function(){c.unregister(t)})),t;function n(e){
121
+ o.closed||(o.flushSync(),u(100),o.end())}return o}function b(e){e.ref(),e.flushSync(),e.end(),e.once(`close`,function(){e.unref()})}function x(e){e.flushSync()}function S(e){let{pipeline:t,targets:r,levels:a,dedupe:l,worker:u={},caller:d=i(),sync:f=!1}=e,m={...e.options},h=!1,g=typeof d==`string`?[d]:d,_=typeof globalThis==`object`&&Object.prototype.hasOwnProperty.call(globalThis,`__bundlerPathsOverrides`)&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides==`object`?globalThis.__bundlerPathsOverrides:Object.create(null),v=e.target;if(v&&r)throw Error(`only one of target or targets can be specified`);if(r){v=_[`pino-worker`]||o(__dirname,`worker.js`),m.targets=r.filter(e=>e.target).map(e=>({...e,target:S(e.target)})),m.pipelines=r.filter(e=>e.pipeline).map(e=>e.pipeline.map(t=>({...t,level:e.level,target:S(t.target)})));let e=m.targets.some(e=>e.level!=null),t=m.pipelines.some(e=>e.some(e=>e.level!=null));h=m.targets.length+m.pipelines.length>1||e||t}else t&&(v=_[`pino-worker`]||o(__dirname,`worker.js`),m.pipelines=[t.map(e=>({...e,target:S(e.target)}))]);a&&(m.levels=a),l&&(m.dedupe=l),m.pinoWillSendConfig=!0;let b=r||t?`pino.transport`:v,x=y(S(v),m,u,f,b);return h&&(x[p]=!0),x;function S(e){if(e=_[e]||e,s(e)||e.indexOf(`file://`)===0)return e;if(e===`pino/file`)return o(__dirname,`..`,`file.js`);let t;for(let r of g)try{let i=r===`node:repl`?process.cwd()+c:r;t=n(i).resolve(e);break}catch{continue}if(!t)throw Error(`unable to determine transport target for "${e}"`);return t}}t.exports=S})),Bl=/* @__PURE__ */ n(((e,t)=>{let n=a(`node:diagnostics_channel`),r=jl(),{mapHttpRequest:i,mapHttpResponse:o}=Tl(),s=Nl(),c=Pl(),{lsCacheSym:l,chindingsSym:u,writeSym:d,serializersSym:f,formatOptsSym:p,endSym:m,stringifiersSym:h,stringifySym:g,stringifySafeSym:_,wildcardFirstSym:v,nestedKeySym:y,formattersSym:b,messageKeySym:x,errorKeySym:S,nestedKeyStrSym:C,msgPrefixSym:w}=Ol(),{isMainThread:T}=a(`worker_threads`),E=zl(),[D]=process.versions.node.split(`.`).map(e=>Number(e)),O=n.tracingChannel(`pino_asJson`),k=D>=25?e=>JSON.stringify(e):te;function A(){}function ee(e,t){return t?function(...r){t.call(this,r,n,e)}:n;function n(t,...n){if(typeof t==`object`){let a=t;t!==null&&(t.method&&t.headers&&t.socket?t=i(t):typeof t.setHeader==`function`&&(t=o(t)));let s;a===null&&n.length===0?s=[null]:(a=n.shift(),s=n),typeof this[w]==`string`&&a!=null&&(a=this[w]+a),this[d](t,r(a,s,this[p]),e)}else{let i=t===void 0?n.shift():t;typeof this[w]==`string`&&i!=null&&(i=this[w]+i),this[d](null,r(i,n,this[p]),e)}}}function te(e){let t=``,n=0,r=!1,i=255,a=e.length;if(a>100)return JSON.stringify(e);for(var o=0;o<a&&i>=32;o++)i=e.charCodeAt(o),(i===34||i===92)&&(t+=e.slice(n,o)+`\\`,n=o,r=!0);return r?t+=e.slice(n):t=e,i<32?JSON.stringify(e):`"`+t+`"`}function ne(e,t,n,r){if(O.hasSubscribers===!1)return j.call(this,e,t,n,r);let i={instance:this,arguments};return O.traceSync(j,i,this,e,t,n,r)}function j(e,t,n,r){let i=this[g],a=this[_],o=this[h],s=this[m],c=this[u],d=this[f],p=this[b],w=this[x],T=this[S],E=this[l][n]+r;E+=c;let D;p.log&&(e=p.log(e));let O=o[v],A=``;for(let t in e)if(D=e[t],Object.prototype.hasOwnProperty.call(e,t)&&D!==void 0){d[t]?D=d[t](D):t===T&&d.err&&(D=d.err(D));let e=o[t]||O;switch(typeof D){case`undefined`:case`function`:continue;case`number`:Number.isFinite(D)===!1&&(D=null);case`boolean`:e&&(D=e(D));break;case`string`:D=(e||k)(D);break;default:D=(e||i)(D,a)}if(D===void 0)continue;let n=k(t);A+=`,`+n+`:`+D}let ee=``;if(t!==void 0){D=d[w]?d[w](t):t;let e=o[w]||O;switch(typeof D){case`function`:break;case`number`:Number.isFinite(D)===!1&&(D=null);case`boolean`:e&&(D=e(D)),ee=`,"`+w+`":`+D;break;case`string`:D=(e||k)(D),ee=`,"`+w+`":`+D;break;default:D=(e||i)(D,a),ee=`,"`+w+`":`+D}}return this[y]&&A?E+this[C]+A.slice(1)+`}`+ee+s:E+A+ee+s}function re(e,t){let n,r=e[u],i=e[g],a=e[_],o=e[h],s=o[v],c=e[f],l=e[b].bindings;t=l(t);for(let e in t)if(n=t[e],((e.length<5||e!==`level`&&e!==`serializers`&&e!==`formatters`&&e!==`customLevels`)&&t.hasOwnProperty(e)&&n!==void 0)===!0){if(n=c[e]?c[e](n):n,n=(o[e]||s||i)(n,a),n===void 0)continue;r+=`,`+k(e)+`:`+n}return r}function M(e){return e.write!==e.constructor.prototype.write}function N(e){let t=new s(e);return t.on(`error`,n),!e.sync&&T&&(c.register(t,ie),t.on(`close`,function(){c.unregister(t)})),t;function n(e){
122
122
  /* istanbul ignore next */
123
- e.code===`EPIPE`?(t.write=A,t.end=A,t.flushSync=A,t.destroy=A):(t.removeListener(`error`,n),t.emit(`error`,e))}}function ne(e,t){
123
+ e.code===`EPIPE`?(t.write=A,t.end=A,t.flushSync=A,t.destroy=A):(t.removeListener(`error`,n),t.emit(`error`,e))}}function ie(e,t){
124
124
  /* istanbul ignore next */
125
125
  e.destroyed||(t===`beforeExit`?(e.flush(),e.on(`drain`,function(){e.end()})):
126
126
  /* istanbul ignore next */
127
- e.flushSync())}function re(e){return function(t,n,r={},i){if(typeof r==`string`)i=F({dest:r}),r={};else if(typeof i==`string`){if(r&&r.transport)throw Error(`only one of option.transport or stream can be specified`);i=F({dest:i})}else if(r instanceof s||r.writable||r._writableState)i=r,r={};else if(r.transport){if(r.transport instanceof s||r.transport.writable||r.transport._writableState)throw Error(`option.transport do not allow stream, please pass to option directly. e.g. pino(transport)`);if(r.transport.targets&&r.transport.targets.length&&r.formatters&&typeof r.formatters.level==`function`)throw Error(`option.transport.targets do not allow custom level formatters`);let e;r.customLevels&&(e=r.useOnlyCustomLevels?r.customLevels:Object.assign({},r.levels,r.customLevels)),i=E({caller:n,...r.transport,levels:e})}if(r=Object.assign({},e,r),r.serializers=Object.assign(Object.create(null),e.serializers,r.serializers),r.formatters=Object.assign({},e.formatters,r.formatters),r.prettyPrint)throw Error(`prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)`);let{enabled:a,onChild:o}=r;return a===!1&&(r.level=`silent`),o||(r.onChild=A),i||=P(process.stdout)?process.stdout:F({fd:process.stdout.fd||1}),{opts:r,stream:i}}}function ie(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[_])(e)}catch{return`"[unable to serialize, circular reference is too complex to analyze]"`}}}function I(e,t,n){return{level:e,bindings:t,log:n}}function L(e){let t=Number(e);return typeof e==`string`&&Number.isFinite(t)?t:e===void 0?1:e}t.exports={noop:A,buildSafeSonicBoom:F,asChindings:N,asJson:te,genLog:j,createArgsNormalizer:re,stringify:ie,buildFormatters:I,normalizeDestFileDescriptor:L}})),Vl=/* @__PURE__ */ n(((e,t)=>{t.exports={DEFAULT_LEVELS:{trace:10,debug:20,info:30,warn:40,error:50,fatal:60},SORTING_ORDER:{ASC:`ASC`,DESC:`DESC`}}})),Hl=/* @__PURE__ */ n(((e,t)=>{let{lsCacheSym:n,levelValSym:r,useOnlyCustomLevelsSym:i,streamSym:a,formattersSym:o,hooksSym:s,levelCompSym:c}=Ol(),{noop:l,genLog:u}=Bl(),{DEFAULT_LEVELS:d,SORTING_ORDER:f}=Vl(),p={fatal:e=>{let t=u(d.fatal,e);return function(...e){let n=this[a];if(t.call(this,...e),typeof n.flushSync==`function`)try{n.flushSync()}catch{}}},error:e=>u(d.error,e),warn:e=>u(d.warn,e),info:e=>u(d.info,e),debug:e=>u(d.debug,e),trace:e=>u(d.trace,e)},m=Object.keys(d).reduce((e,t)=>(e[d[t]]=t,e),{}),h=Object.keys(m).reduce((e,t)=>(e[t]=`{"level":`+Number(t),e),{});function g(e){let t=e[o].level,{labels:r}=e.levels,i={};for(let e in r){let n=t(r[e],Number(e));i[e]=JSON.stringify(n).slice(0,-1)}return e[n]=i,e}function _(e,t){if(t)return!1;switch(e){case`fatal`:case`error`:case`warn`:case`info`:case`debug`:case`trace`:return!0;default:return!1}}function v(e){let{labels:t,values:n}=this.levels;if(typeof e==`number`){if(t[e]===void 0)throw Error(`unknown level value`+e);e=t[e]}if(n[e]===void 0)throw Error(`unknown level `+e);let a=this[r],o=this[r]=n[e],d=this[i],f=this[c],m=this[s].logMethod;for(let e in n)this[e]=f(n[e],o)===!1?l:_(e,d)?p[e](m):u(n[e],m);this.emit(`level-change`,e,o,t[a],a,this)}function y(e){let{levels:t,levelVal:n}=this;return t&&t.labels?t.labels[n]:``}function b(e){let{values:t}=this.levels,n=t[e];return n!==void 0&&this[c](n,this[r])}function x(e,t,n){return e===f.DESC?t<=n:t>=n}function S(e){return typeof e==`string`?x.bind(null,e):e}function C(e=null,t=!1){let n=e?Object.keys(e).reduce((t,n)=>(t[e[n]]=n,t),{}):null;return{labels:Object.assign(Object.create(Object.prototype,{Infinity:{value:`silent`}}),t?null:m,n),values:Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:d,e)}}function w(e,t,n){if(typeof e==`number`){if(![].concat(Object.keys(t||{}).map(e=>t[e]),n?[]:Object.keys(m).map(e=>+e),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`)}else if(!(e in Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),n?null:d,t)))throw Error(`default level:${e} must be included in custom levels`)}function T(e,t){let{labels:n,values:r}=e;for(let e in t){if(e in r)throw Error(`levels cannot be overridden`);if(t[e]in n)throw Error(`pre-existing level values cannot be used for new levels`)}}function E(e){if(typeof e!=`function`&&!(typeof e==`string`&&Object.values(f).includes(e)))throw Error(`Levels comparison should be one of "ASC", "DESC" or "function" type`)}t.exports={initialLsCache:h,genLsCache:g,levelMethods:p,getLevel:y,setLevel:v,isLevelEnabled:b,mappings:C,assertNoLevelCollisions:T,assertDefaultLevelFound:w,genLevelComparison:S,assertLevelComparison:E}})),Ul=/* @__PURE__ */ n(((e,t)=>{t.exports={version:`10.4.0`}})),Wl=/* @__PURE__ */ n(((e,t)=>{let{EventEmitter:n}=a(`node:events`),{lsCacheSym:r,levelValSym:i,setLevelSym:o,getLevelSym:s,chindingsSym:c,mixinSym:l,asJsonSym:u,writeSym:d,mixinMergeStrategySym:f,timeSym:p,timeSliceIndexSym:m,streamSym:h,serializersSym:g,formattersSym:_,errorKeySym:v,messageKeySym:y,useOnlyCustomLevelsSym:b,needsMetadataGsym:x,redactFmtSym:S,stringifySym:C,formatOptsSym:w,stringifiersSym:T,msgPrefixSym:E,hooksSym:D}=Ol(),{getLevel:O,setLevel:k,isLevelEnabled:A,mappings:j,initialLsCache:ee,genLsCache:te,assertNoLevelCollisions:M}=Hl(),{asChindings:N,asJson:P,buildFormatters:F,stringify:ne,noop:re}=Bl(),{version:ie}=Ul(),I=kl(),L={constructor:class{},child:ae,bindings:oe,setBindings:se,flush:le,isLevelEnabled:A,version:ie,get level(){return this[s]()},set level(e){this[o](e)},get levelVal(){return this[i]},set levelVal(e){throw Error(`levelVal is read-only`)},get msgPrefix(){return this[E]},get[Symbol.toStringTag](){return`Pino`},[r]:ee,[d]:ce,[u]:P,[s]:O,[o]:k};Object.setPrototypeOf(L,n.prototype),t.exports=function(){return Object.create(L)};let R=e=>e;function ae(e,t){if(!e)throw Error(`missing bindings for child Pino`);let n=this[g],r=this[_],i=Object.create(this);if(t==null)return i[_].bindings!==R&&(i[_]=F(r.level,R,r.log)),i[c]=N(i,e),this.onChild!==re&&this.onChild(i),i;if(t.hasOwnProperty(`serializers`)===!0){i[g]=Object.create(null);for(let e in n)i[g][e]=n[e];let e=Object.getOwnPropertySymbols(n);for(var a=0;a<e.length;a++){let t=e[a];i[g][t]=n[t]}for(let e in t.serializers)i[g][e]=t.serializers[e];let r=Object.getOwnPropertySymbols(t.serializers);for(var s=0;s<r.length;s++){let e=r[s];i[g][e]=t.serializers[e]}}else i[g]=n;if(t.hasOwnProperty(`formatters`)){let{level:e,bindings:n,log:a}=t.formatters;i[_]=F(e||r.level,n||R,a||r.log)}else i[_]=F(r.level,R,r.log);if(t.hasOwnProperty(`customLevels`)===!0&&(M(this.levels,t.customLevels),i.levels=j(t.customLevels,i[b]),te(i)),typeof t.redact==`object`&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let e=I(i.redact,ne),n={stringify:e[S]};i[C]=ne,i[T]=e,i[w]=n}if(typeof t.msgPrefix==`string`&&(i[E]=(this[E]||``)+t.msgPrefix),i[c]=N(i,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty(`customLevels`)){let e=t.level||this.level;i[o](e)}return this.onChild(i),i}function oe(){let e=`{${this[c].substr(1)}}`,t=JSON.parse(e);return delete t.pid,delete t.hostname,t}function se(e){let t=N(this,e);this[c]=t}function z(e,t){return Object.assign(t,e)}function ce(e,t,n){let r=this[p](),i=this[l],a=this[v],o=this[y],s=this[f]||z,c,d=this[D].streamWrite;e==null?c={}:e instanceof Error?(c={[a]:e},t===void 0&&(t=e.message)):(c=e,t===void 0&&e[o]===void 0&&e[a]&&(t=e[a].message)),i&&(c=s(c,i(c,n,this)));let g=this[u](c,t,n,r),_=this[h];_[x]===!0&&(_.lastLevel=n,_.lastObj=c,_.lastMsg=t,_.lastTime=r.slice(this[m]),_.lastLogger=this),_.write(d?d(g):g)}function le(e){if(e!=null&&typeof e!=`function`)throw Error(`callback must be a function`);let t=this[h];typeof t.flush==`function`?t.flush(e||re):e&&e()}})),Gl=/* @__PURE__ */ n(((e,t)=>{let{hasOwnProperty:n}=Object.prototype,r=_();r.configure=_,r.stringify=r,r.default=r,e.stringify=r,e.configure=_,t.exports=r;let i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function a(e){return e.length<5e3&&!i.test(e)?`"${e}"`:JSON.stringify(e)}function o(e,t){if(e.length>200||t)return e.sort(t);for(let t=1;t<e.length;t++){let n=e[t],r=t;for(;r!==0&&e[r-1]>n;)e[r]=e[r-1],r--;e[r]=n}return e}let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(/* @__PURE__ */ new Int8Array)),Symbol.toStringTag).get;function c(e){return s.call(e)!==void 0&&e.length!==0}function l(e,t,n){e.length<n&&(n=e.length);let r=t===`,`?``:` `,i=`"0":${r}${e[0]}`;for(let a=1;a<n;a++)i+=`${t}"${a}":${r}${e[a]}`;return i}function u(e){if(n.call(e,`circularValue`)){let t=e.circularValue;if(typeof t==`string`)return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw TypeError(`Converting circular structure to JSON`)}};throw TypeError(`The "circularValue" argument must be of type string or the value null or undefined`)}return`"[Circular]"`}function d(e){let t;if(n.call(e,`deterministic`)&&(t=e.deterministic,typeof t!=`boolean`&&typeof t!=`function`))throw TypeError(`The "deterministic" argument must be of type boolean or comparator function`);return t===void 0||t}function f(e,t){let r;if(n.call(e,t)&&(r=e[t],typeof r!=`boolean`))throw TypeError(`The "${t}" argument must be of type boolean`);return r===void 0||r}function p(e,t){let r;if(n.call(e,t)){if(r=e[t],typeof r!=`number`)throw TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw TypeError(`The "${t}" argument must be an integer`);if(r<1)throw RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function m(e){return e===1?`1 item`:`${e} items`}function h(e){let t=/* @__PURE__ */ new Set;for(let n of e)(typeof n==`string`||typeof n==`number`)&&t.add(String(n));return t}function g(e){if(n.call(e,`strict`)){let t=e.strict;if(typeof t!=`boolean`)throw TypeError(`The "strict" argument must be of type boolean`);if(t)return e=>{let t=`Object can not safely be stringified. Received type ${typeof e}`;throw typeof e!=`function`&&(t+=` (${e.toString()})`),Error(t)}}}function _(e){e={...e};let t=g(e);t&&(e.bigint===void 0&&(e.bigint=!1),`circularValue`in e||(e.circularValue=Error));let n=u(e),r=f(e,`bigint`),i=d(e),s=typeof i==`function`?i:void 0,_=p(e,`maximumDepth`),v=p(e,`maximumBreadth`);function y(e,l,u,d,f,p){let h=l[e];switch(typeof h==`object`&&h&&typeof h.toJSON==`function`&&(h=h.toJSON(e)),h=d.call(l,e,h),typeof h){case`string`:return a(h);case`object`:{if(h===null)return`null`;if(u.indexOf(h)!==-1)return n;let e=``,t=`,`,r=p;if(Array.isArray(h)){if(h.length===0)return`[]`;if(_<u.length+1)return`"[Array]"`;u.push(h),f!==``&&(p+=f,e+=`\n${p}`,t=`,\n${p}`);let n=Math.min(h.length,v),i=0;for(;i<n-1;i++){let n=y(String(i),h,u,d,f,p);e+=n===void 0?`null`:n,e+=t}let a=y(String(i),h,u,d,f,p);if(e+=a===void 0?`null`:a,h.length-1>v){let n=h.length-v-1;e+=`${t}"... ${m(n)} not stringified"`}return f!==``&&(e+=`\n${r}`),u.pop(),`[${e}]`}let l=Object.keys(h),g=l.length;if(g===0)return`{}`;if(_<u.length+1)return`"[Object]"`;let b=``,x=``;f!==``&&(p+=f,t=`,\n${p}`,b=` `);let S=Math.min(g,v);i&&!c(h)&&(l=o(l,s)),u.push(h);for(let n=0;n<S;n++){let r=l[n],i=y(r,h,u,d,f,p);i!==void 0&&(e+=`${x}${a(r)}:${b}${i}`,x=t)}if(g>v){let n=g-v;e+=`${x}"...":${b}"${m(n)} not stringified"`,x=t}return f!==``&&x.length>1&&(e=`\n${p}${e}\n${r}`),u.pop(),`{${e}}`}case`number`:return isFinite(h)?String(h):t?t(h):`null`;case`boolean`:return h===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(h);default:return t?t(h):void 0}}function b(e,i,o,s,c,l){switch(typeof i==`object`&&i&&typeof i.toJSON==`function`&&(i=i.toJSON(e)),typeof i){case`string`:return a(i);case`object`:{if(i===null)return`null`;if(o.indexOf(i)!==-1)return n;let e=l,t=``,r=`,`;if(Array.isArray(i)){if(i.length===0)return`[]`;if(_<o.length+1)return`"[Array]"`;o.push(i),c!==``&&(l+=c,t+=`\n${l}`,r=`,\n${l}`);let n=Math.min(i.length,v),a=0;for(;a<n-1;a++){let e=b(String(a),i[a],o,s,c,l);t+=e===void 0?`null`:e,t+=r}let u=b(String(a),i[a],o,s,c,l);if(t+=u===void 0?`null`:u,i.length-1>v){let e=i.length-v-1;t+=`${r}"... ${m(e)} not stringified"`}return c!==``&&(t+=`\n${e}`),o.pop(),`[${t}]`}o.push(i);let u=``;c!==``&&(l+=c,r=`,\n${l}`,u=` `);let d=``;for(let e of s){let n=b(e,i[e],o,s,c,l);n!==void 0&&(t+=`${d}${a(e)}:${u}${n}`,d=r)}return c!==``&&d.length>1&&(t=`\n${l}${t}\n${e}`),o.pop(),`{${t}}`}case`number`:return isFinite(i)?String(i):t?t(i):`null`;case`boolean`:return i===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(i);default:return t?t(i):void 0}}function x(e,u,d,f,p){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return x(e,u,d,f,p);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=p;if(Array.isArray(u)){if(u.length===0)return`[]`;if(_<d.length+1)return`"[Array]"`;d.push(u),p+=f;let e=`\n${p}`,n=`,\n${p}`,r=Math.min(u.length,v),i=0;for(;i<r-1;i++){let t=x(String(i),u[i],d,f,p);e+=t===void 0?`null`:t,e+=n}let a=x(String(i),u[i],d,f,p);if(e+=a===void 0?`null`:a,u.length-1>v){let t=u.length-v-1;e+=`${n}"... ${m(t)} not stringified"`}return e+=`\n${t}`,d.pop(),`[${e}]`}let r=Object.keys(u),h=r.length;if(h===0)return`{}`;if(_<d.length+1)return`"[Object]"`;p+=f;let g=`,\n${p}`,y=``,b=``,S=Math.min(h,v);c(u)&&(y+=l(u,g,v),r=r.slice(u.length),S-=u.length,b=g),i&&(r=o(r,s)),d.push(u);for(let e=0;e<S;e++){let t=r[e],n=x(t,u[t],d,f,p);n!==void 0&&(y+=`${b}${a(t)}: ${n}`,b=g)}if(h>v){let e=h-v;y+=`${b}"...": "${m(e)} not stringified"`,b=g}return b!==``&&(y=`\n${p}${y}\n${t}`),d.pop(),`{${y}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function S(e,u,d){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return S(e,u,d);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=``,r=u.length!==void 0;if(r&&Array.isArray(u)){if(u.length===0)return`[]`;if(_<d.length+1)return`"[Array]"`;d.push(u);let e=Math.min(u.length,v),n=0;for(;n<e-1;n++){let e=S(String(n),u[n],d);t+=e===void 0?`null`:e,t+=`,`}let r=S(String(n),u[n],d);if(t+=r===void 0?`null`:r,u.length-1>v){let e=u.length-v-1;t+=`,"... ${m(e)} not stringified"`}return d.pop(),`[${t}]`}let f=Object.keys(u),p=f.length;if(p===0)return`{}`;if(_<d.length+1)return`"[Object]"`;let h=``,g=Math.min(p,v);r&&c(u)&&(t+=l(u,`,`,v),f=f.slice(u.length),g-=u.length,h=`,`),i&&(f=o(f,s)),d.push(u);for(let e=0;e<g;e++){let n=f[e],r=S(n,u[n],d);r!==void 0&&(t+=`${h}${a(n)}:${r}`,h=`,`)}if(p>v){let e=p-v;t+=`${h}"...":"${m(e)} not stringified"`}return d.pop(),`{${t}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function C(e,t,n){if(arguments.length>1){let r=``;if(typeof n==`number`?r=` `.repeat(Math.min(n,10)):typeof n==`string`&&(r=n.slice(0,10)),t!=null){if(typeof t==`function`)return y(``,{"":e},[],t,r,``);if(Array.isArray(t))return b(``,e,[],h(t),r,``)}if(r.length!==0)return x(``,e,[],r,``)}return S(``,e,[])}return C}})),Kl=/* @__PURE__ */ n(((e,t)=>{let n=Symbol.for(`pino.metadata`),{DEFAULT_LEVELS:r}=Vl(),i=r.info;function a(e,t){e||=[],t||={dedupe:!1};let a=Object.create(r);a.silent=1/0,t.levels&&typeof t.levels==`object`&&Object.keys(t.levels).forEach(e=>{a[e]=t.levels[e]});let u={write:d,add:m,remove:h,emit:f,flushSync:p,end:g,minLevel:0,lastId:0,streams:[],clone:_,[n]:!0,streamLevels:a};return Array.isArray(e)?e.forEach(m,u):m.call(u,e),e=null,u;function d(e){let r,i=typeof this.lastLevel==`string`?(this.streamLevels||a)[this.lastLevel]:this.lastLevel,{streams:o}=this,u=0,d;for(let a=s(o.length,t.dedupe);l(a,o.length,t.dedupe);a=c(a,t.dedupe))if(r=o[a],r.level<=i){if(u!==0&&u!==r.level)break;if(d=r.stream,d[n]){let{lastTime:e,lastMsg:t,lastObj:n,lastLogger:r}=this;d.lastLevel=i,d.lastTime=e,d.lastMsg=t,d.lastObj=n,d.lastLogger=r}d.write(e),t.dedupe&&(u=r.level)}else if(!t.dedupe)break}function f(...e){for(let{stream:t}of this.streams)typeof t.emit==`function`&&t.emit(...e)}function p(){for(let{stream:e}of this.streams)typeof e.flushSync==`function`&&e.flushSync()}function m(e){if(!e)return this;let t=typeof e.write==`function`||e.stream,n=e.write?e:e.stream;if(!t)throw Error(`stream object needs to implement either StreamEntry or DestinationStream interface`);let{streams:r,streamLevels:a}=this,s;s=typeof e.levelVal==`number`?e.levelVal:typeof e.level==`string`?a[e.level]:typeof e.level==`number`?e.level:i;let c={stream:n,level:s,levelVal:void 0,id:++u.lastId};return r.unshift(c),r.sort(o),this.minLevel=r[0].level,this}function h(e){let{streams:t}=this,n=t.findIndex(t=>t.id===e);return n>=0&&(t.splice(n,1),t.sort(o),this.minLevel=t.length>0?t[0].level:-1),this}function g(){for(let{stream:e}of this.streams)typeof e.flushSync==`function`&&e.flushSync(),e.end()}function _(e){let t=Array(this.streams.length);for(let n=0;n<t.length;n++)t[n]={level:e,stream:this.streams[n].stream};return{write:d,add:m,remove:h,emit:f,flushSync:p,end:g,minLevel:e,streams:t,clone:_,[n]:!0,streamLevels:a}}}function o(e,t){return e.level-t.level}function s(e,t){return t?e-1:0}function c(e,t){return t?e-1:e+1}function l(e,t,n){return n?e>=0:e<t}t.exports=a})),ql=/* @__PURE__ */ t((/* @__PURE__ */ n(((e,t)=>{let n=a(`node:os`),r=Tl(),i=El(),o=kl(),s=Al(),c=Wl(),l=Ol(),{configure:u}=Gl(),{assertDefaultLevelFound:d,mappings:f,genLsCache:p,genLevelComparison:m,assertLevelComparison:h}=Hl(),{DEFAULT_LEVELS:g,SORTING_ORDER:_}=Vl(),{createArgsNormalizer:v,asChindings:y,buildSafeSonicBoom:b,buildFormatters:x,stringify:S,normalizeDestFileDescriptor:C,noop:w}=Bl(),{version:T}=Ul(),{chindingsSym:E,redactFmtSym:D,serializersSym:O,timeSym:k,timeSliceIndexSym:A,streamSym:j,stringifySym:ee,stringifySafeSym:te,stringifiersSym:M,setLevelSym:N,endSym:P,formatOptsSym:F,messageKeySym:ne,errorKeySym:re,nestedKeySym:ie,mixinSym:I,levelCompSym:L,useOnlyCustomLevelsSym:R,formattersSym:ae,hooksSym:oe,nestedKeyStrSym:se,mixinMergeStrategySym:z,msgPrefixSym:ce,transportUsesMultistreamSym:le}=l,{epochTime:ue,nullTime:de}=s,{pid:B}=process,fe=n.hostname(),pe=r.err,me=v({level:`info`,levelComparison:_.ASC,levels:g,messageKey:`msg`,errorKey:`err`,nestedKey:null,enabled:!0,base:{pid:B,hostname:fe},serializers:Object.assign(Object.create(null),{err:pe}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:ue,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100}),he=Object.assign(Object.create(null),r);function ge(...e){let t={},{opts:n,stream:r}=me(t,i(),...e);n.level&&typeof n.level==`string`&&g[n.level.toLowerCase()]!==void 0&&(n.level=n.level.toLowerCase());let{redact:a,crlf:s,serializers:l,timestamp:_,messageKey:v,errorKey:b,nestedKey:C,base:T,name:B,level:fe,customLevels:pe,levelComparison:he,mixin:ge,mixinMergeStrategy:_e,useOnlyCustomLevels:ve,formatters:ye,hooks:be,depthLimit:xe,edgeLimit:Se,onChild:Ce,msgPrefix:we}=n,Te=u({maximumDepth:xe,maximumBreadth:Se}),Ee=x(ye.level,ye.bindings,ye.log),De=S.bind({[te]:Te}),Oe=a?Object.assign(Object.create(null),o(a,De)):Object.create(null),ke=a?{stringify:Oe[D]}:{stringify:De},Ae=`}`+(s?`\r
127
+ e.flushSync())}function P(e){return function(t,n,r={},i){if(typeof r==`string`)i=N({dest:r}),r={};else if(typeof i==`string`){if(r&&r.transport)throw Error(`only one of option.transport or stream can be specified`);i=N({dest:i})}else if(r instanceof s||r.writable||r._writableState)i=r,r={};else if(r.transport){if(r.transport instanceof s||r.transport.writable||r.transport._writableState)throw Error(`option.transport do not allow stream, please pass to option directly. e.g. pino(transport)`);if(r.transport.targets&&r.transport.targets.length&&r.formatters&&typeof r.formatters.level==`function`)throw Error(`option.transport.targets do not allow custom level formatters`);let e;r.customLevels&&(e=r.useOnlyCustomLevels?r.customLevels:Object.assign({},r.levels,r.customLevels)),i=E({caller:n,...r.transport,levels:e})}if(r=Object.assign({},e,r),r.serializers=Object.assign(Object.create(null),e.serializers,r.serializers),r.formatters=Object.assign({},e.formatters,r.formatters),r.prettyPrint)throw Error(`prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)`);let{enabled:a,onChild:o}=r;return a===!1&&(r.level=`silent`),o||(r.onChild=A),i||=M(process.stdout)?process.stdout:N({fd:process.stdout.fd||1}),{opts:r,stream:i}}}function ae(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[_])(e)}catch{return`"[unable to serialize, circular reference is too complex to analyze]"`}}}function F(e,t,n){return{level:e,bindings:t,log:n}}function I(e){let t=Number(e);return typeof e==`string`&&Number.isFinite(t)?t:e===void 0?1:e}t.exports={noop:A,buildSafeSonicBoom:N,asChindings:re,asJson:ne,genLog:ee,createArgsNormalizer:P,stringify:ae,buildFormatters:F,normalizeDestFileDescriptor:I}})),Vl=/* @__PURE__ */ n(((e,t)=>{t.exports={DEFAULT_LEVELS:{trace:10,debug:20,info:30,warn:40,error:50,fatal:60},SORTING_ORDER:{ASC:`ASC`,DESC:`DESC`}}})),Hl=/* @__PURE__ */ n(((e,t)=>{let{lsCacheSym:n,levelValSym:r,useOnlyCustomLevelsSym:i,streamSym:a,formattersSym:o,hooksSym:s,levelCompSym:c}=Ol(),{noop:l,genLog:u}=Bl(),{DEFAULT_LEVELS:d,SORTING_ORDER:f}=Vl(),p={fatal:e=>{let t=u(d.fatal,e);return function(...e){let n=this[a];if(t.call(this,...e),typeof n.flushSync==`function`)try{n.flushSync()}catch{}}},error:e=>u(d.error,e),warn:e=>u(d.warn,e),info:e=>u(d.info,e),debug:e=>u(d.debug,e),trace:e=>u(d.trace,e)},m=Object.keys(d).reduce((e,t)=>(e[d[t]]=t,e),{}),h=Object.keys(m).reduce((e,t)=>(e[t]=`{"level":`+Number(t),e),{});function g(e){let t=e[o].level,{labels:r}=e.levels,i={};for(let e in r){let n=t(r[e],Number(e));i[e]=JSON.stringify(n).slice(0,-1)}return e[n]=i,e}function _(e,t){if(t)return!1;switch(e){case`fatal`:case`error`:case`warn`:case`info`:case`debug`:case`trace`:return!0;default:return!1}}function v(e){let{labels:t,values:n}=this.levels;if(typeof e==`number`){if(t[e]===void 0)throw Error(`unknown level value`+e);e=t[e]}if(n[e]===void 0)throw Error(`unknown level `+e);let a=this[r],o=this[r]=n[e],d=this[i],f=this[c],m=this[s].logMethod;for(let e in n)this[e]=f(n[e],o)===!1?l:_(e,d)?p[e](m):u(n[e],m);this.emit(`level-change`,e,o,t[a],a,this)}function y(e){let{levels:t,levelVal:n}=this;return t&&t.labels?t.labels[n]:``}function b(e){let{values:t}=this.levels,n=t[e];return n!==void 0&&this[c](n,this[r])}function x(e,t,n){return e===f.DESC?t<=n:t>=n}function S(e){return typeof e==`string`?x.bind(null,e):e}function C(e=null,t=!1){let n=e?Object.keys(e).reduce((t,n)=>(t[e[n]]=n,t),{}):null;return{labels:Object.assign(Object.create(Object.prototype,{Infinity:{value:`silent`}}),t?null:m,n),values:Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:d,e)}}function w(e,t,n){if(typeof e==`number`){if(![].concat(Object.keys(t||{}).map(e=>t[e]),n?[]:Object.keys(m).map(e=>+e),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`)}else if(!(e in Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),n?null:d,t)))throw Error(`default level:${e} must be included in custom levels`)}function T(e,t){let{labels:n,values:r}=e;for(let e in t){if(e in r)throw Error(`levels cannot be overridden`);if(t[e]in n)throw Error(`pre-existing level values cannot be used for new levels`)}}function E(e){if(typeof e!=`function`&&!(typeof e==`string`&&Object.values(f).includes(e)))throw Error(`Levels comparison should be one of "ASC", "DESC" or "function" type`)}t.exports={initialLsCache:h,genLsCache:g,levelMethods:p,getLevel:y,setLevel:v,isLevelEnabled:b,mappings:C,assertNoLevelCollisions:T,assertDefaultLevelFound:w,genLevelComparison:S,assertLevelComparison:E}})),Ul=/* @__PURE__ */ n(((e,t)=>{t.exports={version:`10.4.0`}})),Wl=/* @__PURE__ */ n(((e,t)=>{let{EventEmitter:n}=a(`node:events`),{lsCacheSym:r,levelValSym:i,setLevelSym:o,getLevelSym:s,chindingsSym:c,mixinSym:l,asJsonSym:u,writeSym:d,mixinMergeStrategySym:f,timeSym:p,timeSliceIndexSym:m,streamSym:h,serializersSym:g,formattersSym:_,errorKeySym:v,messageKeySym:y,useOnlyCustomLevelsSym:b,needsMetadataGsym:x,redactFmtSym:S,stringifySym:C,formatOptsSym:w,stringifiersSym:T,msgPrefixSym:E,hooksSym:D}=Ol(),{getLevel:O,setLevel:k,isLevelEnabled:A,mappings:ee,initialLsCache:te,genLsCache:ne,assertNoLevelCollisions:j}=Hl(),{asChindings:re,asJson:M,buildFormatters:N,stringify:ie,noop:P}=Bl(),{version:ae}=Ul(),F=kl(),I={constructor:class{},child:oe,bindings:se,setBindings:ce,flush:ue,isLevelEnabled:A,version:ae,get level(){return this[s]()},set level(e){this[o](e)},get levelVal(){return this[i]},set levelVal(e){throw Error(`levelVal is read-only`)},get msgPrefix(){return this[E]},get[Symbol.toStringTag](){return`Pino`},[r]:te,[d]:le,[u]:M,[s]:O,[o]:k};Object.setPrototypeOf(I,n.prototype),t.exports=function(){return Object.create(I)};let L=e=>e;function oe(e,t){if(!e)throw Error(`missing bindings for child Pino`);let n=this[g],r=this[_],i=Object.create(this);if(t==null)return i[_].bindings!==L&&(i[_]=N(r.level,L,r.log)),i[c]=re(i,e),this.onChild!==P&&this.onChild(i),i;if(t.hasOwnProperty(`serializers`)===!0){i[g]=Object.create(null);for(let e in n)i[g][e]=n[e];let e=Object.getOwnPropertySymbols(n);for(var a=0;a<e.length;a++){let t=e[a];i[g][t]=n[t]}for(let e in t.serializers)i[g][e]=t.serializers[e];let r=Object.getOwnPropertySymbols(t.serializers);for(var s=0;s<r.length;s++){let e=r[s];i[g][e]=t.serializers[e]}}else i[g]=n;if(t.hasOwnProperty(`formatters`)){let{level:e,bindings:n,log:a}=t.formatters;i[_]=N(e||r.level,n||L,a||r.log)}else i[_]=N(r.level,L,r.log);if(t.hasOwnProperty(`customLevels`)===!0&&(j(this.levels,t.customLevels),i.levels=ee(t.customLevels,i[b]),ne(i)),typeof t.redact==`object`&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let e=F(i.redact,ie),n={stringify:e[S]};i[C]=ie,i[T]=e,i[w]=n}if(typeof t.msgPrefix==`string`&&(i[E]=(this[E]||``)+t.msgPrefix),i[c]=re(i,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty(`customLevels`)){let e=t.level||this.level;i[o](e)}return this.onChild(i),i}function se(){let e=`{${this[c].substr(1)}}`,t=JSON.parse(e);return delete t.pid,delete t.hostname,t}function ce(e){let t=re(this,e);this[c]=t}function R(e,t){return Object.assign(t,e)}function le(e,t,n){let r=this[p](),i=this[l],a=this[v],o=this[y],s=this[f]||R,c,d=this[D].streamWrite;e==null?c={}:e instanceof Error?(c={[a]:e},t===void 0&&(t=e.message)):(c=e,t===void 0&&e[o]===void 0&&e[a]&&(t=e[a].message)),i&&(c=s(c,i(c,n,this)));let g=this[u](c,t,n,r),_=this[h];_[x]===!0&&(_.lastLevel=n,_.lastObj=c,_.lastMsg=t,_.lastTime=r.slice(this[m]),_.lastLogger=this),_.write(d?d(g):g)}function ue(e){if(e!=null&&typeof e!=`function`)throw Error(`callback must be a function`);let t=this[h];typeof t.flush==`function`?t.flush(e||P):e&&e()}})),Gl=/* @__PURE__ */ n(((e,t)=>{let{hasOwnProperty:n}=Object.prototype,r=_();r.configure=_,r.stringify=r,r.default=r,e.stringify=r,e.configure=_,t.exports=r;let i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function a(e){return e.length<5e3&&!i.test(e)?`"${e}"`:JSON.stringify(e)}function o(e,t){if(e.length>200||t)return e.sort(t);for(let t=1;t<e.length;t++){let n=e[t],r=t;for(;r!==0&&e[r-1]>n;)e[r]=e[r-1],r--;e[r]=n}return e}let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(/* @__PURE__ */ new Int8Array)),Symbol.toStringTag).get;function c(e){return s.call(e)!==void 0&&e.length!==0}function l(e,t,n){e.length<n&&(n=e.length);let r=t===`,`?``:` `,i=`"0":${r}${e[0]}`;for(let a=1;a<n;a++)i+=`${t}"${a}":${r}${e[a]}`;return i}function u(e){if(n.call(e,`circularValue`)){let t=e.circularValue;if(typeof t==`string`)return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw TypeError(`Converting circular structure to JSON`)}};throw TypeError(`The "circularValue" argument must be of type string or the value null or undefined`)}return`"[Circular]"`}function d(e){let t;if(n.call(e,`deterministic`)&&(t=e.deterministic,typeof t!=`boolean`&&typeof t!=`function`))throw TypeError(`The "deterministic" argument must be of type boolean or comparator function`);return t===void 0||t}function f(e,t){let r;if(n.call(e,t)&&(r=e[t],typeof r!=`boolean`))throw TypeError(`The "${t}" argument must be of type boolean`);return r===void 0||r}function p(e,t){let r;if(n.call(e,t)){if(r=e[t],typeof r!=`number`)throw TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw TypeError(`The "${t}" argument must be an integer`);if(r<1)throw RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function m(e){return e===1?`1 item`:`${e} items`}function h(e){let t=/* @__PURE__ */ new Set;for(let n of e)(typeof n==`string`||typeof n==`number`)&&t.add(String(n));return t}function g(e){if(n.call(e,`strict`)){let t=e.strict;if(typeof t!=`boolean`)throw TypeError(`The "strict" argument must be of type boolean`);if(t)return e=>{let t=`Object can not safely be stringified. Received type ${typeof e}`;throw typeof e!=`function`&&(t+=` (${e.toString()})`),Error(t)}}}function _(e){e={...e};let t=g(e);t&&(e.bigint===void 0&&(e.bigint=!1),`circularValue`in e||(e.circularValue=Error));let n=u(e),r=f(e,`bigint`),i=d(e),s=typeof i==`function`?i:void 0,_=p(e,`maximumDepth`),v=p(e,`maximumBreadth`);function y(e,l,u,d,f,p){let h=l[e];switch(typeof h==`object`&&h&&typeof h.toJSON==`function`&&(h=h.toJSON(e)),h=d.call(l,e,h),typeof h){case`string`:return a(h);case`object`:{if(h===null)return`null`;if(u.indexOf(h)!==-1)return n;let e=``,t=`,`,r=p;if(Array.isArray(h)){if(h.length===0)return`[]`;if(_<u.length+1)return`"[Array]"`;u.push(h),f!==``&&(p+=f,e+=`\n${p}`,t=`,\n${p}`);let n=Math.min(h.length,v),i=0;for(;i<n-1;i++){let n=y(String(i),h,u,d,f,p);e+=n===void 0?`null`:n,e+=t}let a=y(String(i),h,u,d,f,p);if(e+=a===void 0?`null`:a,h.length-1>v){let n=h.length-v-1;e+=`${t}"... ${m(n)} not stringified"`}return f!==``&&(e+=`\n${r}`),u.pop(),`[${e}]`}let l=Object.keys(h),g=l.length;if(g===0)return`{}`;if(_<u.length+1)return`"[Object]"`;let b=``,x=``;f!==``&&(p+=f,t=`,\n${p}`,b=` `);let S=Math.min(g,v);i&&!c(h)&&(l=o(l,s)),u.push(h);for(let n=0;n<S;n++){let r=l[n],i=y(r,h,u,d,f,p);i!==void 0&&(e+=`${x}${a(r)}:${b}${i}`,x=t)}if(g>v){let n=g-v;e+=`${x}"...":${b}"${m(n)} not stringified"`,x=t}return f!==``&&x.length>1&&(e=`\n${p}${e}\n${r}`),u.pop(),`{${e}}`}case`number`:return isFinite(h)?String(h):t?t(h):`null`;case`boolean`:return h===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(h);default:return t?t(h):void 0}}function b(e,i,o,s,c,l){switch(typeof i==`object`&&i&&typeof i.toJSON==`function`&&(i=i.toJSON(e)),typeof i){case`string`:return a(i);case`object`:{if(i===null)return`null`;if(o.indexOf(i)!==-1)return n;let e=l,t=``,r=`,`;if(Array.isArray(i)){if(i.length===0)return`[]`;if(_<o.length+1)return`"[Array]"`;o.push(i),c!==``&&(l+=c,t+=`\n${l}`,r=`,\n${l}`);let n=Math.min(i.length,v),a=0;for(;a<n-1;a++){let e=b(String(a),i[a],o,s,c,l);t+=e===void 0?`null`:e,t+=r}let u=b(String(a),i[a],o,s,c,l);if(t+=u===void 0?`null`:u,i.length-1>v){let e=i.length-v-1;t+=`${r}"... ${m(e)} not stringified"`}return c!==``&&(t+=`\n${e}`),o.pop(),`[${t}]`}o.push(i);let u=``;c!==``&&(l+=c,r=`,\n${l}`,u=` `);let d=``;for(let e of s){let n=b(e,i[e],o,s,c,l);n!==void 0&&(t+=`${d}${a(e)}:${u}${n}`,d=r)}return c!==``&&d.length>1&&(t=`\n${l}${t}\n${e}`),o.pop(),`{${t}}`}case`number`:return isFinite(i)?String(i):t?t(i):`null`;case`boolean`:return i===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(i);default:return t?t(i):void 0}}function x(e,u,d,f,p){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return x(e,u,d,f,p);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=p;if(Array.isArray(u)){if(u.length===0)return`[]`;if(_<d.length+1)return`"[Array]"`;d.push(u),p+=f;let e=`\n${p}`,n=`,\n${p}`,r=Math.min(u.length,v),i=0;for(;i<r-1;i++){let t=x(String(i),u[i],d,f,p);e+=t===void 0?`null`:t,e+=n}let a=x(String(i),u[i],d,f,p);if(e+=a===void 0?`null`:a,u.length-1>v){let t=u.length-v-1;e+=`${n}"... ${m(t)} not stringified"`}return e+=`\n${t}`,d.pop(),`[${e}]`}let r=Object.keys(u),h=r.length;if(h===0)return`{}`;if(_<d.length+1)return`"[Object]"`;p+=f;let g=`,\n${p}`,y=``,b=``,S=Math.min(h,v);c(u)&&(y+=l(u,g,v),r=r.slice(u.length),S-=u.length,b=g),i&&(r=o(r,s)),d.push(u);for(let e=0;e<S;e++){let t=r[e],n=x(t,u[t],d,f,p);n!==void 0&&(y+=`${b}${a(t)}: ${n}`,b=g)}if(h>v){let e=h-v;y+=`${b}"...": "${m(e)} not stringified"`,b=g}return b!==``&&(y=`\n${p}${y}\n${t}`),d.pop(),`{${y}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function S(e,u,d){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return S(e,u,d);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=``,r=u.length!==void 0;if(r&&Array.isArray(u)){if(u.length===0)return`[]`;if(_<d.length+1)return`"[Array]"`;d.push(u);let e=Math.min(u.length,v),n=0;for(;n<e-1;n++){let e=S(String(n),u[n],d);t+=e===void 0?`null`:e,t+=`,`}let r=S(String(n),u[n],d);if(t+=r===void 0?`null`:r,u.length-1>v){let e=u.length-v-1;t+=`,"... ${m(e)} not stringified"`}return d.pop(),`[${t}]`}let f=Object.keys(u),p=f.length;if(p===0)return`{}`;if(_<d.length+1)return`"[Object]"`;let h=``,g=Math.min(p,v);r&&c(u)&&(t+=l(u,`,`,v),f=f.slice(u.length),g-=u.length,h=`,`),i&&(f=o(f,s)),d.push(u);for(let e=0;e<g;e++){let n=f[e],r=S(n,u[n],d);r!==void 0&&(t+=`${h}${a(n)}:${r}`,h=`,`)}if(p>v){let e=p-v;t+=`${h}"...":"${m(e)} not stringified"`}return d.pop(),`{${t}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function C(e,t,n){if(arguments.length>1){let r=``;if(typeof n==`number`?r=` `.repeat(Math.min(n,10)):typeof n==`string`&&(r=n.slice(0,10)),t!=null){if(typeof t==`function`)return y(``,{"":e},[],t,r,``);if(Array.isArray(t))return b(``,e,[],h(t),r,``)}if(r.length!==0)return x(``,e,[],r,``)}return S(``,e,[])}return C}})),Kl=/* @__PURE__ */ n(((e,t)=>{let n=Symbol.for(`pino.metadata`),{DEFAULT_LEVELS:r}=Vl(),i=r.info;function a(e,t){e||=[],t||={dedupe:!1};let a=Object.create(r);a.silent=1/0,t.levels&&typeof t.levels==`object`&&Object.keys(t.levels).forEach(e=>{a[e]=t.levels[e]});let u={write:d,add:m,remove:h,emit:f,flushSync:p,end:g,minLevel:0,lastId:0,streams:[],clone:_,[n]:!0,streamLevels:a};return Array.isArray(e)?e.forEach(m,u):m.call(u,e),e=null,u;function d(e){let r,i=typeof this.lastLevel==`string`?(this.streamLevels||a)[this.lastLevel]:this.lastLevel,{streams:o}=this,u=0,d;for(let a=s(o.length,t.dedupe);l(a,o.length,t.dedupe);a=c(a,t.dedupe))if(r=o[a],r.level<=i){if(u!==0&&u!==r.level)break;if(d=r.stream,d[n]){let{lastTime:e,lastMsg:t,lastObj:n,lastLogger:r}=this;d.lastLevel=i,d.lastTime=e,d.lastMsg=t,d.lastObj=n,d.lastLogger=r}d.write(e),t.dedupe&&(u=r.level)}else if(!t.dedupe)break}function f(...e){for(let{stream:t}of this.streams)typeof t.emit==`function`&&t.emit(...e)}function p(){for(let{stream:e}of this.streams)typeof e.flushSync==`function`&&e.flushSync()}function m(e){if(!e)return this;let t=typeof e.write==`function`||e.stream,n=e.write?e:e.stream;if(!t)throw Error(`stream object needs to implement either StreamEntry or DestinationStream interface`);let{streams:r,streamLevels:a}=this,s;s=typeof e.levelVal==`number`?e.levelVal:typeof e.level==`string`?a[e.level]:typeof e.level==`number`?e.level:i;let c={stream:n,level:s,levelVal:void 0,id:++u.lastId};return r.unshift(c),r.sort(o),this.minLevel=r[0].level,this}function h(e){let{streams:t}=this,n=t.findIndex(t=>t.id===e);return n>=0&&(t.splice(n,1),t.sort(o),this.minLevel=t.length>0?t[0].level:-1),this}function g(){for(let{stream:e}of this.streams)typeof e.flushSync==`function`&&e.flushSync(),e.end()}function _(e){let t=Array(this.streams.length);for(let n=0;n<t.length;n++)t[n]={level:e,stream:this.streams[n].stream};return{write:d,add:m,remove:h,emit:f,flushSync:p,end:g,minLevel:e,streams:t,clone:_,[n]:!0,streamLevels:a}}}function o(e,t){return e.level-t.level}function s(e,t){return t?e-1:0}function c(e,t){return t?e-1:e+1}function l(e,t,n){return n?e>=0:e<t}t.exports=a})),ql=/* @__PURE__ */ t((/* @__PURE__ */ n(((e,t)=>{let n=a(`node:os`),r=Tl(),i=El(),o=kl(),s=Al(),c=Wl(),l=Ol(),{configure:u}=Gl(),{assertDefaultLevelFound:d,mappings:f,genLsCache:p,genLevelComparison:m,assertLevelComparison:h}=Hl(),{DEFAULT_LEVELS:g,SORTING_ORDER:_}=Vl(),{createArgsNormalizer:v,asChindings:y,buildSafeSonicBoom:b,buildFormatters:x,stringify:S,normalizeDestFileDescriptor:C,noop:w}=Bl(),{version:T}=Ul(),{chindingsSym:E,redactFmtSym:D,serializersSym:O,timeSym:k,timeSliceIndexSym:A,streamSym:ee,stringifySym:te,stringifySafeSym:ne,stringifiersSym:j,setLevelSym:re,endSym:M,formatOptsSym:N,messageKeySym:ie,errorKeySym:P,nestedKeySym:ae,mixinSym:F,levelCompSym:I,useOnlyCustomLevelsSym:L,formattersSym:oe,hooksSym:se,nestedKeyStrSym:ce,mixinMergeStrategySym:R,msgPrefixSym:le,transportUsesMultistreamSym:ue}=l,{epochTime:de,nullTime:fe}=s,{pid:z}=process,pe=n.hostname(),me=r.err,he=v({level:`info`,levelComparison:_.ASC,levels:g,messageKey:`msg`,errorKey:`err`,nestedKey:null,enabled:!0,base:{pid:z,hostname:pe},serializers:Object.assign(Object.create(null),{err:me}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:de,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100}),ge=Object.assign(Object.create(null),r);function _e(...e){let t={},{opts:n,stream:r}=he(t,i(),...e);n.level&&typeof n.level==`string`&&g[n.level.toLowerCase()]!==void 0&&(n.level=n.level.toLowerCase());let{redact:a,crlf:s,serializers:l,timestamp:_,messageKey:v,errorKey:b,nestedKey:C,base:T,name:z,level:pe,customLevels:me,levelComparison:ge,mixin:_e,mixinMergeStrategy:ve,useOnlyCustomLevels:ye,formatters:be,hooks:xe,depthLimit:Se,edgeLimit:Ce,onChild:we,msgPrefix:Te}=n,Ee=u({maximumDepth:Se,maximumBreadth:Ce}),De=x(be.level,be.bindings,be.log),Oe=S.bind({[ne]:Ee}),ke=a?Object.assign(Object.create(null),o(a,Oe)):Object.create(null),Ae=a?{stringify:ke[D]}:{stringify:Oe},je=`}`+(s?`\r
128
128
  `:`
129
- `),je=y.bind(null,{[E]:``,[O]:l,[M]:Oe,[ee]:S,[te]:Te,[ae]:Ee}),Me=``;T!==null&&(Me=je(B===void 0?T:Object.assign({},T,{name:B})));let V=_ instanceof Function?_:_?ue:de,Ne=V().indexOf(`:`)+1;if(ve&&!pe)throw Error(`customLevels is required if useOnlyCustomLevels is set true`);if(ge&&typeof ge!=`function`)throw Error(`Unknown mixin type "${typeof ge}" - expected "function"`);if(we&&typeof we!=`string`)throw Error(`Unknown msgPrefix type "${typeof we}" - expected "string"`);d(fe,pe,ve);let Pe=f(pe,ve);if(r&&r[le]===!0){let e=typeof fe==`string`?fe:void 0;(!e||Pe[e]===void 0)&&(e=Object.keys(Pe)[0]);let t=Pe[e],n=!1;try{let r=ye.level(e,t);n=r&&typeof r==`object`&&r.level===t}catch{n=!1}n||process.emitWarning(`custom formatters.level detected with multiple transport targets/pipelines; ensure logs include a numeric "level" field or they may be dropped`,{code:`PINO_TRANSPORT_MULTI_TARGETS_LEVEL_FORMATTER`})}typeof r.emit==`function`&&r.emit(`message`,{code:`PINO_CONFIG`,config:{levels:Pe,messageKey:v,errorKey:b}}),h(he);let Fe=m(he);return Object.assign(t,{levels:Pe,[L]:Fe,[R]:ve,[j]:r,[k]:V,[A]:Ne,[ee]:S,[te]:Te,[M]:Oe,[P]:Ae,[F]:ke,[ne]:v,[re]:b,[ie]:C,[se]:C?`,${JSON.stringify(C)}:{`:``,[O]:l,[I]:ge,[z]:_e,[E]:Me,[ae]:Ee,[oe]:be,silent:w,onChild:Ce,[ce]:we}),Object.setPrototypeOf(t,c()),p(t),t[N](fe),t}t.exports=ge,t.exports.destination=(e=process.stdout.fd)=>typeof e==`object`?(e.dest=C(e.dest||process.stdout.fd),b(e)):b({dest:C(e),minLength:0}),t.exports.transport=zl(),t.exports.multistream=Kl(),t.exports.levels=f(),t.exports.stdSerializers=he,t.exports.stdTimeFunctions=Object.assign({},s),t.exports.symbols=l,t.exports.version=T,t.exports.default=ge,t.exports.pino=ge})))(),1);function Jl(e){return{level:e}}function Yl(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}let Xl={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,base:{},formatters:{level:Jl},timestamp:Yl}},Zl=0;function Ql(e){Xl=e,Zl+=1}function $l(){return Xl}function eu(){return Zl}const tu={debug:`debug`,info:`info`,warn:`warn`,error:`error`};function nu(e){return{level:e}}function ru(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function iu(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}const au={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,formatters:{level:nu},timestamp:iu}};var ou=class e{context;config;hasExplicitConfig;builtConfigVersion;pinoLogger;constructor(e,t={},n,r){this.context={module:e,operation:n,trace:r};let i=Object.keys(t).length===0,a=t===$l();this.hasExplicitConfig=!i&&!a,this.config=this.hasExplicitConfig?{...au,...t}:{...au,...$l()},this.builtConfigVersion=eu(),this.pinoLogger=this.buildPinoLogger(this.config)}buildPinoLogger(e){let t={...e.pinoOptions,level:e.minLevel},n=e.pinoOptions?.base;return t.base={...ru(n)?n:{},module:this.context.module},e.transport&&(t.transport=e.transport),e.stream&&!e.transport?(0,ql.default)(t,e.stream):(0,ql.default)(t)}getActivePinoLogger(){if(this.hasExplicitConfig)return this.pinoLogger;let e=eu();return e!==this.builtConfigVersion&&(this.config.minLevel=$l().minLevel??au.minLevel,this.config.transport=$l().transport,this.config.stream=$l().stream,this.pinoLogger=this.buildPinoLogger(this.config),this.builtConfigVersion=e),this.pinoLogger}debug(e,t){this.log(`debug`,e,t)}info(e,t){this.log(`info`,e,t)}warn(e,t){this.log(`warn`,e,t)}error(e,t,n){let r=t===void 0?void 0:ll(t);this.log(`error`,e,n,r)}withOperation(t){return this.hasExplicitConfig?new e(this.context.module,this.config,t,this.context.trace):new e(this.context.module,{},t,this.context.trace)}withTrace(t){return this.hasExplicitConfig?new e(this.context.module,this.config,this.context.operation,t):new e(this.context.module,{},this.context.operation,t)}flush(){return new Promise(e=>{this.getActivePinoLogger().flush(()=>e())})}log(e,t,n,r){if(!this.shouldLog(e))return;let i={...n},a=this.context.operation;a&&(i.operation=a);let o=this.context.trace;if(o&&(i.traceId=o.traceId,i.spanId=o.spanId),r){let e=ml(r).slice(1);i.error={name:r.name,message:r.message,stack:r.stack,...e.length>0?{causeChain:e}:{}}}let s=tu[e],c=`[${this.context.module}${a?`:${a}`:``}] ${t}`;Object.keys(i).length>0?this.getActivePinoLogger()[s](i,c):this.getActivePinoLogger()[s](c)}shouldLog(e){let t=gl[e],n=this.hasExplicitConfig?this.config.minLevel:$l().minLevel??au.minLevel;return t>=gl[n]}getPinoLogger(){return this.getActivePinoLogger()}};function su(e){return new ou(e,$l())}su(`App`);const cu=new re;var lu=class{getCurrentContext(){return cu.getStore()}getCurrentTraceId(){return cu.getStore()?.traceId}getCurrentSpanId(){return cu.getStore()?.spanId}createNewContext(){return{traceId:_l(),spanId:vl()}}createChildContext(e){return{traceId:e.traceId,spanId:vl(),parentSpanId:e.spanId}}runWithContext(e,t){return cu.run(e,t)}runWithNewTrace(e){let t=this.createNewContext();return cu.run(t,e)}runWithChildSpan(e){let t=this.getCurrentContext();if(!t)return this.runWithNewTrace(e);let n=this.createChildContext(t);return cu.run(n,e)}};let uu;function du(e){uu=e}function fu(){return uu?.getCurrentContext()}function pu(){return new lu}var mu=/* @__PURE__ */ n((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=a(`tty`);function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if(n!=="default"){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var r=/*#__PURE__*/ n(t);let{env:i={},argv:o=[],platform:s=``}=typeof process>`u`?{}:process,c=`NO_COLOR`in i||o.includes(`--no-color`),l=`FORCE_COLOR`in i||o.includes(`--color`),u=s===`win32`,d=i.TERM===`dumb`,f=r&&r.isatty&&r.isatty(1)&&i.TERM&&!d,p=`CI`in i&&(`GITHUB_ACTIONS`in i||`GITLAB_CI`in i||`CIRCLECI`in i),m=!c&&(l||u&&!d||f||p),h=(e,t,n,r,i=t.substring(0,e)+r,a=t.substring(e+n.length),o=a.indexOf(n))=>i+(o<0?a:h(o,a,n,r)),g=(e,t,n,r,i)=>e<0?n+t+r:n+h(e,t,r,i)+r,_=(e,t,n=e,r=e.length+1)=>i=>i||i!==``&&i!==void 0?g((``+i).indexOf(t,r),i,e,t,n):``,v=(e,t,n)=>_(`\x1b[${e}m`,`\x1b[${t}m`,n),y={reset:v(0,0),bold:v(1,22,`\x1B[22m\x1B[1m`),dim:v(2,22,`\x1B[22m\x1B[2m`),italic:v(3,23),underline:v(4,24),inverse:v(7,27),hidden:v(8,28),strikethrough:v(9,29),black:v(30,39),red:v(31,39),green:v(32,39),yellow:v(33,39),blue:v(34,39),magenta:v(35,39),cyan:v(36,39),white:v(37,39),gray:v(90,39),bgBlack:v(40,49),bgRed:v(41,49),bgGreen:v(42,49),bgYellow:v(43,49),bgBlue:v(44,49),bgMagenta:v(45,49),bgCyan:v(46,49),bgWhite:v(47,49),blackBright:v(90,39),redBright:v(91,39),greenBright:v(92,39),yellowBright:v(93,39),blueBright:v(94,39),magentaBright:v(95,39),cyanBright:v(96,39),whiteBright:v(97,39),bgBlackBright:v(100,49),bgRedBright:v(101,49),bgGreenBright:v(102,49),bgYellowBright:v(103,49),bgBlueBright:v(104,49),bgMagentaBright:v(105,49),bgCyanBright:v(106,49),bgWhiteBright:v(107,49)},b=({useColor:e=m}={})=>e?y:Object.keys(y).reduce((e,t)=>({...e,[t]:String}),{}),{reset:x,bold:S,dim:C,italic:w,underline:T,inverse:E,hidden:D,strikethrough:O,black:k,red:A,green:j,yellow:ee,blue:te,magenta:M,cyan:N,white:P,gray:F,bgBlack:ne,bgRed:re,bgGreen:ie,bgYellow:I,bgBlue:L,bgMagenta:R,bgCyan:ae,bgWhite:oe,blackBright:se,redBright:z,greenBright:ce,yellowBright:le,blueBright:ue,magentaBright:de,cyanBright:B,whiteBright:fe,bgBlackBright:pe,bgRedBright:me,bgGreenBright:he,bgYellowBright:ge,bgBlueBright:_e,bgMagentaBright:ve,bgCyanBright:ye,bgWhiteBright:be}=b();e.bgBlack=ne,e.bgBlackBright=pe,e.bgBlue=L,e.bgBlueBright=_e,e.bgCyan=ae,e.bgCyanBright=ye,e.bgGreen=ie,e.bgGreenBright=he,e.bgMagenta=R,e.bgMagentaBright=ve,e.bgRed=re,e.bgRedBright=me,e.bgWhite=oe,e.bgWhiteBright=be,e.bgYellow=I,e.bgYellowBright=ge,e.black=k,e.blackBright=se,e.blue=te,e.blueBright=ue,e.bold=S,e.createColors=b,e.cyan=N,e.cyanBright=B,e.dim=C,e.gray=F,e.green=j,e.greenBright=ce,e.hidden=D,e.inverse=E,e.isColorSupported=m,e.italic=w,e.magenta=M,e.magentaBright=de,e.red=A,e.redBright=z,e.reset=x,e.strikethrough=O,e.underline=T,e.white=P,e.whiteBright=fe,e.yellow=ee,e.yellowBright=le})),hu=/* @__PURE__ */ n(((e,t)=>{t.exports=n;function n(e,t){if(e&&t)return n(e)(t);if(typeof e!=`function`)throw TypeError(`need wrapper function`);return Object.keys(e).forEach(function(t){r[t]=e[t]}),r;function r(){for(var t=Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];var r=e.apply(this,t),i=t[t.length-1];return typeof r==`function`&&r!==i&&Object.keys(i).forEach(function(e){r[e]=i[e]}),r}}})),gu=/* @__PURE__ */ n(((e,t)=>{var n=hu();t.exports=n(r),t.exports.strict=n(i),r.proto=r(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return r(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})});function r(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)};return t.onceError=(e.name||"Function wrapped with `once`")+` shouldn't be called more than once`,t.called=!1,t}})),_u=/* @__PURE__ */ n(((e,t)=>{var n=gu(),r=function(){},i=global.Bare?queueMicrotask:process.nextTick.bind(process),a=function(e){return e.setHeader&&typeof e.abort==`function`},o=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},s=function(e,t,c){if(typeof t==`function`)return s(e,null,t);t||={},c=n(c||r);var l=e._writableState,u=e._readableState,d=t.readable||t.readable!==!1&&e.readable,f=t.writable||t.writable!==!1&&e.writable,p=!1,m=function(){e.writable||h()},h=function(){f=!1,d||c.call(e)},g=function(){d=!1,f||c.call(e)},_=function(t){c.call(e,t?/* @__PURE__ */ Error(`exited with error code: `+t):null)},v=function(t){c.call(e,t)},y=function(){i(b)},b=function(){if(!p&&(d&&!(u&&u.ended&&!u.destroyed)||f&&!(l&&l.ended&&!l.destroyed)))return c.call(e,/* @__PURE__ */ Error(`premature close`))},x=function(){e.req.on(`finish`,h)};return a(e)?(e.on(`complete`,h),e.on(`abort`,y),e.req?x():e.on(`request`,x)):f&&!l&&(e.on(`end`,m),e.on(`close`,m)),o(e)&&e.on(`exit`,_),e.on(`end`,g),e.on(`finish`,h),t.error!==!1&&e.on(`error`,v),e.on(`close`,y),function(){p=!0,e.removeListener(`complete`,h),e.removeListener(`abort`,y),e.removeListener(`request`,x),e.req&&e.req.removeListener(`finish`,h),e.removeListener(`end`,m),e.removeListener(`close`,m),e.removeListener(`finish`,h),e.removeListener(`exit`,_),e.removeListener(`end`,g),e.removeListener(`error`,v),e.removeListener(`close`,y)}};t.exports=s})),vu=/* @__PURE__ */ n(((e,t)=>{var n=gu(),r=_u(),i;try{i=a(`fs`)}catch{}var o=function(){},s=typeof process>`u`?!1:/^v?\.0/.test(process.version),c=function(e){return typeof e==`function`},l=function(e){return!s||!i?!1:(e instanceof(i.ReadStream||o)||e instanceof(i.WriteStream||o))&&c(e.close)},u=function(e){return e.setHeader&&c(e.abort)},d=function(e,t,i,a){a=n(a);var s=!1;e.on(`close`,function(){s=!0}),r(e,{readable:t,writable:i},function(e){if(e)return a(e);s=!0,a()});var d=!1;return function(t){if(!s&&!d){if(d=!0,l(e))return e.close(o);if(u(e))return e.abort();if(c(e.destroy))return e.destroy();a(t||/* @__PURE__ */ Error(`stream was destroyed`))}}},f=function(e){e()},p=function(e,t){return e.pipe(t)};t.exports=function(){var e=Array.prototype.slice.call(arguments),t=c(e[e.length-1]||o)&&e.pop()||o;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw Error(`pump requires two streams per minimum`);var n,r=e.map(function(i,a){var o=a<e.length-1;return d(i,o,a>0,function(e){n||=e,e&&r.forEach(f),!o&&(r.forEach(f),t(n))})});return e.reduce(p)}})),yu=/* @__PURE__ */ n(((e,t)=>{let{Transform:n}=a(`stream`),{StringDecoder:r}=a(`string_decoder`),i=Symbol(`last`),o=Symbol(`decoder`);function s(e,t,n){let r;if(this.overflow){if(r=this[o].write(e).split(this.matcher),r.length===1)return n();r.shift(),this.overflow=!1}else this[i]+=this[o].write(e),r=this[i].split(this.matcher);this[i]=r.pop();for(let e=0;e<r.length;e++)try{l(this,this.mapper(r[e]))}catch(e){return n(e)}this.overflow=this[i].length>this.maxLength,this.overflow&&!this.skipOverflow?n(/* @__PURE__ */ Error(`maximum buffer reached`)):n()}function c(e){if(this[i]+=this[o].end(),this[i])try{l(this,this.mapper(this[i]))}catch(t){return e(t)}e()}function l(e,t){t!==void 0&&e.push(t)}function u(e){return e}function d(e,t,a){switch(e||=/\r?\n/,t||=u,a||={},arguments.length){case 1:typeof e==`function`?(t=e,e=/\r?\n/):typeof e==`object`&&!(e instanceof RegExp)&&!e[Symbol.split]&&(a=e,e=/\r?\n/);break;case 2:typeof e==`function`?(a=t,t=e,e=/\r?\n/):typeof t==`object`&&(a=t,t=u)}a=Object.assign({},a),a.autoDestroy=!0,a.transform=s,a.flush=c,a.readableObjectMode=!0;let l=new n(a);return l[i]=``,l[o]=new r(`utf8`),l.matcher=e,l.mapper=t,l.maxLength=a.maxLength,l.skipOverflow=a.skipOverflow||!1,l.overflow=!1,l._destroy=function(e,t){this._writableState.errorEmitted=!1,t(e)},l}t.exports=d})),bu=/* @__PURE__ */ n(((e,t)=>{let n=Symbol.for(`pino.metadata`),r=yu(),{Duplex:i}=a(`stream`),{parentPort:o,workerData:s}=a(`worker_threads`);function c(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}t.exports=function(e,t={}){let a=t.expectPinoConfig===!0&&s?.workerData?.pinoWillSendConfig===!0,u=t.parse===`lines`,d=typeof t.parseLine==`function`?t.parseLine:JSON.parse,f=t.close||l,p=r(function(e){let t;try{t=d(e)}catch(t){this.emit(`unknown`,e,t);return}if(t===null)this.emit(`unknown`,e,`Null value ignored`);else return typeof t!=`object`&&(t={data:t,time:Date.now()}),p[n]&&(p.lastTime=t.time,p.lastLevel=t.level,p.lastObj=t),u?e:t},{autoDestroy:!0});if(p._destroy=function(e,t){let n=f(e,t);n&&typeof n.then==`function`&&n.then(t,t)},t.expectPinoConfig===!0&&s?.workerData?.pinoWillSendConfig!==!0&&setImmediate(()=>{p.emit(`error`,/* @__PURE__ */ Error(`This transport is not compatible with the current version of pino. Please upgrade pino to the latest version.`))}),t.metadata!==!1&&(p[n]=!0,p.lastTime=0,p.lastLevel=0,p.lastObj=null),a){let e={},t=c();return o.on(`message`,function n(r){r.code===`PINO_CONFIG`&&(e=r.config,t.resolve(),o.off(`message`,n))}),Object.defineProperties(p,{levels:{get(){return e.levels}},messageKey:{get(){return e.messageKey}},errorKey:{get(){return e.errorKey}}}),t.then(m)}return m();function m(){let n=e(p);if(n&&typeof n.catch==`function`)n.catch(e=>{p.destroy(e)}),n=null;else if(t.enablePipelining&&n)return i.from({writable:p,readable:n});return p}};function l(e,t){process.nextTick(t,e)}})),xu=/* @__PURE__ */ n(((e,t)=>{t.exports={DATE_FORMAT:`yyyy-mm-dd HH:MM:ss.l o`,DATE_FORMAT_SIMPLE:`HH:MM:ss.l`,ERROR_LIKE_KEYS:[`err`,`error`],MESSAGE_KEY:`msg`,LEVEL_KEY:`level`,LEVEL_LABEL:`levelLabel`,TIMESTAMP_KEY:`time`,LEVELS:{default:`USERLVL`,60:`FATAL`,50:`ERROR`,40:`WARN`,30:`INFO`,20:`DEBUG`,10:`TRACE`},LEVEL_NAMES:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},LOGGER_KEYS:[`pid`,`hostname`,`name`,`level`,`time`,`timestamp`,`caller`]}})),Su=/* @__PURE__ */ n(((e,t)=>{t.exports=i;let{LEVELS:n,LEVEL_NAMES:r}=xu();function i(e,t,i){let a=e?t||n:Object.assign({},n,t),o=e?i||r:Object.assign({},r,i);return function(e){let t=`default`;return t=Number.isInteger(+e)?Object.prototype.hasOwnProperty.call(a,e)?e:t:Object.prototype.hasOwnProperty.call(o,e.toLowerCase())?o[e.toLowerCase()]:t,[a[t],t]}}})),Cu=/* @__PURE__ */ n(((e,t)=>{let n=e=>e,r={default:n,60:n,50:n,40:n,30:n,20:n,10:n,message:n,greyMessage:n,property:n},{createColors:i}=mu(),a=Su(),o=i({useColor:!0}),{white:s,bgRed:c,red:l,yellow:u,green:d,blue:f,gray:p,cyan:m,magenta:h}=o,g={default:s,60:c,50:l,40:u,30:d,20:f,10:p,message:m,greyMessage:p,property:h};function _(e){return e.reduce(function(e,[t,n]){return e[t]=typeof o[n]==`function`?o[n]:s,e},{default:s,message:m,greyMessage:p,property:h})}function v(e){return function(t,n,{customLevels:r,customLevelNames:i}={}){let[o,s]=a(e,r,i)(t);return Object.prototype.hasOwnProperty.call(n,s)?n[s](o):n.default(o)}}function y(e){let t=v(e),n=function(e,n){return t(e,r,n)};return n.message=r.message,n.greyMessage=r.greyMessage,n.property=r.property,n.colors=i({useColor:!1}),n}function b(e){let t=v(e),n=function(e,n){return t(e,g,n)};return n.message=g.message,n.property=g.property,n.greyMessage=g.greyMessage,n.colors=o,n}function x(e,t){let n=_(e),r=t?n:Object.assign({},g,n),i=v(t),a=function(e,t){return i(e,r,t)};return a.colors=o,a.message=a.message||r.message,a.property=a.property||r.property,a.greyMessage=a.greyMessage||r.greyMessage,a}t.exports=function(e=!1,t,n){return e&&t!==void 0?x(t,n):e?b(n):y(n)}})),wu=/* @__PURE__ */ n(((e,t)=>{let n=a(`node:fs`),r=a(`node:events`),i=a(`node:util`).inherits,o=a(`node:path`),s=a(`node:assert`),c=Ml(),l=Buffer.allocUnsafe(0),u=`buffer`,d=`utf8`,f=Symbol(`kFlush`);function p(e){switch(e?.code){case`EBADF`:case`EINVAL`:case`ENOTSUP`:case`EOPNOTSUPP`:case`EROFS`:return!0;default:return!1}}let[m,h]=(process.versions.node||`0.0`).split(`.`).map(Number),g=m>=22&&h>=7;function _(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(n,r){if(n){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount(`error`)>0&&t.emit(`error`,n)}):t.emit(`error`,n);return}let i=t._reopening;t.fd=r,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit(`ready`)):t.emit(`ready`),!t.destroyed&&(!t._writing&&(t._len>t.minLength||t._flushPending)?t._actualWrite():i&&!t._writing&&process.nextTick(x,t))}let i=t.append?`a`:`w`,a=t.mode;if(t.sync)try{t.mkdir&&n.mkdirSync(o.dirname(e),{recursive:!0}),r(null,n.openSync(e,i,a))}catch(e){throw r(e),e}else t.mkdir?n.mkdir(o.dirname(e),{recursive:!0},t=>{if(t)return r(t);n.open(e,i,a,r)}):n.open(e,i,a,r)}function v(e){if(!(this instanceof v))return new v(e);let{fd:t,dest:r,minLength:i,maxLength:a,maxWrite:o,periodicFlush:s,sync:p,append:m=!0,mkdir:h,retryEAGAIN:g,maxWriteRetries:x,fsync:S,contentMode:w,mode:D}=e||{};t||=r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=0,this._flushInProgress=0,this._emittingFlush=!1,this._emittingWrite=!1,this._retryTimer=null,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=a||0,this.maxWrite=o||16384,this._periodicFlush=s||0,this._periodicFlushTimer=void 0,this.sync=p||!1,this.writable=!0,this._fsync=S||!1,this.append=m||!1,this.mode=D,this.retryEAGAIN=g||(()=>!0),this.maxWriteRetries=x||0,this._writeRetries=0,this.mkdir=h||!1;let A,j;if(w===u)this._writingBuf=l,this.write=E,this.flush=k,this.flushSync=te,this._actualWrite=N,A=()=>n.writeSync(this.fd,this._writingBuf),j=()=>n.write(this.fd,this._writingBuf,this.release);else if(w===void 0||w===d)this._writingBuf=``,this.write=T,this.flush=O,this.flushSync=ee,this._actualWrite=M,A=()=>Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`),j=()=>Buffer.isBuffer(this._writingBuf)?n.write(this.fd,this._writingBuf,this.release):n.write(this.fd,this._writingBuf,`utf8`,this.release);else throw Error(`SonicBoom supports "${d}" and "${u}", but passed ${w}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)_(t,this);else throw Error(`SonicBoom supports only file descriptors and files`);if(this.minLength>=this.maxWrite)throw Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(e,t)=>{if(e){let t=e.code===`EAGAIN`||e.code===`EBUSY`;t&&this._writeRetries++;let n=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(t&&!n&&this.retryEAGAIN(e,this._writingBuf.length,this._len-this._writingBuf.length)){if(this.sync)try{c(100),this.release(void 0,0)}catch(e){this.release(e)}else this._retryTimer=setTimeout(()=>{this._retryTimer=null,j()},100)}else this._writing=!1,this.emit(`error`,e);return}t>0&&(this._writeRetries=0);let r=y(this._writingBuf,this._len,t);this._len=r.len,this._writingBuf=r.writingBuf,this._emittingWrite=!0;try{this.emit(`write`,t)}finally{this._emittingWrite=!1}if(this.destroyed){this._writing=!1,this._flushPending>0&&(this._len===0?b(this):this.emit(f,/* @__PURE__ */ Error(`SonicBoom destroyed`)));return}if(this._writingBuf.length){if(!this.sync){j();return}try{do{let e=A(),t=y(this._writingBuf,this._len,e);this._len=t.len,this._writingBuf=t.writingBuf}while(this._writingBuf.length)}catch(e){this.release(e);return}}this._fsync&&n.fsyncSync(this.fd);let i=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):i>0&&(i>this.minLength||this._flushPending)?this._actualWrite():this._ending?i>0?this._actualWrite():(this._writing=!1,C(this)):(this._writing=!1,b(this))},this.on(`newListener`,function(e){(e===`drain`||e===f)&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>{this._flushPending===0&&this._flushInProgress===0&&this.flush(null)},this._periodicFlush),this._periodicFlushTimer.unref())}function y(e,t,n){return typeof e==`string`&&(e=Buffer.from(e)),t=Math.max(t-n,0),e=e.subarray(n),{writingBuf:e,len:t}}function b(e){e.sync?e._asyncDrainScheduled||(e._asyncDrainScheduled=!0,process.nextTick(x,e)):x(e)}function x(e){(e.listenerCount(`drain`)>0||e.listenerCount(f)>0)&&(e._asyncDrainScheduled=!1,!e._writing&&(S(e),!(e._writing||e.destroyed)&&e.listenerCount(`drain`)>0&&e.emit(`drain`)))}function S(e){if(!e._emittingFlush){e._emittingFlush=!0;try{e.emit(f)}finally{e._emittingFlush=!1}}}function C(e){!e._ending||e._writing||e.destroyed||(e._len>0?e._actualWrite():(e._flushPending>0&&S(e),e._flushPending===0&&e._flushInProgress===0&&!e._writing&&e._len===0&&P(e)))}i(v,r);function w(e,t){return e.length===0?l:e.length===1?e[0]:Buffer.concat(e,t)}function T(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);e=``+e;let t=Buffer.byteLength(e),n=this._len+t,r=this._bufs;return this.maxLength&&n>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(r.length===0||Buffer.byteLength(r[r.length-1])+t>this.maxWrite?r.push(e):r[r.length-1]+=e,this._len=n,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function E(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);let t=this._len+e.length,n=this._bufs,r=this._lens;return this.maxLength&&t>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(n.length===0||r[r.length-1]+e.length>this.maxWrite?(n.push([e]),r.push(e.length)):(n[n.length-1].push(e),r[r.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function D(e){this._flushPending++;let t=!0,r=!1,i=!1,a=()=>t?(t=!1,this.off(f,s),this.off(`error`,c),!0):!1,o=(t,n=!0)=>{if(!r){r=!0,i&&this._flushInProgress--;try{e(t)}finally{n&&C(this)}}},s=e=>{if(a()){if(this._flushPending--,e)o(e,!1);else if(this._flushInProgress++,i=!0,!this._fsync&&!this.destroyed)try{n.fsync(this.fd,e=>{p(e)?o():o(e)})}catch(e){o(e)}else o()}},c=e=>{a()&&(this._flushPending--,o(e,!1))};this.once(f,s),this.once(`error`,c)}function O(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0&&!this._writing&&this._len===0?e?.():(e&&D.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(``),this._actualWrite()))}function k(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0&&!this._writing&&this._len===0?e?.():(e&&D.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite()))}v.prototype.reopen=function(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{this.destroyed||this.reopen(e)});return}if(this._ending)return;if(!this.file)throw Error(`Unable to reopen a file descriptor, you must pass a file to SonicBoom`);if(e&&(this.file=e),this._reopening=!0,this._writing)return;let t=this.fd;this.once(`ready`,()=>{t!==this.fd&&n.close(t,e=>{if(e)return this.emit(`error`,e)})}),_(this.file,this)},v.prototype.end=function(){if(this.destroyed)throw Error(`SonicBoom destroyed`);this._opening?this.once(`ready`,()=>{this.destroyed||this.end()}):this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():C(this)))};function A(e){if(e.destroyed)throw Error(`SonicBoom destroyed`);if(e.fd<0)throw Error(`sonic boom is not ready yet`);return!e._writing||e._opening?0:e._retryTimer===null?e._emittingWrite?2:3:(clearTimeout(e._retryTimer),e._retryTimer=null,1)}function j(e){e._writing=!1,process.nextTick(()=>{e.destroyed||e._writing||(e._reopening?(e._reopening=!1,e.reopen()):e._ending?C(e):e._len>0&&(e._len>e.minLength||e._flushPending)?e._actualWrite():x(e))})}function ee(){let e=A(this);try{e!==3&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf=``);let t=``;for(;this._bufs.length||t.length;){t.length<=0&&(t=this._bufs[0]);try{let e=Buffer.isBuffer(t)?n.writeSync(this.fd,t):n.writeSync(this.fd,t,`utf8`);this._writeRetries=0;let r=y(t,this._len,e);t=r.writingBuf,this._len=r.len,t.length<=0&&this._bufs.shift()}catch(e){let n=e.code===`EAGAIN`||e.code===`EBUSY`;n&&this._writeRetries++;let r=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(!n||r||!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;c(100)}}}finally{e===1&&j(this)}try{n.fsyncSync(this.fd)}catch{}}function te(){let e=A(this);try{e!==3&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._lens.unshift(this._writingBuf.length),this._writingBuf=l);let t=l;for(;this._bufs.length||t.length;){t.length<=0&&(t=w(this._bufs[0],this._lens[0]));try{let e=n.writeSync(this.fd,t);this._writeRetries=0,t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(e){let n=e.code===`EAGAIN`||e.code===`EBUSY`;n&&this._writeRetries++;let r=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(!n||r||!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;c(100)}}}finally{e===1&&j(this)}}v.prototype.destroy=function(){if(this.destroyed)return;let e=this._opening;P(this),e&&this._flushPending>0&&this.emit(`error`,/* @__PURE__ */ Error(`SonicBoom destroyed`))};function M(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||``,this.sync)try{e(null,Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`))}catch(t){e(t)}else n.write(this.fd,this._writingBuf,e)}function N(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:w(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,n.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else g&&(this._writingBuf=Buffer.from(this._writingBuf)),n.write(this.fd,this._writingBuf,e)}function P(e){if(e.destroyed)return;if(e.fd===-1){e.destroyed=!0,e.once(`ready`,()=>{e.destroyed=!1,P(e)});return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],e._retryTimer!==null&&(clearTimeout(e._retryTimer),e._retryTimer=null,e._writing=!1),e._flushPending>0&&!e._writing&&e.emit(f,/* @__PURE__ */ Error(`SonicBoom destroyed`)),s(typeof e.fd==`number`,`sonic.fd must be a number, got ${typeof e.fd}`);try{n.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?n.close(e.fd,r):r()}function r(t){t?e.emit(`error`,t):(e._ending&&!e._writing&&e.emit(`finish`),e.emit(`close`))}}v.SonicBoom=v,v.default=v,t.exports=v})),Tu=/* @__PURE__ */ n(((e,t)=>{t.exports=function(){}})),Eu=/* @__PURE__ */ n(((e,t)=>{t.exports=o;let{isMainThread:n}=a(`node:worker_threads`),r=wu(),i=Tu();function o(e){let t=new r(e);return t.on(`error`,a),!e.sync&&n&&s(t),t;function a(e){e.code===`EPIPE`?(t.write=i,t.end=i,t.flushSync=i,t.destroy=i):t.removeListener(`error`,a)}}function s(e){
129
+ `),Me=y.bind(null,{[E]:``,[O]:l,[j]:ke,[te]:S,[ne]:Ee,[oe]:De}),Ne=``;T!==null&&(Ne=Me(z===void 0?T:Object.assign({},T,{name:z})));let B=_ instanceof Function?_:_?de:fe,Pe=B().indexOf(`:`)+1;if(ye&&!me)throw Error(`customLevels is required if useOnlyCustomLevels is set true`);if(_e&&typeof _e!=`function`)throw Error(`Unknown mixin type "${typeof _e}" - expected "function"`);if(Te&&typeof Te!=`string`)throw Error(`Unknown msgPrefix type "${typeof Te}" - expected "string"`);d(pe,me,ye);let Fe=f(me,ye);if(r&&r[ue]===!0){let e=typeof pe==`string`?pe:void 0;e&&Fe[e]!==void 0||(e=Object.keys(Fe)[0]);let t=Fe[e],n=!1;try{let r=be.level(e,t);n=r&&typeof r==`object`&&r.level===t}catch{n=!1}n||process.emitWarning(`custom formatters.level detected with multiple transport targets/pipelines; ensure logs include a numeric "level" field or they may be dropped`,{code:`PINO_TRANSPORT_MULTI_TARGETS_LEVEL_FORMATTER`})}typeof r.emit==`function`&&r.emit(`message`,{code:`PINO_CONFIG`,config:{levels:Fe,messageKey:v,errorKey:b}}),h(ge);let Ie=m(ge);return Object.assign(t,{levels:Fe,[I]:Ie,[L]:ye,[ee]:r,[k]:B,[A]:Pe,[te]:S,[ne]:Ee,[j]:ke,[M]:je,[N]:Ae,[ie]:v,[P]:b,[ae]:C,[ce]:C?`,${JSON.stringify(C)}:{`:``,[O]:l,[F]:_e,[R]:ve,[E]:Ne,[oe]:De,[se]:xe,silent:w,onChild:we,[le]:Te}),Object.setPrototypeOf(t,c()),p(t),t[re](pe),t}t.exports=_e,t.exports.destination=(e=process.stdout.fd)=>typeof e==`object`?(e.dest=C(e.dest||process.stdout.fd),b(e)):b({dest:C(e),minLength:0}),t.exports.transport=zl(),t.exports.multistream=Kl(),t.exports.levels=f(),t.exports.stdSerializers=ge,t.exports.stdTimeFunctions=Object.assign({},s),t.exports.symbols=l,t.exports.version=T,t.exports.default=_e,t.exports.pino=_e})))(),1);function Jl(e){return{level:e}}function Yl(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}let Xl={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,base:{},formatters:{level:Jl},timestamp:Yl}},Zl=0;function Ql(e){Xl=e,Zl+=1}function $l(){return Xl}function eu(){return Zl}const tu={debug:`debug`,info:`info`,warn:`warn`,error:`error`};function nu(e){return{level:e}}function ru(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function iu(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}const au={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,formatters:{level:nu},timestamp:iu}};var ou=class e{context;config;hasExplicitConfig;builtConfigVersion;pinoLogger;constructor(e,t={},n,r){this.context={module:e,operation:n,trace:r};let i=Object.keys(t).length===0,a=t===$l();this.hasExplicitConfig=!i&&!a,this.config=this.hasExplicitConfig?{...au,...t}:{...au,...$l()},this.builtConfigVersion=eu(),this.pinoLogger=this.buildPinoLogger(this.config)}buildPinoLogger(e){let t={...e.pinoOptions,level:e.minLevel},n=e.pinoOptions?.base;return t.base={...ru(n)?n:{},module:this.context.module},e.transport&&(t.transport=e.transport),e.stream&&!e.transport?(0,ql.default)(t,e.stream):(0,ql.default)(t)}getActivePinoLogger(){if(this.hasExplicitConfig)return this.pinoLogger;let e=eu();return e!==this.builtConfigVersion&&(this.config.minLevel=$l().minLevel??au.minLevel,this.config.transport=$l().transport,this.config.stream=$l().stream,this.pinoLogger=this.buildPinoLogger(this.config),this.builtConfigVersion=e),this.pinoLogger}debug(e,t){this.log(`debug`,e,t)}info(e,t){this.log(`info`,e,t)}warn(e,t){this.log(`warn`,e,t)}error(e,t,n){let r=t===void 0?void 0:ll(t);this.log(`error`,e,n,r)}withOperation(t){return this.hasExplicitConfig?new e(this.context.module,this.config,t,this.context.trace):new e(this.context.module,{},t,this.context.trace)}withTrace(t){return this.hasExplicitConfig?new e(this.context.module,this.config,this.context.operation,t):new e(this.context.module,{},this.context.operation,t)}flush(){return new Promise(e=>{this.getActivePinoLogger().flush(()=>e())})}log(e,t,n,r){if(!this.shouldLog(e))return;let i={...n},a=this.context.operation;a&&(i.operation=a);let o=this.context.trace;if(o&&(i.traceId=o.traceId,i.spanId=o.spanId),r){let e=ml(r).slice(1);i.error={name:r.name,message:r.message,stack:r.stack,...e.length>0?{causeChain:e}:{}}}let s=tu[e],c=`[${this.context.module}${a?`:${a}`:``}] ${t}`;Object.keys(i).length>0?this.getActivePinoLogger()[s](i,c):this.getActivePinoLogger()[s](c)}shouldLog(e){let t=gl[e],n=this.hasExplicitConfig?this.config.minLevel:$l().minLevel??au.minLevel;return t>=gl[n]}getPinoLogger(){return this.getActivePinoLogger()}};function su(e){return new ou(e,$l())}su(`App`);const cu=new P;var lu=class{getCurrentContext(){return cu.getStore()}getCurrentTraceId(){return cu.getStore()?.traceId}getCurrentSpanId(){return cu.getStore()?.spanId}createNewContext(){return{traceId:_l(),spanId:vl()}}createChildContext(e){return{traceId:e.traceId,spanId:vl(),parentSpanId:e.spanId}}runWithContext(e,t){return cu.run(e,t)}runWithNewTrace(e){let t=this.createNewContext();return cu.run(t,e)}runWithChildSpan(e){let t=this.getCurrentContext();if(!t)return this.runWithNewTrace(e);let n=this.createChildContext(t);return cu.run(n,e)}};let uu;function du(e){uu=e}function fu(){return uu?.getCurrentContext()}function pu(){return new lu}var mu=/* @__PURE__ */ n((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=a(`tty`);function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if(n!=="default"){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var r=/*#__PURE__*/ n(t);let{env:i={},argv:o=[],platform:s=``}=typeof process>`u`?{}:process,c=`NO_COLOR`in i||o.includes(`--no-color`),l=`FORCE_COLOR`in i||o.includes(`--color`),u=s===`win32`,d=i.TERM===`dumb`,f=r&&r.isatty&&r.isatty(1)&&i.TERM&&!d,p=`CI`in i&&(`GITHUB_ACTIONS`in i||`GITLAB_CI`in i||`CIRCLECI`in i),m=!c&&(l||u&&!d||f||p),h=(e,t,n,r,i=t.substring(0,e)+r,a=t.substring(e+n.length),o=a.indexOf(n))=>i+(o<0?a:h(o,a,n,r)),g=(e,t,n,r,i)=>e<0?n+t+r:n+h(e,t,r,i)+r,_=(e,t,n=e,r=e.length+1)=>i=>i||i!==``&&i!==void 0?g((``+i).indexOf(t,r),i,e,t,n):``,v=(e,t,n)=>_(`\x1b[${e}m`,`\x1b[${t}m`,n),y={reset:v(0,0),bold:v(1,22,`\x1B[22m\x1B[1m`),dim:v(2,22,`\x1B[22m\x1B[2m`),italic:v(3,23),underline:v(4,24),inverse:v(7,27),hidden:v(8,28),strikethrough:v(9,29),black:v(30,39),red:v(31,39),green:v(32,39),yellow:v(33,39),blue:v(34,39),magenta:v(35,39),cyan:v(36,39),white:v(37,39),gray:v(90,39),bgBlack:v(40,49),bgRed:v(41,49),bgGreen:v(42,49),bgYellow:v(43,49),bgBlue:v(44,49),bgMagenta:v(45,49),bgCyan:v(46,49),bgWhite:v(47,49),blackBright:v(90,39),redBright:v(91,39),greenBright:v(92,39),yellowBright:v(93,39),blueBright:v(94,39),magentaBright:v(95,39),cyanBright:v(96,39),whiteBright:v(97,39),bgBlackBright:v(100,49),bgRedBright:v(101,49),bgGreenBright:v(102,49),bgYellowBright:v(103,49),bgBlueBright:v(104,49),bgMagentaBright:v(105,49),bgCyanBright:v(106,49),bgWhiteBright:v(107,49)},b=({useColor:e=m}={})=>e?y:Object.keys(y).reduce((e,t)=>({...e,[t]:String}),{}),{reset:x,bold:S,dim:C,italic:w,underline:T,inverse:E,hidden:D,strikethrough:O,black:k,red:A,green:ee,yellow:te,blue:ne,magenta:j,cyan:re,white:M,gray:N,bgBlack:ie,bgRed:P,bgGreen:ae,bgYellow:F,bgBlue:I,bgMagenta:L,bgCyan:oe,bgWhite:se,blackBright:ce,redBright:R,greenBright:le,yellowBright:ue,blueBright:de,magentaBright:fe,cyanBright:z,whiteBright:pe,bgBlackBright:me,bgRedBright:he,bgGreenBright:ge,bgYellowBright:_e,bgBlueBright:ve,bgMagentaBright:ye,bgCyanBright:be,bgWhiteBright:xe}=b();e.bgBlack=ie,e.bgBlackBright=me,e.bgBlue=I,e.bgBlueBright=ve,e.bgCyan=oe,e.bgCyanBright=be,e.bgGreen=ae,e.bgGreenBright=ge,e.bgMagenta=L,e.bgMagentaBright=ye,e.bgRed=P,e.bgRedBright=he,e.bgWhite=se,e.bgWhiteBright=xe,e.bgYellow=F,e.bgYellowBright=_e,e.black=k,e.blackBright=ce,e.blue=ne,e.blueBright=de,e.bold=S,e.createColors=b,e.cyan=re,e.cyanBright=z,e.dim=C,e.gray=N,e.green=ee,e.greenBright=le,e.hidden=D,e.inverse=E,e.isColorSupported=m,e.italic=w,e.magenta=j,e.magentaBright=fe,e.red=A,e.redBright=R,e.reset=x,e.strikethrough=O,e.underline=T,e.white=M,e.whiteBright=pe,e.yellow=te,e.yellowBright=ue})),hu=/* @__PURE__ */ n(((e,t)=>{t.exports=n;function n(e,t){if(e&&t)return n(e)(t);if(typeof e!=`function`)throw TypeError(`need wrapper function`);return Object.keys(e).forEach(function(t){r[t]=e[t]}),r;function r(){for(var t=Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];var r=e.apply(this,t),i=t[t.length-1];return typeof r==`function`&&r!==i&&Object.keys(i).forEach(function(e){r[e]=i[e]}),r}}})),gu=/* @__PURE__ */ n(((e,t)=>{var n=hu();t.exports=n(r),t.exports.strict=n(i),r.proto=r(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return r(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})});function r(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)};return t.onceError=(e.name||"Function wrapped with `once`")+` shouldn't be called more than once`,t.called=!1,t}})),_u=/* @__PURE__ */ n(((e,t)=>{var n=gu(),r=function(){},i=global.Bare?queueMicrotask:process.nextTick.bind(process),a=function(e){return e.setHeader&&typeof e.abort==`function`},o=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},s=function(e,t,c){if(typeof t==`function`)return s(e,null,t);t||={},c=n(c||r);var l=e._writableState,u=e._readableState,d=t.readable||t.readable!==!1&&e.readable,f=t.writable||t.writable!==!1&&e.writable,p=!1,m=function(){e.writable||h()},h=function(){f=!1,d||c.call(e)},g=function(){d=!1,f||c.call(e)},_=function(t){c.call(e,t?/* @__PURE__ */ Error(`exited with error code: `+t):null)},v=function(t){c.call(e,t)},y=function(){i(b)},b=function(){if(!p&&(d&&!(u&&u.ended&&!u.destroyed)||f&&!(l&&l.ended&&!l.destroyed)))return c.call(e,/* @__PURE__ */ Error(`premature close`))},x=function(){e.req.on(`finish`,h)};return a(e)?(e.on(`complete`,h),e.on(`abort`,y),e.req?x():e.on(`request`,x)):f&&!l&&(e.on(`end`,m),e.on(`close`,m)),o(e)&&e.on(`exit`,_),e.on(`end`,g),e.on(`finish`,h),t.error!==!1&&e.on(`error`,v),e.on(`close`,y),function(){p=!0,e.removeListener(`complete`,h),e.removeListener(`abort`,y),e.removeListener(`request`,x),e.req&&e.req.removeListener(`finish`,h),e.removeListener(`end`,m),e.removeListener(`close`,m),e.removeListener(`finish`,h),e.removeListener(`exit`,_),e.removeListener(`end`,g),e.removeListener(`error`,v),e.removeListener(`close`,y)}};t.exports=s})),vu=/* @__PURE__ */ n(((e,t)=>{var n=gu(),r=_u(),i;try{i=a(`fs`)}catch{}var o=function(){},s=typeof process>`u`?!1:/^v?\.0/.test(process.version),c=function(e){return typeof e==`function`},l=function(e){return!s||!i?!1:(e instanceof(i.ReadStream||o)||e instanceof(i.WriteStream||o))&&c(e.close)},u=function(e){return e.setHeader&&c(e.abort)},d=function(e,t,i,a){a=n(a);var s=!1;e.on(`close`,function(){s=!0}),r(e,{readable:t,writable:i},function(e){if(e)return a(e);s=!0,a()});var d=!1;return function(t){if(!s&&!d){if(d=!0,l(e))return e.close(o);if(u(e))return e.abort();if(c(e.destroy))return e.destroy();a(t||/* @__PURE__ */ Error(`stream was destroyed`))}}},f=function(e){e()},p=function(e,t){return e.pipe(t)};t.exports=function(){var e=Array.prototype.slice.call(arguments),t=c(e[e.length-1]||o)&&e.pop()||o;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw Error(`pump requires two streams per minimum`);var n,r=e.map(function(i,a){var o=a<e.length-1;return d(i,o,a>0,function(e){n||=e,e&&r.forEach(f),!o&&(r.forEach(f),t(n))})});return e.reduce(p)}})),yu=/* @__PURE__ */ n(((e,t)=>{let{Transform:n}=a(`stream`),{StringDecoder:r}=a(`string_decoder`),i=Symbol(`last`),o=Symbol(`decoder`);function s(e,t,n){let r;if(this.overflow){if(r=this[o].write(e).split(this.matcher),r.length===1)return n();r.shift(),this.overflow=!1}else this[i]+=this[o].write(e),r=this[i].split(this.matcher);this[i]=r.pop();for(let e=0;e<r.length;e++)try{l(this,this.mapper(r[e]))}catch(e){return n(e)}this.overflow=this[i].length>this.maxLength,this.overflow&&!this.skipOverflow?n(/* @__PURE__ */ Error(`maximum buffer reached`)):n()}function c(e){if(this[i]+=this[o].end(),this[i])try{l(this,this.mapper(this[i]))}catch(t){return e(t)}e()}function l(e,t){t!==void 0&&e.push(t)}function u(e){return e}function d(e,t,a){switch(e||=/\r?\n/,t||=u,a||={},arguments.length){case 1:typeof e==`function`?(t=e,e=/\r?\n/):typeof e==`object`&&!(e instanceof RegExp)&&!e[Symbol.split]&&(a=e,e=/\r?\n/);break;case 2:typeof e==`function`?(a=t,t=e,e=/\r?\n/):typeof t==`object`&&(a=t,t=u)}a=Object.assign({},a),a.autoDestroy=!0,a.transform=s,a.flush=c,a.readableObjectMode=!0;let l=new n(a);return l[i]=``,l[o]=new r(`utf8`),l.matcher=e,l.mapper=t,l.maxLength=a.maxLength,l.skipOverflow=a.skipOverflow||!1,l.overflow=!1,l._destroy=function(e,t){this._writableState.errorEmitted=!1,t(e)},l}t.exports=d})),bu=/* @__PURE__ */ n(((e,t)=>{let n=Symbol.for(`pino.metadata`),r=yu(),{Duplex:i}=a(`stream`),{parentPort:o,workerData:s}=a(`worker_threads`);function c(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}t.exports=function(e,t={}){let a=t.expectPinoConfig===!0&&s?.workerData?.pinoWillSendConfig===!0,u=t.parse===`lines`,d=typeof t.parseLine==`function`?t.parseLine:JSON.parse,f=t.close||l,p=r(function(e){let t;try{t=d(e)}catch(t){this.emit(`unknown`,e,t);return}if(t===null)this.emit(`unknown`,e,`Null value ignored`);else return typeof t!=`object`&&(t={data:t,time:Date.now()}),p[n]&&(p.lastTime=t.time,p.lastLevel=t.level,p.lastObj=t),u?e:t},{autoDestroy:!0});if(p._destroy=function(e,t){let n=f(e,t);n&&typeof n.then==`function`&&n.then(t,t)},t.expectPinoConfig===!0&&s?.workerData?.pinoWillSendConfig!==!0&&setImmediate(()=>{p.emit(`error`,/* @__PURE__ */ Error(`This transport is not compatible with the current version of pino. Please upgrade pino to the latest version.`))}),t.metadata!==!1&&(p[n]=!0,p.lastTime=0,p.lastLevel=0,p.lastObj=null),a){let e={},t=c();return o.on(`message`,function n(r){r.code===`PINO_CONFIG`&&(e=r.config,t.resolve(),o.off(`message`,n))}),Object.defineProperties(p,{levels:{get(){return e.levels}},messageKey:{get(){return e.messageKey}},errorKey:{get(){return e.errorKey}}}),t.then(m)}return m();function m(){let n=e(p);if(n&&typeof n.catch==`function`)n.catch(e=>{p.destroy(e)}),n=null;else if(t.enablePipelining&&n)return i.from({writable:p,readable:n});return p}};function l(e,t){process.nextTick(t,e)}})),xu=/* @__PURE__ */ n(((e,t)=>{t.exports={DATE_FORMAT:`yyyy-mm-dd HH:MM:ss.l o`,DATE_FORMAT_SIMPLE:`HH:MM:ss.l`,ERROR_LIKE_KEYS:[`err`,`error`],MESSAGE_KEY:`msg`,LEVEL_KEY:`level`,LEVEL_LABEL:`levelLabel`,TIMESTAMP_KEY:`time`,LEVELS:{default:`USERLVL`,60:`FATAL`,50:`ERROR`,40:`WARN`,30:`INFO`,20:`DEBUG`,10:`TRACE`},LEVEL_NAMES:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},LOGGER_KEYS:[`pid`,`hostname`,`name`,`level`,`time`,`timestamp`,`caller`]}})),Su=/* @__PURE__ */ n(((e,t)=>{t.exports=i;let{LEVELS:n,LEVEL_NAMES:r}=xu();function i(e,t,i){let a=e?t||n:Object.assign({},n,t),o=e?i||r:Object.assign({},r,i);return function(e){let t=`default`;return t=Number.isInteger(+e)?Object.prototype.hasOwnProperty.call(a,e)?e:t:Object.prototype.hasOwnProperty.call(o,e.toLowerCase())?o[e.toLowerCase()]:t,[a[t],t]}}})),Cu=/* @__PURE__ */ n(((e,t)=>{let n=e=>e,r={default:n,60:n,50:n,40:n,30:n,20:n,10:n,message:n,greyMessage:n,property:n},{createColors:i}=mu(),a=Su(),o=i({useColor:!0}),{white:s,bgRed:c,red:l,yellow:u,green:d,blue:f,gray:p,cyan:m,magenta:h}=o,g={default:s,60:c,50:l,40:u,30:d,20:f,10:p,message:m,greyMessage:p,property:h};function _(e){return e.reduce(function(e,[t,n]){return e[t]=typeof o[n]==`function`?o[n]:s,e},{default:s,message:m,greyMessage:p,property:h})}function v(e){return function(t,n,{customLevels:r,customLevelNames:i}={}){let[o,s]=a(e,r,i)(t);return Object.prototype.hasOwnProperty.call(n,s)?n[s](o):n.default(o)}}function y(e){let t=v(e),n=function(e,n){return t(e,r,n)};return n.message=r.message,n.greyMessage=r.greyMessage,n.property=r.property,n.colors=i({useColor:!1}),n}function b(e){let t=v(e),n=function(e,n){return t(e,g,n)};return n.message=g.message,n.property=g.property,n.greyMessage=g.greyMessage,n.colors=o,n}function x(e,t){let n=_(e),r=t?n:Object.assign({},g,n),i=v(t),a=function(e,t){return i(e,r,t)};return a.colors=o,a.message=a.message||r.message,a.property=a.property||r.property,a.greyMessage=a.greyMessage||r.greyMessage,a}t.exports=function(e=!1,t,n){return e&&t!==void 0?x(t,n):e?b(n):y(n)}})),wu=/* @__PURE__ */ n(((e,t)=>{let n=a(`node:fs`),r=a(`node:events`),i=a(`node:util`).inherits,o=a(`node:path`),s=a(`node:assert`),c=Ml(),l=Buffer.allocUnsafe(0),u=`buffer`,d=`utf8`,f=Symbol(`kFlush`);function p(e){switch(e?.code){case`EBADF`:case`EINVAL`:case`ENOTSUP`:case`EOPNOTSUPP`:case`EROFS`:return!0;default:return!1}}let[m,h]=(process.versions.node||`0.0`).split(`.`).map(Number),g=m>=22&&h>=7;function _(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(n,r){if(n){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount(`error`)>0&&t.emit(`error`,n)}):t.emit(`error`,n);return}let i=t._reopening;t.fd=r,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit(`ready`)):t.emit(`ready`),!t.destroyed&&(!t._writing&&(t._len>t.minLength||t._flushPending)?t._actualWrite():i&&!t._writing&&process.nextTick(x,t))}let i=t.append?`a`:`w`,a=t.mode;if(t.sync)try{t.mkdir&&n.mkdirSync(o.dirname(e),{recursive:!0}),r(null,n.openSync(e,i,a))}catch(e){throw r(e),e}else t.mkdir?n.mkdir(o.dirname(e),{recursive:!0},t=>{if(t)return r(t);n.open(e,i,a,r)}):n.open(e,i,a,r)}function v(e){if(!(this instanceof v))return new v(e);let{fd:t,dest:r,minLength:i,maxLength:a,maxWrite:o,periodicFlush:s,sync:p,append:m=!0,mkdir:h,retryEAGAIN:g,maxWriteRetries:x,fsync:S,contentMode:w,mode:D}=e||{};t||=r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=0,this._flushInProgress=0,this._emittingFlush=!1,this._emittingWrite=!1,this._retryTimer=null,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=a||0,this.maxWrite=o||16384,this._periodicFlush=s||0,this._periodicFlushTimer=void 0,this.sync=p||!1,this.writable=!0,this._fsync=S||!1,this.append=m||!1,this.mode=D,this.retryEAGAIN=g||(()=>!0),this.maxWriteRetries=x||0,this._writeRetries=0,this.mkdir=h||!1;let A,ee;if(w===u)this._writingBuf=l,this.write=E,this.flush=k,this.flushSync=ne,this._actualWrite=re,A=()=>n.writeSync(this.fd,this._writingBuf),ee=()=>n.write(this.fd,this._writingBuf,this.release);else if(w===void 0||w===d)this._writingBuf=``,this.write=T,this.flush=O,this.flushSync=te,this._actualWrite=j,A=()=>Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`),ee=()=>Buffer.isBuffer(this._writingBuf)?n.write(this.fd,this._writingBuf,this.release):n.write(this.fd,this._writingBuf,`utf8`,this.release);else throw Error(`SonicBoom supports "${d}" and "${u}", but passed ${w}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)_(t,this);else throw Error(`SonicBoom supports only file descriptors and files`);if(this.minLength>=this.maxWrite)throw Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(e,t)=>{if(e){let t=e.code===`EAGAIN`||e.code===`EBUSY`;t&&this._writeRetries++;let n=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(t&&!n&&this.retryEAGAIN(e,this._writingBuf.length,this._len-this._writingBuf.length)){if(this.sync)try{c(100),this.release(void 0,0)}catch(e){this.release(e)}else this._retryTimer=setTimeout(()=>{this._retryTimer=null,ee()},100)}else this._writing=!1,this.emit(`error`,e);return}t>0&&(this._writeRetries=0);let r=y(this._writingBuf,this._len,t);this._len=r.len,this._writingBuf=r.writingBuf,this._emittingWrite=!0;try{this.emit(`write`,t)}finally{this._emittingWrite=!1}if(this.destroyed){this._writing=!1,this._flushPending>0&&(this._len===0?b(this):this.emit(f,/* @__PURE__ */ Error(`SonicBoom destroyed`)));return}if(this._writingBuf.length){if(!this.sync){ee();return}try{do{let e=A(),t=y(this._writingBuf,this._len,e);this._len=t.len,this._writingBuf=t.writingBuf}while(this._writingBuf.length)}catch(e){this.release(e);return}}this._fsync&&n.fsyncSync(this.fd);let i=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):i>0&&(i>this.minLength||this._flushPending)?this._actualWrite():this._ending?i>0?this._actualWrite():(this._writing=!1,C(this)):(this._writing=!1,b(this))},this.on(`newListener`,function(e){(e===`drain`||e===f)&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>{this._flushPending===0&&this._flushInProgress===0&&this.flush(null)},this._periodicFlush),this._periodicFlushTimer.unref())}function y(e,t,n){return typeof e==`string`&&(e=Buffer.from(e)),t=Math.max(t-n,0),e=e.subarray(n),{writingBuf:e,len:t}}function b(e){e.sync?e._asyncDrainScheduled||(e._asyncDrainScheduled=!0,process.nextTick(x,e)):x(e)}function x(e){(e.listenerCount(`drain`)>0||e.listenerCount(f)>0)&&(e._asyncDrainScheduled=!1,!e._writing&&(S(e),!(e._writing||e.destroyed)&&e.listenerCount(`drain`)>0&&e.emit(`drain`)))}function S(e){if(!e._emittingFlush){e._emittingFlush=!0;try{e.emit(f)}finally{e._emittingFlush=!1}}}function C(e){!e._ending||e._writing||e.destroyed||(e._len>0?e._actualWrite():(e._flushPending>0&&S(e),e._flushPending===0&&e._flushInProgress===0&&!e._writing&&e._len===0&&M(e)))}i(v,r);function w(e,t){return e.length===0?l:e.length===1?e[0]:Buffer.concat(e,t)}function T(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);e=``+e;let t=Buffer.byteLength(e),n=this._len+t,r=this._bufs;return this.maxLength&&n>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(r.length===0||Buffer.byteLength(r[r.length-1])+t>this.maxWrite?r.push(e):r[r.length-1]+=e,this._len=n,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function E(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);let t=this._len+e.length,n=this._bufs,r=this._lens;return this.maxLength&&t>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(n.length===0||r[r.length-1]+e.length>this.maxWrite?(n.push([e]),r.push(e.length)):(n[n.length-1].push(e),r[r.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function D(e){this._flushPending++;let t=!0,r=!1,i=!1,a=()=>t?(t=!1,this.off(f,s),this.off(`error`,c),!0):!1,o=(t,n=!0)=>{if(!r){r=!0,i&&this._flushInProgress--;try{e(t)}finally{n&&C(this)}}},s=e=>{if(a()){if(this._flushPending--,e)o(e,!1);else if(this._flushInProgress++,i=!0,!this._fsync&&!this.destroyed)try{n.fsync(this.fd,e=>{p(e)?o():o(e)})}catch(e){o(e)}else o()}},c=e=>{a()&&(this._flushPending--,o(e,!1))};this.once(f,s),this.once(`error`,c)}function O(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0&&!this._writing&&this._len===0?e?.():(e&&D.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(``),this._actualWrite()))}function k(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=/* @__PURE__ */ Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}this.minLength<=0&&!this._writing&&this._len===0?e?.():(e&&D.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite()))}v.prototype.reopen=function(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{this.destroyed||this.reopen(e)});return}if(this._ending)return;if(!this.file)throw Error(`Unable to reopen a file descriptor, you must pass a file to SonicBoom`);if(e&&(this.file=e),this._reopening=!0,this._writing)return;let t=this.fd;this.once(`ready`,()=>{t!==this.fd&&n.close(t,e=>{if(e)return this.emit(`error`,e)})}),_(this.file,this)},v.prototype.end=function(){if(this.destroyed)throw Error(`SonicBoom destroyed`);this._opening?this.once(`ready`,()=>{this.destroyed||this.end()}):this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():C(this)))};function A(e){if(e.destroyed)throw Error(`SonicBoom destroyed`);if(e.fd<0)throw Error(`sonic boom is not ready yet`);return!e._writing||e._opening?0:e._retryTimer===null?e._emittingWrite?2:3:(clearTimeout(e._retryTimer),e._retryTimer=null,1)}function ee(e){e._writing=!1,process.nextTick(()=>{e.destroyed||e._writing||(e._reopening?(e._reopening=!1,e.reopen()):e._ending?C(e):e._len>0&&(e._len>e.minLength||e._flushPending)?e._actualWrite():x(e))})}function te(){let e=A(this);try{e!==3&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf=``);let t=``;for(;this._bufs.length||t.length;){t.length<=0&&(t=this._bufs[0]);try{let e=Buffer.isBuffer(t)?n.writeSync(this.fd,t):n.writeSync(this.fd,t,`utf8`);this._writeRetries=0;let r=y(t,this._len,e);t=r.writingBuf,this._len=r.len,t.length<=0&&this._bufs.shift()}catch(e){let n=e.code===`EAGAIN`||e.code===`EBUSY`;n&&this._writeRetries++;let r=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(!n||r||!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;c(100)}}}finally{e===1&&ee(this)}try{n.fsyncSync(this.fd)}catch{}}function ne(){let e=A(this);try{e!==3&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._lens.unshift(this._writingBuf.length),this._writingBuf=l);let t=l;for(;this._bufs.length||t.length;){t.length<=0&&(t=w(this._bufs[0],this._lens[0]));try{let e=n.writeSync(this.fd,t);this._writeRetries=0,t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(e){let n=e.code===`EAGAIN`||e.code===`EBUSY`;n&&this._writeRetries++;let r=this.maxWriteRetries>0&&this._writeRetries>this.maxWriteRetries;if(!n||r||!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;c(100)}}}finally{e===1&&ee(this)}}v.prototype.destroy=function(){if(this.destroyed)return;let e=this._opening;M(this),e&&this._flushPending>0&&this.emit(`error`,/* @__PURE__ */ Error(`SonicBoom destroyed`))};function j(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||``,this.sync)try{e(null,Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`))}catch(t){e(t)}else n.write(this.fd,this._writingBuf,e)}function re(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:w(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,n.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else g&&(this._writingBuf=Buffer.from(this._writingBuf)),n.write(this.fd,this._writingBuf,e)}function M(e){if(e.destroyed)return;if(e.fd===-1){e.destroyed=!0,e.once(`ready`,()=>{e.destroyed=!1,M(e)});return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],e._retryTimer!==null&&(clearTimeout(e._retryTimer),e._retryTimer=null,e._writing=!1),e._flushPending>0&&!e._writing&&e.emit(f,/* @__PURE__ */ Error(`SonicBoom destroyed`)),s(typeof e.fd==`number`,`sonic.fd must be a number, got ${typeof e.fd}`);try{n.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?n.close(e.fd,r):r()}function r(t){t?e.emit(`error`,t):(e._ending&&!e._writing&&e.emit(`finish`),e.emit(`close`))}}v.SonicBoom=v,v.default=v,t.exports=v})),Tu=/* @__PURE__ */ n(((e,t)=>{t.exports=function(){}})),Eu=/* @__PURE__ */ n(((e,t)=>{t.exports=o;let{isMainThread:n}=a(`node:worker_threads`),r=wu(),i=Tu();function o(e){let t=new r(e);return t.on(`error`,a),!e.sync&&n&&s(t),t;function a(e){e.code===`EPIPE`?(t.write=i,t.end=i,t.flushSync=i,t.destroy=i):t.removeListener(`error`,a)}}function s(e){
130
130
  /* istanbul ignore next */
131
131
  if(global.WeakRef&&global.WeakMap&&global.FinalizationRegistry){let t=Pl();t.register(e,c),e.on(`close`,function(){t.unregister(e)})}}
132
132
  /* istanbul ignore next */
133
133
  function c(e,t){e.destroyed||(t===`beforeExit`?(e.flush(),e.on(`drain`,function(){e.end()})):e.flushSync())}})),Du=/* @__PURE__ */ n(((e,t)=>{t.exports=n;function n(e){return e instanceof Date&&!Number.isNaN(e.getTime())}})),Ou=/* @__PURE__ */ n(((e,t)=>{t.exports=r;let n=Du();function r(e){let t=new Date(e);return n(t)||(t=/* @__PURE__ */ new Date(+e)),t}})),ku=/* @__PURE__ */ n(((e,t)=>{t.exports=n;function n(e){let t=[],n=!1,r=``;for(let i=0;i<e.length;i++){let a=e.charAt(i);a===`\\`?n=!0:n?(n=!1,r+=a):a===`.`?(t.push(r),r=``):r+=a}return r.length&&t.push(r),t}})),Au=/* @__PURE__ */ n(((e,t)=>{t.exports=r;let n=ku();function r(e,t){let r=Array.isArray(t)?t:n(t);for(let t of r){if(!Object.prototype.hasOwnProperty.call(e,t))return;e=e[t]}return e}})),ju=/* @__PURE__ */ n(((e,t)=>{t.exports=i;let n=Au(),r=ku();function i(e,t){let i=r(t),a=i.pop();
134
134
  /* istanbul ignore else */
135
- e=n(e,i),typeof e==`object`&&e&&Object.prototype.hasOwnProperty.call(e,a)&&delete e[a]}})),Mu=/* @__PURE__ */ n((e=>{var t=class extends RangeError{constructor(e){super(`Maximum copy depth of ${String(e)} exceeded; the value copied is nested too deeply.`),this.maxDepth=e,this.name=`MaxDepthExceededError`}};let n=Function.prototype.toString,r=Object.prototype.toString;function i(e){if(!e)return Object.create(null);let t=e.constructor;if(t===Object)return e===Object.prototype?{}:Object.create(e);if(typeof t==`function`&&~n.call(t).indexOf(`[native code]`))try{return new t}catch{}return Object.create(e)}function a(e){let t=e[Symbol.toStringTag];if(t)return t;let n=r.call(e);return n.substring(8,n.length-1)}let{propertyIsEnumerable:o}=Object.prototype,s=Object.getPrototypeOf(Int8Array.prototype).slice;function c(e,t,n,r){let i=Object.getOwnPropertyDescriptor(e,n)||{configurable:!0,enumerable:!0,value:e[n],writable:!0},a=i.get||i.set?i:{configurable:i.configurable,enumerable:i.enumerable,value:r.copier(i.value,r),writable:i.writable};try{Object.defineProperty(t,n,a)}catch{t[n]=a.get?a.get():a.value}}function l(e,t,n){for(let r of Object.getOwnPropertyNames(e))c(e,t,r,n);for(let r of Object.getOwnPropertySymbols(e))c(e,t,r,n);return t}function u(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let r=0;r<e.length;++r)n[r]=t.copier(e[r],t);return n}function d(e,t){let n=new t.Constructor;return t.cache.set(e,n),l(e,n,t)}function f(e,t){return ArrayBuffer.isView(e)?s.call(e,0):e.slice(0)}function p(e,t){return e.slice(0,e.size,e.type)}function m(e,t){return new t.Constructor(f(e.buffer),e.byteOffset,e.byteLength)}function h(e,t){return new t.Constructor(e.getTime())}function g(e,t){let n=h(e,t);return t.cache.set(e,n),l(e,n,t)}function _(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let[r,i]of e)n.set(r,t.copier(i,t));return n}function v(e,t){return l(e,_(e,t),t)}function y(e,t){let n=i(t.prototype);t.cache.set(e,n);for(let r of Object.keys(e))r===`__proto__`?Object.defineProperty(n,r,{configurable:!0,enumerable:!0,value:t.copier(e[r],t),writable:!0}):n[r]=t.copier(e[r],t);for(let r of Object.getOwnPropertySymbols(e))o.call(e,r)&&(n[r]=t.copier(e[r],t));return n}function b(e,t){let n=i(t.prototype);return t.cache.set(e,n),l(e,n,t)}function x(e,t){return new t.Constructor(e.valueOf())}function S(e,t){let n=new t.Constructor(e.source,e.flags);return n.lastIndex=e.lastIndex,n}function C(e,t){return e}function w(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let r of e)n.add(t.copier(r,t));return n}function T(e,t){return l(e,w(e,t),t)}function E(){return/* @__PURE__ */ new WeakMap}function D({createCache:e,maxDepth:t,methods:n,strict:r}){let i={array:r?d:u,arrayBuffer:f,asyncGenerator:C,blob:p,dataView:m,date:r?g:h,error:C,generator:C,map:r?v:_,object:r?b:y,regExp:S,set:r?T:w},a=n?Object.assign(i,n):i,o=O(a),s=e||E;if(!o.Object||!o.Array)throw Error(`An object and array copier must be provided.`);return{createCache:s,copiers:o,maxDepth:t??1e3,methods:a,strict:!!r}}function O(e){return Object.assign(Object.create(null),{Arguments:e.object,Array:e.array,ArrayBuffer:e.arrayBuffer,AsyncGenerator:e.asyncGenerator,BigInt64Array:e.arrayBuffer,BigUint64Array:e.arrayBuffer,Blob:e.blob,Boolean:x,DataView:e.dataView,Date:e.date,Error:e.error,Float32Array:e.arrayBuffer,Float64Array:e.arrayBuffer,Generator:e.generator,Int8Array:e.arrayBuffer,Int16Array:e.arrayBuffer,Int32Array:e.arrayBuffer,Map:e.map,Number:x,Object:e.object,Promise:C,RegExp:e.regExp,Set:e.set,String:x,WeakMap:C,WeakSet:C,Uint8Array:e.arrayBuffer,Uint8ClampedArray:e.arrayBuffer,Uint16Array:e.arrayBuffer,Uint32Array:e.arrayBuffer})}function k(e={}){let{createCache:n,copiers:r,maxDepth:i}=D(e),{Array:o,Object:s}=r;function c(e,n){if(n.prototype=n.Constructor=void 0,!e||typeof e!=`object`)return e;if(n.cache.has(e))return n.cache.get(e);if(++n.depth>i)throw new t(i);n.prototype=Object.getPrototypeOf(e),n.Constructor=n.prototype&&n.prototype.constructor;let c;if(!n.Constructor||n.Constructor===Object)c=s(e,n);else if(Array.isArray(e))c=o(e,n);else{let t=r[a(e)];c=t?t(e,n):typeof e.then==`function`?e:s(e,n)}return--n.depth,c}return function(e){return c(e,{Constructor:void 0,cache:n(),copier:c,depth:0,prototype:void 0})}}let A=k({strict:!0}),j=k();e.MaxDepthExceededError=t,e.copy=j,e.copyStrict=A,e.createCopier=k})),Nu=/* @__PURE__ */ n(((e,t)=>{t.exports=l;let{createCopier:n}=Mu(),r=n({}),i=ju(),a=Au(),o=ku();function s(e,t){let n=o(t);if(n.length===0)return!1;let r=e;for(let e of n){if(typeof r!=`object`||!r||!Object.prototype.hasOwnProperty.call(r,e))return!1;r=r[e]}return!0}function c(e,t,n){let r=o(t),i=r.pop(),a=e;for(let e of r)(a[e]===null||typeof a[e]!=`object`)&&(a[e]={}),a=a[e];a[i]=n}function l({log:e,context:t}){let{ignoreKeys:n,includeKeys:o}=t,l=r(e);if(o){let e={};return o.forEach(t=>{s(l,t)&&c(e,t,a(l,t))}),e}return n.forEach(e=>{i(l,e)}),l}})),Pu=/* @__PURE__ */ n(((e,t)=>{function n(e){"@babel/helpers - typeof";return n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n(e)}(function(r){var i=arguments,a=function(){var e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,t=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g;return function(r,d,f,p){if(i.length===1&&u(r)===`string`&&!/\d/.test(r)&&(d=r,r=void 0),r=r||r===0?r:/* @__PURE__ */ new Date,r instanceof Date||(r=new Date(r)),isNaN(r))throw TypeError(`Invalid date`);d=String(a.masks[d]||d||a.masks.default);var m=d.slice(0,4);(m===`UTC:`||m===`GMT:`)&&(d=d.slice(4),f=!0,m===`GMT:`&&(p=!0));var h=function(){return f?`getUTC`:`get`},g=function(){return r[h()+`Date`]()},_=function(){return r[h()+`Day`]()},v=function(){return r[h()+`Month`]()},y=function(){return r[h()+`FullYear`]()},b=function(){return r[h()+`Hours`]()},x=function(){return r[h()+`Minutes`]()},S=function(){return r[h()+`Seconds`]()},C=function(){return r[h()+`Milliseconds`]()},w=function(){return f?0:r.getTimezoneOffset()},T=function(){return c(r)},E=function(){return l(r)},D={d:function(){return g()},dd:function(){return o(g())},ddd:function(){return a.i18n.dayNames[_()]},DDD:function(){return s({y:y(),m:v(),d:g(),_:h(),dayName:a.i18n.dayNames[_()],short:!0})},dddd:function(){return a.i18n.dayNames[_()+7]},DDDD:function(){return s({y:y(),m:v(),d:g(),_:h(),dayName:a.i18n.dayNames[_()+7]})},m:function(){return v()+1},mm:function(){return o(v()+1)},mmm:function(){return a.i18n.monthNames[v()]},mmmm:function(){return a.i18n.monthNames[v()+12]},yy:function(){return String(y()).slice(2)},yyyy:function(){return o(y(),4)},h:function(){return b()%12||12},hh:function(){return o(b()%12||12)},H:function(){return b()},HH:function(){return o(b())},M:function(){return x()},MM:function(){return o(x())},s:function(){return S()},ss:function(){return o(S())},l:function(){return o(C(),3)},L:function(){return o(Math.floor(C()/10))},t:function(){return b()<12?a.i18n.timeNames[0]:a.i18n.timeNames[1]},tt:function(){return b()<12?a.i18n.timeNames[2]:a.i18n.timeNames[3]},T:function(){return b()<12?a.i18n.timeNames[4]:a.i18n.timeNames[5]},TT:function(){return b()<12?a.i18n.timeNames[6]:a.i18n.timeNames[7]},Z:function(){return p?`GMT`:f?`UTC`:(String(r).match(t)||[``]).pop().replace(n,``).replace(/GMT\+0000/g,`UTC`)},o:function(){return(w()>0?`-`:`+`)+o(Math.floor(Math.abs(w())/60)*100+Math.abs(w())%60,4)},p:function(){return(w()>0?`-`:`+`)+o(Math.floor(Math.abs(w())/60),2)+`:`+o(Math.floor(Math.abs(w())%60),2)},S:function(){return[`th`,`st`,`nd`,`rd`][g()%10>3?0:(g()%100-g()%10!=10)*g()%10]},W:function(){return T()},WW:function(){return o(T())},N:function(){return E()}};return d.replace(e,function(e){return e in D?D[e]():e.slice(1,e.length-1)})}}();a.masks={default:`ddd mmm dd yyyy HH:MM:ss`,shortDate:`m/d/yy`,paddedShortDate:`mm/dd/yyyy`,mediumDate:`mmm d, yyyy`,longDate:`mmmm d, yyyy`,fullDate:`dddd, mmmm d, yyyy`,shortTime:`h:MM TT`,mediumTime:`h:MM:ss TT`,longTime:`h:MM:ss TT Z`,isoDate:`yyyy-mm-dd`,isoTime:`HH:MM:ss`,isoDateTime:`yyyy-mm-dd'T'HH:MM:sso`,isoUtcDateTime:`UTC:yyyy-mm-dd'T'HH:MM:ss'Z'`,expiresHeaderFormat:`ddd, dd mmm yyyy HH:MM:ss Z`},a.i18n={dayNames:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],monthNames:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`,`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],timeNames:[`a`,`p`,`am`,`pm`,`A`,`P`,`AM`,`PM`]};var o=function(e,t){for(e=String(e),t||=2;e.length<t;)e=`0`+e;return e},s=function(e){var t=e.y,n=e.m,r=e.d,i=e._,a=e.dayName,o=e.short,s=o!==void 0&&o,c=/* @__PURE__ */ new Date,l=/* @__PURE__ */ new Date;l.setDate(l[i+`Date`]()-1);var u=/* @__PURE__ */ new Date;return u.setDate(u[i+`Date`]()+1),function(){return c[i+`FullYear`]()}()===t&&function(){return c[i+`Month`]()}()===n&&function(){return c[i+`Date`]()}()===r?s?`Tdy`:`Today`:function(){return l[i+`FullYear`]()}()===t&&function(){return l[i+`Month`]()}()===n&&function(){return l[i+`Date`]()}()===r?s?`Ysd`:`Yesterday`:function(){return u[i+`FullYear`]()}()===t&&function(){return u[i+`Month`]()}()===n&&function(){return u[i+`Date`]()}()===r?s?`Tmw`:`Tomorrow`:a},c=function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-r);var i=(t-n)/6048e5;return 1+Math.floor(i)},l=function(e){var t=e.getDay();return t===0&&(t=7),t},u=function(e){return e===null?`null`:e===void 0?`undefined`:n(e)===`object`?Array.isArray(e)?`array`:{}.toString.call(e).slice(8,-1).toLowerCase():n(e)};typeof define==`function`&&define.amd?define(function(){return a}):(e===void 0?`undefined`:n(e))===`object`?t.exports=a:r.dateFormat=a})(void 0)})),Fu=/* @__PURE__ */ n(((e,t)=>{t.exports=s;let{DATE_FORMAT:n,DATE_FORMAT_SIMPLE:r}=xu(),i=Pu(),a=Ou(),o=Du();function s(e,t=!1){if(t===!1)return e;let s=a(e);if(!o(s))return e;if(t===!0)return i(s,r);let c=t.toUpperCase();if(c===`SYS:STANDARD`)return i(s,n);let l=c.substr(0,4);return l===`SYS:`||l===`UTC:`?l===`UTC:`?i(s,t):i(s,t.slice(4)):i(s,`UTC:${t}`)}})),Iu=/* @__PURE__ */ n(((e,t)=>{t.exports=n;function n(e){return e?typeof e==`string`?e.split(`,`).reduce((e,t,n)=>{let[r,i=n]=t.split(`:`);return e[r.toLowerCase()]=i,e},{}):Object.prototype.toString.call(e)===`[object Object]`?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}:{}}})),Lu=/* @__PURE__ */ n(((e,t)=>{t.exports=n;function n(e){return e?typeof e==`string`?e.split(`,`).reduce((e,t,n)=>{let[r,i=n]=t.split(`:`);return e[i]=r.toUpperCase(),e},{default:`USERLVL`}):Object.prototype.toString.call(e)===`[object Object]`?Object.keys(e).reduce((t,n)=>(t[e[n]]=n.toUpperCase(),t),{default:`USERLVL`}):{}:{}}})),Ru=/* @__PURE__ */ n(((e,t)=>{t.exports=r;let n=Au();function r(e,t){return e=e.replace(/{if (.*?)}([\s\S]*?){end}/g,r),e=e.replace(/{if (.*?)}/g,``),e=e.replace(/{end}/g,``),e=e.replace(/[^\S\r\n]+/g,` `),e=e.replace(/\n[^\S\r\n]*\n/g,`
135
+ e=n(e,i),typeof e==`object`&&e&&Object.prototype.hasOwnProperty.call(e,a)&&delete e[a]}})),Mu=/* @__PURE__ */ n((e=>{var t=class extends RangeError{constructor(e){super(`Maximum copy depth of ${String(e)} exceeded; the value copied is nested too deeply.`),this.maxDepth=e,this.name=`MaxDepthExceededError`}};let n=Function.prototype.toString,r=Object.prototype.toString;function i(e){if(!e)return Object.create(null);let t=e.constructor;if(t===Object)return e===Object.prototype?{}:Object.create(e);if(typeof t==`function`&&~n.call(t).indexOf(`[native code]`))try{return new t}catch{}return Object.create(e)}function a(e){let t=e[Symbol.toStringTag];if(t)return t;let n=r.call(e);return n.substring(8,n.length-1)}let{propertyIsEnumerable:o}=Object.prototype,s=Object.getPrototypeOf(Int8Array.prototype).slice;function c(e,t,n,r){let i=Object.getOwnPropertyDescriptor(e,n)||{configurable:!0,enumerable:!0,value:e[n],writable:!0},a=i.get||i.set?i:{configurable:i.configurable,enumerable:i.enumerable,value:r.copier(i.value,r),writable:i.writable};try{Object.defineProperty(t,n,a)}catch{t[n]=a.get?a.get():a.value}}function l(e,t,n){for(let r of Object.getOwnPropertyNames(e))c(e,t,r,n);for(let r of Object.getOwnPropertySymbols(e))c(e,t,r,n);return t}function u(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let r=0;r<e.length;++r)n[r]=t.copier(e[r],t);return n}function d(e,t){let n=new t.Constructor;return t.cache.set(e,n),l(e,n,t)}function f(e,t){return ArrayBuffer.isView(e)?s.call(e,0):e.slice(0)}function p(e,t){return e.slice(0,e.size,e.type)}function m(e,t){return new t.Constructor(f(e.buffer),e.byteOffset,e.byteLength)}function h(e,t){return new t.Constructor(e.getTime())}function g(e,t){let n=h(e,t);return t.cache.set(e,n),l(e,n,t)}function _(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let[r,i]of e)n.set(r,t.copier(i,t));return n}function v(e,t){return l(e,_(e,t),t)}function y(e,t){let n=i(t.prototype);t.cache.set(e,n);for(let r of Object.keys(e))r===`__proto__`?Object.defineProperty(n,r,{configurable:!0,enumerable:!0,value:t.copier(e[r],t),writable:!0}):n[r]=t.copier(e[r],t);for(let r of Object.getOwnPropertySymbols(e))o.call(e,r)&&(n[r]=t.copier(e[r],t));return n}function b(e,t){let n=i(t.prototype);return t.cache.set(e,n),l(e,n,t)}function x(e,t){return new t.Constructor(e.valueOf())}function S(e,t){let n=new t.Constructor(e.source,e.flags);return n.lastIndex=e.lastIndex,n}function C(e,t){return e}function w(e,t){let n=new t.Constructor;t.cache.set(e,n);for(let r of e)n.add(t.copier(r,t));return n}function T(e,t){return l(e,w(e,t),t)}function E(){return/* @__PURE__ */ new WeakMap}function D({createCache:e,maxDepth:t,methods:n,strict:r}){let i={array:r?d:u,arrayBuffer:f,asyncGenerator:C,blob:p,dataView:m,date:r?g:h,error:C,generator:C,map:r?v:_,object:r?b:y,regExp:S,set:r?T:w},a=n?Object.assign(i,n):i,o=O(a),s=e||E;if(!o.Object||!o.Array)throw Error(`An object and array copier must be provided.`);return{createCache:s,copiers:o,maxDepth:t??1e3,methods:a,strict:!!r}}function O(e){return Object.assign(Object.create(null),{Arguments:e.object,Array:e.array,ArrayBuffer:e.arrayBuffer,AsyncGenerator:e.asyncGenerator,BigInt64Array:e.arrayBuffer,BigUint64Array:e.arrayBuffer,Blob:e.blob,Boolean:x,DataView:e.dataView,Date:e.date,Error:e.error,Float32Array:e.arrayBuffer,Float64Array:e.arrayBuffer,Generator:e.generator,Int8Array:e.arrayBuffer,Int16Array:e.arrayBuffer,Int32Array:e.arrayBuffer,Map:e.map,Number:x,Object:e.object,Promise:C,RegExp:e.regExp,Set:e.set,String:x,WeakMap:C,WeakSet:C,Uint8Array:e.arrayBuffer,Uint8ClampedArray:e.arrayBuffer,Uint16Array:e.arrayBuffer,Uint32Array:e.arrayBuffer})}function k(e={}){let{createCache:n,copiers:r,maxDepth:i}=D(e),{Array:o,Object:s}=r;function c(e,n){if(n.prototype=n.Constructor=void 0,!e||typeof e!=`object`)return e;if(n.cache.has(e))return n.cache.get(e);if(++n.depth>i)throw new t(i);n.prototype=Object.getPrototypeOf(e),n.Constructor=n.prototype&&n.prototype.constructor;let c;if(!n.Constructor||n.Constructor===Object)c=s(e,n);else if(Array.isArray(e))c=o(e,n);else{let t=r[a(e)];c=t?t(e,n):typeof e.then==`function`?e:s(e,n)}return--n.depth,c}return function(e){return c(e,{Constructor:void 0,cache:n(),copier:c,depth:0,prototype:void 0})}}let A=k({strict:!0}),ee=k();e.MaxDepthExceededError=t,e.copy=ee,e.copyStrict=A,e.createCopier=k})),Nu=/* @__PURE__ */ n(((e,t)=>{t.exports=l;let{createCopier:n}=Mu(),r=n({}),i=ju(),a=Au(),o=ku();function s(e,t){let n=o(t);if(n.length===0)return!1;let r=e;for(let e of n){if(typeof r!=`object`||!r||!Object.prototype.hasOwnProperty.call(r,e))return!1;r=r[e]}return!0}function c(e,t,n){let r=o(t),i=r.pop(),a=e;for(let e of r)(a[e]===null||typeof a[e]!=`object`)&&(a[e]={}),a=a[e];a[i]=n}function l({log:e,context:t}){let{ignoreKeys:n,includeKeys:o}=t,l=r(e);if(o){let e={};return o.forEach(t=>{s(l,t)&&c(e,t,a(l,t))}),e}return n.forEach(e=>{i(l,e)}),l}})),Pu=/* @__PURE__ */ n(((e,t)=>{function n(e){"@babel/helpers - typeof";return n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n(e)}(function(r){var i=arguments,a=function(){var e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,t=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g;return function(r,d,f,p){if(i.length===1&&u(r)===`string`&&!/\d/.test(r)&&(d=r,r=void 0),r=r||r===0?r:/* @__PURE__ */ new Date,r instanceof Date||(r=new Date(r)),isNaN(r))throw TypeError(`Invalid date`);d=String(a.masks[d]||d||a.masks.default);var m=d.slice(0,4);(m===`UTC:`||m===`GMT:`)&&(d=d.slice(4),f=!0,m===`GMT:`&&(p=!0));var h=function(){return f?`getUTC`:`get`},g=function(){return r[h()+`Date`]()},_=function(){return r[h()+`Day`]()},v=function(){return r[h()+`Month`]()},y=function(){return r[h()+`FullYear`]()},b=function(){return r[h()+`Hours`]()},x=function(){return r[h()+`Minutes`]()},S=function(){return r[h()+`Seconds`]()},C=function(){return r[h()+`Milliseconds`]()},w=function(){return f?0:r.getTimezoneOffset()},T=function(){return c(r)},E=function(){return l(r)},D={d:function(){return g()},dd:function(){return o(g())},ddd:function(){return a.i18n.dayNames[_()]},DDD:function(){return s({y:y(),m:v(),d:g(),_:h(),dayName:a.i18n.dayNames[_()],short:!0})},dddd:function(){return a.i18n.dayNames[_()+7]},DDDD:function(){return s({y:y(),m:v(),d:g(),_:h(),dayName:a.i18n.dayNames[_()+7]})},m:function(){return v()+1},mm:function(){return o(v()+1)},mmm:function(){return a.i18n.monthNames[v()]},mmmm:function(){return a.i18n.monthNames[v()+12]},yy:function(){return String(y()).slice(2)},yyyy:function(){return o(y(),4)},h:function(){return b()%12||12},hh:function(){return o(b()%12||12)},H:function(){return b()},HH:function(){return o(b())},M:function(){return x()},MM:function(){return o(x())},s:function(){return S()},ss:function(){return o(S())},l:function(){return o(C(),3)},L:function(){return o(Math.floor(C()/10))},t:function(){return b()<12?a.i18n.timeNames[0]:a.i18n.timeNames[1]},tt:function(){return b()<12?a.i18n.timeNames[2]:a.i18n.timeNames[3]},T:function(){return b()<12?a.i18n.timeNames[4]:a.i18n.timeNames[5]},TT:function(){return b()<12?a.i18n.timeNames[6]:a.i18n.timeNames[7]},Z:function(){return p?`GMT`:f?`UTC`:(String(r).match(t)||[``]).pop().replace(n,``).replace(/GMT\+0000/g,`UTC`)},o:function(){return(w()>0?`-`:`+`)+o(Math.floor(Math.abs(w())/60)*100+Math.abs(w())%60,4)},p:function(){return(w()>0?`-`:`+`)+o(Math.floor(Math.abs(w())/60),2)+`:`+o(Math.floor(Math.abs(w())%60),2)},S:function(){return[`th`,`st`,`nd`,`rd`][g()%10>3?0:(g()%100-g()%10!=10)*g()%10]},W:function(){return T()},WW:function(){return o(T())},N:function(){return E()}};return d.replace(e,function(e){return e in D?D[e]():e.slice(1,e.length-1)})}}();a.masks={default:`ddd mmm dd yyyy HH:MM:ss`,shortDate:`m/d/yy`,paddedShortDate:`mm/dd/yyyy`,mediumDate:`mmm d, yyyy`,longDate:`mmmm d, yyyy`,fullDate:`dddd, mmmm d, yyyy`,shortTime:`h:MM TT`,mediumTime:`h:MM:ss TT`,longTime:`h:MM:ss TT Z`,isoDate:`yyyy-mm-dd`,isoTime:`HH:MM:ss`,isoDateTime:`yyyy-mm-dd'T'HH:MM:sso`,isoUtcDateTime:`UTC:yyyy-mm-dd'T'HH:MM:ss'Z'`,expiresHeaderFormat:`ddd, dd mmm yyyy HH:MM:ss Z`},a.i18n={dayNames:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],monthNames:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`,`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],timeNames:[`a`,`p`,`am`,`pm`,`A`,`P`,`AM`,`PM`]};var o=function(e,t){for(e=String(e),t||=2;e.length<t;)e=`0`+e;return e},s=function(e){var t=e.y,n=e.m,r=e.d,i=e._,a=e.dayName,o=e.short,s=o!==void 0&&o,c=/* @__PURE__ */ new Date,l=/* @__PURE__ */ new Date;l.setDate(l[i+`Date`]()-1);var u=/* @__PURE__ */ new Date;return u.setDate(u[i+`Date`]()+1),function(){return c[i+`FullYear`]()}()===t&&function(){return c[i+`Month`]()}()===n&&function(){return c[i+`Date`]()}()===r?s?`Tdy`:`Today`:function(){return l[i+`FullYear`]()}()===t&&function(){return l[i+`Month`]()}()===n&&function(){return l[i+`Date`]()}()===r?s?`Ysd`:`Yesterday`:function(){return u[i+`FullYear`]()}()===t&&function(){return u[i+`Month`]()}()===n&&function(){return u[i+`Date`]()}()===r?s?`Tmw`:`Tomorrow`:a},c=function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-r);var i=(t-n)/6048e5;return 1+Math.floor(i)},l=function(e){var t=e.getDay();return t===0&&(t=7),t},u=function(e){return e===null?`null`:e===void 0?`undefined`:n(e)===`object`?Array.isArray(e)?`array`:{}.toString.call(e).slice(8,-1).toLowerCase():n(e)};typeof define==`function`&&define.amd?define(function(){return a}):(e===void 0?`undefined`:n(e))===`object`?t.exports=a:r.dateFormat=a})(void 0)})),Fu=/* @__PURE__ */ n(((e,t)=>{t.exports=s;let{DATE_FORMAT:n,DATE_FORMAT_SIMPLE:r}=xu(),i=Pu(),a=Ou(),o=Du();function s(e,t=!1){if(t===!1)return e;let s=a(e);if(!o(s))return e;if(t===!0)return i(s,r);let c=t.toUpperCase();if(c===`SYS:STANDARD`)return i(s,n);let l=c.substr(0,4);return l===`SYS:`||l===`UTC:`?l===`UTC:`?i(s,t):i(s,t.slice(4)):i(s,`UTC:${t}`)}})),Iu=/* @__PURE__ */ n(((e,t)=>{t.exports=n;function n(e){return e?typeof e==`string`?e.split(`,`).reduce((e,t,n)=>{let[r,i=n]=t.split(`:`);return e[r.toLowerCase()]=i,e},{}):Object.prototype.toString.call(e)===`[object Object]`?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}:{}}})),Lu=/* @__PURE__ */ n(((e,t)=>{t.exports=n;function n(e){return e?typeof e==`string`?e.split(`,`).reduce((e,t,n)=>{let[r,i=n]=t.split(`:`);return e[i]=r.toUpperCase(),e},{default:`USERLVL`}):Object.prototype.toString.call(e)===`[object Object]`?Object.keys(e).reduce((t,n)=>(t[e[n]]=n.toUpperCase(),t),{default:`USERLVL`}):{}:{}}})),Ru=/* @__PURE__ */ n(((e,t)=>{t.exports=r;let n=Au();function r(e,t){return e=e.replace(/{if (.*?)}([\s\S]*?){end}/g,r),e=e.replace(/{if (.*?)}/g,``),e=e.replace(/{end}/g,``),e=e.replace(/[^\S\r\n]+/g,` `),e=e.replace(/\n[^\S\r\n]*\n/g,`
136
136
  `),e.trim();function r(e,r,i){let a=n(t,r);return a&&i.includes(r)?i.replace(RegExp(`{`+r+`}`,`g`),a):``}}})),zu=/* @__PURE__ */ n(((e,t)=>{t.exports=n;function n(e){return Object.prototype.toString.apply(e)===`[object Object]`}})),Bu=/* @__PURE__ */ n(((e,t)=>{t.exports=n;function n({input:e,ident:t=` `,eol:n=`
137
137
  `}){let r=e.split(/\r?\n/);for(let e=1;e<r.length;e+=1)r[e]=t+r[e];return r.join(n)}})),Vu=/* @__PURE__ */ n(((e,t)=>{t.exports=s;let{LEVEL_NAMES:n}=xu(),r=Cu(),i=Lu(),a=Iu(),o=Su();function s(e){let t=e.crlf?`\r
138
138
  `:`
@@ -140,9 +140,7 @@ e=n(e,i),typeof e==`object`&&e&&Object.prototype.hasOwnProperty.call(e,a)&&delet
140
140
  /* istanbul ignore else */
141
141
  if(e&&e.length===3){let n=/^\s*/.exec(t)[0].length+4,a=` `.repeat(n),c=e[2],l=JSON.parse(c),u=o?r(l):l;s+=e[1]+i+a+u.replace(/\n/g,i+a)}else s+=t}else s+=t}return s}})),Gu=/* @__PURE__ */ n(((e,t)=>{t.exports=s;let{LOGGER_KEYS:n}=xu(),r=Hu(),i=Bu(),a=Wu(),o=Uu();function s({log:e,excludeLoggerKeys:t=!0,skipKeys:s=[],context:c}){let{EOL:l,IDENT:u,customPrettifiers:d,errorLikeObjectKeys:f,objectColorizer:p,singleLine:m,colorizer:h}=c,g=[].concat(s);
142
142
  /* istanbul ignore else */
143
- t===!0&&Array.prototype.push.apply(g,n);let _=``,{plain:v,errors:y}=Object.entries(e).reduce(({plain:t,errors:n},[r,i])=>{if(g.includes(r)===!1){let a=typeof d[r]==`function`?d[r](i,r,e,{colors:h.colors}):i;f.includes(r)?n[r]=a:t[r]=a}return{plain:t,errors:n}},{plain:{},errors:{}});return m?
144
- /* istanbul ignore else */
145
- (Object.keys(v).length>0&&(_+=p.greyMessage(r(v))),_+=l,_=_.replace(/\\\\/gi,`\\`)):Object.entries(v).forEach(([e,t])=>{let n=typeof d[e]==`function`?t:r(t,null,2);if(n===void 0)return;n=n.replace(/\\\\/gi,`\\`);let a=i({input:n,ident:u,eol:l}),s=o(e);_+=`${u}${p.property(s)}:${a.startsWith(l)?``:` `}${a}${l}`}),Object.entries(y).forEach(([e,t])=>{let n=typeof d[e]==`function`,i=n?t:r(t,null,2);i!==void 0&&(_+=a({keyName:e,lines:i,eol:l,ident:u,sanitizeStack:!n}))}),_}})),Ku=/* @__PURE__ */ n(((e,t)=>{t.exports=s;let{LOGGER_KEYS:n}=xu(),r=zu(),i=Bu(),a=Gu(),o=Uu();function s({log:e,context:t}){let{EOL:s,IDENT:c,errorProps:l,messageKey:u}=t,d=o(e.stack),f=`${c}${i({input:d,ident:c,eol:s})}${s}`;if(l.length>0){let i=n.concat(u,`type`,`stack`),d;d=l[0]===`*`?Object.keys(e).filter(e=>i.includes(e)===!1):l.filter(e=>i.includes(e)===!1);for(let n=0;n<d.length;n+=1){let i=d[n];if(!(i in e))continue;let l=o(i);if(r(e[i])){let n=a({log:e[i],excludeLoggerKeys:!1,context:{...t,IDENT:c+c}});f=`${f}${c}${l}: {${s}${n}${c}}${s}`;continue}let u=o(e[i]);f=`${f}${c}${l}: ${u}${s}`}}return f}})),qu=/* @__PURE__ */ n(((e,t)=>{t.exports=r;let n=Au();function r({log:e,context:t}){let{colorizer:r,customLevels:i,customLevelNames:a,levelKey:o,getLevelLabelData:s}=t,c=t.customPrettifiers?.level,l=n(e,o);if(l===void 0)return;let u=r(l,{customLevels:i,customLevelNames:a});if(c){let[t]=s(l);return c(l,o,e,{label:t,labelColorized:u,colors:r.colors})}return u}})),Ju=/* @__PURE__ */ n(((e,t)=>{t.exports=o;let{LEVELS:n}=xu(),r=Au(),i=Ru(),a=Uu();function o({log:e,context:t}){let{colorizer:o,customLevels:s,levelKey:c,levelLabel:l,messageFormat:u,messageKey:d,useOnlyCustomProps:f}=t;if(u&&typeof u==`string`){let t=i(u,e),d=String(t).replace(/{([^{}]+)}/g,function(t,i){let a;if(i===l&&(a=r(e,c))!==void 0)return(f?s===void 0:s[a]===void 0)?n[a]:s[a];let o=r(e,i);return o===void 0?``:o});return o.message(a(d))}if(u&&typeof u==`function`){let t=u(e,d,l,{colors:o.colors});return o.message(t)}if(d in e&&(typeof e[d]==`string`||typeof e[d]==`number`||typeof e[d]==`boolean`))return o.message(a(e[d]))}})),Yu=/* @__PURE__ */ n(((e,t)=>{t.exports=r;let n=Uu();function r({log:e,context:t}){let{customPrettifiers:r,colorizer:i}=t,a=``;if(e.name||e.pid||e.hostname){if(a+=`(`,e.name&&(a+=r.name?r.name(e.name,`name`,e,{colors:i.colors}):n(e.name)),e.pid){let t=r.pid?r.pid(e.pid,`pid`,e,{colors:i.colors}):n(e.pid);e.name&&e.pid?a+=`/`+t:a+=t}if(e.hostname){let t=r.hostname?r.hostname(e.hostname,`hostname`,e,{colors:i.colors}):n(e.hostname);a+=`${a===`(`?`on`:` on`} ${t}`}a+=`)`}if(e.caller){let t=r.caller?r.caller(e.caller,`caller`,e,{colors:i.colors}):n(e.caller);a+=`${a===``?``:` `}<${t}>`}if(a!==``)return a}})),Xu=/* @__PURE__ */ n(((e,t)=>{t.exports=i;let n=Fu(),r=Uu();function i({log:e,context:t}){let{timestampKey:i,translateTime:a}=t,o=t.customPrettifiers?.time,s=null;if(i in e?s=e[i]:`timestamp`in e&&(s=e.timestamp),s===null)return;let c=a?n(s,a):s;return o?o(c):`[${r(c)}]`}})),Zu=/* @__PURE__ */ n(((e,t)=>{t.exports={buildSafeSonicBoom:Eu(),createDate:Ou(),deleteLogProperty:ju(),filterLog:Nu(),formatTime:Fu(),getPropertyValue:Au(),handleCustomLevelsNamesOpts:Iu(),handleCustomLevelsOpts:Lu(),interpretConditionals:Ru(),isObject:zu(),isValidDate:Du(),joinLinesWithIndentation:Bu(),noop:Tu(),parseFactoryOptions:Vu(),prettifyErrorLog:Ku(),prettifyError:Wu(),prettifyLevel:qu(),prettifyMessage:Ju(),prettifyMetadata:Yu(),prettifyObject:Gu(),prettifyTime:Xu(),splitPropertyKey:ku(),stripUnsafeControlChars:Uu(),getLevelLabelData:Su()}})),Qu=/* @__PURE__ */ n(((e,t)=>{let n=typeof Buffer<`u`,r=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,i=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function a(e,t,a){a==null&&typeof t==`object`&&t&&(a=t,t=void 0),n&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let s=JSON.parse(e,t);if(typeof s!=`object`||!s)return s;let c=a&&a.protoAction||`error`,l=a&&a.constructorAction||`error`;if(c===`ignore`&&l===`ignore`)return s;if(c!==`ignore`&&l!==`ignore`){if(r.test(e)===!1&&i.test(e)===!1)return s}else if(c!==`ignore`&&l===`ignore`){if(r.test(e)===!1)return s}else if(i.test(e)===!1)return s;return o(s,{protoAction:c,constructorAction:l,safe:a&&a.safe})}function o(e,{protoAction:t=`error`,constructorAction:n=`error`,safe:r}={}){let i=[e];for(;i.length;){let e=i;i=[];for(let a of e){if(t!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`__proto__`)){if(r===!0)return null;if(t===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.__proto__}if(n!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`constructor`)&&a.constructor!==null&&typeof a.constructor==`object`&&Object.prototype.hasOwnProperty.call(a.constructor,`prototype`)){if(r===!0)return null;if(n===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.constructor}for(let e in a){let t=a[e];t&&typeof t==`object`&&i.push(t)}}}return e}function s(e,t,n){let{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return a(e,t,n)}finally{Error.stackTraceLimit=r}}function c(e,t){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;let r;try{r=a(e,t,{safe:!0})}catch{r=void 0}finally{Error.stackTraceLimit=n}return r}t.exports=s,t.exports.default=s,t.exports.parse=s,t.exports.safeParse=c,t.exports.scan=o})),$u=/* @__PURE__ */ n(((e,t)=>{t.exports=h;let n=Qu(),r=zu(),i=Ku(),a=qu(),o=Ju(),s=Yu(),c=Gu(),l=Xu(),u=Nu(),{LEVELS:d,LEVEL_KEY:f,LEVEL_NAMES:p}=xu(),m=e=>{try{return{value:n.parse(e,{protoAction:`remove`})}}catch(e){return{err:e}}};function h(e){let t;if(r(e))t=e;else{let n=m(e);if(n.err||!r(n.value))return e+this.EOL;t=n.value}if(this.minimumLevel){let e;e=this.useOnlyCustomProps?this.customLevels:this.customLevelNames[this.minimumLevel]!==void 0;let n;if(n=e?this.customLevelNames[this.minimumLevel]:p[this.minimumLevel],n||=typeof this.minimumLevel==`string`?p[this.minimumLevel]:p[d[this.minimumLevel].toLowerCase()],t[this.levelKey===void 0?f:this.levelKey]<n)return}let n=o({log:t,context:this.context});(this.ignoreKeys||this.includeKeys)&&(t=u({log:t,context:this.context}));let h=a({log:t,context:{...this.context,...this.context.customProperties}}),g=s({log:t,context:this.context}),_=l({log:t,context:this.context}),v=``;if(this.levelFirst&&h&&(v=`${h}`),_&&v===``?v=`${_}`:_&&(v=`${v} ${_}`),!this.levelFirst&&h&&(v=v.length>0?`${v} ${h}`:h),g&&(v=v.length>0?`${v} ${g}:`:g),v.endsWith(`:`)===!1&&v!==``&&(v+=`:`),n!==void 0&&(v=v.length>0?`${v} ${n}`:n),v.length>0&&!this.singleLine&&(v+=this.EOL),t.type===`Error`&&typeof t.stack==`string`){let e=i({log:t,context:this.context});this.singleLine&&(v+=this.EOL),v+=e}else if(this.hideObject===!1){let e=[this.messageKey,this.levelKey,this.timestampKey].map(e=>e.replaceAll(/\\/g,``)).filter(e=>typeof t[e]==`string`||typeof t[e]==`number`||typeof t[e]==`boolean`),n=c({log:t,skipKeys:e,context:this.context});this.singleLine&&!/^\s$/.test(n)&&(v+=` `),v+=n}return v}})),ed=/* @__PURE__ */ t((/* @__PURE__ */ n(((e,t)=>{let{isColorSupported:n}=mu(),r=vu(),{Transform:i}=a(`node:stream`),o=bu(),s=Cu(),{ERROR_LIKE_KEYS:c,LEVEL_KEY:l,LEVEL_LABEL:u,MESSAGE_KEY:d,TIMESTAMP_KEY:f}=xu(),{buildSafeSonicBoom:p,parseFactoryOptions:m}=Zu(),h=$u(),g={colorize:n,colorizeObjects:!0,crlf:!1,customColors:null,customLevels:null,customPrettifiers:{},errorLikeObjectKeys:c,errorProps:``,hideObject:!1,ignore:`hostname`,include:void 0,levelFirst:!1,levelKey:l,levelLabel:u,messageFormat:null,messageKey:d,minimumLevel:void 0,singleLine:!1,timestampKey:f,translateTime:!0,useOnlyCustomProps:!0};function _(e){return e===`true`||e!==`false`&&e}function v(e){let t={...e};for(let e of[`colorize`,`colorizeObjects`,`crlf`,`hideObject`,`levelFirst`,`singleLine`,`useOnlyCustomProps`])e in t&&(t[e]=_(t[e]));return`translateTime`in t&&(t.translateTime===`true`||t.translateTime===`false`)&&(t.translateTime=_(t.translateTime)),t}function y(e){let t=v(Object.assign({},g,e)),n=m(t);return h.bind({...n,context:n})}function b(e={}){let t=y(e),n;return o(function(a){a.on(`message`,function n(r){r&&r.code===`PINO_CONFIG`&&(Object.assign(e,{messageKey:r.config.messageKey,errorLikeObjectKeys:Array.from(/* @__PURE__ */ new Set([...e.errorLikeObjectKeys||c,r.config.errorKey])),customLevels:r.config.levels.values}),t=y(e),a.off(`message`,n))});let o=new i({objectMode:!0,autoDestroy:!0,transform(e,n,r){r(null,t(e))}});return n=typeof e.destination==`object`&&typeof e.destination.write==`function`?e.destination:p({dest:e.destination||1,append:e.append,mkdir:e.mkdir,sync:e.sync}),a.on(`unknown`,function(e){n.write(e+`
143
+ t===!0&&Array.prototype.push.apply(g,n);let _=``,{plain:v,errors:y}=Object.entries(e).reduce(({plain:t,errors:n},[r,i])=>{if(g.includes(r)===!1){let a=typeof d[r]==`function`?d[r](i,r,e,{colors:h.colors}):i;f.includes(r)?n[r]=a:t[r]=a}return{plain:t,errors:n}},{plain:{},errors:{}});return m?(Object.keys(v).length>0&&(_+=p.greyMessage(r(v))),_+=l,_=_.replace(/\\\\/gi,`\\`)):Object.entries(v).forEach(([e,t])=>{let n=typeof d[e]==`function`?t:r(t,null,2);if(n===void 0)return;n=n.replace(/\\\\/gi,`\\`);let a=i({input:n,ident:u,eol:l}),s=o(e);_+=`${u}${p.property(s)}:${a.startsWith(l)?``:` `}${a}${l}`}),Object.entries(y).forEach(([e,t])=>{let n=typeof d[e]==`function`,i=n?t:r(t,null,2);i!==void 0&&(_+=a({keyName:e,lines:i,eol:l,ident:u,sanitizeStack:!n}))}),_}})),Ku=/* @__PURE__ */ n(((e,t)=>{t.exports=s;let{LOGGER_KEYS:n}=xu(),r=zu(),i=Bu(),a=Gu(),o=Uu();function s({log:e,context:t}){let{EOL:s,IDENT:c,errorProps:l,messageKey:u}=t,d=o(e.stack),f=`${c}${i({input:d,ident:c,eol:s})}${s}`;if(l.length>0){let i=n.concat(u,`type`,`stack`),d;d=l[0]===`*`?Object.keys(e).filter(e=>i.includes(e)===!1):l.filter(e=>i.includes(e)===!1);for(let n=0;n<d.length;n+=1){let i=d[n];if(!(i in e))continue;let l=o(i);if(r(e[i])){let n=a({log:e[i],excludeLoggerKeys:!1,context:{...t,IDENT:c+c}});f=`${f}${c}${l}: {${s}${n}${c}}${s}`;continue}let u=o(e[i]);f=`${f}${c}${l}: ${u}${s}`}}return f}})),qu=/* @__PURE__ */ n(((e,t)=>{t.exports=r;let n=Au();function r({log:e,context:t}){let{colorizer:r,customLevels:i,customLevelNames:a,levelKey:o,getLevelLabelData:s}=t,c=t.customPrettifiers?.level,l=n(e,o);if(l===void 0)return;let u=r(l,{customLevels:i,customLevelNames:a});if(c){let[t]=s(l);return c(l,o,e,{label:t,labelColorized:u,colors:r.colors})}return u}})),Ju=/* @__PURE__ */ n(((e,t)=>{t.exports=o;let{LEVELS:n}=xu(),r=Au(),i=Ru(),a=Uu();function o({log:e,context:t}){let{colorizer:o,customLevels:s,levelKey:c,levelLabel:l,messageFormat:u,messageKey:d,useOnlyCustomProps:f}=t;if(u&&typeof u==`string`){let t=i(u,e),d=String(t).replace(/{([^{}]+)}/g,function(t,i){let a;if(i===l&&(a=r(e,c))!==void 0)return(f?s===void 0:s[a]===void 0)?n[a]:s[a];let o=r(e,i);return o===void 0?``:o});return o.message(a(d))}if(u&&typeof u==`function`){let t=u(e,d,l,{colors:o.colors});return o.message(t)}if(d in e&&(typeof e[d]==`string`||typeof e[d]==`number`||typeof e[d]==`boolean`))return o.message(a(e[d]))}})),Yu=/* @__PURE__ */ n(((e,t)=>{t.exports=r;let n=Uu();function r({log:e,context:t}){let{customPrettifiers:r,colorizer:i}=t,a=``;if(e.name||e.pid||e.hostname){if(a+=`(`,e.name&&(a+=r.name?r.name(e.name,`name`,e,{colors:i.colors}):n(e.name)),e.pid){let t=r.pid?r.pid(e.pid,`pid`,e,{colors:i.colors}):n(e.pid);e.name&&e.pid?a+=`/`+t:a+=t}if(e.hostname){let t=r.hostname?r.hostname(e.hostname,`hostname`,e,{colors:i.colors}):n(e.hostname);a+=`${a===`(`?`on`:` on`} ${t}`}a+=`)`}if(e.caller){let t=r.caller?r.caller(e.caller,`caller`,e,{colors:i.colors}):n(e.caller);a+=`${a===``?``:` `}<${t}>`}if(a!==``)return a}})),Xu=/* @__PURE__ */ n(((e,t)=>{t.exports=i;let n=Fu(),r=Uu();function i({log:e,context:t}){let{timestampKey:i,translateTime:a}=t,o=t.customPrettifiers?.time,s=null;if(i in e?s=e[i]:`timestamp`in e&&(s=e.timestamp),s===null)return;let c=a?n(s,a):s;return o?o(c):`[${r(c)}]`}})),Zu=/* @__PURE__ */ n(((e,t)=>{t.exports={buildSafeSonicBoom:Eu(),createDate:Ou(),deleteLogProperty:ju(),filterLog:Nu(),formatTime:Fu(),getPropertyValue:Au(),handleCustomLevelsNamesOpts:Iu(),handleCustomLevelsOpts:Lu(),interpretConditionals:Ru(),isObject:zu(),isValidDate:Du(),joinLinesWithIndentation:Bu(),noop:Tu(),parseFactoryOptions:Vu(),prettifyErrorLog:Ku(),prettifyError:Wu(),prettifyLevel:qu(),prettifyMessage:Ju(),prettifyMetadata:Yu(),prettifyObject:Gu(),prettifyTime:Xu(),splitPropertyKey:ku(),stripUnsafeControlChars:Uu(),getLevelLabelData:Su()}})),Qu=/* @__PURE__ */ n(((e,t)=>{let n=typeof Buffer<`u`,r=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,i=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function a(e,t,a){a==null&&typeof t==`object`&&t&&(a=t,t=void 0),n&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let s=JSON.parse(e,t);if(typeof s!=`object`||!s)return s;let c=a&&a.protoAction||`error`,l=a&&a.constructorAction||`error`;if(c===`ignore`&&l===`ignore`)return s;if(c!==`ignore`&&l!==`ignore`){if(r.test(e)===!1&&i.test(e)===!1)return s}else if(c!==`ignore`&&l===`ignore`){if(r.test(e)===!1)return s}else if(i.test(e)===!1)return s;return o(s,{protoAction:c,constructorAction:l,safe:a&&a.safe})}function o(e,{protoAction:t=`error`,constructorAction:n=`error`,safe:r}={}){let i=[e];for(;i.length;){let e=i;i=[];for(let a of e){if(t!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`__proto__`)){if(r===!0)return null;if(t===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.__proto__}if(n!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`constructor`)&&a.constructor!==null&&typeof a.constructor==`object`&&Object.prototype.hasOwnProperty.call(a.constructor,`prototype`)){if(r===!0)return null;if(n===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.constructor}for(let e in a){let t=a[e];t&&typeof t==`object`&&i.push(t)}}}return e}function s(e,t,n){let{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return a(e,t,n)}finally{Error.stackTraceLimit=r}}function c(e,t){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;let r;try{r=a(e,t,{safe:!0})}catch{r=void 0}finally{Error.stackTraceLimit=n}return r}t.exports=s,t.exports.default=s,t.exports.parse=s,t.exports.safeParse=c,t.exports.scan=o})),$u=/* @__PURE__ */ n(((e,t)=>{t.exports=h;let n=Qu(),r=zu(),i=Ku(),a=qu(),o=Ju(),s=Yu(),c=Gu(),l=Xu(),u=Nu(),{LEVELS:d,LEVEL_KEY:f,LEVEL_NAMES:p}=xu(),m=e=>{try{return{value:n.parse(e,{protoAction:`remove`})}}catch(e){return{err:e}}};function h(e){let t;if(r(e))t=e;else{let n=m(e);if(n.err||!r(n.value))return e+this.EOL;t=n.value}if(this.minimumLevel){let e;e=this.useOnlyCustomProps?this.customLevels:this.customLevelNames[this.minimumLevel]!==void 0;let n;if(n=e?this.customLevelNames[this.minimumLevel]:p[this.minimumLevel],n||=typeof this.minimumLevel==`string`?p[this.minimumLevel]:p[d[this.minimumLevel].toLowerCase()],t[this.levelKey===void 0?f:this.levelKey]<n)return}let n=o({log:t,context:this.context});(this.ignoreKeys||this.includeKeys)&&(t=u({log:t,context:this.context}));let h=a({log:t,context:{...this.context,...this.context.customProperties}}),g=s({log:t,context:this.context}),_=l({log:t,context:this.context}),v=``;if(this.levelFirst&&h&&(v=`${h}`),_&&v===``?v=`${_}`:_&&(v=`${v} ${_}`),!this.levelFirst&&h&&(v=v.length>0?`${v} ${h}`:h),g&&(v=v.length>0?`${v} ${g}:`:g),v.endsWith(`:`)===!1&&v!==``&&(v+=`:`),n!==void 0&&(v=v.length>0?`${v} ${n}`:n),v.length>0&&!this.singleLine&&(v+=this.EOL),t.type===`Error`&&typeof t.stack==`string`){let e=i({log:t,context:this.context});this.singleLine&&(v+=this.EOL),v+=e}else if(this.hideObject===!1){let e=[this.messageKey,this.levelKey,this.timestampKey].map(e=>e.replaceAll(/\\/g,``)).filter(e=>typeof t[e]==`string`||typeof t[e]==`number`||typeof t[e]==`boolean`),n=c({log:t,skipKeys:e,context:this.context});this.singleLine&&!/^\s$/.test(n)&&(v+=` `),v+=n}return v}})),ed=/* @__PURE__ */ t((/* @__PURE__ */ n(((e,t)=>{let{isColorSupported:n}=mu(),r=vu(),{Transform:i}=a(`node:stream`),o=bu(),s=Cu(),{ERROR_LIKE_KEYS:c,LEVEL_KEY:l,LEVEL_LABEL:u,MESSAGE_KEY:d,TIMESTAMP_KEY:f}=xu(),{buildSafeSonicBoom:p,parseFactoryOptions:m}=Zu(),h=$u(),g={colorize:n,colorizeObjects:!0,crlf:!1,customColors:null,customLevels:null,customPrettifiers:{},errorLikeObjectKeys:c,errorProps:``,hideObject:!1,ignore:`hostname`,include:void 0,levelFirst:!1,levelKey:l,levelLabel:u,messageFormat:null,messageKey:d,minimumLevel:void 0,singleLine:!1,timestampKey:f,translateTime:!0,useOnlyCustomProps:!0};function _(e){return e===`true`||e!==`false`&&e}function v(e){let t={...e};for(let e of[`colorize`,`colorizeObjects`,`crlf`,`hideObject`,`levelFirst`,`singleLine`,`useOnlyCustomProps`])e in t&&(t[e]=_(t[e]));return`translateTime`in t&&(t.translateTime===`true`||t.translateTime===`false`)&&(t.translateTime=_(t.translateTime)),t}function y(e){let t=v(Object.assign({},g,e)),n=m(t);return h.bind({...n,context:n})}function b(e={}){let t=y(e),n;return o(function(a){a.on(`message`,function n(r){r&&r.code===`PINO_CONFIG`&&(Object.assign(e,{messageKey:r.config.messageKey,errorLikeObjectKeys:Array.from(/* @__PURE__ */ new Set([...e.errorLikeObjectKeys||c,r.config.errorKey])),customLevels:r.config.levels.values}),t=y(e),a.off(`message`,n))});let o=new i({objectMode:!0,autoDestroy:!0,transform(e,n,r){r(null,t(e))}});return n=typeof e.destination==`object`&&typeof e.destination.write==`function`?e.destination:p({dest:e.destination||1,append:e.append,mkdir:e.mkdir,sync:e.sync}),a.on(`unknown`,function(e){n.write(e+`
146
144
  `)}),r(a,o,n),o},{parse:`lines`,close(e,t){n.on(`close`,()=>{t(e)})}})}t.exports=b,t.exports.build=b,t.exports.PinoPretty=b,t.exports.prettyFactory=y,t.exports.colorizerFactory=s,t.exports.isColorSupported=n,t.exports.default=b})))(),1),td=class{module;constructor(e=`Noop`){this.module=e}debug(e,t){}info(e,t){}warn(e,t){}error(e,t,n){}withOperation(e){return this}withTrace(e){return this}flush(){return Promise.resolve()}getModule(){return this.module}};function nd(e=`Noop`){return new td(e)}nd(`App`);const rd={colorize:!0,translateTime:`SYS:HH:MM:ss`,ignore:`pid,hostname,module`,messageFormat:`{msg}`,singleLine:!0};let id=!1;function ad(){return o(import.meta.url).resolve(`pino-pretty`)}function od(e){return(0,ed.default)({...rd,...e})}function sd(e){return{target:ad(),options:{...rd,...e}}}const cd={enableTracing:!0,prettyMode:`stream`,output:`stdout`};function ld(){return id}function ud(){id=!0}function dd(e={}){let t={...cd,...e},n=process.env.NODE_ENV!==`production`,r=t.output===`stderr`,i=r?{...e.prettyOptions,destination:2}:e.prettyOptions,a=e.transport??(n&&t.prettyMode===`transport`?sd(i):void 0),o=n&&!e.transport&&t.prettyMode===`stream`?od(i):void 0,s=o===void 0&&a===void 0&&r?process.stderr:void 0;Ql({minLevel:e.minLevel??(n?`debug`:`info`),enableConsole:!0,autoTracing:t.enableTracing,transport:a,stream:o??s}),t.enableTracing&&du(pu())}function fd(){ld()||(ud(),dd())}function pd(e={}){ud(),dd(e)}function md(e){fd();let t=su(e),n=fu();return n?t.withTrace(n):t}pd();var hd=/* @__PURE__ */ n((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),gd=/* @__PURE__ */ n((e=>{let{InvalidArgumentError:t}=hd();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),_d=/* @__PURE__ */ n((e=>{let{humanReadableArgName:t}=gd();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=/* @__PURE__ */ new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
147
145
  `)}displayWidth(e){return r(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
148
146
  `+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
@@ -161,7 +159,7 @@ Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._life
161
159
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
162
160
  - ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(r)}_executeSubCommand(e,t){t=t.slice();let a=!1,s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function c(e,t){let n=r.resolve(e,t);if(i.existsSync(n))return n;if(s.includes(r.extname(t)))return;let a=s.find(e=>i.existsSync(`${n}${e}`));if(a)return`${n}${a}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=e._executableFile||`${this._name}-${e._name}`,d=this._executableDir||``;if(this._scriptPath){let e;try{e=i.realpathSync(this._scriptPath)}catch{e=this._scriptPath}d=r.resolve(r.dirname(e),d)}if(d){let t=c(d,u);if(!t&&!e._executableFile&&this._scriptPath){let n=r.basename(this._scriptPath,r.extname(this._scriptPath));n!==this._name&&(t=c(d,`${n}-${e._name}`))}u=t||u}a=s.includes(r.extname(u));let f;o.platform===`win32`?(this._checkForMissingExecutable(u,d,e._name),t.unshift(u),t=g(o.execArgv).concat(t),f=n.spawn(o.execPath,t,{stdio:`inherit`})):a?(t.unshift(u),t=g(o.execArgv).concat(t),f=n.spawn(o.argv[0],t,{stdio:`inherit`})):f=n.spawn(u,t,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{o.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e??=1,p?p(new l(e,`commander.executeSubCommandAsync`,`(close)`)):o.exit(e)}),f.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(u,d,e._name);else if(t.code===`EACCES`)throw Error(`'${u}' not executable`);if(!p)o.exit(1);else{let e=new l(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,p(e)}}),this.runningCommand=f}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent?.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)!==void 0&&this.getOptionValueSource(t)!=="default"});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t;function i(e){return e.length>1&&e[0]===`-`}let a=e=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(e)?!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))):!1,o=null,s=null,c=0;for(;c<e.length||s;){let l=s??e[c++];if(s=null,l===`--`){r===n&&r.push(l),r.push(...e.slice(c));break}if(o&&(!i(l)||a(l)))this.emit(`option:${o.name()}`,l);else{if(o=null,i(l)){let t=this._findOption(l);if(t){if(t.required){let n=e[c++];n===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;c<e.length&&(!i(e[c])||a(e[c]))&&(n=e[c++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&l[0]===`-`&&l[1]!==`-`){let e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),s=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let e=l.indexOf(`=`),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r===t&&i(l)&&!(this.commands.length===0&&a(l))&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
163
161
  `),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in o.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,o.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new p(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=m(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=m(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t||=`-V, --version`,n||=`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>c(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??``:(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??``:(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??``:(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=r.basename(e,r.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let r=t.formatHelp(this,t);return n.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e||={};let t=!!e.error,n,r,i;return t?(n=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),n(e)),hasColors:r,helpWidth:i}}outputHelp(e){let t;typeof e==`function`&&(t=e,e=void 0);let n=this._getOutputContext(e),r={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit(`beforeAllHelp`,r)),this.emit(`beforeHelp`,r);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!=`string`&&!Buffer.isBuffer(i)))throw Error(`outputHelp callback must return a string or a Buffer`);n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit(`afterHelp`,r),this._getCommandAndAncestors().forEach(e=>e.emit(`afterAllHelp`,r))}helpOption(e,t){return typeof e==`boolean`?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??`-h, --help`,t??`display help for command`),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(o.exitCode??0);t===0&&e&&typeof e!=`function`&&e.error&&(t=1),this._exit(t,`commander.help`,`(outputHelp)`)}addHelpText(e,t){let n=[`beforeAll`,`before`,`after`,`afterAll`];if(!n.includes(e))throw Error(`Unexpected value for position to addHelpText.
164
- Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function g(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function _(){if(o.env.NO_COLOR||o.env.FORCE_COLOR===`0`||o.env.FORCE_COLOR===`false`)return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=h,e.useColor=_}));const{program:xd,createCommand:Sd,createArgument:Cd,createOption:wd,CommanderError:Td,InvalidArgumentError:Ed,InvalidOptionArgumentError:Dd,Command:Od,Argument:kd,Option:Ad,Help:jd}=(/* @__PURE__ */ t((/* @__PURE__ */ n((e=>{let{Argument:t}=gd(),{Command:n}=bd(),{CommanderError:r,InvalidArgumentError:i}=hd(),{Help:a}=_d(),{Option:o}=vd();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i})))(),1)).default;let Md;function Nd(){return Md??=md(`@longzai-intelligence-cli/core/provider`),Md}const Pd={red:e=>e,green:e=>e,yellow:e=>e,blue:e=>e,cyan:e=>e,magenta:e=>e,gray:e=>e,bold:e=>e,dim:e=>e};let Fd={select:async(e,t)=>t[0]?.value??``,textInput:async(e,t)=>t?.defaultValue??``,confirm:async(e,t)=>t?.defaultValue??!1,spinner:()=>({start:e=>Nd().info(e),stop:e=>Nd().info(e)}),note:(e,t)=>{t?Nd().info(`${t}: ${e}`):Nd().info(e)},log:{info:e=>Nd().info(e),success:e=>Nd().info(e),warn:e=>Nd().warn(e),error:e=>Nd().error(e),step:e=>Nd().info(e)}},Id=Pd;function Ld(e){Fd=e}function Rd(e){Id=e}function zd(){return Fd}function Bd(){return Id}const Vd=()=>`0.0.9`;function Hd(e){let t=e.version??Vd();e.interaction&&Ld(e.interaction),e.color&&Rd(e.color);let n=new Od;return n.name(e.name).version(t,`-v, --version`,`输出 ${e.name} 的版本号`),e.description&&n.description(e.description),n}let Ud;function Wd(){return Ud??=md(`@longzai-intelligence-cli/core/define-command`),Ud}function Gd(e,t){let n=e.commands.find(e=>e.name()===t);return n===void 0?e.command(t):n}function Kd(e,t){if(t.length===1){let n=t[0];if(n===void 0)throw Error(`defineCommand: segments 为空,无法解析命令名`);return e.command(n)}let[n,...r]=t;if(n===void 0)throw Error(`defineCommand: segments 首段为空,无法解析父命令名`);let i=r.pop();if(i===void 0)throw Error(`defineCommand: segments 末段为空,无法解析子命令名`);let a=Gd(e,n);for(let e of r)a=Gd(a,e);return a.command(i)}function qd(e,t){let n=Kd(e,t.name.split(` `).filter(e=>e.length>0));t.description&&n.description(t.description);for(let e of t.arguments??[])e.description?n.argument(e.signature,e.description):n.argument(e.signature);for(let e of t.options??[])e.defaultValue===void 0?n.option(e.flags,e.description??``):n.option(e.flags,e.description??``,e.defaultValue);n.action(async(...e)=>{let n=e[e.length-1];if(!(n instanceof Od))return;let r=n.opts(),i=n.args,a=t.schema.safeParse(r);if(!a.success){let e=a.error.issues.map(e=>e.message).join(`, `);Wd().error(Bd().red(`参数校验失败: ${e}`)),zd().log.error(`参数校验失败: ${e}`),process.exit(1)}await t.action(a.data,i)})}var Jd=/* @__PURE__ */ T(import.meta.url);function Yd(e){let t=b(e);return t.length>1&&t[t.length-1]===w&&(t=t.substring(0,t.length-1)),t}const Xd=/[\\/]/g;function Zd(e,t){return e.replace(Xd,t)}const Qd=/^[a-z]:[\\/]$/i;function $d(e){return e===`/`||Qd.test(e)}function ef(e,t){let{resolvePaths:n,normalizePath:r,pathSeparator:i}=t,a=process.platform===`win32`&&e.includes(`/`)||e.startsWith(`.`);return n&&(e=C(e)),(r||a)&&(e=Yd(e)),e===`.`?``:Zd(e[e.length-1]===i?e:e+i,i)}function tf(e,t){return t+e}function nf(e,t){return function(n,r){return r.startsWith(e)?r.slice(e.length)+n:Zd(S(e,r),t.pathSeparator)+t.pathSeparator+n}}function rf(e){return e}function af(e,t,n){return t+e+n}function of(e,t){let{relativePaths:n,includeBasePath:r}=t;return n&&e?nf(e,t):r?tf:rf}function sf(e){return function(t,n){n.push(t.substring(e.length)||`.`)}}function cf(e){return function(t,n,r){let i=t.substring(e.length)||`.`;r.every(e=>e(i,!0))&&n.push(i)}}const lf=(e,t)=>{t.push(e||`.`)},uf=(e,t,n)=>{let r=e||`.`;n.every(e=>e(r,!0))&&t.push(r)},df=()=>{};function ff(e,t){let{includeDirs:n,filters:r,relativePaths:i}=t;return n?i?r&&r.length?cf(e):sf(e):r&&r.length?uf:lf:df}const pf=(e,t,n,r)=>{r.every(t=>t(e,!1))&&n.files++},mf=(e,t,n,r)=>{r.every(t=>t(e,!1))&&t.push(e)},hf=(e,t,n,r)=>{n.files++},gf=(e,t)=>{t.push(e)},_f=()=>{};function vf(e){let{excludeFiles:t,filters:n,onlyCounts:r}=e;return t?_f:n&&n.length?r?pf:mf:r?hf:gf}const yf=e=>e,bf=()=>[``].slice(0,0);function xf(e){return e.group?bf:yf}const Sf=(e,t,n)=>{e.push({directory:t,files:n,dir:t})},Cf=()=>{};function wf(e){return e.group?Sf:Cf}const Tf=function(e,t,n){let{queue:r,fs:i,options:{suppressErrors:a}}=t;r.enqueue(),i.realpath(e,(o,s)=>{if(o)return r.dequeue(a?null:o,t);i.stat(s,(i,o)=>{if(i)return r.dequeue(a?null:i,t);if(o.isDirectory()&&Of(e,s,t))return r.dequeue(null,t);n(o,s),r.dequeue(null,t)})})},Ef=function(e,t,n){let{queue:r,fs:i,options:{suppressErrors:a}}=t;r.enqueue();try{let r=i.realpathSync(e),a=i.statSync(r);if(a.isDirectory()&&Of(e,r,t))return;n(a,r)}catch(e){if(!a)throw e}};function Df(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?Ef:Tf}function Of(e,t,n){if(n.options.useRealPaths)return kf(t,n);let r=v(e),i=1;for(;r!==n.root&&i<2;){let e=n.symlinks.get(r);e&&(e===t||e.startsWith(t)||t.startsWith(e))?i++:r=v(r)}return n.symlinks.set(e,t),i>1}function kf(e,t){return t.visited.includes(e+t.options.pathSeparator)}const Af=e=>e.counts,jf=e=>e.groups,Mf=e=>e.paths,Nf=e=>e.paths.slice(0,e.options.maxFiles),Pf=(e,t,n)=>(Rf(t,n,e.counts,e.options.suppressErrors),null),Ff=(e,t,n)=>(Rf(t,n,e.paths,e.options.suppressErrors),null),If=(e,t,n)=>(Rf(t,n,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),Lf=(e,t,n)=>(Rf(t,n,e.groups,e.options.suppressErrors),null);function Rf(e,t,n,r){t(e&&!r?e:null,n)}function zf(e,t){let{onlyCounts:n,group:r,maxFiles:i}=e;return n?t?Af:Pf:r?t?jf:Lf:i?t?Nf:If:t?Mf:Ff}const Bf={withFileTypes:!0},Vf=(e,t,n,r,i)=>{if(e.queue.enqueue(),r<0)return e.queue.dequeue(null,e);let{fs:a}=e;e.visited.push(t),e.counts.directories++,a.readdir(t||`.`,Bf,(t,a=[])=>{i(a,n,r),e.queue.dequeue(e.options.suppressErrors?null:t,e)})},Hf=(e,t,n,r,i)=>{let{fs:a}=e;if(r<0)return;e.visited.push(t),e.counts.directories++;let o=[];try{o=a.readdirSync(t||`.`,Bf)}catch(t){if(!e.options.suppressErrors)throw t}i(o,n,r)};function Uf(e){return e?Hf:Vf}var Wf=class{count=0;constructor(e){this.onQueueEmpty=e}enqueue(){return this.count++,this.count}dequeue(e,t){this.onQueueEmpty&&(--this.count<=0||e)&&(this.onQueueEmpty(e,t),e&&(t.controller.abort(),this.onQueueEmpty=void 0))}},Gf=class{_files=0;_directories=0;set files(e){this._files=e}get files(){return this._files}set directories(e){this._directories=e}get directories(){return this._directories}
162
+ Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function g(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function _(){if(o.env.NO_COLOR||o.env.FORCE_COLOR===`0`||o.env.FORCE_COLOR===`false`)return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=h,e.useColor=_}));const{program:xd,createCommand:Sd,createArgument:Cd,createOption:wd,CommanderError:Td,InvalidArgumentError:Ed,InvalidOptionArgumentError:Dd,Command:Od,Argument:kd,Option:Ad,Help:jd}=(/* @__PURE__ */ t((/* @__PURE__ */ n((e=>{let{Argument:t}=gd(),{Command:n}=bd(),{CommanderError:r,InvalidArgumentError:i}=hd(),{Help:a}=_d(),{Option:o}=vd();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i})))(),1)).default;let Md;function Nd(){return Md??=md(`@longzai-intelligence-cli/core/provider`),Md}const Pd={red:e=>e,green:e=>e,yellow:e=>e,blue:e=>e,cyan:e=>e,magenta:e=>e,gray:e=>e,bold:e=>e,dim:e=>e};let Fd={select:async(e,t)=>t[0]?.value??``,textInput:async(e,t)=>t?.defaultValue??``,confirm:async(e,t)=>t?.defaultValue??!1,spinner:()=>({start:e=>Nd().info(e),stop:e=>Nd().info(e)}),note:(e,t)=>{t?Nd().info(`${t}: ${e}`):Nd().info(e)},log:{info:e=>Nd().info(e),success:e=>Nd().info(e),warn:e=>Nd().warn(e),error:e=>Nd().error(e),step:e=>Nd().info(e)}},Id=Pd;function Ld(e){Fd=e}function Rd(e){Id=e}function zd(){return Fd}function Bd(){return Id}const Vd=()=>`0.0.11`;function Hd(e){let t=e.version??Vd();e.interaction&&Ld(e.interaction),e.color&&Rd(e.color);let n=new Od;return n.name(e.name).version(t,`-v, --version`,`输出 ${e.name} 的版本号`),e.description&&n.description(e.description),n}let Ud;function Wd(){return Ud??=md(`@longzai-intelligence-cli/core/define-command`),Ud}function Gd(e,t){let n=e.commands.find(e=>e.name()===t);return n===void 0?e.command(t):n}function Kd(e,t){if(t.length===1){let n=t[0];if(n===void 0)throw Error(`defineCommand: segments 为空,无法解析命令名`);return e.command(n)}let[n,...r]=t;if(n===void 0)throw Error(`defineCommand: segments 首段为空,无法解析父命令名`);let i=r.pop();if(i===void 0)throw Error(`defineCommand: segments 末段为空,无法解析子命令名`);let a=Gd(e,n);for(let e of r)a=Gd(a,e);return a.command(i)}function qd(e,t){let n=Kd(e,t.name.split(` `).filter(e=>e.length>0));t.description&&n.description(t.description);for(let e of t.arguments??[])e.description?n.argument(e.signature,e.description):n.argument(e.signature);for(let e of t.options??[])e.defaultValue===void 0?n.option(e.flags,e.description??``):n.option(e.flags,e.description??``,e.defaultValue);n.action(async(...e)=>{let n=e[e.length-1];if(!(n instanceof Od))return;let r=n.opts(),i=n.args,a=t.schema.safeParse(r);if(!a.success){let e=a.error.issues.map(e=>e.message).join(`, `);Wd().error(Bd().red(`参数校验失败: ${e}`)),zd().log.error(`参数校验失败: ${e}`),process.exit(1)}await t.action(a.data,i)})}var Jd=/* @__PURE__ */ T(import.meta.url);function Yd(e){let t=b(e);return t.length>1&&t[t.length-1]===w&&(t=t.substring(0,t.length-1)),t}const Xd=/[\\/]/g;function Zd(e,t){return e.replace(Xd,t)}const Qd=/^[a-z]:[\\/]$/i;function $d(e){return e===`/`||Qd.test(e)}function ef(e,t){let{resolvePaths:n,normalizePath:r,pathSeparator:i}=t,a=process.platform===`win32`&&e.includes(`/`)||e.startsWith(`.`);return n&&(e=C(e)),(r||a)&&(e=Yd(e)),e===`.`?``:Zd(e[e.length-1]===i?e:e+i,i)}function tf(e,t){return t+e}function nf(e,t){return function(n,r){return r.startsWith(e)?r.slice(e.length)+n:Zd(S(e,r),t.pathSeparator)+t.pathSeparator+n}}function rf(e){return e}function af(e,t,n){return t+e+n}function of(e,t){let{relativePaths:n,includeBasePath:r}=t;return n&&e?nf(e,t):r?tf:rf}function sf(e){return function(t,n){n.push(t.substring(e.length)||`.`)}}function cf(e){return function(t,n,r){let i=t.substring(e.length)||`.`;r.every(e=>e(i,!0))&&n.push(i)}}const lf=(e,t)=>{t.push(e||`.`)},uf=(e,t,n)=>{let r=e||`.`;n.every(e=>e(r,!0))&&t.push(r)},df=()=>{};function ff(e,t){let{includeDirs:n,filters:r,relativePaths:i}=t;return n?i?r&&r.length?cf(e):sf(e):r&&r.length?uf:lf:df}const pf=(e,t,n,r)=>{r.every(t=>t(e,!1))&&n.files++},mf=(e,t,n,r)=>{r.every(t=>t(e,!1))&&t.push(e)},hf=(e,t,n,r)=>{n.files++},gf=(e,t)=>{t.push(e)},_f=()=>{};function vf(e){let{excludeFiles:t,filters:n,onlyCounts:r}=e;return t?_f:n&&n.length?r?pf:mf:r?hf:gf}const yf=e=>e,bf=()=>[``].slice(0,0);function xf(e){return e.group?bf:yf}const Sf=(e,t,n)=>{e.push({directory:t,files:n,dir:t})},Cf=()=>{};function wf(e){return e.group?Sf:Cf}const Tf=function(e,t,n){let{queue:r,fs:i,options:{suppressErrors:a}}=t;r.enqueue(),i.realpath(e,(o,s)=>{if(o)return r.dequeue(a?null:o,t);i.stat(s,(i,o)=>{if(i)return r.dequeue(a?null:i,t);if(o.isDirectory()&&Of(e,s,t))return r.dequeue(null,t);n(o,s),r.dequeue(null,t)})})},Ef=function(e,t,n){let{queue:r,fs:i,options:{suppressErrors:a}}=t;r.enqueue();try{let r=i.realpathSync(e),a=i.statSync(r);if(a.isDirectory()&&Of(e,r,t))return;n(a,r)}catch(e){if(!a)throw e}};function Df(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?Ef:Tf}function Of(e,t,n){if(n.options.useRealPaths)return kf(t,n);let r=v(e),i=1;for(;r!==n.root&&i<2;){let e=n.symlinks.get(r);e&&(e===t||e.startsWith(t)||t.startsWith(e))?i++:r=v(r)}return n.symlinks.set(e,t),i>1}function kf(e,t){return t.visited.includes(e+t.options.pathSeparator)}const Af=e=>e.counts,jf=e=>e.groups,Mf=e=>e.paths,Nf=e=>e.paths.slice(0,e.options.maxFiles),Pf=(e,t,n)=>(Rf(t,n,e.counts,e.options.suppressErrors),null),Ff=(e,t,n)=>(Rf(t,n,e.paths,e.options.suppressErrors),null),If=(e,t,n)=>(Rf(t,n,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),Lf=(e,t,n)=>(Rf(t,n,e.groups,e.options.suppressErrors),null);function Rf(e,t,n,r){t(e&&!r?e:null,n)}function zf(e,t){let{onlyCounts:n,group:r,maxFiles:i}=e;return n?t?Af:Pf:r?t?jf:Lf:i?t?Nf:If:t?Mf:Ff}const Bf={withFileTypes:!0},Vf=(e,t,n,r,i)=>{if(e.queue.enqueue(),r<0)return e.queue.dequeue(null,e);let{fs:a}=e;e.visited.push(t),e.counts.directories++,a.readdir(t||`.`,Bf,(t,a=[])=>{i(a,n,r),e.queue.dequeue(e.options.suppressErrors?null:t,e)})},Hf=(e,t,n,r,i)=>{let{fs:a}=e;if(r<0)return;e.visited.push(t),e.counts.directories++;let o=[];try{o=a.readdirSync(t||`.`,Bf)}catch(t){if(!e.options.suppressErrors)throw t}i(o,n,r)};function Uf(e){return e?Hf:Vf}var Wf=class{count=0;constructor(e){this.onQueueEmpty=e}enqueue(){return this.count++,this.count}dequeue(e,t){this.onQueueEmpty&&(--this.count<=0||e)&&(this.onQueueEmpty(e,t),e&&(t.controller.abort(),this.onQueueEmpty=void 0))}},Gf=class{_files=0;_directories=0;set files(e){this._files=e}get files(){return this._files}set directories(e){this._directories=e}get directories(){return this._directories}
165
163
  /* c8 ignore next 3 */
166
164
  get dirs(){return this._directories}},Kf=class{aborted=!1;abort(){this.aborted=!0}},qf=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,t,n){this.isSynchronous=!n,this.callbackInvoker=zf(t,this.isSynchronous),this.root=ef(e,t),this.state={root:$d(this.root)?this.root:this.root.slice(0,-1),paths:[``].slice(0,0),groups:[],counts:new Gf,options:t,queue:new Wf((e,t)=>this.callbackInvoker(t,e,n)),symlinks:/* @__PURE__ */ new Map,visited:[``].slice(0,0),controller:new Kf,fs:t.fs||u},this.joinPath=of(this.root,t),this.pushDirectory=ff(this.root,t),this.pushFile=vf(t),this.getArray=xf(t),this.groupFiles=wf(t),this.resolveSymlink=Df(t,this.isSynchronous),this.walkDirectory=Uf(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(e,t,n)=>{let{paths:r,options:{filters:i,resolveSymlinks:a,excludeSymlinks:o,exclude:s,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&r.length>c)return;let p=this.getArray(this.state.paths);for(let c=0;c<e.length;++c){let l=e[c];if(l.isFile()||l.isSymbolicLink()&&!a&&!o){let e=this.joinPath(l.name,t);this.pushFile(e,p,this.state.counts,i)}else if(l.isDirectory()){let e=af(l.name,t,this.state.options.pathSeparator);if(s&&s(l.name,e))continue;this.pushDirectory(e,r,i),this.walkDirectory(this.state,e,e,n-1,this.walk)}else if(this.resolveSymlink&&l.isSymbolicLink()){let e=tf(l.name,t);this.resolveSymlink(e,this.state,(t,r)=>{if(t.isDirectory()){if(r=ef(r,this.state.options),s&&s(l.name,u?r:e+d))return;this.walkDirectory(this.state,r,u?r:e+d,n-1,this.walk)}else{r=u?r:e;let t=_(r),n=ef(v(r),this.state.options);r=this.joinPath(t,n),this.pushFile(r,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,t,p)}};function Jf(e,t){return new Promise((n,r)=>{Yf(e,t,(e,t)=>{if(e)return r(e);n(t)})})}function Yf(e,t,n){new qf(e,t,n).start()}function Xf(e,t){return new qf(e,t).start()}var Zf=class{constructor(e,t){this.root=e,this.options=t}withPromise(){return Jf(this.root,this.options)}withCallback(e){Yf(this.root,this.options,e)}sync(){return Xf(this.root,this.options)}};let Qf=null;
167
165
  /* c8 ignore next 6 */
@@ -169,19 +167,19 @@ try{Jd.resolve(`picomatch`),Qf=Jd(`picomatch`)}catch{}var $f=class{globCache={};
169
167
  /* c8 ignore next 4 */
170
168
  crawlWithOptions(e,t){return this.options={...this.options,...t},new Zf(e||`.`,this.options)}glob(...e){return this.globFunction?this.globWithOptions(e):this.globWithOptions(e,{dot:!0})}globWithOptions(e,...t){let n=this.globFunction||Qf;
171
169
  /* c8 ignore next 5 */
172
- if(!n)throw Error(`Please specify a glob function to use glob matching.`);var r=this.globCache[e.join(`\0`)];return r||(r=n(e,...t),this.globCache[e.join(`\0`)]=r),this.options.filters.push(e=>r(e)),this}},ep=/* @__PURE__ */ n(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),tp=/* @__PURE__ */ n((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=ep();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),np=/* @__PURE__ */ n(((e,t)=>{let n=tp(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=ep(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.tokens===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,O=0,k=0,A=!1,j=!1,ee=!1,te=!1,M=!1,N=!1,P=!1,F=!1,ne=!1,re=!1,ie=0,I,L,R={value:``,depth:0,isGlob:!1},ae=()=>D>=x,oe=()=>E.charCodeAt(D+1),se=()=>(I=L,E.charCodeAt(++D));for(;D<x;){L=se();let e;if(L===a)P=R.backslashes=!0,L=se(),L===u&&(N=!0);else{if(N===!0||L===u){for(ie++;ae()!==!0&&(L=se());)if(L===a)P=R.backslashes=!0,se();else if(L===u)ie++;else{if(N!==!0&&L===s&&(L=se())===s||N!==!0&&L===o){if(A=R.isBrace=!0,ee=R.isGlob=!0,re=!0,S===!0)continue;break}if(L===h&&(ie--,ie===0)){N=!1,A=R.isBrace=!0,re=!0;break}}if(S===!0)continue;break}if(L===l){if(C.push(D),w.push(R),R={value:``,depth:0,isGlob:!1},re===!0)continue;if(I===s&&D===O+1){O+=2;continue}k=D+1}else{if(b.noext!==!0&&(L===p||L===i||L===r||L===m||L===c)&&oe()===d){if(ee=R.isGlob=!0,te=R.isExtglob=!0,re=!0,L===c&&D===O&&(ne=!0),S===!0){let e=0;for(;ae()!==!0&&(L=se());)if(L===a)P=R.backslashes=!0,se();else if(L===d)e++;else if(L===g&&--e===0){re=!0;break}continue}break}if(L===r){if(I===r&&(M=R.isGlobstar=!0),ee=R.isGlob=!0,re=!0,S===!0)continue;break}if(L===m){if(ee=R.isGlob=!0,re=!0,S===!0)continue;break}if(L===f){for(;ae()!==!0&&(e=se());)if(e===a)P=R.backslashes=!0,se();else if(e===_){j=R.isBracket=!0,ee=R.isGlob=!0,re=!0;break}if(S===!0)continue;break}if(b.nonegate!==!0&&L===c&&D===O)F=R.negated=!0,O++;else{if(b.noparen!==!0&&L===d){if(ee=R.isGlob=!0,S===!0){let e=1;for(;ae()!==!0&&(L=se());)if(L===a)P=R.backslashes=!0,se();else if(L===d)e++;else if(L===g&&--e===0){re=!0;break}continue}break}if(ee===!0){if(re=!0,S===!0)continue;break}}}}}b.noext===!0&&(te=!1,ee=!1);let z=E,ce=``,le=``;O>0&&(ce=E.slice(0,O),E=E.slice(O),k-=O),z&&ee===!0&&k>0?(z=E.slice(0,k),le=E.slice(k)):ee===!0?(z=``,le=E):z=E,z&&z!==``&&z!==`/`&&z!==E&&v(z.charCodeAt(z.length-1))&&(z=z.slice(0,-1)),b.unescape===!0&&(le&&=n.removeBackslashes(le),z&&P===!0&&(z=n.removeBackslashes(z)));let ue={prefix:ce,input:e,start:O,base:z,glob:le,isBrace:A,isBracket:j,isGlob:ee,isExtglob:te,isGlobstar:M,negated:F,negatedExtglob:ne};if(b.tokens===!0&&(ue.maxDepth=0,v(L)||w.push(R),ue.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t===void 0?O:t+1,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&O!==0?(w[n].isPrefix=!0,w[n].value=ce):w[n].value=a,y(w[n]),ue.maxDepth+=w[n].depth),i>=O&&(T.push(a),t=i)}let n=t===void 0?O:t+1,r=e.slice(n);T.push(r),b.tokens&&t&&t+1<e.length&&(w[w.length-1].value=r,y(w[w.length-1]),ue.maxDepth+=w[w.length-1].depth),ue.slashes=C,ue.parts=T}return ue}})),rp=/* @__PURE__ */ n(((e,t)=>{let n=ep(),r=tp(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e)if(o===!0)a+=s,o=!1;else if(s===`\\`)a+=s,o=!0;else if(s===`"`)i=i===1?0:1,a+=s;else{if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e)if(t===!0)t=!1;else if(n===`\\`)t=!0;else if(/[?*+@!()[\]{}]/.test(n))return!1;return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(a&&r===a.repeat(r.length)&&i===a.repeat(i.length)&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0)a=!1;else if(s===`\\`)a=!0;else if(s===`"`)i=i===1?0:1;else if(i!==1){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(!(n>0)){if(s===`(`)r++;else if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,_=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},v=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=_(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1)a.push(n);else if(s=!1,v(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:g([...new Set(a)])}:{risky:!0}:{risky:!1}},b=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),v=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:T,NO_DOT:E,NO_DOT_SLASH:D,NO_DOTS_SLASH:O,QMARK:k,QMARK_NO_DOT:A,STAR:j,START_ANCHOR:ee}=_,te=e=>`(${g}(?:(?!${ee}${e.dot?T:x}).)*?)`,M=d.dot?``:E,N=d.dot?k:A,P=d.bash===!0?te(d):j;d.capture&&(P=`(${P})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let F={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,F),p=e.length;let ne=[],re=[],ie=[],I=m,L,R=()=>F.index===p-1,ae=F.peek=(t=1)=>e[F.index+t],oe=F.advance=()=>e[++F.index]||``,se=()=>e.slice(F.index+1),z=(e=``,t=0)=>{F.consumed+=e,F.index+=t},ce=e=>{F.output+=e.output==null?e.value:e.output,z(e.value)},le=()=>{let e=1;for(;ae()===`!`&&(ae(2)!==`(`||ae(3)===`?`);)oe(),F.start++,e++;return e%2!=0&&(F.negated=!0,F.start++,!0)},ue=e=>{F[e]++,ie.push(e)},de=e=>{F[e]--,ie.pop()},B=e=>{if(I.type===`globstar`){let t=F.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||ne.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(F.output=F.output.slice(0,-I.output.length),I.type=`star`,I.value=`*`,I.output=P,F.output+=I.output)}ne.length&&e.type!==`paren`&&(ne[ne.length-1].inner+=e.value),(e.value||e.output)&&ce(e),I&&I.type===`text`&&e.type===`text`?(I.output=(I.output||I.value)+e.value,I.value+=e.value):(e.prev=I,h.push(e),I=e)},fe=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=I,n.parens=F.parens,n.output=F.output,n.startIndex=F.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;ue(`parens`),B({type:e,value:t,output:F.output?``:w}),B({type:`paren`,extglob:!0,value:oe(),output:r}),ne.push(n)},pe=n=>{let i=e.slice(n.startIndex,F.index+1),a=e.slice(n.startIndex+2,F.index),o=y(a,d);if((n.type===`plus`||n.type===`star`)&&o.risky){let e=o.safeOutput?(n.output?``:w)+(d.capture?`(${o.safeOutput})`:o.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;F.output=n.output+t.output,F.backtrack=!0,B({type:`paren`,extglob:!0,value:L,output:``}),de(`parens`);return}let s=n.close+(d.capture?`)`:``),c;if(n.type===`negate`){let e=P;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=te(d)),(e!==P||R()||/^\)+$/.test(se()))&&(s=n.close=`)$))${e}`),n.inner.includes(`*`)&&(c=se())&&/^\.[^\\/.]+$/.test(c)&&(s=n.close=`)${b(c,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(F.negatedExtglob=!0)}B({type:`paren`,extglob:!0,value:L,output:s}),de(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?k.repeat(a.length):``):o===0?N+(a?k.repeat(a.length):``):k.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?P:``):P:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(F.output=e,F):(F.output=r.wrapOutput(i,F,t),F)}for(;!R();){if(L=oe(),L===`\0`)continue;if(L===`\\`){let e=ae();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){L+=`\\`,B({type:`text`,value:L});continue}let t=/^\\+/.exec(se()),n=0;if(t&&t[0].length>2&&(n=t[0].length,F.index+=n,n%2!=0&&(L+=`\\`)),d.unescape===!0?L=oe():L+=oe(),F.brackets===0){B({type:`text`,value:L});continue}}if(F.brackets>0&&(L!==`]`||I.value===`[`||I.value===`[^`)){if(d.posix!==!1&&L===`:`){let e=I.value.slice(1);if(e.includes(`[`)&&(I.posix=!0,e.includes(`:`))){let e=I.value.lastIndexOf(`[`),t=I.value.slice(0,e),n=I.value.slice(e+2),r=a[n];if(r){I.value=t+r,F.backtrack=!0,oe(),!m.output&&h.indexOf(I)===1&&(m.output=w);continue}}}(L===`[`&&ae()!==`:`||L===`-`&&ae()===`]`)&&(L=`\\${L}`),L===`]`&&(I.value===`[`||I.value===`[^`)&&(L=`\\${L}`),d.posix===!0&&L===`!`&&I.value===`[`&&(L=`^`),I.value+=L,ce({value:L});continue}if(F.quotes===1&&L!==`"`){L=r.escapeRegex(L),I.value+=L,ce({value:L});continue}if(L===`"`){F.quotes=F.quotes===1?0:1,d.keepQuotes===!0&&B({type:`text`,value:L});continue}if(L===`(`){ue(`parens`),B({type:`paren`,value:L});continue}if(L===`)`){if(F.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=ne[ne.length-1];if(e&&F.parens===e.parens+1){pe(ne.pop());continue}B({type:`paren`,value:L,output:F.parens?`)`:`\\)`}),de(`parens`);continue}if(L===`[`){if(d.nobracket===!0||!se().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));L=`\\${L}`}else ue(`brackets`);B({type:`bracket`,value:L});continue}if(L===`]`){if(d.nobracket===!0||I&&I.type===`bracket`&&I.value.length===1){B({type:`text`,value:L,output:`\\${L}`});continue}if(F.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));B({type:`text`,value:L,output:`\\${L}`});continue}de(`brackets`);let e=I.value.slice(1);if(I.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(L=`/${L}`),I.value+=L,ce({value:L}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(I.value);if(F.output=F.output.slice(0,-I.value.length),d.literalBrackets===!0){F.output+=t,I.value=t;continue}I.value=`(${g}${t}|${I.value})`,F.output+=I.value;continue}if(L===`{`&&d.nobrace!==!0){ue(`braces`);let e={type:`brace`,value:L,output:`(`,outputIndex:F.output.length,tokensIndex:F.tokens.length};re.push(e),B(e);continue}if(L===`}`){let e=re[re.length-1];if(d.nobrace===!0||!e){B({type:`text`,value:L,output:L});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),F.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=F.output.slice(0,e.outputIndex),r=F.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,L=t=`\\}`,F.output=n;for(let e of r)F.output+=e.output||e.value}B({type:`brace`,value:L,output:t}),de(`braces`),re.pop();continue}if(L===`|`){ne.length>0&&ne[ne.length-1].conditions++,B({type:`text`,value:L});continue}if(L===`,`){let e=L,t=re[re.length-1];t&&ie[ie.length-1]===`braces`&&(t.comma=!0,e=`|`),B({type:`comma`,value:L,output:e});continue}if(L===`/`){if(I.type===`dot`&&F.index===F.start+1){F.start=F.index+1,F.consumed=``,F.output=``,h.pop(),I=m;continue}B({type:`slash`,value:L,output:C});continue}if(L===`.`){if(F.braces>0&&I.type===`dot`){I.value===`.`&&(I.output=x);let e=re[re.length-1];I.type=`dots`,I.output+=L,I.value+=L,e.dots=!0;continue}if(F.braces+F.parens===0&&I.type!==`bos`&&I.type!==`slash`){B({type:`text`,value:L,output:x});continue}B({type:`dot`,value:L,output:x});continue}if(L===`?`){if(!(I&&I.value===`(`)&&d.noextglob!==!0&&ae()===`(`&&ae(2)!==`?`){fe(`qmark`,L);continue}if(I&&I.type===`paren`){let e=ae(),t=L;(I.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(se()))&&(t=`\\${L}`),B({type:`text`,value:L,output:t});continue}if(d.dot!==!0&&(I.type===`slash`||I.type===`bos`)){B({type:`qmark`,value:L,output:A});continue}B({type:`qmark`,value:L,output:k});continue}if(L===`!`){if(d.noextglob!==!0&&ae()===`(`&&(ae(2)!==`?`||!/[!=<:]/.test(ae(3)))){fe(`negate`,L);continue}if(d.nonegate!==!0&&F.index===0){le();continue}}if(L===`+`){if(d.noextglob!==!0&&ae()===`(`&&ae(2)!==`?`){fe(`plus`,L);continue}if(I&&I.value===`(`||d.regex===!1){B({type:`plus`,value:L,output:S});continue}if(I&&(I.type===`bracket`||I.type===`paren`||I.type===`brace`)||F.parens>0){B({type:`plus`,value:L});continue}B({type:`plus`,value:S});continue}if(L===`@`){if(d.noextglob!==!0&&ae()===`(`&&ae(2)!==`?`){B({type:`at`,extglob:!0,value:L,output:``});continue}B({type:`text`,value:L});continue}if(L!==`*`){(L===`$`||L===`^`)&&(L=`\\${L}`);let e=o.exec(se());e&&(L+=e[0],F.index+=e[0].length),B({type:`text`,value:L});continue}if(I&&(I.type===`globstar`||I.star===!0)){I.type=`star`,I.star=!0,I.value+=L,I.output=P,F.backtrack=!0,F.globstar=!0,z(L);continue}let t=se();if(d.noextglob!==!0&&/^\([^?]/.test(t)){fe(`star`,L);continue}if(I.type===`star`){if(d.noglobstar===!0){z(L);continue}let n=I.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){B({type:`star`,value:L,output:``});continue}let o=F.braces>0&&(n.type===`comma`||n.type===`brace`),s=ne.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){B({type:`star`,value:L,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[F.index+4];if(n&&n!==`/`)break;t=t.slice(3),z(`/**`,3)}let c=R()||F.parens>0&&t===`)`.repeat(F.parens)&&!ne.some(e=>e.type===`negate`);if(n.type===`bos`&&R()){I.type=`globstar`,I.value+=L,I.output=te(d),F.output=I.output,F.globstar=!0,z(L);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&c){F.output=F.output.slice(0,-(n.output+I.output).length),n.output=`(?:${n.output}`,I.type=`globstar`,I.output=te(d)+(d.strictSlashes?`)`:`|$)`),I.value+=L,F.globstar=!0,F.output+=n.output+I.output,z(L);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;F.output=F.output.slice(0,-(n.output+I.output).length),n.output=`(?:${n.output}`,I.type=`globstar`,I.output=`${te(d)}${C}|${C}${e})`,I.value+=L,F.output+=n.output+I.output,F.globstar=!0,z(L+oe()),B({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){I.type=`globstar`,I.value+=L,I.output=`(?:^|${C}|${te(d)}${C})`,F.output=I.output,F.globstar=!0,z(L+oe()),B({type:`slash`,value:`/`,output:``});continue}F.output=F.output.slice(0,-I.output.length),I.type=`globstar`,I.output=te(d),I.value+=L,F.output+=I.output,F.globstar=!0,z(L);continue}let n={type:`star`,value:L,output:P};d.bash===!0?(n.output=`.*?`,(I.type===`bos`||I.type===`slash`)&&(n.output=M+n.output),B(n)):I&&(I.type===`bracket`||I.type===`paren`)&&d.regex===!0?(n.output=L,B(n)):((F.index===F.start||I.type===`slash`||I.type===`dot`)&&(I.type===`dot`?(F.output+=D,I.output+=D):d.dot===!0?(F.output+=O,I.output+=O):(F.output+=M,I.output+=M),ae()!==`*`&&(F.output+=w,I.output+=w)),B(n))}for(;F.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));F.output=r.escapeLast(F.output,`[`),de(`brackets`)}for(;F.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));F.output=r.escapeLast(F.output,`(`),de(`parens`)}for(;F.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));F.output=r.escapeLast(F.output,`{`),de(`braces`)}if(d.strictSlashes!==!0&&(I.type===`star`||I.type===`bracket`)&&B({type:`maybe_slash`,value:``,output:`${C}?`}),F.backtrack===!0){F.output=``;for(let e of F.tokens)F.output+=e.output==null?e.value:e.output,e.suffix&&(F.output+=e.suffix)}return F};b.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},T=w(r.removePrefix(e,x));return T&&a.strictSlashes!==!0&&(T+=`${u}?`),T},t.exports=b})),ip=/* @__PURE__ */ n(((e,t)=>{let n=np(),r=rp(),i=tp(),a=ep(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),!r||p)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),ap=/* @__PURE__ */ t((/* @__PURE__ */ n(((e,t)=>{let n=ip(),r=tp();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i})))(),1);const op=Array.isArray,sp=/\\/g,cp=/^[A-Za-z]:$/,lp=process.platform===`win32`,up=/^(\/?\.\.)+$/;function dp(e,t={}){let n=e.length,r=Array(n),i=Array(n),a,o;for(a=0;a<n;a++){let n=vp(e[a]);r[a]=n;let s=n.length,c=Array(s);for(o=0;o<s;o++)c[o]=(0,ap.default)(n[o],t);i[a]=c}return e=>{let s=e.split(`/`);if(s[0]===`..`&&up.test(e))return!0;for(a=0;a<n;a++){let e=r[a],n=i[a],c=s.length,l=Math.min(c,e.length);for(o=0;o<l;){let r=e[o];if(r.includes(`/`))return!0;if(!n[o](s[o]))break;if(!t.noglobstar&&r===`**`)return!0;o++}if(o===c)return!0}return!1}}
170
+ if(!n)throw Error(`Please specify a glob function to use glob matching.`);var r=this.globCache[e.join(`\0`)];return r||(r=n(e,...t),this.globCache[e.join(`\0`)]=r),this.options.filters.push(e=>r(e)),this}},ep=/* @__PURE__ */ n(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),tp=/* @__PURE__ */ n((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=ep();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),np=/* @__PURE__ */ n(((e,t)=>{let n=tp(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=ep(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.tokens===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,O=0,k=0,A=!1,ee=!1,te=!1,ne=!1,j=!1,re=!1,M=!1,N=!1,ie=!1,P=!1,ae=0,F,I,L={value:``,depth:0,isGlob:!1},oe=()=>D>=x,se=()=>E.charCodeAt(D+1),ce=()=>(F=I,E.charCodeAt(++D));for(;D<x;){I=ce();let e;if(I===a)M=L.backslashes=!0,I=ce(),I===u&&(re=!0);else{if(re===!0||I===u){for(ae++;oe()!==!0&&(I=ce());)if(I===a)M=L.backslashes=!0,ce();else if(I===u)ae++;else{if(re!==!0&&I===s&&(I=ce())===s||re!==!0&&I===o){if(A=L.isBrace=!0,te=L.isGlob=!0,P=!0,S===!0)continue;break}if(I===h&&(ae--,ae===0)){re=!1,A=L.isBrace=!0,P=!0;break}}if(S===!0)continue;break}if(I===l){if(C.push(D),w.push(L),L={value:``,depth:0,isGlob:!1},P===!0)continue;if(F===s&&D===O+1){O+=2;continue}k=D+1}else{if(b.noext!==!0&&(I===p||I===i||I===r||I===m||I===c)&&se()===d){if(te=L.isGlob=!0,ne=L.isExtglob=!0,P=!0,I===c&&D===O&&(ie=!0),S===!0){let e=0;for(;oe()!==!0&&(I=ce());)if(I===a)M=L.backslashes=!0,ce();else if(I===d)e++;else if(I===g&&--e===0){P=!0;break}continue}break}if(I===r){if(F===r&&(j=L.isGlobstar=!0),te=L.isGlob=!0,P=!0,S===!0)continue;break}if(I===m){if(te=L.isGlob=!0,P=!0,S===!0)continue;break}if(I===f){for(;oe()!==!0&&(e=ce());)if(e===a)M=L.backslashes=!0,ce();else if(e===_){ee=L.isBracket=!0,te=L.isGlob=!0,P=!0;break}if(S===!0)continue;break}if(b.nonegate!==!0&&I===c&&D===O)N=L.negated=!0,O++;else{if(b.noparen!==!0&&I===d){if(te=L.isGlob=!0,S===!0){let e=1;for(;oe()!==!0&&(I=ce());)if(I===a)M=L.backslashes=!0,ce();else if(I===d)e++;else if(I===g&&--e===0){P=!0;break}continue}break}if(te===!0){if(P=!0,S===!0)continue;break}}}}}b.noext===!0&&(ne=!1,te=!1);let R=E,le=``,ue=``;O>0&&(le=E.slice(0,O),E=E.slice(O),k-=O),R&&te===!0&&k>0?(R=E.slice(0,k),ue=E.slice(k)):te===!0?(R=``,ue=E):R=E,R&&R!==``&&R!==`/`&&R!==E&&v(R.charCodeAt(R.length-1))&&(R=R.slice(0,-1)),b.unescape===!0&&(ue&&=n.removeBackslashes(ue),R&&M===!0&&(R=n.removeBackslashes(R)));let de={prefix:le,input:e,start:O,base:R,glob:ue,isBrace:A,isBracket:ee,isGlob:te,isExtglob:ne,isGlobstar:j,negated:N,negatedExtglob:ie};if(b.tokens===!0&&(de.maxDepth=0,v(I)||w.push(L),de.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t===void 0?O:t+1,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&O!==0?(w[n].isPrefix=!0,w[n].value=le):w[n].value=a,y(w[n]),de.maxDepth+=w[n].depth),i>=O&&(T.push(a),t=i)}let n=t===void 0?O:t+1,r=e.slice(n);T.push(r),b.tokens&&t&&t+1<e.length&&(w[w.length-1].value=r,y(w[w.length-1]),de.maxDepth+=w[w.length-1].depth),de.slashes=C,de.parts=T}return de}})),rp=/* @__PURE__ */ n(((e,t)=>{let n=ep(),r=tp(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e)if(o===!0)a+=s,o=!1;else if(s===`\\`)a+=s,o=!0;else if(s===`"`)i=i===1?0:1,a+=s;else{if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e)if(t===!0)t=!1;else if(n===`\\`)t=!0;else if(/[?*+@!()[\]{}]/.test(n))return!1;return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(a&&r===a.repeat(r.length)&&i===a.repeat(i.length)&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0)a=!1;else if(s===`\\`)a=!0;else if(s===`"`)i=i===1?0:1;else if(i!==1){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(!(n>0)){if(s===`(`)r++;else if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,_=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},v=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=_(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1)a.push(n);else if(s=!1,v(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:g([...new Set(a)])}:{risky:!0}:{risky:!1}},b=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),v=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:T,NO_DOT:E,NO_DOT_SLASH:D,NO_DOTS_SLASH:O,QMARK:k,QMARK_NO_DOT:A,STAR:ee,START_ANCHOR:te}=_,ne=e=>`(${g}(?:(?!${te}${e.dot?T:x}).)*?)`,j=d.dot?``:E,re=d.dot?k:A,M=d.bash===!0?ne(d):ee;d.capture&&(M=`(${M})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let N={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,N),p=e.length;let ie=[],P=[],ae=[],F=m,I,L=()=>N.index===p-1,oe=N.peek=(t=1)=>e[N.index+t],se=N.advance=()=>e[++N.index]||``,ce=()=>e.slice(N.index+1),R=(e=``,t=0)=>{N.consumed+=e,N.index+=t},le=e=>{N.output+=e.output==null?e.value:e.output,R(e.value)},ue=()=>{let e=1;for(;oe()===`!`&&(oe(2)!==`(`||oe(3)===`?`);)se(),N.start++,e++;return e%2!=0&&(N.negated=!0,N.start++,!0)},de=e=>{N[e]++,ae.push(e)},fe=e=>{N[e]--,ae.pop()},z=e=>{if(F.type===`globstar`){let t=N.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||ie.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(N.output=N.output.slice(0,-F.output.length),F.type=`star`,F.value=`*`,F.output=M,N.output+=F.output)}ie.length&&e.type!==`paren`&&(ie[ie.length-1].inner+=e.value),(e.value||e.output)&&le(e),F&&F.type===`text`&&e.type===`text`?(F.output=(F.output||F.value)+e.value,F.value+=e.value):(e.prev=F,h.push(e),F=e)},pe=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=F,n.parens=N.parens,n.output=N.output,n.startIndex=N.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;de(`parens`),z({type:e,value:t,output:N.output?``:w}),z({type:`paren`,extglob:!0,value:se(),output:r}),ie.push(n)},me=n=>{let i=e.slice(n.startIndex,N.index+1),a=e.slice(n.startIndex+2,N.index),o=y(a,d);if((n.type===`plus`||n.type===`star`)&&o.risky){let e=o.safeOutput?(n.output?``:w)+(d.capture?`(${o.safeOutput})`:o.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;N.output=n.output+t.output,N.backtrack=!0,z({type:`paren`,extglob:!0,value:I,output:``}),fe(`parens`);return}let s=n.close+(d.capture?`)`:``),c;if(n.type===`negate`){let e=M;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=ne(d)),(e!==M||L()||/^\)+$/.test(ce()))&&(s=n.close=`)$))${e}`),n.inner.includes(`*`)&&(c=ce())&&/^\.[^\\/.]+$/.test(c)&&(s=n.close=`)${b(c,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(N.negatedExtglob=!0)}z({type:`paren`,extglob:!0,value:I,output:s}),fe(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?k.repeat(a.length):``):o===0?re+(a?k.repeat(a.length):``):k.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?M:``):M:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(N.output=e,N):(N.output=r.wrapOutput(i,N,t),N)}for(;!L();){if(I=se(),I===`\0`)continue;if(I===`\\`){let e=oe();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){I+=`\\`,z({type:`text`,value:I});continue}let t=/^\\+/.exec(ce()),n=0;if(t&&t[0].length>2&&(n=t[0].length,N.index+=n,n%2!=0&&(I+=`\\`)),d.unescape===!0?I=se():I+=se(),N.brackets===0){z({type:`text`,value:I});continue}}if(N.brackets>0&&(I!==`]`||F.value===`[`||F.value===`[^`)){if(d.posix!==!1&&I===`:`){let e=F.value.slice(1);if(e.includes(`[`)&&(F.posix=!0,e.includes(`:`))){let e=F.value.lastIndexOf(`[`),t=F.value.slice(0,e),n=F.value.slice(e+2),r=a[n];if(r){F.value=t+r,N.backtrack=!0,se(),!m.output&&h.indexOf(F)===1&&(m.output=w);continue}}}(I===`[`&&oe()!==`:`||I===`-`&&oe()===`]`)&&(I=`\\${I}`),I===`]`&&(F.value===`[`||F.value===`[^`)&&(I=`\\${I}`),d.posix===!0&&I===`!`&&F.value===`[`&&(I=`^`),F.value+=I,le({value:I});continue}if(N.quotes===1&&I!==`"`){I=r.escapeRegex(I),F.value+=I,le({value:I});continue}if(I===`"`){N.quotes=N.quotes===1?0:1,d.keepQuotes===!0&&z({type:`text`,value:I});continue}if(I===`(`){de(`parens`),z({type:`paren`,value:I});continue}if(I===`)`){if(N.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=ie[ie.length-1];if(e&&N.parens===e.parens+1){me(ie.pop());continue}z({type:`paren`,value:I,output:N.parens?`)`:`\\)`}),fe(`parens`);continue}if(I===`[`){if(d.nobracket===!0||!ce().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));I=`\\${I}`}else de(`brackets`);z({type:`bracket`,value:I});continue}if(I===`]`){if(d.nobracket===!0||F&&F.type===`bracket`&&F.value.length===1){z({type:`text`,value:I,output:`\\${I}`});continue}if(N.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));z({type:`text`,value:I,output:`\\${I}`});continue}fe(`brackets`);let e=F.value.slice(1);if(F.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(I=`/${I}`),F.value+=I,le({value:I}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(F.value);if(N.output=N.output.slice(0,-F.value.length),d.literalBrackets===!0){N.output+=t,F.value=t;continue}F.value=`(${g}${t}|${F.value})`,N.output+=F.value;continue}if(I===`{`&&d.nobrace!==!0){de(`braces`);let e={type:`brace`,value:I,output:`(`,outputIndex:N.output.length,tokensIndex:N.tokens.length};P.push(e),z(e);continue}if(I===`}`){let e=P[P.length-1];if(d.nobrace===!0||!e){z({type:`text`,value:I,output:I});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),N.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=N.output.slice(0,e.outputIndex),r=N.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,I=t=`\\}`,N.output=n;for(let e of r)N.output+=e.output||e.value}z({type:`brace`,value:I,output:t}),fe(`braces`),P.pop();continue}if(I===`|`){ie.length>0&&ie[ie.length-1].conditions++,z({type:`text`,value:I});continue}if(I===`,`){let e=I,t=P[P.length-1];t&&ae[ae.length-1]===`braces`&&(t.comma=!0,e=`|`),z({type:`comma`,value:I,output:e});continue}if(I===`/`){if(F.type===`dot`&&N.index===N.start+1){N.start=N.index+1,N.consumed=``,N.output=``,h.pop(),F=m;continue}z({type:`slash`,value:I,output:C});continue}if(I===`.`){if(N.braces>0&&F.type===`dot`){F.value===`.`&&(F.output=x);let e=P[P.length-1];F.type=`dots`,F.output+=I,F.value+=I,e.dots=!0;continue}if(N.braces+N.parens===0&&F.type!==`bos`&&F.type!==`slash`){z({type:`text`,value:I,output:x});continue}z({type:`dot`,value:I,output:x});continue}if(I===`?`){if(!(F&&F.value===`(`)&&d.noextglob!==!0&&oe()===`(`&&oe(2)!==`?`){pe(`qmark`,I);continue}if(F&&F.type===`paren`){let e=oe(),t=I;(F.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(ce()))&&(t=`\\${I}`),z({type:`text`,value:I,output:t});continue}if(d.dot!==!0&&(F.type===`slash`||F.type===`bos`)){z({type:`qmark`,value:I,output:A});continue}z({type:`qmark`,value:I,output:k});continue}if(I===`!`){if(d.noextglob!==!0&&oe()===`(`&&(oe(2)!==`?`||!/[!=<:]/.test(oe(3)))){pe(`negate`,I);continue}if(d.nonegate!==!0&&N.index===0){ue();continue}}if(I===`+`){if(d.noextglob!==!0&&oe()===`(`&&oe(2)!==`?`){pe(`plus`,I);continue}if(F&&F.value===`(`||d.regex===!1){z({type:`plus`,value:I,output:S});continue}if(F&&(F.type===`bracket`||F.type===`paren`||F.type===`brace`)||N.parens>0){z({type:`plus`,value:I});continue}z({type:`plus`,value:S});continue}if(I===`@`){if(d.noextglob!==!0&&oe()===`(`&&oe(2)!==`?`){z({type:`at`,extglob:!0,value:I,output:``});continue}z({type:`text`,value:I});continue}if(I!==`*`){(I===`$`||I===`^`)&&(I=`\\${I}`);let e=o.exec(ce());e&&(I+=e[0],N.index+=e[0].length),z({type:`text`,value:I});continue}if(F&&(F.type===`globstar`||F.star===!0)){F.type=`star`,F.star=!0,F.value+=I,F.output=M,N.backtrack=!0,N.globstar=!0,R(I);continue}let t=ce();if(d.noextglob!==!0&&/^\([^?]/.test(t)){pe(`star`,I);continue}if(F.type===`star`){if(d.noglobstar===!0){R(I);continue}let n=F.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){z({type:`star`,value:I,output:``});continue}let o=N.braces>0&&(n.type===`comma`||n.type===`brace`),s=ie.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){z({type:`star`,value:I,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[N.index+4];if(n&&n!==`/`)break;t=t.slice(3),R(`/**`,3)}let c=L()||N.parens>0&&t===`)`.repeat(N.parens)&&!ie.some(e=>e.type===`negate`);if(n.type===`bos`&&L()){F.type=`globstar`,F.value+=I,F.output=ne(d),N.output=F.output,N.globstar=!0,R(I);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&c){N.output=N.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type=`globstar`,F.output=ne(d)+(d.strictSlashes?`)`:`|$)`),F.value+=I,N.globstar=!0,N.output+=n.output+F.output,R(I);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;N.output=N.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type=`globstar`,F.output=`${ne(d)}${C}|${C}${e})`,F.value+=I,N.output+=n.output+F.output,N.globstar=!0,R(I+se()),z({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){F.type=`globstar`,F.value+=I,F.output=`(?:^|${C}|${ne(d)}${C})`,N.output=F.output,N.globstar=!0,R(I+se()),z({type:`slash`,value:`/`,output:``});continue}N.output=N.output.slice(0,-F.output.length),F.type=`globstar`,F.output=ne(d),F.value+=I,N.output+=F.output,N.globstar=!0,R(I);continue}let n={type:`star`,value:I,output:M};d.bash===!0?(n.output=`.*?`,(F.type===`bos`||F.type===`slash`)&&(n.output=j+n.output),z(n)):F&&(F.type===`bracket`||F.type===`paren`)&&d.regex===!0?(n.output=I,z(n)):((N.index===N.start||F.type===`slash`||F.type===`dot`)&&(F.type===`dot`?(N.output+=D,F.output+=D):d.dot===!0?(N.output+=O,F.output+=O):(N.output+=j,F.output+=j),oe()!==`*`&&(N.output+=w,F.output+=w)),z(n))}for(;N.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));N.output=r.escapeLast(N.output,`[`),fe(`brackets`)}for(;N.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));N.output=r.escapeLast(N.output,`(`),fe(`parens`)}for(;N.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));N.output=r.escapeLast(N.output,`{`),fe(`braces`)}if(d.strictSlashes!==!0&&(F.type===`star`||F.type===`bracket`)&&z({type:`maybe_slash`,value:``,output:`${C}?`}),N.backtrack===!0){N.output=``;for(let e of N.tokens)N.output+=e.output==null?e.value:e.output,e.suffix&&(N.output+=e.suffix)}return N};b.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},T=w(r.removePrefix(e,x));return T&&a.strictSlashes!==!0&&(T+=`${u}?`),T},t.exports=b})),ip=/* @__PURE__ */ n(((e,t)=>{let n=np(),r=rp(),i=tp(),a=ep(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),!r||p)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),ap=/* @__PURE__ */ t((/* @__PURE__ */ n(((e,t)=>{let n=ip(),r=tp();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i})))(),1);const op=Array.isArray,sp=/\\/g,cp=/^[A-Za-z]:$/,lp=process.platform===`win32`,up=/^(\/?\.\.)+$/;function dp(e,t={}){let n=e.length,r=Array(n),i=Array(n),a,o;for(a=0;a<n;a++){let n=vp(e[a]);r[a]=n;let s=n.length,c=Array(s);for(o=0;o<s;o++)c[o]=(0,ap.default)(n[o],t);i[a]=c}return e=>{let s=e.split(`/`);if(s[0]===`..`&&up.test(e))return!0;for(a=0;a<n;a++){let e=r[a],n=i[a],c=s.length,l=Math.min(c,e.length);for(o=0;o<l;){let r=e[o];if(r.includes(`/`))return!0;if(!n[o](s[o]))break;if(!t.noglobstar&&r===`**`)return!0;o++}if(o===c)return!0}return!1}}
173
171
  /* node:coverage ignore next 2 */
174
- const fp=/^[A-Z]:\/$/i,pp=lp?e=>fp.test(e):e=>e===`/`;function mp(e,t,n){if(e===t||t.startsWith(`${e}/`)){if(n){let t=e.length+ +!pp(e);return(e,n)=>e.slice(t,n?-1:void 0)||`.`}let r=t.slice(e.length+1);return r?(e,t)=>{if(e===`.`)return r;let n=`${r}/${e}`;return t?n.slice(0,-1):n}:(e,t)=>t&&e!==`.`?e.slice(0,-1):e}return n?t=>x.relative(e,t)||`.`:n=>x.relative(e,`${t}/${n}`)||`.`}function hp(e,t){if(t.startsWith(`${e}/`)){let n=t.slice(e.length+1);return e=>`${n}/${e}`}return n=>{let r=x.relative(e,`${t}/${n}`);return n[n.length-1]===`/`&&r!==``?`${r}/`:r||`.`}}function gp(e){return e.replace(cp,e=>`${e}/`)}const _p={parts:!0};function vp(e){let t=ap.default.scan(e,_p);return t.parts?.length?t.parts:[e]}const yp=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,bp=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,xp=lp?e=>e.replace(bp,`\\$&`):e=>e.replace(yp,`\\$&`);function Sp(e,t){if(t?.caseSensitiveMatch===!1)return!0;let n=ap.default.scan(e);return n.isGlob||n.negated}function Cp(...e){console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString(`es`)}]`,...e)}function wp(e){return typeof e==`string`?[e]:e??[]}const Tp=/^(\/?\.\.)+/,Ep=/\\(?=[()[\]{}!*+?@|])/g;function Dp(e,t,n,r){let i=t.cwd,a=e;e[e.length-1]===`/`&&(a=e.slice(0,-1)),a[a.length-1]!==`*`&&t.expandDirectories&&(a+=`/**`);let o=xp(i);a=y(a.replace(Ep,``))?x.relative(o,a):x.normalize(a);let s=Tp.exec(a)?.[0],c=vp(a);if(s){let e=(s.length+1)/3,t=0,r=o.split(`/`);for(;t<e&&c[t+e]===r[r.length+t-e];)a=a.slice(0,(e-t-1)*3)+a.slice((e-t)*3+c[t+e].length+1)||`.`,t++;let l=x.join(i,s.slice(t*3));l[0]!==`.`&&n.root.length>l.length&&(n.root=gp(l),n.depthOffset=-e+t)}if(!r&&n.depthOffset>=0){n.commonPath??=c;let e=[],t=Math.min(n.commonPath.length,c.length);for(let r=0;r<t;r++){let t=c[r];if(t===`**`&&!c[r+1]){e.pop();break}if(r===c.length-1||t!==n.commonPath[r]||Sp(t))break;e.push(t)}n.depthOffset=e.length,n.commonPath=e,n.root=gp(e.length>0?x.join(i,...e):i)}return a}function Op(e,t,n){let r=[],i=[];for(let t of e.ignore)t&&(t[0]!==`!`||t[1]===`(`)&&i.push(Dp(t,e,n,!0));for(let a of t)a&&(a[0]!==`!`||a[1]===`(`?r.push(Dp(a,e,n,!1)):(a[1]!==`!`||a[2]===`(`)&&i.push(Dp(a.slice(1),e,n,!0)));return{match:r,ignore:i}}function kp(e,t){let n=e.cwd,r={root:n,depthOffset:0},i=Op(e,t,r);e.debug&&Cp(`internal processing patterns:`,i);let{absolute:a,caseSensitiveMatch:o,debug:s,dot:c,followSymbolicLinks:l,onlyDirectories:u}=e,d=r.root.replace(sp,``),f={dot:c,nobrace:e.braceExpansion===!1,nocase:!o,noextglob:e.extglob===!1,noglobstar:e.globstar===!1,posix:!0},p=(0,ap.default)(i.match,f),m=(0,ap.default)(i.ignore,f),h=dp(i.match,f),g=mp(n,d,a),_=a?g:mp(n,d,!0),v=(e,t)=>{let n=_(t,!0);return n!==`.`&&!h(n)||m(n)},y;e.deep!==void 0&&(y=Math.round(e.deep-r.depthOffset));let b=new $f({filters:[s?(e,t)=>{let n=g(e,t),r=p(n)&&!m(n);return r&&Cp(`matched ${n}`),r}:(e,t)=>{let n=g(e,t);return p(n)&&!m(n)}],exclude:s?(e,t)=>{let n=v(e,t);return Cp(`${n?`skipped`:`crawling`} ${t}`),n}:v,fs:e.fs,pathSeparator:`/`,relativePaths:!a,resolvePaths:a,includeBasePath:a,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!e.onlyFiles,maxDepth:y,signal:e.signal}).crawl(d);return e.debug&&Cp(`internal properties:`,{...r,root:d}),[b,n!==d&&!a&&hp(n,d)]}function Ap(e,t){if(t)for(let n=e.length-1;n>=0;n--)e[n]=t(e[n]);return e}const jp={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Mp(e){let t=Object.assign({},e);for(let e in jp)t[e]===void 0&&Object.assign(t,{[e]:jp[e]});return t.cwd=(t.cwd instanceof URL?ne(t.cwd):C(t.cwd||process.cwd())).replace(sp,`/`),t.ignore=wp(t.ignore),t.fs&&={readdir:t.fs.readdir||d,readdirSync:t.fs.readdirSync||f,realpath:t.fs.realpath||p,realpathSync:t.fs.realpathSync||m,stat:t.fs.stat||h,statSync:t.fs.statSync||g},t.debug&&Cp(`globbing with options:`,t),t}function Np(e,t={}){if(e&&t?.patterns)throw Error(`Cannot pass patterns as both an argument and an option`);let n=op(e)||typeof e==`string`,r=wp((n?e:e.patterns)??`**/*`),i=Mp(n?t:e);return r.length>0?kp(i,r):[]}async function Pp(e,t){let[n,r]=Np(e,t);return n?Ap(await n.withPromise(),r):[]}var Fp=class extends Error{configPath;constructor(e,t){super(e),this.name=`SharedConfigError`,this.configPath=t}},Ip=class extends Fp{cause;constructor(e,t){super(`加载配置文件 ${e} 失败`,e),this.name=`SharedConfigLoadError`,this.cause=t}},Lp=class extends Fp{searchFrom;constructor(e){super(`未在 ${e} 及其上级目录中找到 lzi.config.ts 配置文件`,e),this.name=`SharedConfigNotFoundError`,this.searchFrom=e}};function Rp(e=process.cwd()){let t=P(e);for(;;){let e=M(t,`lzi.config.ts`);if(E(e))return e;let n=ee(t);if(n===t)return null;t=n}}async function zp(e={}){let t=e.cwd??process.cwd(),n=Rp(t);if(n===null)throw new Lp(t);let r=P(n,`..`);try{return{config:(await import(n)).default,configPath:r,configFilePath:n}}catch(e){throw new Ip(n,e)}}function Bp(e,t=process.cwd()){let n=Array.isArray(e)?e:[e],r=P(t);for(;;){for(let e of n){let t=M(r,e);if(E(t))return t}let e=ee(r);if(e===r)return null;r=e}}async function Vp(e={}){let t=e.cwd??P(process.cwd());if(e.standaloneFile){let n=Bp(e.standaloneFile,t);if(n)try{let e=await import(n);return{success:!0,config:e.default??e,source:`standalone`,configFilePath:n}}catch(e){throw new Ip(n,e)}}if(e.unifiedField)try{let{config:n,configFilePath:r}=await zp({cwd:t}),i=n?.[e.unifiedField];if(i!==void 0)return{success:!0,config:i,source:`unified`,configFilePath:r}}catch{}return{success:!1,configFilePath:null}}const Hp=`lzi-dependencies.config.ts`,Up=`lzi-dev.config.ts`,Wp=()=>Bp(Hp)??Bp(Up),Gp=async e=>{let t=Wp();if(!t)return null;let n=await Vp({standaloneFile:Hp,unifiedField:`dependencies`,cwd:e});if(n.success)return{config:n.config,configPath:t,source:`dependencies`};let r=await Vp({standaloneFile:Up,unifiedField:`devTools`,cwd:e});return r.success&&(r.config.versionUpgrade!==void 0||r.config.hoisting!==void 0)&&r.success?{config:{upgrade:r.config.versionUpgrade,hoisting:r.config.hoisting},configPath:t,source:`legacy-dev-tools`}:{config:{},configPath:t,source:`dependencies`}};let Kp=Promise,qp=e=>{let t=0,n=0,r,i,a,o,s,c=()=>{t--,--n?l():o=a?.()},l=()=>{if(r&&t<e){t++;let e=r;r=r.a,e.p().then(t=>(e.c(t),c()),t=>(e.b(t),c()))}};return s={add(e){let t={p:e},a=new Kp((e,n)=>{t.c=e,t.b=n});return i=r?i.a=t:r=t,n++,l(),a},done:()=>n?o||=new Kp(e=>a=e):Kp.resolve(),clear(){for(let e=r;e;e=e.a)e.b(/* @__PURE__ */ Error(`Queue cleared`));r=i=null,n=t},active:()=>t,size:()=>n,all:e=>Kp.all(e.map(e=>s.add(typeof e==`function`?e:()=>e)))}};var Jp=/* @__PURE__ */ n(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),Yp=/* @__PURE__ */ n(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=Jp(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(/* @__PURE__ */ new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n})),Xp=/* @__PURE__ */ n(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=/* @__PURE__ */ `#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=Yp()(e);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),Zp=/* @__PURE__ */ n(((e,t)=>{let n=a(`tty`),r=a(`util`);e.init=d,e.log=c,e.formatArgs=o,e.save=l,e.load=u,e.useColors=i,e.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let t=a(`supports-color`);t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}e.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function i(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:n.isatty(process.stderr.fd)}function o(e){let{namespace:n,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${n} \u001B[0m`;e[0]=a+e[0].split(`
172
+ const fp=/^[A-Z]:\/$/i,pp=lp?e=>fp.test(e):e=>e===`/`;function mp(e,t,n){if(e===t||t.startsWith(`${e}/`)){if(n){let t=e.length+ +!pp(e);return(e,n)=>e.slice(t,n?-1:void 0)||`.`}let r=t.slice(e.length+1);return r?(e,t)=>{if(e===`.`)return r;let n=`${r}/${e}`;return t?n.slice(0,-1):n}:(e,t)=>t&&e!==`.`?e.slice(0,-1):e}return n?t=>x.relative(e,t)||`.`:n=>x.relative(e,`${t}/${n}`)||`.`}function hp(e,t){if(t.startsWith(`${e}/`)){let n=t.slice(e.length+1);return e=>`${n}/${e}`}return n=>{let r=x.relative(e,`${t}/${n}`);return n[n.length-1]===`/`&&r!==``?`${r}/`:r||`.`}}function gp(e){return e.replace(cp,e=>`${e}/`)}const _p={parts:!0};function vp(e){let t=ap.default.scan(e,_p);return t.parts?.length?t.parts:[e]}const yp=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,bp=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,xp=lp?e=>e.replace(bp,`\\$&`):e=>e.replace(yp,`\\$&`);function Sp(e,t){if(t?.caseSensitiveMatch===!1)return!0;let n=ap.default.scan(e);return n.isGlob||n.negated}function Cp(...e){console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString(`es`)}]`,...e)}function wp(e){return typeof e==`string`?[e]:e??[]}const Tp=/^(\/?\.\.)+/,Ep=/\\(?=[()[\]{}!*+?@|])/g;function Dp(e,t,n,r){let i=t.cwd,a=e;e[e.length-1]===`/`&&(a=e.slice(0,-1)),a[a.length-1]!==`*`&&t.expandDirectories&&(a+=`/**`);let o=xp(i);a=y(a.replace(Ep,``))?x.relative(o,a):x.normalize(a);let s=Tp.exec(a)?.[0],c=vp(a);if(s){let e=(s.length+1)/3,t=0,r=o.split(`/`);for(;t<e&&c[t+e]===r[r.length+t-e];)a=a.slice(0,(e-t-1)*3)+a.slice((e-t)*3+c[t+e].length+1)||`.`,t++;let l=x.join(i,s.slice(t*3));l[0]!==`.`&&n.root.length>l.length&&(n.root=gp(l),n.depthOffset=-e+t)}if(!r&&n.depthOffset>=0){n.commonPath??=c;let e=[],t=Math.min(n.commonPath.length,c.length);for(let r=0;r<t;r++){let t=c[r];if(t===`**`&&!c[r+1]){e.pop();break}if(r===c.length-1||t!==n.commonPath[r]||Sp(t))break;e.push(t)}n.depthOffset=e.length,n.commonPath=e,n.root=gp(e.length>0?x.join(i,...e):i)}return a}function Op(e,t,n){let r=[],i=[];for(let t of e.ignore)t&&(t[0]!==`!`||t[1]===`(`)&&i.push(Dp(t,e,n,!0));for(let a of t)a&&(a[0]!==`!`||a[1]===`(`?r.push(Dp(a,e,n,!1)):(a[1]!==`!`||a[2]===`(`)&&i.push(Dp(a.slice(1),e,n,!0)));return{match:r,ignore:i}}function kp(e,t){let n=e.cwd,r={root:n,depthOffset:0},i=Op(e,t,r);e.debug&&Cp(`internal processing patterns:`,i);let{absolute:a,caseSensitiveMatch:o,debug:s,dot:c,followSymbolicLinks:l,onlyDirectories:u}=e,d=r.root.replace(sp,``),f={dot:c,nobrace:e.braceExpansion===!1,nocase:!o,noextglob:e.extglob===!1,noglobstar:e.globstar===!1,posix:!0},p=(0,ap.default)(i.match,f),m=(0,ap.default)(i.ignore,f),h=dp(i.match,f),g=mp(n,d,a),_=a?g:mp(n,d,!0),v=(e,t)=>{let n=_(t,!0);return n!==`.`&&!h(n)||m(n)},y;e.deep!==void 0&&(y=Math.round(e.deep-r.depthOffset));let b=new $f({filters:[s?(e,t)=>{let n=g(e,t),r=p(n)&&!m(n);return r&&Cp(`matched ${n}`),r}:(e,t)=>{let n=g(e,t);return p(n)&&!m(n)}],exclude:s?(e,t)=>{let n=v(e,t);return Cp(`${n?`skipped`:`crawling`} ${t}`),n}:v,fs:e.fs,pathSeparator:`/`,relativePaths:!a,resolvePaths:a,includeBasePath:a,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!e.onlyFiles,maxDepth:y,signal:e.signal}).crawl(d);return e.debug&&Cp(`internal properties:`,{...r,root:d}),[b,n!==d&&!a&&hp(n,d)]}function Ap(e,t){if(t)for(let n=e.length-1;n>=0;n--)e[n]=t(e[n]);return e}const jp={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Mp(e){let t=Object.assign({},e);for(let e in jp)t[e]===void 0&&Object.assign(t,{[e]:jp[e]});return t.cwd=(t.cwd instanceof URL?ie(t.cwd):C(t.cwd||process.cwd())).replace(sp,`/`),t.ignore=wp(t.ignore),t.fs&&={readdir:t.fs.readdir||d,readdirSync:t.fs.readdirSync||f,realpath:t.fs.realpath||p,realpathSync:t.fs.realpathSync||m,stat:t.fs.stat||h,statSync:t.fs.statSync||g},t.debug&&Cp(`globbing with options:`,t),t}function Np(e,t={}){if(e&&t?.patterns)throw Error(`Cannot pass patterns as both an argument and an option`);let n=op(e)||typeof e==`string`,r=wp((n?e:e.patterns)??`**/*`),i=Mp(n?t:e);return r.length>0?kp(i,r):[]}async function Pp(e,t){let[n,r]=Np(e,t);return n?Ap(await n.withPromise(),r):[]}var Fp=class extends Error{configPath;constructor(e,t){super(e),this.name=`SharedConfigError`,this.configPath=t}},Ip=class extends Fp{cause;constructor(e,t){super(`加载配置文件 ${e} 失败`,e),this.name=`SharedConfigLoadError`,this.cause=t}},Lp=class extends Fp{searchFrom;constructor(e){super(`未在 ${e} 及其上级目录中找到 lzi.config.ts 配置文件`,e),this.name=`SharedConfigNotFoundError`,this.searchFrom=e}};function Rp(e=process.cwd()){let t=M(e);for(;;){let e=j(t,`lzi.config.ts`);if(E(e))return e;let n=te(t);if(n===t)return null;t=n}}async function zp(e={}){let t=e.cwd??process.cwd(),n=Rp(t);if(n===null)throw new Lp(t);let r=M(n,`..`);try{return{config:(await import(n)).default,configPath:r,configFilePath:n}}catch(e){throw new Ip(n,e)}}function Bp(e,t=process.cwd()){let n=Array.isArray(e)?e:[e],r=M(t);for(;;){for(let e of n){let t=j(r,e);if(E(t))return t}let e=te(r);if(e===r)return null;r=e}}async function Vp(e={}){let t=e.cwd??M(process.cwd());if(e.standaloneFile){let n=Bp(e.standaloneFile,t);if(n)try{let e=await import(n);return{success:!0,config:e.default??e,source:`standalone`,configFilePath:n}}catch(e){throw new Ip(n,e)}}if(e.unifiedField)try{let{config:n,configFilePath:r}=await zp({cwd:t}),i=n?.[e.unifiedField];if(i!==void 0)return{success:!0,config:i,source:`unified`,configFilePath:r}}catch{}return{success:!1,configFilePath:null}}const Hp=`lzi-dependencies.config.ts`,Up=`lzi-dev.config.ts`,Wp=()=>Bp(Hp)??Bp(Up),Gp=async e=>{let t=Wp();if(!t)return null;let n=await Vp({standaloneFile:Hp,unifiedField:`dependencies`,cwd:e});if(n.success)return{config:n.config,configPath:t,source:`dependencies`};let r=await Vp({standaloneFile:Up,unifiedField:`devTools`,cwd:e});return r.success&&(r.config.versionUpgrade!==void 0||r.config.hoisting!==void 0)&&r.success?{config:{upgrade:r.config.versionUpgrade,hoisting:r.config.hoisting},configPath:t,source:`legacy-dev-tools`}:{config:{},configPath:t,source:`dependencies`}};let Kp=Promise,qp=e=>{let t=0,n=0,r,i,a,o,s,c=()=>{t--,--n?l():o=a?.()},l=()=>{if(r&&t<e){t++;let e=r;r=r.a,e.p().then(t=>(e.c(t),c()),t=>(e.b(t),c()))}};return s={add(e){let t={p:e},a=new Kp((e,n)=>{t.c=e,t.b=n});return i=r?i.a=t:r=t,n++,l(),a},done:()=>n?o||=new Kp(e=>a=e):Kp.resolve(),clear(){for(let e=r;e;e=e.a)e.b(/* @__PURE__ */ Error(`Queue cleared`));r=i=null,n=t},active:()=>t,size:()=>n,all:e=>Kp.all(e.map(e=>s.add(typeof e==`function`?e:()=>e)))}};var Jp=/* @__PURE__ */ n(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),Yp=/* @__PURE__ */ n(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=Jp(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(/* @__PURE__ */ new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n})),Xp=/* @__PURE__ */ n(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=/* @__PURE__ */ `#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=Yp()(e);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),Zp=/* @__PURE__ */ n(((e,t)=>{let n=a(`tty`),r=a(`util`);e.init=d,e.log=c,e.formatArgs=o,e.save=l,e.load=u,e.useColors=i,e.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let t=a(`supports-color`);t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}e.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function i(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:n.isatty(process.stderr.fd)}function o(e){let{namespace:n,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${n} \u001B[0m`;e[0]=a+e[0].split(`
175
173
  `).join(`
176
174
  `+a),e.push(i+`m+`+t.exports.humanize(this.diff)+`\x1B[0m`)}else e[0]=s()+n+` `+e[0]}function s(){return e.inspectOpts.hideDate?``:(/* @__PURE__ */ new Date()).toISOString()+` `}function c(...t){return process.stderr.write(r.formatWithOptions(e.inspectOpts,...t)+`
177
175
  `)}function l(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function u(){return process.env.DEBUG}function d(t){t.inspectOpts={};let n=Object.keys(e.inspectOpts);for(let r=0;r<n.length;r++)t.inspectOpts[n[r]]=e.inspectOpts[n[r]]}t.exports=Yp()(e);let{formatters:f}=t.exports;f.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split(`
178
- `).map(e=>e.trim()).join(` `)},f.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}})),Qp=/* @__PURE__ */ n(((e,t)=>{t.exports=typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?Xp():Zp()}));const $p=/^[A-Za-z]:\//;function em(e=``){return e&&e.replace(/\\/g,`/`).replace($p,e=>e.toUpperCase())}const tm=/^[/\\]{2}/,nm=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,rm=/^[A-Za-z]:$/,im=function(e){if(e.length===0)return`.`;e=em(e);let t=e.match(tm),n=lm(e),r=e[e.length-1]===`/`;return e=cm(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),rm.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!lm(e)?`/${e}`:e)},am=function(...e){let t=``;for(let n of e)if(n){if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;t+=e&&r?n.slice(1):e||r?n:`/${n}`}else t+=n}return im(t)};function om(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const sm=function(...e){e=e.map(e=>em(e));let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:om();i&&i.length!==0&&(t=`${i}/${t}`,n=lm(i))}return t=cm(t,!n),n&&!lm(t)?`/${t}`:t.length>0?t:`.`};function cm(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(i!==s-1&&a!==1){if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1}i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}const lm=function(e){return nm.test(e)},um=function(e){let t=em(e).replace(/\/$/,``).split(`/`).slice(0,-1);return t.length===1&&rm.test(t[0])&&(t[0]+=`/`),t.join(`/`)||(lm(e)?`/`:`.`)};var dm=/* @__PURE__ */ t(Qp(),1);const fm=Object.prototype.toString,pm=e=>fm.call(e)===`[object Error]`,mm=/* @__PURE__ */ new Set([`network error`,`Failed to fetch`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`,`fetch failed`,`terminated`,` A network error occurred.`,`Network connection lost`]);function hm(e){if(!(e&&pm(e)&&e.name===`TypeError`&&typeof e.message==`string`))return!1;let{message:t,stack:n}=e;return t===`Load failed`?n===void 0||`__sentry_captured__`in e:t.startsWith(`error sending request for url`)?!0:mm.has(t)}function gm(e){if(typeof e==`number`){if(e<0)throw TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(e))throw TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(e!==void 0)throw TypeError("Expected `retries` to be a number or Infinity.")}function _m(e,t,{min:n=0,allowInfinity:r=!1}={}){if(t!==void 0){if(typeof t!=`number`||Number.isNaN(t))throw TypeError(`Expected \`${e}\` to be a number${r?` or Infinity`:``}.`);if(!r&&!Number.isFinite(t))throw TypeError(`Expected \`${e}\` to be a finite number.`);if(t<n)throw TypeError(`Expected \`${e}\` to be \u2265 ${n}.`)}}function vm(e,t){if(t!==void 0&&typeof t!=`function`)throw TypeError(`Expected \`${e}\` to be a function.`)}var ym=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}};function bm(e,t){let n=Math.max(1,e+1),r=t.randomize?Math.random()+1:1,i=Math.round(r*t.minTimeout*t.factor**(n-1));return i=Math.min(i,t.maxTimeout),i}function xm(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function Sm(e,t){e<=0||await new Promise((n,r)=>{let i=()=>{clearTimeout(a),t.signal?.removeEventListener(`abort`,i),r(t.signal.reason)},a=setTimeout(()=>{t.signal?.removeEventListener(`abort`,i),n()},e);t.unref&&a.unref?.(),t.signal?.addEventListener(`abort`,i,{once:!0})})}async function Cm({error:e,attemptNumber:t,retriesConsumed:n,startTime:r,options:i}){let a=e instanceof Error?e:/* @__PURE__ */ TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(a instanceof ym)throw a.originalError;let o=Number.isFinite(i.retries)?Math.max(0,i.retries-n):i.retries,s=i.maxRetryTime??1/0,c=bm(n,i);if(xm(r,s)<=0){let e=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:0});throw await i.onFailedAttempt(e),a}let l=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:o>0?c:0}),u=await i.shouldConsumeRetry(l),d=u&&o>0?c:0,f=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:d});if(await i.onFailedAttempt(f),xm(r,s)<=0||xm(r,s)<=0||o<=0||a instanceof TypeError&&!hm(a)||!await i.shouldRetry(f))throw a;let p=xm(r,s);if(p<=0)throw a;if(!u)return i.signal?.throwIfAborted(),!1;let m=Math.min(d,p);return i.signal?.throwIfAborted(),await Sm(m,i),i.signal?.throwIfAborted(),!0}async function wm(e,t={}){if(t={...t},gm(t.retries),Object.hasOwn(t,`forever`))throw Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");t.retries??=10,t.factor??=2,t.minTimeout??=1e3,t.maxTimeout??=1/0,t.maxRetryTime??=1/0,t.randomize??=!1,t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.shouldConsumeRetry??=()=>!0,vm(`onFailedAttempt`,t.onFailedAttempt),vm(`shouldRetry`,t.shouldRetry),vm(`shouldConsumeRetry`,t.shouldConsumeRetry),_m(`factor`,t.factor,{min:0,allowInfinity:!1}),_m(`minTimeout`,t.minTimeout,{min:0,allowInfinity:!1}),_m(`maxTimeout`,t.maxTimeout,{min:0,allowInfinity:!0}),_m(`maxRetryTime`,t.maxRetryTime,{min:0,allowInfinity:!0}),t.factor>0||(t.factor=1),t.signal?.throwIfAborted();let n=0,r=0,i=performance.now();for(;!Number.isFinite(t.retries)||r<=t.retries;){n++;try{t.signal?.throwIfAborted();let r=await e(n);return t.signal?.throwIfAborted(),r}catch(e){await Cm({error:e,attemptNumber:n,retriesConsumed:r,startTime:i,options:t})&&r++}}throw Error(`Retry attempts exhausted without throwing an error.`)}const Tm={retries:5,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1},Em={apiEndpoint:`https://npm.antfu.dev/`};async function Dm(e,t={}){let{apiEndpoint:n=Em.apiEndpoint,fetch:r=fetch,throw:i=!0,retry:a=Tm}=t,o=[t.force?`force=true`:``,t.loose?`loose=true`:``,t.metadata?`metadata=true`:``,t.after?`after=${encodeURIComponent(t.after)}`:``,i?``:`throw=false`].filter(Boolean).join(`&`);o&&=`?${o}`;let s=()=>r(new URL(`/versions/${e.join(`+`)}${o}`,n)).then(e=>e.json()),c=Am(await(a===!1?s():wm(s,typeof a==`number`?{...Tm,retries:a}:a)));return i?km(c):c}async function Om(e,t={}){let[n]=await Dm([e],t);return n}function km(e){for(let t of Am(e))if(t&&`error`in t)throw Error(t.message||t.error);return e}function Am(e){return Array.isArray(e)?e:[e]}const jm=`https://registry.npmjs.org/`;function Mm(e,t,n=jm){let r=e?t[`${e.replace(/^@?/,`@`)}:registry`]:void 0;return!r&&typeof t.scope==`string`&&(r=t[`${t.scope.replace(/^@?/,`@`)}:registry`]),r||=t.registry||n,r}var Nm=Object.create,Pm=Object.defineProperty,Fm=Object.getOwnPropertyDescriptor,Im=Object.getOwnPropertyNames,Lm=Object.getPrototypeOf,Rm=Object.prototype.hasOwnProperty,zm=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bm=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Im(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Rm.call(e,s)&&s!==n&&Pm(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Fm(t,s))||r.enumerable});return e},Vm=(e,t,n)=>(n=e==null?{}:Nm(Lm(e)),Bm(t||!e||!e.__esModule?Pm(n,`default`,{value:e,enumerable:!0}):n,e));const Hm={retries:5,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};function Um(e){if(e.provenance!==void 0)return e.provenance;if(e.dist?.provenance!==void 0)return e.dist.provenance;if(e.dist?.attestations?.provenance)return!0}const Wm=/(?!^)_/gu,Gm=/\r?\n/u,Km=/\$\{([^}]+)\}/g;function qm(e){return Jm(e,`npm_config_userconfig`)||M(e.HOME||c(),`.npmrc`)}function Jm(e,t){let n=t.toLowerCase();for(let[t,r]of Object.entries(e))if(t.toLowerCase()===n&&r!==void 0&&r!==``)return r}function Ym(e,t=I.env){if(!E(e))return{};let n={},r=k(e,`utf8`).split(Gm);for(let e of r){let r=e.trim();if(!r||r.startsWith(`#`)||r.startsWith(`;`))continue;let i=r.indexOf(`=`);i!==-1&&Zm(n,r.slice(0,i).trim(),$m(r.slice(i+1).trim()).replace(Km,(e,n)=>t[n]??``))}return n}function Xm(e){let t={};for(let[n,r]of Object.entries(e)){if(!n.toLowerCase().startsWith(`npm_config_`)||r===void 0||r===``)continue;let e=n.slice(11);e.startsWith(`//`)||(e=e.replace(Wm,`-`).toLowerCase()),Zm(t,e,r)}return t}function Zm(e,t,n){if(t.endsWith(`[]`)){let r=t.slice(0,-2),i=e[r];Array.isArray(i)?i.push(n):e[r]=typeof i==`string`?[i,n]:[n]}else e[t]=n}function Qm(e,t){for(let[n,r]of Object.entries(t))e[n]=r}function $m(e){if(e.length<2)return e;let t=e[0],n=e.at(-1);return t===`"`&&n===`"`||t===`'`&&n===`'`?e.slice(1,-1):e}function eh(e,t){let n=th(e);return n===void 0?t:n===``||n.toLowerCase()!==`false`}function th(e){if(typeof e==`string`)return e}function nh(e){return Array.isArray(e)?e:typeof e==`string`&&e.length>0?e.split(`
176
+ `).map(e=>e.trim()).join(` `)},f.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}})),Qp=/* @__PURE__ */ n(((e,t)=>{t.exports=typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?Xp():Zp()}));const $p=/^[A-Za-z]:\//;function em(e=``){return e&&e.replace(/\\/g,`/`).replace($p,e=>e.toUpperCase())}const tm=/^[/\\]{2}/,nm=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,rm=/^[A-Za-z]:$/,im=function(e){if(e.length===0)return`.`;e=em(e);let t=e.match(tm),n=lm(e),r=e[e.length-1]===`/`;return e=cm(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),rm.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!lm(e)?`/${e}`:e)},am=function(...e){let t=``;for(let n of e)if(n){if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;t+=e&&r?n.slice(1):e||r?n:`/${n}`}else t+=n}return im(t)};function om(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const sm=function(...e){e=e.map(e=>em(e));let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:om();i&&i.length!==0&&(t=`${i}/${t}`,n=lm(i))}return t=cm(t,!n),n&&!lm(t)?`/${t}`:t.length>0?t:`.`};function cm(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(i!==s-1&&a!==1){if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1}i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}const lm=function(e){return nm.test(e)},um=function(e){let t=em(e).replace(/\/$/,``).split(`/`).slice(0,-1);return t.length===1&&rm.test(t[0])&&(t[0]+=`/`),t.join(`/`)||(lm(e)?`/`:`.`)};var dm=/* @__PURE__ */ t(Qp(),1);const fm=Object.prototype.toString,pm=e=>fm.call(e)===`[object Error]`,mm=/* @__PURE__ */ new Set([`network error`,`Failed to fetch`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`,`fetch failed`,`terminated`,` A network error occurred.`,`Network connection lost`]);function hm(e){if(!(e&&pm(e)&&e.name===`TypeError`&&typeof e.message==`string`))return!1;let{message:t,stack:n}=e;return t===`Load failed`?n===void 0||`__sentry_captured__`in e:t.startsWith(`error sending request for url`)?!0:mm.has(t)}function gm(e){if(typeof e==`number`){if(e<0)throw TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(e))throw TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(e!==void 0)throw TypeError("Expected `retries` to be a number or Infinity.")}function _m(e,t,{min:n=0,allowInfinity:r=!1}={}){if(t!==void 0){if(typeof t!=`number`||Number.isNaN(t))throw TypeError(`Expected \`${e}\` to be a number${r?` or Infinity`:``}.`);if(!r&&!Number.isFinite(t))throw TypeError(`Expected \`${e}\` to be a finite number.`);if(t<n)throw TypeError(`Expected \`${e}\` to be \u2265 ${n}.`)}}function vm(e,t){if(t!==void 0&&typeof t!=`function`)throw TypeError(`Expected \`${e}\` to be a function.`)}var ym=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}};function bm(e,t){let n=Math.max(1,e+1),r=t.randomize?Math.random()+1:1,i=Math.round(r*t.minTimeout*t.factor**(n-1));return i=Math.min(i,t.maxTimeout),i}function xm(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function Sm(e,t){e<=0||await new Promise((n,r)=>{let i=()=>{clearTimeout(a),t.signal?.removeEventListener(`abort`,i),r(t.signal.reason)},a=setTimeout(()=>{t.signal?.removeEventListener(`abort`,i),n()},e);t.unref&&a.unref?.(),t.signal?.addEventListener(`abort`,i,{once:!0})})}async function Cm({error:e,attemptNumber:t,retriesConsumed:n,startTime:r,options:i}){let a=e instanceof Error?e:/* @__PURE__ */ TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(a instanceof ym)throw a.originalError;let o=Number.isFinite(i.retries)?Math.max(0,i.retries-n):i.retries,s=i.maxRetryTime??1/0,c=bm(n,i);if(xm(r,s)<=0){let e=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:0});throw await i.onFailedAttempt(e),a}let l=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:o>0?c:0}),u=await i.shouldConsumeRetry(l),d=u&&o>0?c:0,f=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:d});if(await i.onFailedAttempt(f),xm(r,s)<=0||xm(r,s)<=0||o<=0||a instanceof TypeError&&!hm(a)||!await i.shouldRetry(f))throw a;let p=xm(r,s);if(p<=0)throw a;if(!u)return i.signal?.throwIfAborted(),!1;let m=Math.min(d,p);return i.signal?.throwIfAborted(),await Sm(m,i),i.signal?.throwIfAborted(),!0}async function wm(e,t={}){if(t={...t},gm(t.retries),Object.hasOwn(t,`forever`))throw Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");t.retries??=10,t.factor??=2,t.minTimeout??=1e3,t.maxTimeout??=1/0,t.maxRetryTime??=1/0,t.randomize??=!1,t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.shouldConsumeRetry??=()=>!0,vm(`onFailedAttempt`,t.onFailedAttempt),vm(`shouldRetry`,t.shouldRetry),vm(`shouldConsumeRetry`,t.shouldConsumeRetry),_m(`factor`,t.factor,{min:0,allowInfinity:!1}),_m(`minTimeout`,t.minTimeout,{min:0,allowInfinity:!1}),_m(`maxTimeout`,t.maxTimeout,{min:0,allowInfinity:!0}),_m(`maxRetryTime`,t.maxRetryTime,{min:0,allowInfinity:!0}),t.factor>0||(t.factor=1),t.signal?.throwIfAborted();let n=0,r=0,i=performance.now();for(;!Number.isFinite(t.retries)||r<=t.retries;){n++;try{t.signal?.throwIfAborted();let r=await e(n);return t.signal?.throwIfAborted(),r}catch(e){await Cm({error:e,attemptNumber:n,retriesConsumed:r,startTime:i,options:t})&&r++}}throw Error(`Retry attempts exhausted without throwing an error.`)}const Tm={retries:5,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1},Em={apiEndpoint:`https://npm.antfu.dev/`};async function Dm(e,t={}){let{apiEndpoint:n=Em.apiEndpoint,fetch:r=fetch,throw:i=!0,retry:a=Tm}=t,o=[t.force?`force=true`:``,t.loose?`loose=true`:``,t.metadata?`metadata=true`:``,t.after?`after=${encodeURIComponent(t.after)}`:``,i?``:`throw=false`].filter(Boolean).join(`&`);o&&=`?${o}`;let s=()=>r(new URL(`/versions/${e.join(`+`)}${o}`,n)).then(e=>e.json()),c=Am(await(a===!1?s():wm(s,typeof a==`number`?{...Tm,retries:a}:a)));return i?km(c):c}async function Om(e,t={}){let[n]=await Dm([e],t);return n}function km(e){for(let t of Am(e))if(t&&`error`in t)throw Error(t.message||t.error);return e}function Am(e){return Array.isArray(e)?e:[e]}const jm=`https://registry.npmjs.org/`;function Mm(e,t,n=jm){let r=e?t[`${e.replace(/^@?/,`@`)}:registry`]:void 0;return!r&&typeof t.scope==`string`&&(r=t[`${t.scope.replace(/^@?/,`@`)}:registry`]),r||=t.registry||n,r}var Nm=Object.create,Pm=Object.defineProperty,Fm=Object.getOwnPropertyDescriptor,Im=Object.getOwnPropertyNames,Lm=Object.getPrototypeOf,Rm=Object.prototype.hasOwnProperty,zm=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bm=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Im(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Rm.call(e,s)&&s!==n&&Pm(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Fm(t,s))||r.enumerable});return e},Vm=(e,t,n)=>(n=e==null?{}:Nm(Lm(e)),Bm(t||!e||!e.__esModule?Pm(n,`default`,{value:e,enumerable:!0}):n,e));const Hm={retries:5,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};function Um(e){if(e.provenance!==void 0)return e.provenance;if(e.dist?.provenance!==void 0)return e.dist.provenance;if(e.dist?.attestations?.provenance)return!0}const Wm=/(?!^)_/gu,Gm=/\r?\n/u,Km=/\$\{([^}]+)\}/g;function qm(e){return Jm(e,`npm_config_userconfig`)||j(e.HOME||c(),`.npmrc`)}function Jm(e,t){let n=t.toLowerCase();for(let[t,r]of Object.entries(e))if(t.toLowerCase()===n&&r!==void 0&&r!==``)return r}function Ym(e,t=F.env){if(!E(e))return{};let n={},r=k(e,`utf8`).split(Gm);for(let e of r){let r=e.trim();if(!r||r.startsWith(`#`)||r.startsWith(`;`))continue;let i=r.indexOf(`=`);i!==-1&&Zm(n,r.slice(0,i).trim(),$m(r.slice(i+1).trim()).replace(Km,(e,n)=>t[n]??``))}return n}function Xm(e){let t={};for(let[n,r]of Object.entries(e)){if(!n.toLowerCase().startsWith(`npm_config_`)||r===void 0||r===``)continue;let e=n.slice(11);e.startsWith(`//`)||(e=e.replace(Wm,`-`).toLowerCase()),Zm(t,e,r)}return t}function Zm(e,t,n){if(t.endsWith(`[]`)){let r=t.slice(0,-2),i=e[r];Array.isArray(i)?i.push(n):e[r]=typeof i==`string`?[i,n]:[n]}else e[t]=n}function Qm(e,t){for(let[n,r]of Object.entries(t))e[n]=r}function $m(e){if(e.length<2)return e;let t=e[0],n=e.at(-1);return t===`"`&&n===`"`||t===`'`&&n===`'`?e.slice(1,-1):e}function eh(e,t){let n=th(e);return n===void 0?t:n===``||n.toLowerCase()!==`false`}function th(e){if(typeof e==`string`)return e}function nh(e){return Array.isArray(e)?e:typeof e==`string`&&e.length>0?e.split(`
179
177
 
180
- `):[]}const rh=/^(\/\/.+):(_authToken|_auth|username|_password|certfile|keyfile)$/u,ih=/^@[^:]+:registry$/u;function ah(e){let t={};for(let[n,r]of Object.entries(e)){if(!ih.test(n))continue;let e=th(r);e&&(t[n.slice(0,-9)]=lh(e))}return t}function oh(e,t,n){let r={registry:e};for(let[e,n]of Object.entries(t))r[`${e}:registry`]=n;return n&&(r.scope=n),r}function sh(e){let t={};for(let[n,r]of Object.entries(e)){let e=n.match(rh);if(!e)continue;let[,i,a]=e,o=uh(i),s=t[o]??{},c=th(r);if(c!==void 0)switch(a){case`_auth`:s._auth=c;break;case`_authToken`:s._authToken=c;break;case`username`:s.username=c;break;case`_password`:s._password=c;break;case`certfile`:s.certfile=c;break;case`keyfile`:s.keyfile=c}t[o]=s}return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,ch(t)]).filter(e=>Object.keys(e[1]).length>0))}function ch(e){let t={};if(e._authToken)t.token=e._authToken;else if(e._auth)t.basicAuth=e._auth;else if(e.username&&e._password){let n=L.from(e._password,`base64`).toString(`utf8`);t.basicAuth=L.from(`${e.username}:${n}`,`utf8`).toString(`base64`)}return e.certfile&&(t.certFile=e.certfile),e.keyfile&&(t.keyFile=e.keyfile),t}function lh(e){return e.endsWith(`/`)?e:`${e}/`}function uh(e){return e.endsWith(`/`)?e:`${e}/`}function dh(e){let t=new URL(lh(e)),n=t.pathname.endsWith(`/`)?t.pathname:`${t.pathname}/`;return`//${t.host}${n}`}function fh(e,t){let n=dh(e),r;for(let e of Object.keys(t))n.startsWith(e)&&(!r||e.length>r.length)&&(r=e);return r?t[r]:void 0}function ph(e={}){let t=e.env??I.env,n=e.cwd??I.cwd(),r=e.userConfigPath??qm(t),i=e.projectConfigPath===!1?void 0:e.projectConfigPath??M(n,`.npmrc`),a={registry:jm,"strict-ssl":`true`};Qm(a,Ym(r,t)),i&&Qm(a,Ym(i,t)),Qm(a,Xm(t));let o=lh(th(a.registry)??`https://registry.npmjs.org/`),s=th(a.scope),c=ah(a);return{registry:o,npmConfigs:oh(o,c,s),scopeRegistries:c,authByRegistry:sh(a),strictSSL:eh(a[`strict-ssl`],!0),ca:nh(a.ca),caFile:th(a.cafile),userAgent:th(a[`user-agent`]),proxy:th(a.proxy),httpsProxy:th(a[`https-proxy`]),noProxy:th(a.noproxy),userConfigPath:r,projectConfigPath:i}}var mh=/* @__PURE__ */ zm(((e,t)=>{t.exports=/* @__PURE__ */ `_http_agent._http_client._http_common._http_incoming._http_outgoing._http_server._stream_duplex._stream_passthrough._stream_readable._stream_transform._stream_wrap._stream_writable._tls_common._tls_wrap.assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.inspector/promises.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/consumers.stream/promises.stream/web.string_decoder.sys.timers.timers/promises.tls.trace_events.tty.url.util.util/types.v8.vm.wasi.worker_threads.zlib.node:sea.node:sqlite.node:test.node:test/reporters`.split(`.`)})),hh=/* @__PURE__ */ Vm((/* @__PURE__ */ zm(((e,t)=>{let n=mh();var r=/* @__PURE__ */ RegExp(`^(?:@([^/]+?)[/])?([^/]+?)$`),i=[`node_modules`,`favicon.ico`];function a(e){var t=[],a=[];if(e===null)return a.push(`name cannot be null`),o(t,a);if(e===void 0)return a.push(`name cannot be undefined`),o(t,a);if(typeof e!=`string`)return a.push(`name must be a string`),o(t,a);if(e.length||a.push(`name length must be greater than zero`),e.startsWith(`.`)&&a.push(`name cannot start with a period`),e.startsWith(`-`)&&a.push(`name cannot start with a hyphen`),e.match(/^_/)&&a.push(`name cannot start with an underscore`),e.trim()!==e&&a.push(`name cannot contain leading or trailing spaces`),i.forEach(function(t){e.toLowerCase()===t&&a.push(t+` is not a valid package name`)}),n.includes(e.toLowerCase())&&t.push(e+` is a core module name`),e.length>214&&t.push(`name can no longer contain more than 214 characters`),e.toLowerCase()!==e&&t.push(`name can no longer contain capital letters`),/[~'!()*]/.test(e.split(`/`).slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var s=e.match(r);if(s){var c=s[1],l=s[2];if(l.startsWith(`.`)&&a.push(`name cannot start with a period`),encodeURIComponent(c)===c&&encodeURIComponent(l)===l)return o(t,a)}a.push(`name can only contain URL-friendly characters`)}return o(t,a)}var o=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n};t.exports=a})))(),1);const gh=/^file:/iu,_h=/^npm:/iu,vh=/^(?:git\+)?[a-z]+:/iu,yh=/^[^@]+@[^:.]+\.[^:]+:.+$/u,bh=/^(?:\.{1,2}(?:[/\\]|$)|[/\\]|~[/\\]|[A-Za-z]:[/\\])/u;function xh(e){let t=e.spec.trim();if(!t)throw Oh(`Package spec must be a non-empty string.`,`EINVALIDPACKAGESPEC`);Sh(t);let n=t.startsWith(`@`)?Ch(t):wh(t);return Th(n.name,t),{raw:t,name:n.name,escapedName:n.name.replace(`/`,`%2f`),scope:Eh(n.name),rawSpec:n.rawSpec}}function Sh(e){if(gh.test(e))throw Dh(e,`file`);if(_h.test(e))throw Dh(e,`npm alias`);if(bh.test(e))throw Dh(e,`local path`);if(yh.test(e))throw Dh(e,`git`);if(vh.test(e))throw Dh(e,`url`)}function Ch(e){let t=e.indexOf(`/`);if(t<=1||t===e.length-1)throw Oh(`Invalid scoped package spec "${e}".`,`EINVALIDPACKAGESPEC`);let n=e.indexOf(`@`,t+1);return n===-1?{name:e,rawSpec:``}:{name:e.slice(0,n),rawSpec:e.slice(n+1)}}function wh(e){let t=e.indexOf(`@`);return t===-1?{name:e,rawSpec:``}:{name:e.slice(0,t),rawSpec:e.slice(t+1)}}function Th(e,t){if(!e)throw Oh(`Invalid package spec "${t}".`,`EINVALIDPACKAGESPEC`);if(!e.startsWith(`@`)&&e.includes(`/`))throw Dh(t,`local path`);if(!(0,hh.default)(e).validForNewPackages)throw Oh(`Invalid package name "${e}" in "${t}".`,`EINVALIDPACKAGENAME`)}function Eh(e){if(e.startsWith(`@`))return e.slice(0,e.indexOf(`/`))}function Dh(e,t){return Oh(`Unsupported ${t} package spec "${e}" for get-npm-meta.`,`EUNSUPPORTEDPACKAGESPEC`)}function Oh(e,t){return Object.assign(Error(e),{code:t})}function kh(e){return lh(e)===jm}function Ah(e,t){let n=ph(t);return e.map(e=>jh(e,n))}function jh(e,t){let n=xh({spec:e}),r=lh(Mm(n.scope,t.npmConfigs));return{auth:fh(r,t.authByRegistry),config:t,parsed:n,registry:r}}const Mh=Object.prototype.toString,Nh=e=>Mh.call(e)===`[object Error]`,Ph=/* @__PURE__ */ new Set([`network error`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`,`fetch failed`,`terminated`,` A network error occurred.`,`Network connection lost`]);function Fh(e){if(!(e&&Nh(e)&&e.name===`TypeError`&&typeof e.message==`string`))return!1;let{message:t,stack:n}=e;return t===`Load failed`?n===void 0||`__sentry_captured__`in e:t.startsWith(`error sending request for url`)||t===`Failed to fetch`||t.startsWith(`Failed to fetch (`)&&t.endsWith(`)`)?!0:Ph.has(t)}function Ih(e){if(typeof e==`number`){if(e<0)throw TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(e))throw TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(e!==void 0)throw TypeError("Expected `retries` to be a number or Infinity.")}function Lh(e,t,{min:n=0,allowInfinity:r=!1}={}){if(t!==void 0){if(typeof t!=`number`||Number.isNaN(t))throw TypeError(`Expected \`${e}\` to be a number${r?` or Infinity`:``}.`);if(!r&&!Number.isFinite(t))throw TypeError(`Expected \`${e}\` to be a finite number.`);if(t<n)throw TypeError(`Expected \`${e}\` to be \u2265 ${n}.`)}}function Rh(e,t){if(t!==void 0&&typeof t!=`function`)throw TypeError(`Expected \`${e}\` to be a function.`)}var zh=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}};function Bh(e,t){let n=Math.max(1,e+1),r=t.randomize?Math.random()+1:1,i=Math.round(r*t.minTimeout*t.factor**(n-1));return i=Math.min(i,t.maxTimeout),i}function Vh(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function Hh(e,t){e<=0||await new Promise((n,r)=>{let i=()=>{clearTimeout(a),t.signal?.removeEventListener(`abort`,i),r(t.signal.reason)},a=setTimeout(()=>{t.signal?.removeEventListener(`abort`,i),n()},e);t.unref&&a.unref?.(),t.signal?.addEventListener(`abort`,i,{once:!0})})}async function Uh({error:e,attemptNumber:t,retriesConsumed:n,startTime:r,options:i}){let a=e instanceof Error?e:/* @__PURE__ */ TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(a instanceof zh)throw a.originalError;let o=Number.isFinite(i.retries)?Math.max(0,i.retries-n):i.retries,s=i.maxRetryTime??1/0,c=Bh(n,i);if(Vh(r,s)<=0){let e=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:0});throw await i.onFailedAttempt(e),a}let l=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:o>0?c:0}),u=await i.shouldConsumeRetry(l),d=u&&o>0?c:0,f=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:d});if(await i.onFailedAttempt(f),Vh(r,s)<=0||Vh(r,s)<=0||o<=0||a instanceof TypeError&&!Fh(a)||!await i.shouldRetry(f))throw a;let p=Vh(r,s);if(p<=0)throw a;if(!u)return i.signal?.throwIfAborted(),!1;let m=Math.min(d,p);return i.signal?.throwIfAborted(),await Hh(m,i),i.signal?.throwIfAborted(),!0}async function Wh(e,t={}){if(t={...t},Ih(t.retries),Object.hasOwn(t,`forever`))throw Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");t.retries??=10,t.factor??=2,t.minTimeout??=1e3,t.maxTimeout??=1/0,t.maxRetryTime??=1/0,t.randomize??=!1,t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.shouldConsumeRetry??=()=>!0,Rh(`onFailedAttempt`,t.onFailedAttempt),Rh(`shouldRetry`,t.shouldRetry),Rh(`shouldConsumeRetry`,t.shouldConsumeRetry),Lh(`factor`,t.factor,{min:0,allowInfinity:!1}),Lh(`minTimeout`,t.minTimeout,{min:0,allowInfinity:!1}),Lh(`maxTimeout`,t.maxTimeout,{min:0,allowInfinity:!0}),Lh(`maxRetryTime`,t.maxRetryTime,{min:0,allowInfinity:!0}),t.factor>0||(t.factor=1),t.signal?.throwIfAborted();let n=0,r=0,i=performance.now();for(;!Number.isFinite(t.retries)||r<=t.retries;){n++;try{t.signal?.throwIfAborted();let r=await e(n);return t.signal?.throwIfAborted(),r}catch(e){await Uh({error:e,attemptNumber:n,retriesConsumed:r,startTime:i,options:t})&&r++}}throw Error(`Retry attempts exhausted without throwing an error.`)}
178
+ `):[]}const rh=/^(\/\/.+):(_authToken|_auth|username|_password|certfile|keyfile)$/u,ih=/^@[^:]+:registry$/u;function ah(e){let t={};for(let[n,r]of Object.entries(e)){if(!ih.test(n))continue;let e=th(r);e&&(t[n.slice(0,-9)]=lh(e))}return t}function oh(e,t,n){let r={registry:e};for(let[e,n]of Object.entries(t))r[`${e}:registry`]=n;return n&&(r.scope=n),r}function sh(e){let t={};for(let[n,r]of Object.entries(e)){let e=n.match(rh);if(!e)continue;let[,i,a]=e,o=uh(i),s=t[o]??{},c=th(r);if(c!==void 0)switch(a){case`_auth`:s._auth=c;break;case`_authToken`:s._authToken=c;break;case`username`:s.username=c;break;case`_password`:s._password=c;break;case`certfile`:s.certfile=c;break;case`keyfile`:s.keyfile=c}t[o]=s}return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,ch(t)]).filter(e=>Object.keys(e[1]).length>0))}function ch(e){let t={};if(e._authToken)t.token=e._authToken;else if(e._auth)t.basicAuth=e._auth;else if(e.username&&e._password){let n=I.from(e._password,`base64`).toString(`utf8`);t.basicAuth=I.from(`${e.username}:${n}`,`utf8`).toString(`base64`)}return e.certfile&&(t.certFile=e.certfile),e.keyfile&&(t.keyFile=e.keyfile),t}function lh(e){return e.endsWith(`/`)?e:`${e}/`}function uh(e){return e.endsWith(`/`)?e:`${e}/`}function dh(e){let t=new URL(lh(e)),n=t.pathname.endsWith(`/`)?t.pathname:`${t.pathname}/`;return`//${t.host}${n}`}function fh(e,t){let n=dh(e),r;for(let e of Object.keys(t))n.startsWith(e)&&(!r||e.length>r.length)&&(r=e);return r?t[r]:void 0}function ph(e={}){let t=e.env??F.env,n=e.cwd??F.cwd(),r=e.userConfigPath??qm(t),i=e.projectConfigPath===!1?void 0:e.projectConfigPath??j(n,`.npmrc`),a={registry:jm,"strict-ssl":`true`};Qm(a,Ym(r,t)),i&&Qm(a,Ym(i,t)),Qm(a,Xm(t));let o=lh(th(a.registry)??`https://registry.npmjs.org/`),s=th(a.scope),c=ah(a);return{registry:o,npmConfigs:oh(o,c,s),scopeRegistries:c,authByRegistry:sh(a),strictSSL:eh(a[`strict-ssl`],!0),ca:nh(a.ca),caFile:th(a.cafile),userAgent:th(a[`user-agent`]),proxy:th(a.proxy),httpsProxy:th(a[`https-proxy`]),noProxy:th(a.noproxy),userConfigPath:r,projectConfigPath:i}}var mh=/* @__PURE__ */ zm(((e,t)=>{t.exports=/* @__PURE__ */ `_http_agent._http_client._http_common._http_incoming._http_outgoing._http_server._stream_duplex._stream_passthrough._stream_readable._stream_transform._stream_wrap._stream_writable._tls_common._tls_wrap.assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.inspector/promises.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/consumers.stream/promises.stream/web.string_decoder.sys.timers.timers/promises.tls.trace_events.tty.url.util.util/types.v8.vm.wasi.worker_threads.zlib.node:sea.node:sqlite.node:test.node:test/reporters`.split(`.`)})),hh=/* @__PURE__ */ Vm((/* @__PURE__ */ zm(((e,t)=>{let n=mh();var r=/* @__PURE__ */ RegExp(`^(?:@([^/]+?)[/])?([^/]+?)$`),i=[`node_modules`,`favicon.ico`];function a(e){var t=[],a=[];if(e===null)return a.push(`name cannot be null`),o(t,a);if(e===void 0)return a.push(`name cannot be undefined`),o(t,a);if(typeof e!=`string`)return a.push(`name must be a string`),o(t,a);if(e.length||a.push(`name length must be greater than zero`),e.startsWith(`.`)&&a.push(`name cannot start with a period`),e.startsWith(`-`)&&a.push(`name cannot start with a hyphen`),e.match(/^_/)&&a.push(`name cannot start with an underscore`),e.trim()!==e&&a.push(`name cannot contain leading or trailing spaces`),i.forEach(function(t){e.toLowerCase()===t&&a.push(t+` is not a valid package name`)}),n.includes(e.toLowerCase())&&t.push(e+` is a core module name`),e.length>214&&t.push(`name can no longer contain more than 214 characters`),e.toLowerCase()!==e&&t.push(`name can no longer contain capital letters`),/[~'!()*]/.test(e.split(`/`).slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var s=e.match(r);if(s){var c=s[1],l=s[2];if(l.startsWith(`.`)&&a.push(`name cannot start with a period`),encodeURIComponent(c)===c&&encodeURIComponent(l)===l)return o(t,a)}a.push(`name can only contain URL-friendly characters`)}return o(t,a)}var o=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n};t.exports=a})))(),1);const gh=/^file:/iu,_h=/^npm:/iu,vh=/^(?:git\+)?[a-z]+:/iu,yh=/^[^@]+@[^:.]+\.[^:]+:.+$/u,bh=/^(?:\.{1,2}(?:[/\\]|$)|[/\\]|~[/\\]|[A-Za-z]:[/\\])/u;function xh(e){let t=e.spec.trim();if(!t)throw Oh(`Package spec must be a non-empty string.`,`EINVALIDPACKAGESPEC`);Sh(t);let n=t.startsWith(`@`)?Ch(t):wh(t);return Th(n.name,t),{raw:t,name:n.name,escapedName:n.name.replace(`/`,`%2f`),scope:Eh(n.name),rawSpec:n.rawSpec}}function Sh(e){if(gh.test(e))throw Dh(e,`file`);if(_h.test(e))throw Dh(e,`npm alias`);if(bh.test(e))throw Dh(e,`local path`);if(yh.test(e))throw Dh(e,`git`);if(vh.test(e))throw Dh(e,`url`)}function Ch(e){let t=e.indexOf(`/`);if(t<=1||t===e.length-1)throw Oh(`Invalid scoped package spec "${e}".`,`EINVALIDPACKAGESPEC`);let n=e.indexOf(`@`,t+1);return n===-1?{name:e,rawSpec:``}:{name:e.slice(0,n),rawSpec:e.slice(n+1)}}function wh(e){let t=e.indexOf(`@`);return t===-1?{name:e,rawSpec:``}:{name:e.slice(0,t),rawSpec:e.slice(t+1)}}function Th(e,t){if(!e)throw Oh(`Invalid package spec "${t}".`,`EINVALIDPACKAGESPEC`);if(!e.startsWith(`@`)&&e.includes(`/`))throw Dh(t,`local path`);if(!(0,hh.default)(e).validForNewPackages)throw Oh(`Invalid package name "${e}" in "${t}".`,`EINVALIDPACKAGENAME`)}function Eh(e){if(e.startsWith(`@`))return e.slice(0,e.indexOf(`/`))}function Dh(e,t){return Oh(`Unsupported ${t} package spec "${e}" for get-npm-meta.`,`EUNSUPPORTEDPACKAGESPEC`)}function Oh(e,t){return Object.assign(Error(e),{code:t})}function kh(e){return lh(e)===jm}function Ah(e,t){let n=ph(t);return e.map(e=>jh(e,n))}function jh(e,t){let n=xh({spec:e}),r=lh(Mm(n.scope,t.npmConfigs));return{auth:fh(r,t.authByRegistry),config:t,parsed:n,registry:r}}const Mh=Object.prototype.toString,Nh=e=>Mh.call(e)===`[object Error]`,Ph=/* @__PURE__ */ new Set([`network error`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`,`fetch failed`,`terminated`,` A network error occurred.`,`Network connection lost`]);function Fh(e){if(!(e&&Nh(e)&&e.name===`TypeError`&&typeof e.message==`string`))return!1;let{message:t,stack:n}=e;return t===`Load failed`?n===void 0||`__sentry_captured__`in e:t.startsWith(`error sending request for url`)||t===`Failed to fetch`||t.startsWith(`Failed to fetch (`)&&t.endsWith(`)`)?!0:Ph.has(t)}function Ih(e){if(typeof e==`number`){if(e<0)throw TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(e))throw TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(e!==void 0)throw TypeError("Expected `retries` to be a number or Infinity.")}function Lh(e,t,{min:n=0,allowInfinity:r=!1}={}){if(t!==void 0){if(typeof t!=`number`||Number.isNaN(t))throw TypeError(`Expected \`${e}\` to be a number${r?` or Infinity`:``}.`);if(!r&&!Number.isFinite(t))throw TypeError(`Expected \`${e}\` to be a finite number.`);if(t<n)throw TypeError(`Expected \`${e}\` to be \u2265 ${n}.`)}}function Rh(e,t){if(t!==void 0&&typeof t!=`function`)throw TypeError(`Expected \`${e}\` to be a function.`)}var zh=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}};function Bh(e,t){let n=Math.max(1,e+1),r=t.randomize?Math.random()+1:1,i=Math.round(r*t.minTimeout*t.factor**(n-1));return i=Math.min(i,t.maxTimeout),i}function Vh(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function Hh(e,t){e<=0||await new Promise((n,r)=>{let i=()=>{clearTimeout(a),t.signal?.removeEventListener(`abort`,i),r(t.signal.reason)},a=setTimeout(()=>{t.signal?.removeEventListener(`abort`,i),n()},e);t.unref&&a.unref?.(),t.signal?.addEventListener(`abort`,i,{once:!0})})}async function Uh({error:e,attemptNumber:t,retriesConsumed:n,startTime:r,options:i}){let a=e instanceof Error?e:/* @__PURE__ */ TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(a instanceof zh)throw a.originalError;let o=Number.isFinite(i.retries)?Math.max(0,i.retries-n):i.retries,s=i.maxRetryTime??1/0,c=Bh(n,i);if(Vh(r,s)<=0){let e=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:0});throw await i.onFailedAttempt(e),a}let l=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:o>0?c:0}),u=await i.shouldConsumeRetry(l),d=u&&o>0?c:0,f=Object.freeze({error:a,attemptNumber:t,retriesLeft:o,retriesConsumed:n,retryDelay:d});if(await i.onFailedAttempt(f),Vh(r,s)<=0||Vh(r,s)<=0||o<=0||a instanceof TypeError&&!Fh(a)||!await i.shouldRetry(f))throw a;let p=Vh(r,s);if(p<=0)throw a;if(!u)return i.signal?.throwIfAborted(),!1;let m=Math.min(d,p);return i.signal?.throwIfAborted(),await Hh(m,i),i.signal?.throwIfAborted(),!0}async function Wh(e,t={}){if(t={...t},Ih(t.retries),Object.hasOwn(t,`forever`))throw Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");t.retries??=10,t.factor??=2,t.minTimeout??=1e3,t.maxTimeout??=1/0,t.maxRetryTime??=1/0,t.randomize??=!1,t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.shouldConsumeRetry??=()=>!0,Rh(`onFailedAttempt`,t.onFailedAttempt),Rh(`shouldRetry`,t.shouldRetry),Rh(`shouldConsumeRetry`,t.shouldConsumeRetry),Lh(`factor`,t.factor,{min:0,allowInfinity:!1}),Lh(`minTimeout`,t.minTimeout,{min:0,allowInfinity:!1}),Lh(`maxTimeout`,t.maxTimeout,{min:0,allowInfinity:!0}),Lh(`maxRetryTime`,t.maxRetryTime,{min:0,allowInfinity:!0}),t.factor>0||(t.factor=1),t.signal?.throwIfAborted();let n=0,r=0,i=performance.now();for(;!Number.isFinite(t.retries)||r<=t.retries;){n++;try{t.signal?.throwIfAborted();let r=await e(n);return t.signal?.throwIfAborted(),r}catch(e){await Uh({error:e,attemptNumber:n,retriesConsumed:r,startTime:i,options:t})&&r++}}throw Error(`Retry attempts exhausted without throwing an error.`)}
181
179
  /* istanbul ignore next */
182
- const Gh=2**53-1||9007199254740991,Kh=/^\d+$/;function qh(e,t){if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let n=Kh.test(String(e)),r=Kh.test(String(t));return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1}const W=typeof I==`object`&&I.env&&I.env.NODE_DEBUG&&/\bsemver\b/i.test(I.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{},Jh=[],Yh=[],G=[],Xh=[],K={};let Zh=0;const Qh=`[a-zA-Z0-9-]`,$h=[[`\\s`,1],[`\\d`,256],[Qh,250]];function eg(e){for(let[t,n]of $h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e}function q(e,t,n=!1){let r=eg(t),i=Zh++;W(e,i,t),K[e]=i,G[i]=t,Xh[i]=r,Jh[i]=new RegExp(t,n?`g`:void 0),Yh[i]=new RegExp(r,n?`g`:void 0)}q(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),q(`NUMERICIDENTIFIERLOOSE`,`\\d+`),q(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${Qh}*`),q(`MAINVERSION`,`(${G[K.NUMERICIDENTIFIER]})\\.(${G[K.NUMERICIDENTIFIER]})\\.(${G[K.NUMERICIDENTIFIER]})`),q(`MAINVERSIONLOOSE`,`(${G[K.NUMERICIDENTIFIERLOOSE]})\\.(${G[K.NUMERICIDENTIFIERLOOSE]})\\.(${G[K.NUMERICIDENTIFIERLOOSE]})`),q(`PRERELEASEIDENTIFIER`,`(?:${G[K.NONNUMERICIDENTIFIER]}|${G[K.NUMERICIDENTIFIER]})`),q(`PRERELEASEIDENTIFIERLOOSE`,`(?:${G[K.NONNUMERICIDENTIFIER]}|${G[K.NUMERICIDENTIFIERLOOSE]})`),q(`PRERELEASE`,`(?:-(${G[K.PRERELEASEIDENTIFIER]}(?:\\.${G[K.PRERELEASEIDENTIFIER]})*))`),q(`PRERELEASELOOSE`,`(?:-?(${G[K.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${G[K.PRERELEASEIDENTIFIERLOOSE]})*))`),q(`BUILDIDENTIFIER`,`${Qh}+`),q(`BUILD`,`(?:\\+(${G[K.BUILDIDENTIFIER]}(?:\\.${G[K.BUILDIDENTIFIER]})*))`),q(`FULLPLAIN`,`v?${G[K.MAINVERSION]}${G[K.PRERELEASE]}?${G[K.BUILD]}?`),q(`FULL`,`^${G[K.FULLPLAIN]}$`),q(`LOOSEPLAIN`,`[v=\\s]*${G[K.MAINVERSIONLOOSE]}${G[K.PRERELEASELOOSE]}?${G[K.BUILD]}?`),q(`LOOSE`,`^${G[K.LOOSEPLAIN]}$`),q(`GTLT`,`((?:<|>)?=?)`),q(`XRANGEIDENTIFIERLOOSE`,`${G[K.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),q(`XRANGEIDENTIFIER`,`${G[K.NUMERICIDENTIFIER]}|x|X|\\*`),q(`XRANGEPLAIN`,`[v=\\s]*(${G[K.XRANGEIDENTIFIER]})(?:\\.(${G[K.XRANGEIDENTIFIER]})(?:\\.(${G[K.XRANGEIDENTIFIER]})(?:${G[K.PRERELEASE]})?${G[K.BUILD]}?)?)?`),q(`XRANGEPLAINLOOSE`,`[v=\\s]*(${G[K.XRANGEIDENTIFIERLOOSE]})(?:\\.(${G[K.XRANGEIDENTIFIERLOOSE]})(?:\\.(${G[K.XRANGEIDENTIFIERLOOSE]})(?:${G[K.PRERELEASELOOSE]})?${G[K.BUILD]}?)?)?`),q(`XRANGE`,`^${G[K.GTLT]}\\s*${G[K.XRANGEPLAIN]}$`),q(`XRANGELOOSE`,`^${G[K.GTLT]}\\s*${G[K.XRANGEPLAINLOOSE]}$`),q(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?`),q(`COERCE`,`${G[K.COERCEPLAIN]}(?:$|[^\\d])`),q(`COERCEFULL`,`${G[K.COERCEPLAIN]}(?:${G[K.PRERELEASE]})?(?:${G[K.BUILD]})?(?:$|[^\\d])`),q(`COERCERTL`,G[K.COERCE],!0),q(`COERCERTLFULL`,G[K.COERCEFULL],!0),q(`LONETILDE`,`(?:~>?)`),q(`TILDETRIM`,`(\\s*)${G[K.LONETILDE]}\\s+`,!0),q(`TILDE`,`^${G[K.LONETILDE]}${G[K.XRANGEPLAIN]}$`),q(`TILDELOOSE`,`^${G[K.LONETILDE]}${G[K.XRANGEPLAINLOOSE]}$`),q(`LONECARET`,`(?:\\^)`),q(`CARETTRIM`,`(\\s*)${G[K.LONECARET]}\\s+`,!0),q(`CARET`,`^${G[K.LONECARET]}${G[K.XRANGEPLAIN]}$`),q(`CARETLOOSE`,`^${G[K.LONECARET]}${G[K.XRANGEPLAINLOOSE]}$`),q(`COMPARATORLOOSE`,`^${G[K.GTLT]}\\s*(${G[K.LOOSEPLAIN]})$|^$`),q(`COMPARATOR`,`^${G[K.GTLT]}\\s*(${G[K.FULLPLAIN]})$|^$`),q(`COMPARATORTRIM`,`(\\s*)${G[K.GTLT]}\\s*(${G[K.LOOSEPLAIN]}|${G[K.XRANGEPLAIN]})`,!0),q(`HYPHENRANGE`,`^\\s*(${G[K.XRANGEPLAIN]})\\s+-\\s+(${G[K.XRANGEPLAIN]})\\s*$`),q(`HYPHENRANGELOOSE`,`^\\s*(${G[K.XRANGEPLAINLOOSE]})\\s+-\\s+(${G[K.XRANGEPLAINLOOSE]})\\s*$`),q(`STAR`,`(<|>)?=?\\s*\\*`),q(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),q(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`);const tg=Object.freeze({loose:!0}),ng=Object.freeze({});function rg(e){return e?typeof e==`object`?e:tg:ng}const ig=/^\d+$/;var ag=class e{raw=``;loose=!1;options={};includePrerelease=!1;major=0;minor=0;patch=0;version=``;build=[];prerelease=[];constructor(t,n){let r=rg(n),i;if(t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;i=t.version}else if(typeof t==`string`)i=t;else throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(i.length>256)throw TypeError(`version is longer than 256 characters`);W(`SemVer`,i,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let a=i.trim().match(r.loose?Yh[K.LOOSE]:Yh[K.FULL]);if(!a)throw TypeError(`Invalid Version: ${i}`);if(this.raw=i,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>Gh||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>Gh||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>Gh||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=a[4]?a[4].split(`.`).map(e=>{if(ig.test(e)){let t=+e;if(t>=0&&t<Gh)return t}return e}):[],this.build=a[5]?a[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}inspect(){return`<SemVer "${this.version}">`}asSemVer(t){return t instanceof e?t:new e(t,this.options)}compare(t){W(`SemVer.compare`,this.version,this.options,t);let n;if(t instanceof e)n=t;else{if(typeof t==`string`&&t===this.version)return 0;n=this.asSemVer(t)}return n.version===this.version?0:this.compareMain(n)||this.comparePre(n)}compareMain(e){let t=this.asSemVer(e);return this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(e){let t=this.asSemVer(e);if(this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let e=this.prerelease[n],r=t.prerelease[n];if(W(`prerelease compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e!==r)return qh(e,r)}while(++n);return 0}compareBuild(e){let t=this.asSemVer(e),n=0;do{let e=this.build[n],r=t.build[n];if(W(`build compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e!==r)return qh(e,r)}while(++n);return 0}inc(e,t,n){let r=e,i=t;if(r.startsWith(`pre`)){if(!i&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(i){let e=`-${i}`.match(this.options.loose?Yh[K.PRERELEASELOOSE]:Yh[K.PRERELEASE]);if(!e||e[1]!==i)throw Error(`invalid identifier: ${i}`)}}switch(r){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,i,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,i,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,i,n),this.inc(`pre`,i,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,i,n),this.inc(`pre`,i,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let t=this.prerelease.length;for(;--t>=0;)typeof this.prerelease[t]==`number`&&(this.prerelease[t]=this.prerelease[t]+1,t=-2);if(t===-1){if(i===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(i){let t=[i,e];n===!1&&(t=[i]),qh(this.prerelease[0],i)===0?Number.isNaN(Number(this.prerelease[1]))&&(this.prerelease=t):this.prerelease=t}break}default:throw Error(`invalid increment argument: ${r}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}};function og(e,t,n){return new ag(e,n).compare(new ag(t,n))}function sg(e,t,n){return og(e,t,n)===0}function cg(e,t,n){return og(e,t,n)>0}function lg(e,t,n){return og(e,t,n)>=0}function ug(e,t,n){return og(e,t,n)<0}function dg(e,t,n){return og(e,t,n)<=0}function fg(e,t,n){return og(e,t,n)!==0}function pg(e,t,n,r){let i=e=>e instanceof ag?e.version:e;switch(t){case`===`:return e=i(e),n=i(n),e===n;case`!==`:return e=i(e),n=i(n),e!==n;case``:case`=`:case`==`:return sg(e,n,r);case`!=`:return fg(e,n,r);case`>`:return cg(e,n,r);case`>=`:return lg(e,n,r);case`<`:return ug(e,n,r);case`<=`:return dg(e,n,r);default:throw TypeError(`Invalid operator: ${t}`)}}var mg=class{max;map;constructor(){this.max=1e3,this.map=/* @__PURE__ */ new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;e!==void 0&&this.delete(e)}this.map.set(e,t)}return this}};const hg=Symbol(`SemVer ANY`),gg=/\s+/;var _g=class e{options={};loose=!1;operator=``;semver=hg;value=``;static get ANY(){return hg}constructor(t,n){let r=rg(n);if(t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}let i=String(t).trim().split(gg).join(` `);W(`comparator`,i,r),this.options=r,this.loose=!!r.loose,this.parse(i),this.value=this.semver===hg?``:this.operator+this.semver.version,W(`comp`,this)}parse(e){let t=this.options.loose?Yh[K.COMPARATORLOOSE]:Yh[K.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);this.operator=n[1]===void 0?``:n[1],this.operator===`=`&&(this.operator=``),this.semver=n[2]?new ag(n[2],this.options.loose):hg}toString(){return this.value}test(e){if(W(`Comparator.test`,e,this.options.loose),this.semver===hg||e===hg)return!0;if(typeof e==`string`)try{e=new ag(e,this.options)}catch{return!1}return pg(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);if(this.operator===``)return this.value===``||new wg(t.value,n).test(this.value);if(t.operator===``)return t.value===``||new wg(this.value,n).test(t.semver);let r=rg(n);return r.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!r.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver!==hg&&t.semver!==hg&&this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||pg(this.semver,`<`,t.semver,r)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||pg(this.semver,`>`,t.semver,r)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`))}};const vg=/\s+/g,yg=/\s+/,bg=new mg,xg=e=>e.value===`<0.0.0-0`,Sg=e=>e.value===``,Cg=e=>e!==_g.ANY;var wg=class e{raw=``;loose=!1;options={};includePrerelease=!1;set=[];formatted;constructor(t,n){let r=rg(n);if(t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof _g)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=(typeof t==`string`?t:String(t)).trim().replace(vg,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length>0),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!xg(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&Sg(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}inspect(){return`<SemVer Range "${this.range}">`}parseRange(e){let t=`${+!!this.options.includePrerelease|(this.options.loose?2:0)}:${e}`,n=bg.get(t);if(n)return n;let r=this.options.loose,i=r?Yh[K.HYPHENRANGELOOSE]:Yh[K.HYPHENRANGE];e=e.replace(i,Ig(!!this.options.includePrerelease)),W(`hyphen replace`,e),e=e.replace(Yh[K.COMPARATORTRIM],`$1$2$3`),W(`comparator trim`,e),e=e.replace(Yh[K.TILDETRIM],`$1~`),W(`tilde trim`,e),e=e.replace(Yh[K.CARETTRIM],`$1^`),W(`caret trim`,e);let a=e.split(` `).map(e=>Eg(e,this.options)).join(` `).split(yg).map(e=>Fg(e,this.options));r&&(a=a.filter(e=>(W(`loose invalid filter`,e,this.options),!!e.match(Yh[K.COMPARATORLOOSE])))),W(`range list`,a);let o=/* @__PURE__ */ new Map,s=a.map(e=>new _g(e,this.options));for(let e of s){if(xg(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let c=[...o.values()];return bg.set(t,c),c}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>Tg(e,n)&&t.set.some(t=>Tg(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;let t;if(typeof e==`string`)try{t=new ag(e,this.options)}catch{return!1}else if(e instanceof ag)t=e;else return!1;for(let e=0;e<this.set.length;e++)if(Lg(this.set[e],t,this.options))return!0;return!1}};function Tg(e,t){let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;){let e=i;if(!e)break;n=r.every(n=>e.intersects(n,t)),i=r.pop()}return n}function Eg(e,t){return e=e.replace(Yh[K.BUILD],``),W(`comp`,e,t),e=Ag(e,t),W(`caret`,e),e=Og(e,t),W(`tildes`,e),e=Mg(e,t),W(`xrange`,e),e=Pg(e,t),W(`stars`,e),e}function Dg(e){return!e||e.toLowerCase()===`x`||e===`*`}function Og(e,t){return e.trim().split(yg).map(e=>kg(e,t)).join(` `)}function kg(e,t){let n=t.loose?Yh[K.TILDELOOSE]:Yh[K.TILDE];return e.replace(n,(t,n,r,i,a)=>{W(`tilde`,e,t,n,r,i,a);let o,s=String(n),c=String(r),l=String(i);return Dg(n)?o=``:Dg(r)?o=`>=${s}.0.0 <${Number(s)+1}.0.0-0`:Dg(i)?o=`>=${s}.${c}.0 <${s}.${Number(c)+1}.0-0`:a?(W(`replaceTilde pr`,a),o=`>=${s}.${c}.${l}-${a} <${s}.${Number(c)+1}.0-0`):o=`>=${s}.${c}.${l} <${s}.${Number(c)+1}.0-0`,W(`tilde return`,o),o})}function Ag(e,t){return e.trim().split(yg).map(e=>jg(e,t)).join(` `)}function jg(e,t){W(`caret`,e,t);let n=t.loose?Yh[K.CARETLOOSE]:Yh[K.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{W(`caret`,e,t,n,i,a,o);let s,c=String(n),l=String(i),u=String(a);return Dg(n)?s=``:Dg(i)?s=`>=${c}.0.0${r} <${Number(c)+1}.0.0-0`:Dg(a)?s=c===`0`?`>=${c}.${l}.0${r} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.0${r} <${Number(c)+1}.0.0-0`:o?(W(`replaceCaret pr`,o),s=c===`0`?l===`0`?`>=${c}.${l}.${u}-${o} <${c}.${l}.${Number(u)+1}-0`:`>=${c}.${l}.${u}-${o} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.${u}-${o} <${Number(c)+1}.0.0-0`):(W(`no pr`),s=c===`0`?l===`0`?`>=${c}.${l}.${u}${r} <${c}.${l}.${Number(u)+1}-0`:`>=${c}.${l}.${u}${r} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.${u} <${Number(c)+1}.0.0-0`),W(`caret return`,s),s})}function Mg(e,t){return W(`replaceXRanges`,e,t),e.split(yg).map(e=>Ng(e,t)).join(` `)}function Ng(e,t){e=e.trim();let n=t.loose?Yh[K.XRANGELOOSE]:Yh[K.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{W(`xRange`,e,n,r,i,a,o,s);let c=Dg(i),l=c||Dg(a),u=l||Dg(o),d=u,f=r,p=String(i),m=String(a),h=String(o),g=s??``;return f===`=`&&d&&(f=``),g=t.includePrerelease?`-0`:``,c?n=f===`>`||f===`<`?`<0.0.0-0`:`*`:f&&d?(l&&(m=0),h=0,f===`>`?(f=`>=`,l?(p=Number(p)+1,m=0,h=0):(m=Number(m)+1,h=0)):f===`<=`&&(f=`<`,l?p=Number(p)+1:m=Number(m)+1),f===`<`&&(g=`-0`),n=`${f+p}.${m}.${h}${g}`):l?n=`>=${p}.0.0${g} <${Number(p)+1}.0.0-0`:u&&(n=`>=${p}.${m}.0${g} <${p}.${Number(m)+1}.0-0`),W(`xRange return`,n),n})}function Pg(e,t){return W(`replaceStars`,e,t),e.trim().replace(Yh[K.STAR],``)}function Fg(e,t){return W(`replaceGTE0`,e,t),e.trim().replace(Yh[t.includePrerelease?K.GTE0PRE:K.GTE0],``)}function Ig(e){return(t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n??``,m=c??``;return p=Dg(r)?``:Dg(i)?`>=${String(r)}.0.0${e?`-0`:``}`:Dg(a)?`>=${String(r)}.${String(i)}.0${e?`-0`:``}`:o?`>=${p}`:`>=${p}${e?`-0`:``}`,m=Dg(l)?``:Dg(u)?`<${Number(l)+1}.0.0-0`:Dg(d)?`<${String(l)}.${Number(u)+1}.0-0`:f?`<=${String(l)}.${String(u)}.${String(d)}-${f}`:e?`<${String(l)}.${String(u)}.${Number(d)+1}-0`:`<=${m}`,`${p} ${m}`.trim()}}function Lg(e,t,n){for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++){let r=e[n];if(W(r.semver),!Cg(r.semver))continue;let i=r.semver;if(i.prerelease.length>0&&i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function Rg(e,t,n=!1){if(e instanceof ag)return e;try{return new ag(e,t)}catch(e){if(!n)return null;throw e}}function zg(e,t,n){try{return new wg(t,n).test(e)}catch{return!1}}function Bg(e,t){let n=Rg(e,t);return n?n.version:null}function Vg(e,t){try{return new wg(e,t).range||`*`}catch{return null}}async function Hg(e,t={}){let n=await Wg(e,t);if(qg(n)){if(t.throw===!1)return n;throw Error(n.error)}let r=n.versions??{},i=Yg(n[`dist-tags`]),a=n.time??{},o=e.parsed.rawSpec||`*`,s=Date.now(),c=Gg(Kg(Object.keys(r),i,o,t.loose),a,t.after);return t.metadata?{name:n.name??e.parsed.name,distTags:i,lastSynced:s,specifier:o,timeCreated:a.created??``,timeModified:a.modified??``,versionsMeta:Object.fromEntries(c.filter(e=>!!r[e]).map(e=>[e,Zg(r[e],a[e])]))}:{name:n.name??e.parsed.name,distTags:i,lastSynced:s,specifier:o,versions:c,time:{created:a.created??``,modified:a.modified??``,...Object.fromEntries(c.filter(e=>!!a[e]).map(e=>[e,a[e]]))}}}async function Ug(e,t){let n=t.fetch??fetch,r=new URL(e.parsed.escapedName,e.registry),i=new Headers({accept:`application/json`});e.auth?.token?i.set(`authorization`,`Bearer ${e.auth.token}`):e.auth?.basicAuth&&i.set(`authorization`,`Basic ${e.auth.basicAuth}`),e.config.userAgent&&i.set(`user-agent`,e.config.userAgent);let a=await n(r,{headers:i});return a.ok?a.json():Xg(e.parsed.name,r,a.status,a.statusText)}async function Wg(e,t){let n=Jg(t.retry),r=()=>Ug(e,t);return n===!1?r():Wh(r,n)}function Gg(e,t,n){if(!n)return e;let r=Date.parse(n);return Number.isNaN(r)?e:e.filter(e=>{let n=t[e];return n?Date.parse(n)>r:!1})}function Kg(e,t,n,r){if(n===`*`)return e;let i=t[n];return i?e.includes(i)?[i]:[]:Bg(n)?e:Vg(n)?e.filter(e=>zg(e,n,{includePrerelease:!0,loose:r??!1})):e}function qg(e){return`error`in e}function Jg(e){return e===!1?!1:typeof e==`number`?{...Hm,retries:e}:e??Hm}function Yg(e){return{latest:e?.latest??``,...e??{}}}function Xg(e,t,n,r){return{status:n,name:e,error:`[GET] "${t}": ${n} ${r}`}}function Zg(e,t){return{time:t,engines:e.engines,deprecated:e.deprecated,provenance:Um(e),integrity:e.integrity??e.dist?.integrity}}async function Qg(e,t={}){let[n]=Ah([e],t);return $g(n,t)}function $g(e,t){return kh(e.registry)?Om(e.parsed.raw,e_(t)):Hg(e,t)}function e_(e){let{cwd:t,env:n,userConfigPath:r,projectConfigPath:i,...a}=e;return a}const t_=!!globalThis.process?.env?.FORCE_NODE_FETCH,n_=!t_&&globalThis.fetch||i;!t_&&globalThis.Blob,!t_&&globalThis.File,!t_&&globalThis.FormData;const r_=!t_&&globalThis.Headers||e;!t_&&globalThis.Request,!t_&&globalThis.Response;const i_=!t_&&globalThis.AbortController||r,a_=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,o_=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,s_=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function c_(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t)l_(e);else return t}function l_(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function u_(e,t={}){if(typeof e!=`string`)return e;if(e[0]===`"`&&e[e.length-1]===`"`&&e.indexOf(`\\`)===-1)return e.slice(1,-1);let n=e.trim();if(n.length<=9)switch(n.toLowerCase()){case`true`:return!0;case`false`:return!1;case`undefined`:return;case`null`:return null;case`nan`:return NaN;case`infinity`:return 1/0;case`-infinity`:return-1/0}if(!s_.test(e)){if(t.strict)throw SyntaxError(`[destr] Invalid JSON`);return e}try{if(a_.test(e)||o_.test(e)){if(t.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(e,c_)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}String.fromCharCode;const d_=/#/g,f_=/&/g,p_=/\//g,m_=/=/g,h_=/\+/g,g_=/%5e/gi,__=/%60/gi,v_=/%7c/gi,y_=/%20/gi;function b_(e){return encodeURI(``+e).replace(v_,`|`)}function x_(e){return b_(typeof e==`string`?e:JSON.stringify(e)).replace(h_,`%2B`).replace(y_,`+`).replace(d_,`%23`).replace(f_,`%26`).replace(__,"`").replace(g_,`^`).replace(p_,`%2F`)}function S_(e){return x_(e).replace(m_,`%3D`)}function C_(e=``){try{return decodeURIComponent(``+e)}catch{return``+e}}function w_(e){return C_(e.replace(h_,` `))}function T_(e){return C_(e.replace(h_,` `))}function E_(e=``){let t=/* @__PURE__ */ Object.create(null);e[0]===`?`&&(e=e.slice(1));for(let n of e.split(`&`)){let e=n.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let r=w_(e[1]);if(r===`__proto__`||r===`constructor`)continue;let i=T_(e[2]||``);t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}return t}function D_(e,t){return(typeof t==`number`||typeof t==`boolean`)&&(t=String(t)),t?Array.isArray(t)?t.map(t=>`${S_(e)}=${x_(t)}`).join(`&`):`${S_(e)}=${x_(t)}`:S_(e)}function O_(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>D_(t,e[t])).filter(Boolean).join(`&`)}const k_=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,A_=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,j_=/^([/\\]\s*){2,}[^/\\]/,M_=/\/$|\/\?|\/#/,N_=/^\.?\//;function P_(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?k_.test(e):A_.test(e)||(t.acceptRelative?j_.test(e):!1)}function F_(e=``,t){return t?M_.test(e):e.endsWith(`/`)}function I_(e=``,t){if(!t)return(F_(e)?e.slice(0,-1):e)||`/`;if(!F_(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);i!==-1&&(n=e.slice(0,i),r=e.slice(i));let[a,...o]=n.split(`?`);return((a.endsWith(`/`)?a.slice(0,-1):a)||`/`)+(o.length>0?`?${o.join(`?`)}`:``)+r}function L_(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(F_(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function R_(e,t){if(B_(t)||P_(e))return e;let n=I_(t);if(e.startsWith(n)){let t=e[n.length];if(!t||t===`/`||t===`?`)return e}return H_(n,e)}function z_(e,t){let n=W_(e);return n.search=O_({...E_(n.search),...t}),K_(n)}function B_(e){return!e||e===`/`}function V_(e){return e&&e!==`/`}function H_(e,...t){let n=e||``;for(let e of t.filter(e=>V_(e)))if(n){let t=e.replace(N_,``);n=L_(n)+t}else n=e;return n}const U_=Symbol.for(`ufo:protocolRelative`);function W_(e=``,t){let n=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=``]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:``,host:``,search:``,hash:``}}if(!P_(e,{acceptRelative:!0}))return t?W_(t+e):G_(e);let[,r=``,i,a=``]=e.replace(/\\/g,`/`).match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,o=``,s=``]=a.match(/([^#/?]*)(.*)?/)||[];r===`file:`&&(s=s.replace(/\/(?=[A-Za-z]:)/,``));let{pathname:c,search:l,hash:u}=G_(s);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):``,host:o,pathname:c,search:l,hash:u,[U_]:!r}}function G_(e=``){let[t=``,n=``,r=``]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}function K_(e){let t=e.pathname||``,n=e.search?(e.search.startsWith(`?`)?``:`?`)+e.search:``,r=e.hash||``,i=e.auth?e.auth+`@`:``,a=e.host||``;return(e.protocol||e[U_]?(e.protocol||``)+`//`:``)+i+a+t+n+r}var q_=class extends Error{constructor(e,t){super(e,t),this.name=`FetchError`,t?.cause&&!this.cause&&(this.cause=t.cause)}};function J_(e){let t=e.error?.message||e.error?.toString()||``,n=e.request?.method||e.options?.method||`GET`,r=e.request?.url||String(e.request)||`/`,i=new q_(`${`[${n}] ${JSON.stringify(r)}`}: ${e.response?`${e.response.status} ${e.response.statusText}`:`<no response>`}${t?` ${t}`:``}`,e.error?{cause:e.error}:void 0);for(let t of[`request`,`options`,`response`])Object.defineProperty(i,t,{get(){return e[t]}});for(let[t,n]of[[`data`,`_data`],[`status`,`status`],[`statusCode`,`status`],[`statusText`,`statusText`],[`statusMessage`,`statusText`]])Object.defineProperty(i,t,{get(){return e.response&&e.response[n]}});return i}const Y_=new Set(Object.freeze([`PATCH`,`POST`,`PUT`,`DELETE`]));function X_(e=`GET`){return Y_.has(e.toUpperCase())}function Z_(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer||e instanceof FormData||e instanceof URLSearchParams?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}const Q_=/* @__PURE__ */ new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]),$_=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function ev(e=``){if(!e)return`json`;let t=e.split(`;`).shift()||``;return $_.test(t)?`json`:t===`text/event-stream`?`stream`:Q_.has(t)||t.startsWith(`text/`)?`text`:`blob`}function tv(e,t,n,r){let i=nv(t?.headers??e?.headers,n?.headers,r),a;return(n?.query||n?.params||t?.params||t?.query)&&(a={...n?.params,...n?.query,...t?.params,...t?.query}),{...n,...t,query:a,params:a,headers:i}}function nv(e,t,n){if(!t)return new n(e);let r=new n(t);if(e)for(let[t,i]of Symbol.iterator in e||Array.isArray(e)?e:new n(e))r.set(t,i);return r}async function rv(e,t){if(t){if(Array.isArray(t))for(let n of t)await n(e);else await t(e)}}const iv=/* @__PURE__ */ new Set([408,409,425,429,500,502,503,504]),av=/* @__PURE__ */ new Set([101,204,205,304]);function ov(e={}){let{fetch:t=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:r=globalThis.AbortController}=e;async function i(e){let t=e.error&&e.error.name===`AbortError`&&!e.options.timeout||!1;if(e.options.retry!==!1&&!t){let t;t=typeof e.options.retry==`number`?e.options.retry:+!X_(e.options.method);let n=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(n):iv.has(n))){let n=typeof e.options.retryDelay==`function`?e.options.retryDelay(e):e.options.retryDelay||0;return n>0&&await new Promise(e=>setTimeout(e,n)),a(e.request,{...e.options,retry:t-1})}}let n=J_(e);throw Error.captureStackTrace&&Error.captureStackTrace(n,a),n}let a=async function(a,o={}){let s={request:a,options:tv(a,o,e.defaults,n),response:void 0,error:void 0};if(s.options.method&&(s.options.method=s.options.method.toUpperCase()),s.options.onRequest&&(await rv(s,s.options.onRequest),s.options.headers instanceof n||(s.options.headers=new n(s.options.headers||{}))),typeof s.request==`string`&&(s.options.baseURL&&(s.request=R_(s.request,s.options.baseURL)),s.options.query&&(s.request=z_(s.request,s.options.query),delete s.options.query),`query`in s.options&&delete s.options.query,`params`in s.options&&delete s.options.params),s.options.body&&X_(s.options.method)){if(Z_(s.options.body)){let e=s.options.headers.get(`content-type`);typeof s.options.body!=`string`&&(s.options.body=e===`application/x-www-form-urlencoded`?new URLSearchParams(s.options.body).toString():JSON.stringify(s.options.body)),e||s.options.headers.set(`content-type`,`application/json`),s.options.headers.has(`accept`)||s.options.headers.set(`accept`,`application/json`)}else(`pipeTo`in s.options.body&&typeof s.options.body.pipeTo==`function`||typeof s.options.body.pipe==`function`)&&(`duplex`in s.options||(s.options.duplex=`half`))}let c;if(!s.options.signal&&s.options.timeout){let e=new r;c=setTimeout(()=>{let t=/* @__PURE__ */ Error(`[TimeoutError]: The operation was aborted due to timeout`);t.name=`TimeoutError`,t.code=23,e.abort(t)},s.options.timeout),s.options.signal=e.signal}try{s.response=await t(s.request,s.options)}catch(e){return s.error=e,s.options.onRequestError&&await rv(s,s.options.onRequestError),await i(s)}finally{c&&clearTimeout(c)}if((s.response.body||s.response._bodyInit)&&!av.has(s.response.status)&&s.options.method!==`HEAD`){let e=(s.options.parseResponse?`json`:s.options.responseType)||ev(s.response.headers.get(`content-type`)||``);switch(e){case`json`:{let e=await s.response.text(),t=s.options.parseResponse||u_;s.response._data=t(e);break}case`stream`:s.response._data=s.response.body||s.response._bodyInit;break;default:s.response._data=await s.response[e]()}}return s.options.onResponse&&await rv(s,s.options.onResponse),!s.options.ignoreResponseError&&s.response.status>=400&&s.response.status<600?(s.options.onResponseError&&await rv(s,s.options.onResponseError),await i(s)):s.response},o=async function(e,t){return(await a(e,t))._data};return o.raw=a,o.native=(...e)=>t(...e),o.create=(t={},n={})=>ov({...e,...n,defaults:{...e.defaults,...n.defaults,...t}}),o}function sv(){if(!JSON.parse(process.env.FETCH_KEEP_ALIVE||`false`))return n_;let e={keepAlive:!0},t=new R.Agent(e),n=new ae.Agent(e),r={agent(e){return e.protocol===`http:`?t:n}};return function(e,t){return n_(e,{...r,...t})}}const cv=globalThis.fetch?(...e)=>globalThis.fetch(...e):sv();ov({fetch:cv,Headers:globalThis.Headers||r_,AbortController:globalThis.AbortController||i_});const lv=/^(?:( )+|\t+)/,uv=`space`;function dv(e,t,n){return e&&t===uv&&n===1}function fv(e,t){let n=/* @__PURE__ */ new Map,r=0,i,a;for(let o of e.split(/\n/g)){if(!o)continue;let e=o.match(lv);if(e===null)r=0,i=``;else{let o=e[0].length,s=e[1]?uv:`tab`;if(dv(t,s,o))continue;s!==i&&(r=0),i=s;let c=1,l=0,u=o-r;if(r=o,u===0)c=0,l=1;else{let e=Math.abs(u);if(dv(t,s,e))continue;a=pv(s,e)}let d=n.get(a);n.set(a,d===void 0?[1,0]:[d[0]+c,d[1]+l])}}return n}function pv(e,t){return(e===uv?`s`:`t`)+String(t)}function mv(e){return{type:e[0]===`s`?uv:`tab`,amount:Number(e.slice(1))}}function hv(e){let t,n=0,r=0;for(let[i,[a,o]]of e)(a>n||a===n&&o>r)&&(n=a,r=o,t=i);return t}function gv(e,t){return(e===uv?` `:` `).repeat(t)}function _v(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);let t=fv(e,!0);t.size===0&&(t=fv(e,!1));let n=hv(t),r,i=0,a=``;return n!==void 0&&({type:r,amount:i}=mv(n),a=gv(r,i)),{amount:i,type:r,indent:a}}function vv(e,t){return te(e)?e:P(t||`.`,e)}function yv(e,t){let{last:n,cwd:r}=t||{},i=vv(e,r),a=vv(n||`/`,r),o,s=[];for(;o!==a&&(s.push(i),i=ee(o=i),i!==o););return s}function bv(e,t){let n,r;for(n of yv(t&&t.cwd||``,t))if(r=M(n,e),E(r))return r}
180
+ const Gh=2**53-1||9007199254740991,Kh=/^\d+$/;function qh(e,t){if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let n=Kh.test(String(e)),r=Kh.test(String(t));return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1}const W=typeof F==`object`&&F.env&&F.env.NODE_DEBUG&&/\bsemver\b/i.test(F.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{},Jh=[],Yh=[],G=[],Xh=[],K={};let Zh=0;const Qh=`[a-zA-Z0-9-]`,$h=[[`\\s`,1],[`\\d`,256],[Qh,250]];function eg(e){for(let[t,n]of $h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e}function q(e,t,n=!1){let r=eg(t),i=Zh++;W(e,i,t),K[e]=i,G[i]=t,Xh[i]=r,Jh[i]=new RegExp(t,n?`g`:void 0),Yh[i]=new RegExp(r,n?`g`:void 0)}q(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),q(`NUMERICIDENTIFIERLOOSE`,`\\d+`),q(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${Qh}*`),q(`MAINVERSION`,`(${G[K.NUMERICIDENTIFIER]})\\.(${G[K.NUMERICIDENTIFIER]})\\.(${G[K.NUMERICIDENTIFIER]})`),q(`MAINVERSIONLOOSE`,`(${G[K.NUMERICIDENTIFIERLOOSE]})\\.(${G[K.NUMERICIDENTIFIERLOOSE]})\\.(${G[K.NUMERICIDENTIFIERLOOSE]})`),q(`PRERELEASEIDENTIFIER`,`(?:${G[K.NONNUMERICIDENTIFIER]}|${G[K.NUMERICIDENTIFIER]})`),q(`PRERELEASEIDENTIFIERLOOSE`,`(?:${G[K.NONNUMERICIDENTIFIER]}|${G[K.NUMERICIDENTIFIERLOOSE]})`),q(`PRERELEASE`,`(?:-(${G[K.PRERELEASEIDENTIFIER]}(?:\\.${G[K.PRERELEASEIDENTIFIER]})*))`),q(`PRERELEASELOOSE`,`(?:-?(${G[K.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${G[K.PRERELEASEIDENTIFIERLOOSE]})*))`),q(`BUILDIDENTIFIER`,`${Qh}+`),q(`BUILD`,`(?:\\+(${G[K.BUILDIDENTIFIER]}(?:\\.${G[K.BUILDIDENTIFIER]})*))`),q(`FULLPLAIN`,`v?${G[K.MAINVERSION]}${G[K.PRERELEASE]}?${G[K.BUILD]}?`),q(`FULL`,`^${G[K.FULLPLAIN]}$`),q(`LOOSEPLAIN`,`[v=\\s]*${G[K.MAINVERSIONLOOSE]}${G[K.PRERELEASELOOSE]}?${G[K.BUILD]}?`),q(`LOOSE`,`^${G[K.LOOSEPLAIN]}$`),q(`GTLT`,`((?:<|>)?=?)`),q(`XRANGEIDENTIFIERLOOSE`,`${G[K.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),q(`XRANGEIDENTIFIER`,`${G[K.NUMERICIDENTIFIER]}|x|X|\\*`),q(`XRANGEPLAIN`,`[v=\\s]*(${G[K.XRANGEIDENTIFIER]})(?:\\.(${G[K.XRANGEIDENTIFIER]})(?:\\.(${G[K.XRANGEIDENTIFIER]})(?:${G[K.PRERELEASE]})?${G[K.BUILD]}?)?)?`),q(`XRANGEPLAINLOOSE`,`[v=\\s]*(${G[K.XRANGEIDENTIFIERLOOSE]})(?:\\.(${G[K.XRANGEIDENTIFIERLOOSE]})(?:\\.(${G[K.XRANGEIDENTIFIERLOOSE]})(?:${G[K.PRERELEASELOOSE]})?${G[K.BUILD]}?)?)?`),q(`XRANGE`,`^${G[K.GTLT]}\\s*${G[K.XRANGEPLAIN]}$`),q(`XRANGELOOSE`,`^${G[K.GTLT]}\\s*${G[K.XRANGEPLAINLOOSE]}$`),q(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?`),q(`COERCE`,`${G[K.COERCEPLAIN]}(?:$|[^\\d])`),q(`COERCEFULL`,`${G[K.COERCEPLAIN]}(?:${G[K.PRERELEASE]})?(?:${G[K.BUILD]})?(?:$|[^\\d])`),q(`COERCERTL`,G[K.COERCE],!0),q(`COERCERTLFULL`,G[K.COERCEFULL],!0),q(`LONETILDE`,`(?:~>?)`),q(`TILDETRIM`,`(\\s*)${G[K.LONETILDE]}\\s+`,!0),q(`TILDE`,`^${G[K.LONETILDE]}${G[K.XRANGEPLAIN]}$`),q(`TILDELOOSE`,`^${G[K.LONETILDE]}${G[K.XRANGEPLAINLOOSE]}$`),q(`LONECARET`,`(?:\\^)`),q(`CARETTRIM`,`(\\s*)${G[K.LONECARET]}\\s+`,!0),q(`CARET`,`^${G[K.LONECARET]}${G[K.XRANGEPLAIN]}$`),q(`CARETLOOSE`,`^${G[K.LONECARET]}${G[K.XRANGEPLAINLOOSE]}$`),q(`COMPARATORLOOSE`,`^${G[K.GTLT]}\\s*(${G[K.LOOSEPLAIN]})$|^$`),q(`COMPARATOR`,`^${G[K.GTLT]}\\s*(${G[K.FULLPLAIN]})$|^$`),q(`COMPARATORTRIM`,`(\\s*)${G[K.GTLT]}\\s*(${G[K.LOOSEPLAIN]}|${G[K.XRANGEPLAIN]})`,!0),q(`HYPHENRANGE`,`^\\s*(${G[K.XRANGEPLAIN]})\\s+-\\s+(${G[K.XRANGEPLAIN]})\\s*$`),q(`HYPHENRANGELOOSE`,`^\\s*(${G[K.XRANGEPLAINLOOSE]})\\s+-\\s+(${G[K.XRANGEPLAINLOOSE]})\\s*$`),q(`STAR`,`(<|>)?=?\\s*\\*`),q(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),q(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`);const tg=Object.freeze({loose:!0}),ng=Object.freeze({});function rg(e){return e?typeof e==`object`?e:tg:ng}const ig=/^\d+$/;var ag=class e{raw=``;loose=!1;options={};includePrerelease=!1;major=0;minor=0;patch=0;version=``;build=[];prerelease=[];constructor(t,n){let r=rg(n),i;if(t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;i=t.version}else if(typeof t==`string`)i=t;else throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(i.length>256)throw TypeError(`version is longer than 256 characters`);W(`SemVer`,i,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let a=i.trim().match(r.loose?Yh[K.LOOSE]:Yh[K.FULL]);if(!a)throw TypeError(`Invalid Version: ${i}`);if(this.raw=i,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>Gh||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>Gh||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>Gh||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=a[4]?a[4].split(`.`).map(e=>{if(ig.test(e)){let t=+e;if(t>=0&&t<Gh)return t}return e}):[],this.build=a[5]?a[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}inspect(){return`<SemVer "${this.version}">`}asSemVer(t){return t instanceof e?t:new e(t,this.options)}compare(t){W(`SemVer.compare`,this.version,this.options,t);let n;if(t instanceof e)n=t;else{if(typeof t==`string`&&t===this.version)return 0;n=this.asSemVer(t)}return n.version===this.version?0:this.compareMain(n)||this.comparePre(n)}compareMain(e){let t=this.asSemVer(e);return this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(e){let t=this.asSemVer(e);if(this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let e=this.prerelease[n],r=t.prerelease[n];if(W(`prerelease compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e!==r)return qh(e,r)}while(++n);return 0}compareBuild(e){let t=this.asSemVer(e),n=0;do{let e=this.build[n],r=t.build[n];if(W(`build compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e!==r)return qh(e,r)}while(++n);return 0}inc(e,t,n){let r=e,i=t;if(r.startsWith(`pre`)){if(!i&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(i){let e=`-${i}`.match(this.options.loose?Yh[K.PRERELEASELOOSE]:Yh[K.PRERELEASE]);if(!e||e[1]!==i)throw Error(`invalid identifier: ${i}`)}}switch(r){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,i,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,i,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,i,n),this.inc(`pre`,i,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,i,n),this.inc(`pre`,i,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let t=this.prerelease.length;for(;--t>=0;)typeof this.prerelease[t]==`number`&&(this.prerelease[t]=this.prerelease[t]+1,t=-2);if(t===-1){if(i===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(i){let t=[i,e];n===!1&&(t=[i]),qh(this.prerelease[0],i)===0?Number.isNaN(Number(this.prerelease[1]))&&(this.prerelease=t):this.prerelease=t}break}default:throw Error(`invalid increment argument: ${r}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}};function og(e,t,n){return new ag(e,n).compare(new ag(t,n))}function sg(e,t,n){return og(e,t,n)===0}function cg(e,t,n){return og(e,t,n)>0}function lg(e,t,n){return og(e,t,n)>=0}function ug(e,t,n){return og(e,t,n)<0}function dg(e,t,n){return og(e,t,n)<=0}function fg(e,t,n){return og(e,t,n)!==0}function pg(e,t,n,r){let i=e=>e instanceof ag?e.version:e;switch(t){case`===`:return e=i(e),n=i(n),e===n;case`!==`:return e=i(e),n=i(n),e!==n;case``:case`=`:case`==`:return sg(e,n,r);case`!=`:return fg(e,n,r);case`>`:return cg(e,n,r);case`>=`:return lg(e,n,r);case`<`:return ug(e,n,r);case`<=`:return dg(e,n,r);default:throw TypeError(`Invalid operator: ${t}`)}}var mg=class{max;map;constructor(){this.max=1e3,this.map=/* @__PURE__ */ new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;e!==void 0&&this.delete(e)}this.map.set(e,t)}return this}};const hg=Symbol(`SemVer ANY`),gg=/\s+/;var _g=class e{options={};loose=!1;operator=``;semver=hg;value=``;static get ANY(){return hg}constructor(t,n){let r=rg(n);if(t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}let i=String(t).trim().split(gg).join(` `);W(`comparator`,i,r),this.options=r,this.loose=!!r.loose,this.parse(i),this.value=this.semver===hg?``:this.operator+this.semver.version,W(`comp`,this)}parse(e){let t=this.options.loose?Yh[K.COMPARATORLOOSE]:Yh[K.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);this.operator=n[1]===void 0?``:n[1],this.operator===`=`&&(this.operator=``),this.semver=n[2]?new ag(n[2],this.options.loose):hg}toString(){return this.value}test(e){if(W(`Comparator.test`,e,this.options.loose),this.semver===hg||e===hg)return!0;if(typeof e==`string`)try{e=new ag(e,this.options)}catch{return!1}return pg(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);if(this.operator===``)return this.value===``||new wg(t.value,n).test(this.value);if(t.operator===``)return t.value===``||new wg(this.value,n).test(t.semver);let r=rg(n);return r.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!r.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver!==hg&&t.semver!==hg&&this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||pg(this.semver,`<`,t.semver,r)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||pg(this.semver,`>`,t.semver,r)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`))}};const vg=/\s+/g,yg=/\s+/,bg=new mg,xg=e=>e.value===`<0.0.0-0`,Sg=e=>e.value===``,Cg=e=>e!==_g.ANY;var wg=class e{raw=``;loose=!1;options={};includePrerelease=!1;set=[];formatted;constructor(t,n){let r=rg(n);if(t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof _g)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=(typeof t==`string`?t:String(t)).trim().replace(vg,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length>0),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!xg(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&Sg(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}inspect(){return`<SemVer Range "${this.range}">`}parseRange(e){let t=`${+!!this.options.includePrerelease|(this.options.loose?2:0)}:${e}`,n=bg.get(t);if(n)return n;let r=this.options.loose,i=r?Yh[K.HYPHENRANGELOOSE]:Yh[K.HYPHENRANGE];e=e.replace(i,Ig(!!this.options.includePrerelease)),W(`hyphen replace`,e),e=e.replace(Yh[K.COMPARATORTRIM],`$1$2$3`),W(`comparator trim`,e),e=e.replace(Yh[K.TILDETRIM],`$1~`),W(`tilde trim`,e),e=e.replace(Yh[K.CARETTRIM],`$1^`),W(`caret trim`,e);let a=e.split(` `).map(e=>Eg(e,this.options)).join(` `).split(yg).map(e=>Fg(e,this.options));r&&(a=a.filter(e=>(W(`loose invalid filter`,e,this.options),!!e.match(Yh[K.COMPARATORLOOSE])))),W(`range list`,a);let o=/* @__PURE__ */ new Map,s=a.map(e=>new _g(e,this.options));for(let e of s){if(xg(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let c=[...o.values()];return bg.set(t,c),c}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>Tg(e,n)&&t.set.some(t=>Tg(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;let t;if(typeof e==`string`)try{t=new ag(e,this.options)}catch{return!1}else if(e instanceof ag)t=e;else return!1;for(let e=0;e<this.set.length;e++)if(Lg(this.set[e],t,this.options))return!0;return!1}};function Tg(e,t){let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;){let e=i;if(!e)break;n=r.every(n=>e.intersects(n,t)),i=r.pop()}return n}function Eg(e,t){return e=e.replace(Yh[K.BUILD],``),W(`comp`,e,t),e=Ag(e,t),W(`caret`,e),e=Og(e,t),W(`tildes`,e),e=Mg(e,t),W(`xrange`,e),e=Pg(e,t),W(`stars`,e),e}function Dg(e){return!e||e.toLowerCase()===`x`||e===`*`}function Og(e,t){return e.trim().split(yg).map(e=>kg(e,t)).join(` `)}function kg(e,t){let n=t.loose?Yh[K.TILDELOOSE]:Yh[K.TILDE];return e.replace(n,(t,n,r,i,a)=>{W(`tilde`,e,t,n,r,i,a);let o,s=String(n),c=String(r),l=String(i);return Dg(n)?o=``:Dg(r)?o=`>=${s}.0.0 <${Number(s)+1}.0.0-0`:Dg(i)?o=`>=${s}.${c}.0 <${s}.${Number(c)+1}.0-0`:a?(W(`replaceTilde pr`,a),o=`>=${s}.${c}.${l}-${a} <${s}.${Number(c)+1}.0-0`):o=`>=${s}.${c}.${l} <${s}.${Number(c)+1}.0-0`,W(`tilde return`,o),o})}function Ag(e,t){return e.trim().split(yg).map(e=>jg(e,t)).join(` `)}function jg(e,t){W(`caret`,e,t);let n=t.loose?Yh[K.CARETLOOSE]:Yh[K.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{W(`caret`,e,t,n,i,a,o);let s,c=String(n),l=String(i),u=String(a);return Dg(n)?s=``:Dg(i)?s=`>=${c}.0.0${r} <${Number(c)+1}.0.0-0`:Dg(a)?s=c===`0`?`>=${c}.${l}.0${r} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.0${r} <${Number(c)+1}.0.0-0`:o?(W(`replaceCaret pr`,o),s=c===`0`?l===`0`?`>=${c}.${l}.${u}-${o} <${c}.${l}.${Number(u)+1}-0`:`>=${c}.${l}.${u}-${o} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.${u}-${o} <${Number(c)+1}.0.0-0`):(W(`no pr`),s=c===`0`?l===`0`?`>=${c}.${l}.${u}${r} <${c}.${l}.${Number(u)+1}-0`:`>=${c}.${l}.${u}${r} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.${u} <${Number(c)+1}.0.0-0`),W(`caret return`,s),s})}function Mg(e,t){return W(`replaceXRanges`,e,t),e.split(yg).map(e=>Ng(e,t)).join(` `)}function Ng(e,t){e=e.trim();let n=t.loose?Yh[K.XRANGELOOSE]:Yh[K.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{W(`xRange`,e,n,r,i,a,o,s);let c=Dg(i),l=c||Dg(a),u=l||Dg(o),d=u,f=r,p=String(i),m=String(a),h=String(o),g=s??``;return f===`=`&&d&&(f=``),g=t.includePrerelease?`-0`:``,c?n=f===`>`||f===`<`?`<0.0.0-0`:`*`:f&&d?(l&&(m=0),h=0,f===`>`?(f=`>=`,l?(p=Number(p)+1,m=0,h=0):(m=Number(m)+1,h=0)):f===`<=`&&(f=`<`,l?p=Number(p)+1:m=Number(m)+1),f===`<`&&(g=`-0`),n=`${f+p}.${m}.${h}${g}`):l?n=`>=${p}.0.0${g} <${Number(p)+1}.0.0-0`:u&&(n=`>=${p}.${m}.0${g} <${p}.${Number(m)+1}.0-0`),W(`xRange return`,n),n})}function Pg(e,t){return W(`replaceStars`,e,t),e.trim().replace(Yh[K.STAR],``)}function Fg(e,t){return W(`replaceGTE0`,e,t),e.trim().replace(Yh[t.includePrerelease?K.GTE0PRE:K.GTE0],``)}function Ig(e){return(t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n??``,m=c??``;return p=Dg(r)?``:Dg(i)?`>=${String(r)}.0.0${e?`-0`:``}`:Dg(a)?`>=${String(r)}.${String(i)}.0${e?`-0`:``}`:o?`>=${p}`:`>=${p}${e?`-0`:``}`,m=Dg(l)?``:Dg(u)?`<${Number(l)+1}.0.0-0`:Dg(d)?`<${String(l)}.${Number(u)+1}.0-0`:f?`<=${String(l)}.${String(u)}.${String(d)}-${f}`:e?`<${String(l)}.${String(u)}.${Number(d)+1}-0`:`<=${m}`,`${p} ${m}`.trim()}}function Lg(e,t,n){for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++){let r=e[n];if(W(r.semver),!Cg(r.semver))continue;let i=r.semver;if(i.prerelease.length>0&&i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function Rg(e,t,n=!1){if(e instanceof ag)return e;try{return new ag(e,t)}catch(e){if(!n)return null;throw e}}function zg(e,t,n){try{return new wg(t,n).test(e)}catch{return!1}}function Bg(e,t){let n=Rg(e,t);return n?n.version:null}function Vg(e,t){try{return new wg(e,t).range||`*`}catch{return null}}async function Hg(e,t={}){let n=await Wg(e,t);if(qg(n)){if(t.throw===!1)return n;throw Error(n.error)}let r=n.versions??{},i=Yg(n[`dist-tags`]),a=n.time??{},o=e.parsed.rawSpec||`*`,s=Date.now(),c=Gg(Kg(Object.keys(r),i,o,t.loose),a,t.after);return t.metadata?{name:n.name??e.parsed.name,distTags:i,lastSynced:s,specifier:o,timeCreated:a.created??``,timeModified:a.modified??``,versionsMeta:Object.fromEntries(c.filter(e=>!!r[e]).map(e=>[e,Zg(r[e],a[e])]))}:{name:n.name??e.parsed.name,distTags:i,lastSynced:s,specifier:o,versions:c,time:{created:a.created??``,modified:a.modified??``,...Object.fromEntries(c.filter(e=>!!a[e]).map(e=>[e,a[e]]))}}}async function Ug(e,t){let n=t.fetch??fetch,r=new URL(e.parsed.escapedName,e.registry),i=new Headers({accept:`application/json`});e.auth?.token?i.set(`authorization`,`Bearer ${e.auth.token}`):e.auth?.basicAuth&&i.set(`authorization`,`Basic ${e.auth.basicAuth}`),e.config.userAgent&&i.set(`user-agent`,e.config.userAgent);let a=await n(r,{headers:i});return a.ok?a.json():Xg(e.parsed.name,r,a.status,a.statusText)}async function Wg(e,t){let n=Jg(t.retry),r=()=>Ug(e,t);return n===!1?r():Wh(r,n)}function Gg(e,t,n){if(!n)return e;let r=Date.parse(n);return Number.isNaN(r)?e:e.filter(e=>{let n=t[e];return n?Date.parse(n)>r:!1})}function Kg(e,t,n,r){if(n===`*`)return e;let i=t[n];return i?e.includes(i)?[i]:[]:Bg(n)?e:Vg(n)?e.filter(e=>zg(e,n,{includePrerelease:!0,loose:r??!1})):e}function qg(e){return`error`in e}function Jg(e){return e===!1?!1:typeof e==`number`?{...Hm,retries:e}:e??Hm}function Yg(e){return{latest:e?.latest??``,...e??{}}}function Xg(e,t,n,r){return{status:n,name:e,error:`[GET] "${t}": ${n} ${r}`}}function Zg(e,t){return{time:t,engines:e.engines,deprecated:e.deprecated,provenance:Um(e),integrity:e.integrity??e.dist?.integrity}}async function Qg(e,t={}){let[n]=Ah([e],t);return $g(n,t)}function $g(e,t){return kh(e.registry)?Om(e.parsed.raw,e_(t)):Hg(e,t)}function e_(e){let{cwd:t,env:n,userConfigPath:r,projectConfigPath:i,...a}=e;return a}const t_=!!globalThis.process?.env?.FORCE_NODE_FETCH,n_=!t_&&globalThis.fetch||i;!t_&&globalThis.Blob,!t_&&globalThis.File,!t_&&globalThis.FormData;const r_=!t_&&globalThis.Headers||e;!t_&&globalThis.Request,!t_&&globalThis.Response;const i_=!t_&&globalThis.AbortController||r,a_=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,o_=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,s_=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function c_(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t)l_(e);else return t}function l_(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function u_(e,t={}){if(typeof e!=`string`)return e;if(e[0]===`"`&&e[e.length-1]===`"`&&e.indexOf(`\\`)===-1)return e.slice(1,-1);let n=e.trim();if(n.length<=9)switch(n.toLowerCase()){case`true`:return!0;case`false`:return!1;case`undefined`:return;case`null`:return null;case`nan`:return NaN;case`infinity`:return 1/0;case`-infinity`:return-1/0}if(!s_.test(e)){if(t.strict)throw SyntaxError(`[destr] Invalid JSON`);return e}try{if(a_.test(e)||o_.test(e)){if(t.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(e,c_)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}String.fromCharCode;const d_=/#/g,f_=/&/g,p_=/\//g,m_=/=/g,h_=/\+/g,g_=/%5e/gi,__=/%60/gi,v_=/%7c/gi,y_=/%20/gi;function b_(e){return encodeURI(``+e).replace(v_,`|`)}function x_(e){return b_(typeof e==`string`?e:JSON.stringify(e)).replace(h_,`%2B`).replace(y_,`+`).replace(d_,`%23`).replace(f_,`%26`).replace(__,"`").replace(g_,`^`).replace(p_,`%2F`)}function S_(e){return x_(e).replace(m_,`%3D`)}function C_(e=``){try{return decodeURIComponent(``+e)}catch{return``+e}}function w_(e){return C_(e.replace(h_,` `))}function T_(e){return C_(e.replace(h_,` `))}function E_(e=``){let t=/* @__PURE__ */ Object.create(null);e[0]===`?`&&(e=e.slice(1));for(let n of e.split(`&`)){let e=n.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let r=w_(e[1]);if(r===`__proto__`||r===`constructor`)continue;let i=T_(e[2]||``);t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}return t}function D_(e,t){return(typeof t==`number`||typeof t==`boolean`)&&(t=String(t)),t?Array.isArray(t)?t.map(t=>`${S_(e)}=${x_(t)}`).join(`&`):`${S_(e)}=${x_(t)}`:S_(e)}function O_(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>D_(t,e[t])).filter(Boolean).join(`&`)}const k_=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,A_=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,j_=/^([/\\]\s*){2,}[^/\\]/,M_=/\/$|\/\?|\/#/,N_=/^\.?\//;function P_(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?k_.test(e):A_.test(e)||(t.acceptRelative?j_.test(e):!1)}function F_(e=``,t){return t?M_.test(e):e.endsWith(`/`)}function I_(e=``,t){if(!t)return(F_(e)?e.slice(0,-1):e)||`/`;if(!F_(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);i!==-1&&(n=e.slice(0,i),r=e.slice(i));let[a,...o]=n.split(`?`);return((a.endsWith(`/`)?a.slice(0,-1):a)||`/`)+(o.length>0?`?${o.join(`?`)}`:``)+r}function L_(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(F_(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function R_(e,t){if(B_(t)||P_(e))return e;let n=I_(t);if(e.startsWith(n)){let t=e[n.length];if(!t||t===`/`||t===`?`)return e}return H_(n,e)}function z_(e,t){let n=W_(e);return n.search=O_({...E_(n.search),...t}),K_(n)}function B_(e){return!e||e===`/`}function V_(e){return e&&e!==`/`}function H_(e,...t){let n=e||``;for(let e of t.filter(e=>V_(e)))if(n){let t=e.replace(N_,``);n=L_(n)+t}else n=e;return n}const U_=Symbol.for(`ufo:protocolRelative`);function W_(e=``,t){let n=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=``]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:``,host:``,search:``,hash:``}}if(!P_(e,{acceptRelative:!0}))return t?W_(t+e):G_(e);let[,r=``,i,a=``]=e.replace(/\\/g,`/`).match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,o=``,s=``]=a.match(/([^#/?]*)(.*)?/)||[];r===`file:`&&(s=s.replace(/\/(?=[A-Za-z]:)/,``));let{pathname:c,search:l,hash:u}=G_(s);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):``,host:o,pathname:c,search:l,hash:u,[U_]:!r}}function G_(e=``){let[t=``,n=``,r=``]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}function K_(e){let t=e.pathname||``,n=e.search?(e.search.startsWith(`?`)?``:`?`)+e.search:``,r=e.hash||``,i=e.auth?e.auth+`@`:``,a=e.host||``;return(e.protocol||e[U_]?(e.protocol||``)+`//`:``)+i+a+t+n+r}var q_=class extends Error{constructor(e,t){super(e,t),this.name=`FetchError`,t?.cause&&!this.cause&&(this.cause=t.cause)}};function J_(e){let t=e.error?.message||e.error?.toString()||``,n=e.request?.method||e.options?.method||`GET`,r=e.request?.url||String(e.request)||`/`,i=new q_(`${`[${n}] ${JSON.stringify(r)}`}: ${e.response?`${e.response.status} ${e.response.statusText}`:`<no response>`}${t?` ${t}`:``}`,e.error?{cause:e.error}:void 0);for(let t of[`request`,`options`,`response`])Object.defineProperty(i,t,{get(){return e[t]}});for(let[t,n]of[[`data`,`_data`],[`status`,`status`],[`statusCode`,`status`],[`statusText`,`statusText`],[`statusMessage`,`statusText`]])Object.defineProperty(i,t,{get(){return e.response&&e.response[n]}});return i}const Y_=new Set(Object.freeze([`PATCH`,`POST`,`PUT`,`DELETE`]));function X_(e=`GET`){return Y_.has(e.toUpperCase())}function Z_(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer||e instanceof FormData||e instanceof URLSearchParams?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}const Q_=/* @__PURE__ */ new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]),$_=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function ev(e=``){if(!e)return`json`;let t=e.split(`;`).shift()||``;return $_.test(t)?`json`:t===`text/event-stream`?`stream`:Q_.has(t)||t.startsWith(`text/`)?`text`:`blob`}function tv(e,t,n,r){let i=nv(t?.headers??e?.headers,n?.headers,r),a;return(n?.query||n?.params||t?.params||t?.query)&&(a={...n?.params,...n?.query,...t?.params,...t?.query}),{...n,...t,query:a,params:a,headers:i}}function nv(e,t,n){if(!t)return new n(e);let r=new n(t);if(e)for(let[t,i]of Symbol.iterator in e||Array.isArray(e)?e:new n(e))r.set(t,i);return r}async function rv(e,t){if(t){if(Array.isArray(t))for(let n of t)await n(e);else await t(e)}}const iv=/* @__PURE__ */ new Set([408,409,425,429,500,502,503,504]),av=/* @__PURE__ */ new Set([101,204,205,304]);function ov(e={}){let{fetch:t=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:r=globalThis.AbortController}=e;async function i(e){let t=e.error&&e.error.name===`AbortError`&&!e.options.timeout||!1;if(e.options.retry!==!1&&!t){let t;t=typeof e.options.retry==`number`?e.options.retry:+!X_(e.options.method);let n=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(n):iv.has(n))){let n=typeof e.options.retryDelay==`function`?e.options.retryDelay(e):e.options.retryDelay||0;return n>0&&await new Promise(e=>setTimeout(e,n)),a(e.request,{...e.options,retry:t-1})}}let n=J_(e);throw Error.captureStackTrace&&Error.captureStackTrace(n,a),n}let a=async function(a,o={}){let s={request:a,options:tv(a,o,e.defaults,n),response:void 0,error:void 0};if(s.options.method&&(s.options.method=s.options.method.toUpperCase()),s.options.onRequest&&(await rv(s,s.options.onRequest),s.options.headers instanceof n||(s.options.headers=new n(s.options.headers||{}))),typeof s.request==`string`&&(s.options.baseURL&&(s.request=R_(s.request,s.options.baseURL)),s.options.query&&(s.request=z_(s.request,s.options.query),delete s.options.query),`query`in s.options&&delete s.options.query,`params`in s.options&&delete s.options.params),s.options.body&&X_(s.options.method)){if(Z_(s.options.body)){let e=s.options.headers.get(`content-type`);typeof s.options.body!=`string`&&(s.options.body=e===`application/x-www-form-urlencoded`?new URLSearchParams(s.options.body).toString():JSON.stringify(s.options.body)),e||s.options.headers.set(`content-type`,`application/json`),s.options.headers.has(`accept`)||s.options.headers.set(`accept`,`application/json`)}else(`pipeTo`in s.options.body&&typeof s.options.body.pipeTo==`function`||typeof s.options.body.pipe==`function`)&&(`duplex`in s.options||(s.options.duplex=`half`))}let c;if(!s.options.signal&&s.options.timeout){let e=new r;c=setTimeout(()=>{let t=/* @__PURE__ */ Error(`[TimeoutError]: The operation was aborted due to timeout`);t.name=`TimeoutError`,t.code=23,e.abort(t)},s.options.timeout),s.options.signal=e.signal}try{s.response=await t(s.request,s.options)}catch(e){return s.error=e,s.options.onRequestError&&await rv(s,s.options.onRequestError),await i(s)}finally{c&&clearTimeout(c)}if((s.response.body||s.response._bodyInit)&&!av.has(s.response.status)&&s.options.method!==`HEAD`){let e=(s.options.parseResponse?`json`:s.options.responseType)||ev(s.response.headers.get(`content-type`)||``);switch(e){case`json`:{let e=await s.response.text(),t=s.options.parseResponse||u_;s.response._data=t(e);break}case`stream`:s.response._data=s.response.body||s.response._bodyInit;break;default:s.response._data=await s.response[e]()}}return s.options.onResponse&&await rv(s,s.options.onResponse),!s.options.ignoreResponseError&&s.response.status>=400&&s.response.status<600?(s.options.onResponseError&&await rv(s,s.options.onResponseError),await i(s)):s.response},o=async function(e,t){return(await a(e,t))._data};return o.raw=a,o.native=(...e)=>t(...e),o.create=(t={},n={})=>ov({...e,...n,defaults:{...e.defaults,...n.defaults,...t}}),o}function sv(){if(!JSON.parse(process.env.FETCH_KEEP_ALIVE||`false`))return n_;let e={keepAlive:!0},t=new L.Agent(e),n=new oe.Agent(e),r={agent(e){return e.protocol===`http:`?t:n}};return function(e,t){return n_(e,{...r,...t})}}const cv=globalThis.fetch?(...e)=>globalThis.fetch(...e):sv();ov({fetch:cv,Headers:globalThis.Headers||r_,AbortController:globalThis.AbortController||i_});const lv=/^(?:( )+|\t+)/,uv=`space`;function dv(e,t,n){return e&&t===uv&&n===1}function fv(e,t){let n=/* @__PURE__ */ new Map,r=0,i,a;for(let o of e.split(/\n/g)){if(!o)continue;let e=o.match(lv);if(e===null)r=0,i=``;else{let o=e[0].length,s=e[1]?uv:`tab`;if(dv(t,s,o))continue;s!==i&&(r=0),i=s;let c=1,l=0,u=o-r;if(r=o,u===0)c=0,l=1;else{let e=Math.abs(u);if(dv(t,s,e))continue;a=pv(s,e)}let d=n.get(a);n.set(a,d===void 0?[1,0]:[d[0]+c,d[1]+l])}}return n}function pv(e,t){return(e===uv?`s`:`t`)+String(t)}function mv(e){return{type:e[0]===`s`?uv:`tab`,amount:Number(e.slice(1))}}function hv(e){let t,n=0,r=0;for(let[i,[a,o]]of e)(a>n||a===n&&o>r)&&(n=a,r=o,t=i);return t}function gv(e,t){return(e===uv?` `:` `).repeat(t)}function _v(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);let t=fv(e,!0);t.size===0&&(t=fv(e,!1));let n=hv(t),r,i=0,a=``;return n!==void 0&&({type:r,amount:i}=mv(n),a=gv(r,i)),{amount:i,type:r,indent:a}}function vv(e,t){return ne(e)?e:M(t||`.`,e)}function yv(e,t){let{last:n,cwd:r}=t||{},i=vv(e,r),a=vv(n||`/`,r),o,s=[];for(;o!==a&&(s.push(i),i=te(o=i),i!==o););return s}function bv(e,t){let n,r;for(n of yv(t&&t.cwd||``,t))if(r=j(n,e),E(r))return r}
183
181
  /* istanbul ignore next */
184
- const xv=2**53-1||9007199254740991,Sv=/^\d+$/;function Cv(e,t){if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let n=Sv.test(String(e)),r=Sv.test(String(t));return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1}const J=typeof I==`object`&&I.env&&I.env.NODE_DEBUG&&/\bsemver\b/i.test(I.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{},wv=[],Tv=[],Y=[],Ev=[],X={};let Dv=0;const Ov=`[a-zA-Z0-9-]`,kv=[[`\\s`,1],[`\\d`,256],[Ov,250]];function Av(e){for(let[t,n]of kv)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e}function Z(e,t,n=!1){let r=Av(t),i=Dv++;J(e,i,t),X[e]=i,Y[i]=t,Ev[i]=r,wv[i]=new RegExp(t,n?`g`:void 0),Tv[i]=new RegExp(r,n?`g`:void 0)}Z(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),Z(`NUMERICIDENTIFIERLOOSE`,`\\d+`),Z(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${Ov}*`),Z(`MAINVERSION`,`(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})`),Z(`MAINVERSIONLOOSE`,`(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})`),Z(`PRERELEASEIDENTIFIER`,`(?:${Y[X.NONNUMERICIDENTIFIER]}|${Y[X.NUMERICIDENTIFIER]})`),Z(`PRERELEASEIDENTIFIERLOOSE`,`(?:${Y[X.NONNUMERICIDENTIFIER]}|${Y[X.NUMERICIDENTIFIERLOOSE]})`),Z(`PRERELEASE`,`(?:-(${Y[X.PRERELEASEIDENTIFIER]}(?:\\.${Y[X.PRERELEASEIDENTIFIER]})*))`),Z(`PRERELEASELOOSE`,`(?:-?(${Y[X.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Y[X.PRERELEASEIDENTIFIERLOOSE]})*))`),Z(`BUILDIDENTIFIER`,`${Ov}+`),Z(`BUILD`,`(?:\\+(${Y[X.BUILDIDENTIFIER]}(?:\\.${Y[X.BUILDIDENTIFIER]})*))`),Z(`FULLPLAIN`,`v?${Y[X.MAINVERSION]}${Y[X.PRERELEASE]}?${Y[X.BUILD]}?`),Z(`FULL`,`^${Y[X.FULLPLAIN]}$`),Z(`LOOSEPLAIN`,`[v=\\s]*${Y[X.MAINVERSIONLOOSE]}${Y[X.PRERELEASELOOSE]}?${Y[X.BUILD]}?`),Z(`LOOSE`,`^${Y[X.LOOSEPLAIN]}$`),Z(`GTLT`,`((?:<|>)?=?)`),Z(`XRANGEIDENTIFIERLOOSE`,`${Y[X.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),Z(`XRANGEIDENTIFIER`,`${Y[X.NUMERICIDENTIFIER]}|x|X|\\*`),Z(`XRANGEPLAIN`,`[v=\\s]*(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:${Y[X.PRERELEASE]})?${Y[X.BUILD]}?)?)?`),Z(`XRANGEPLAINLOOSE`,`[v=\\s]*(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:${Y[X.PRERELEASELOOSE]})?${Y[X.BUILD]}?)?)?`),Z(`XRANGE`,`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAIN]}$`),Z(`XRANGELOOSE`,`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAINLOOSE]}$`),Z(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?`),Z(`COERCE`,`${Y[X.COERCEPLAIN]}(?:$|[^\\d])`),Z(`COERCEFULL`,`${Y[X.COERCEPLAIN]}(?:${Y[X.PRERELEASE]})?(?:${Y[X.BUILD]})?(?:$|[^\\d])`),Z(`COERCERTL`,Y[X.COERCE],!0),Z(`COERCERTLFULL`,Y[X.COERCEFULL],!0),Z(`LONETILDE`,`(?:~>?)`),Z(`TILDETRIM`,`(\\s*)${Y[X.LONETILDE]}\\s+`,!0),Z(`TILDE`,`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAIN]}$`),Z(`TILDELOOSE`,`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAINLOOSE]}$`),Z(`LONECARET`,`(?:\\^)`),Z(`CARETTRIM`,`(\\s*)${Y[X.LONECARET]}\\s+`,!0),Z(`CARET`,`^${Y[X.LONECARET]}${Y[X.XRANGEPLAIN]}$`),Z(`CARETLOOSE`,`^${Y[X.LONECARET]}${Y[X.XRANGEPLAINLOOSE]}$`),Z(`COMPARATORLOOSE`,`^${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]})$|^$`),Z(`COMPARATOR`,`^${Y[X.GTLT]}\\s*(${Y[X.FULLPLAIN]})$|^$`),Z(`COMPARATORTRIM`,`(\\s*)${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]}|${Y[X.XRANGEPLAIN]})`,!0),Z(`HYPHENRANGE`,`^\\s*(${Y[X.XRANGEPLAIN]})\\s+-\\s+(${Y[X.XRANGEPLAIN]})\\s*$`),Z(`HYPHENRANGELOOSE`,`^\\s*(${Y[X.XRANGEPLAINLOOSE]})\\s+-\\s+(${Y[X.XRANGEPLAINLOOSE]})\\s*$`),Z(`STAR`,`(<|>)?=?\\s*\\*`),Z(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),Z(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`);const jv=Object.freeze({loose:!0}),Mv=Object.freeze({});function Nv(e){return e?typeof e==`object`?e:jv:Mv}const Pv=/^\d+$/;var Fv=class e{raw=``;loose=!1;options={};includePrerelease=!1;major=0;minor=0;patch=0;version=``;build=[];prerelease=[];constructor(t,n){let r=Nv(n),i;if(t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;i=t.version}else if(typeof t==`string`)i=t;else throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(i.length>256)throw TypeError(`version is longer than 256 characters`);J(`SemVer`,i,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let a=i.trim().match(r.loose?Tv[X.LOOSE]:Tv[X.FULL]);if(!a)throw TypeError(`Invalid Version: ${i}`);if(this.raw=i,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>xv||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>xv||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>xv||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=a[4]?a[4].split(`.`).map(e=>{if(Pv.test(e)){let t=+e;if(t>=0&&t<xv)return t}return e}):[],this.build=a[5]?a[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}inspect(){return`<SemVer "${this.version}">`}asSemVer(t){return t instanceof e?t:new e(t,this.options)}compare(t){J(`SemVer.compare`,this.version,this.options,t);let n;if(t instanceof e)n=t;else{if(typeof t==`string`&&t===this.version)return 0;n=this.asSemVer(t)}return n.version===this.version?0:this.compareMain(n)||this.comparePre(n)}compareMain(e){let t=this.asSemVer(e);return this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(e){let t=this.asSemVer(e);if(this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let e=this.prerelease[n],r=t.prerelease[n];if(J(`prerelease compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e!==r)return Cv(e,r)}while(++n);return 0}compareBuild(e){let t=this.asSemVer(e),n=0;do{let e=this.build[n],r=t.build[n];if(J(`build compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e!==r)return Cv(e,r)}while(++n);return 0}inc(e,t,n){let r=e,i=t;if(r.startsWith(`pre`)){if(!i&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(i){let e=`-${i}`.match(this.options.loose?Tv[X.PRERELEASELOOSE]:Tv[X.PRERELEASE]);if(!e||e[1]!==i)throw Error(`invalid identifier: ${i}`)}}switch(r){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,i,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,i,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,i,n),this.inc(`pre`,i,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,i,n),this.inc(`pre`,i,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let t=this.prerelease.length;for(;--t>=0;)typeof this.prerelease[t]==`number`&&(this.prerelease[t]=this.prerelease[t]+1,t=-2);if(t===-1){if(i===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(i){let t=[i,e];n===!1&&(t=[i]),Cv(this.prerelease[0],i)===0?Number.isNaN(Number(this.prerelease[1]))&&(this.prerelease=t):this.prerelease=t}break}default:throw Error(`invalid increment argument: ${r}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}};function Iv(e,t,n){return new Fv(e,n).compare(new Fv(t,n))}function Lv(e,t,n){return Iv(e,t,n)===0}function Rv(e,t,n){return Iv(e,t,n)>0}function zv(e,t,n){return Iv(e,t,n)>=0}function Bv(e,t,n){return Iv(e,t,n)<0}function Vv(e,t,n){return Iv(e,t,n)<=0}function Hv(e,t,n){return Iv(e,t,n)!==0}function Uv(e,t,n,r){let i=e=>e instanceof Fv?e.version:e;switch(t){case`===`:return e=i(e),n=i(n),e===n;case`!==`:return e=i(e),n=i(n),e!==n;case``:case`=`:case`==`:return Lv(e,n,r);case`!=`:return Hv(e,n,r);case`>`:return Rv(e,n,r);case`>=`:return zv(e,n,r);case`<`:return Bv(e,n,r);case`<=`:return Vv(e,n,r);default:throw TypeError(`Invalid operator: ${t}`)}}var Wv=class{max;map;constructor(){this.max=1e3,this.map=/* @__PURE__ */ new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;e!==void 0&&this.delete(e)}this.map.set(e,t)}return this}};const Gv=Symbol(`SemVer ANY`),Kv=/\s+/;var qv=class e{options={};loose=!1;operator=``;semver=Gv;value=``;static get ANY(){return Gv}constructor(t,n){let r=Nv(n);if(t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}let i=String(t).trim().split(Kv).join(` `);J(`comparator`,i,r),this.options=r,this.loose=!!r.loose,this.parse(i),this.value=this.semver===Gv?``:this.operator+this.semver.version,J(`comp`,this)}parse(e){let t=this.options.loose?Tv[X.COMPARATORLOOSE]:Tv[X.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);this.operator=n[1]===void 0?``:n[1],this.operator===`=`&&(this.operator=``),this.semver=n[2]?new Fv(n[2],this.options.loose):Gv}toString(){return this.value}test(e){if(J(`Comparator.test`,e,this.options.loose),this.semver===Gv||e===Gv)return!0;if(typeof e==`string`)try{e=new Fv(e,this.options)}catch{return!1}return Uv(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);if(this.operator===``)return this.value===``||new ey(t.value,n).test(this.value);if(t.operator===``)return t.value===``||new ey(this.value,n).test(t.semver);let r=Nv(n);return r.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!r.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver!==Gv&&t.semver!==Gv&&this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||Uv(this.semver,`<`,t.semver,r)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||Uv(this.semver,`>`,t.semver,r)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`))}};const Jv=/\s+/g,Yv=/\s+/,Xv=new Wv,Zv=e=>e.value===`<0.0.0-0`,Qv=e=>e.value===``,$v=e=>e!==qv.ANY;var ey=class e{raw=``;loose=!1;options={};includePrerelease=!1;set=[];formatted;constructor(t,n){let r=Nv(n);if(t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof qv)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=(typeof t==`string`?t:String(t)).trim().replace(Jv,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length>0),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!Zv(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&Qv(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}inspect(){return`<SemVer Range "${this.range}">`}parseRange(e){let t=`${+!!this.options.includePrerelease|(this.options.loose?2:0)}:${e}`,n=Xv.get(t);if(n)return n;let r=this.options.loose,i=r?Tv[X.HYPHENRANGELOOSE]:Tv[X.HYPHENRANGE];e=e.replace(i,fy(!!this.options.includePrerelease)),J(`hyphen replace`,e),e=e.replace(Tv[X.COMPARATORTRIM],`$1$2$3`),J(`comparator trim`,e),e=e.replace(Tv[X.TILDETRIM],`$1~`),J(`tilde trim`,e),e=e.replace(Tv[X.CARETTRIM],`$1^`),J(`caret trim`,e);let a=e.split(` `).map(e=>ny(e,this.options)).join(` `).split(Yv).map(e=>dy(e,this.options));r&&(a=a.filter(e=>(J(`loose invalid filter`,e,this.options),!!e.match(Tv[X.COMPARATORLOOSE])))),J(`range list`,a);let o=/* @__PURE__ */ new Map,s=a.map(e=>new qv(e,this.options));for(let e of s){if(Zv(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let c=[...o.values()];return Xv.set(t,c),c}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>ty(e,n)&&t.set.some(t=>ty(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;let t;if(typeof e==`string`)try{t=new Fv(e,this.options)}catch{return!1}else if(e instanceof Fv)t=e;else return!1;for(let e=0;e<this.set.length;e++)if(py(this.set[e],t,this.options))return!0;return!1}};function ty(e,t){let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;){let e=i;if(!e)break;n=r.every(n=>e.intersects(n,t)),i=r.pop()}return n}function ny(e,t){return e=e.replace(Tv[X.BUILD],``),J(`comp`,e,t),e=oy(e,t),J(`caret`,e),e=iy(e,t),J(`tildes`,e),e=cy(e,t),J(`xrange`,e),e=uy(e,t),J(`stars`,e),e}function ry(e){return!e||e.toLowerCase()===`x`||e===`*`}function iy(e,t){return e.trim().split(Yv).map(e=>ay(e,t)).join(` `)}function ay(e,t){let n=t.loose?Tv[X.TILDELOOSE]:Tv[X.TILDE];return e.replace(n,(t,n,r,i,a)=>{J(`tilde`,e,t,n,r,i,a);let o,s=String(n),c=String(r),l=String(i);return ry(n)?o=``:ry(r)?o=`>=${s}.0.0 <${Number(s)+1}.0.0-0`:ry(i)?o=`>=${s}.${c}.0 <${s}.${Number(c)+1}.0-0`:a?(J(`replaceTilde pr`,a),o=`>=${s}.${c}.${l}-${a} <${s}.${Number(c)+1}.0-0`):o=`>=${s}.${c}.${l} <${s}.${Number(c)+1}.0-0`,J(`tilde return`,o),o})}function oy(e,t){return e.trim().split(Yv).map(e=>sy(e,t)).join(` `)}function sy(e,t){J(`caret`,e,t);let n=t.loose?Tv[X.CARETLOOSE]:Tv[X.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{J(`caret`,e,t,n,i,a,o);let s,c=String(n),l=String(i),u=String(a);return ry(n)?s=``:ry(i)?s=`>=${c}.0.0${r} <${Number(c)+1}.0.0-0`:ry(a)?s=c===`0`?`>=${c}.${l}.0${r} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.0${r} <${Number(c)+1}.0.0-0`:o?(J(`replaceCaret pr`,o),s=c===`0`?l===`0`?`>=${c}.${l}.${u}-${o} <${c}.${l}.${Number(u)+1}-0`:`>=${c}.${l}.${u}-${o} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.${u}-${o} <${Number(c)+1}.0.0-0`):(J(`no pr`),s=c===`0`?l===`0`?`>=${c}.${l}.${u}${r} <${c}.${l}.${Number(u)+1}-0`:`>=${c}.${l}.${u}${r} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.${u} <${Number(c)+1}.0.0-0`),J(`caret return`,s),s})}function cy(e,t){return J(`replaceXRanges`,e,t),e.split(Yv).map(e=>ly(e,t)).join(` `)}function ly(e,t){e=e.trim();let n=t.loose?Tv[X.XRANGELOOSE]:Tv[X.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{J(`xRange`,e,n,r,i,a,o,s);let c=ry(i),l=c||ry(a),u=l||ry(o),d=u,f=r,p=String(i),m=String(a),h=String(o),g=s??``;return f===`=`&&d&&(f=``),g=t.includePrerelease?`-0`:``,c?n=f===`>`||f===`<`?`<0.0.0-0`:`*`:f&&d?(l&&(m=0),h=0,f===`>`?(f=`>=`,l?(p=Number(p)+1,m=0,h=0):(m=Number(m)+1,h=0)):f===`<=`&&(f=`<`,l?p=Number(p)+1:m=Number(m)+1),f===`<`&&(g=`-0`),n=`${f+p}.${m}.${h}${g}`):l?n=`>=${p}.0.0${g} <${Number(p)+1}.0.0-0`:u&&(n=`>=${p}.${m}.0${g} <${p}.${Number(m)+1}.0-0`),J(`xRange return`,n),n})}function uy(e,t){return J(`replaceStars`,e,t),e.trim().replace(Tv[X.STAR],``)}function dy(e,t){return J(`replaceGTE0`,e,t),e.trim().replace(Tv[t.includePrerelease?X.GTE0PRE:X.GTE0],``)}function fy(e){return(t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n??``,m=c??``;return p=ry(r)?``:ry(i)?`>=${String(r)}.0.0${e?`-0`:``}`:ry(a)?`>=${String(r)}.${String(i)}.0${e?`-0`:``}`:o?`>=${p}`:`>=${p}${e?`-0`:``}`,m=ry(l)?``:ry(u)?`<${Number(l)+1}.0.0-0`:ry(d)?`<${String(l)}.${Number(u)+1}.0-0`:f?`<=${String(l)}.${String(u)}.${String(d)}-${f}`:e?`<${String(l)}.${String(u)}.${Number(d)+1}-0`:`<=${m}`,`${p} ${m}`.trim()}}function py(e,t,n){for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++){let r=e[n];if(J(r.semver),!$v(r.semver))continue;let i=r.semver;if(i.prerelease.length>0&&i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function my(e,t,n){try{return new ey(t,n).test(e)}catch{return!1}}function hy(e,t){let n=new ey(e,t),r=new Fv(`0.0.0`);if(n.test(r)||(r=new Fv(`0.0.0-0`),n.test(r)))return r;r=null;for(let e=0;e<n.set.length;++e){let t=n.set[e],i=null;t.forEach(e=>{let t=new Fv(e.semver instanceof Fv?e.semver.version:`0.0.0`);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!i||Rv(t,i))&&(i=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),i&&(!r||Rv(r,i))&&(r=i)}return r&&n.test(r)?r:null}function gy(e,t){try{return new ey(e,t).range||`*`}catch{return null}}var Q=/* @__PURE__ */ n((e=>{let t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),c=e=>!!e&&typeof e==`object`&&e[s]===t,l=e=>!!e&&typeof e==`object`&&e[s]===n,u=e=>!!e&&typeof e==`object`&&e[s]===r,d=e=>!!e&&typeof e==`object`&&e[s]===i,f=e=>!!e&&typeof e==`object`&&e[s]===a,p=e=>!!e&&typeof e==`object`&&e[s]===o;function m(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}function h(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1}e.ALIAS=t,e.DOC=n,e.MAP=r,e.NODE_TYPE=s,e.PAIR=i,e.SCALAR=a,e.SEQ=o,e.hasAnchor=e=>(f(e)||m(e))&&!!e.anchor,e.isAlias=c,e.isCollection=m,e.isDocument=l,e.isMap=u,e.isNode=h,e.isPair=d,e.isScalar=f,e.isSeq=p})),_y=/* @__PURE__ */ n((e=>{var t=Q();let n=Symbol(`break visit`),r=Symbol(`skip children`),i=Symbol(`remove node`);function a(e,n){let r=l(n);t.isDocument(e)?o(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):o(null,e,r,Object.freeze([]))}a.BREAK=n,a.SKIP=r,a.REMOVE=i;function o(e,r,a,s){let c=u(e,r,a,s);if(t.isNode(c)||t.isPair(c))return d(e,s,c),o(e,c,a,s);if(typeof c!=`symbol`){if(t.isCollection(r)){s=Object.freeze(s.concat(r));for(let e=0;e<r.items.length;++e){let t=o(e,r.items[e],a,s);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){s=Object.freeze(s.concat(r));let e=o(`key`,r.key,a,s);if(e===n)return n;e===i&&(r.key=null);let t=o(`value`,r.value,a,s);if(t===n)return n;t===i&&(r.value=null)}}return c}async function s(e,n){let r=l(n);t.isDocument(e)?await c(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):await c(null,e,r,Object.freeze([]))}s.BREAK=n,s.SKIP=r,s.REMOVE=i;async function c(e,r,a,o){let s=await u(e,r,a,o);if(t.isNode(s)||t.isPair(s))return d(e,o,s),c(e,s,a,o);if(typeof s!=`symbol`){if(t.isCollection(r)){o=Object.freeze(o.concat(r));for(let e=0;e<r.items.length;++e){let t=await c(e,r.items[e],a,o);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){o=Object.freeze(o.concat(r));let e=await c(`key`,r.key,a,o);if(e===n)return n;e===i&&(r.key=null);let t=await c(`value`,r.value,a,o);if(t===n)return n;t===i&&(r.value=null)}}return s}function l(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function u(e,n,r,i){if(typeof r==`function`)return r(e,n,i);if(t.isMap(n))return r.Map?.(e,n,i);if(t.isSeq(n))return r.Seq?.(e,n,i);if(t.isPair(n))return r.Pair?.(e,n,i);if(t.isScalar(n))return r.Scalar?.(e,n,i);if(t.isAlias(n))return r.Alias?.(e,n,i)}function d(e,n,r){let i=n[n.length-1];if(t.isCollection(i))i.items[e]=r;else if(t.isPair(i))e===`key`?i.key=r:i.value=r;else if(t.isDocument(i))i.contents=r;else{let e=t.isAlias(i)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}e.visit=a,e.visitAsync=s})),vy=/* @__PURE__ */ n((e=>{var t=Q(),n=_y();let r={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},i=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);var a=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+i(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],i=Object.entries(this.tags),a;if(e&&i.length>0&&t.isNode(e.contents)){let r={};n.visit(e.contents,(e,n)=>{t.isNode(n)&&n.tag&&(r[n.tag]=!0)}),a=Object.keys(r)}else a=[];for(let[t,n]of i)(t!==`!!`||n!==`tag:yaml.org,2002:`)&&(!e||a.some(e=>e.startsWith(n)))&&r.push(`%TAG ${t} ${n}`);return r.join(`
182
+ const xv=2**53-1||9007199254740991,Sv=/^\d+$/;function Cv(e,t){if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let n=Sv.test(String(e)),r=Sv.test(String(t));return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1}const J=typeof F==`object`&&F.env&&F.env.NODE_DEBUG&&/\bsemver\b/i.test(F.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{},wv=[],Tv=[],Y=[],Ev=[],X={};let Dv=0;const Ov=`[a-zA-Z0-9-]`,kv=[[`\\s`,1],[`\\d`,256],[Ov,250]];function Av(e){for(let[t,n]of kv)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e}function Z(e,t,n=!1){let r=Av(t),i=Dv++;J(e,i,t),X[e]=i,Y[i]=t,Ev[i]=r,wv[i]=new RegExp(t,n?`g`:void 0),Tv[i]=new RegExp(r,n?`g`:void 0)}Z(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),Z(`NUMERICIDENTIFIERLOOSE`,`\\d+`),Z(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${Ov}*`),Z(`MAINVERSION`,`(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})`),Z(`MAINVERSIONLOOSE`,`(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})`),Z(`PRERELEASEIDENTIFIER`,`(?:${Y[X.NONNUMERICIDENTIFIER]}|${Y[X.NUMERICIDENTIFIER]})`),Z(`PRERELEASEIDENTIFIERLOOSE`,`(?:${Y[X.NONNUMERICIDENTIFIER]}|${Y[X.NUMERICIDENTIFIERLOOSE]})`),Z(`PRERELEASE`,`(?:-(${Y[X.PRERELEASEIDENTIFIER]}(?:\\.${Y[X.PRERELEASEIDENTIFIER]})*))`),Z(`PRERELEASELOOSE`,`(?:-?(${Y[X.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Y[X.PRERELEASEIDENTIFIERLOOSE]})*))`),Z(`BUILDIDENTIFIER`,`${Ov}+`),Z(`BUILD`,`(?:\\+(${Y[X.BUILDIDENTIFIER]}(?:\\.${Y[X.BUILDIDENTIFIER]})*))`),Z(`FULLPLAIN`,`v?${Y[X.MAINVERSION]}${Y[X.PRERELEASE]}?${Y[X.BUILD]}?`),Z(`FULL`,`^${Y[X.FULLPLAIN]}$`),Z(`LOOSEPLAIN`,`[v=\\s]*${Y[X.MAINVERSIONLOOSE]}${Y[X.PRERELEASELOOSE]}?${Y[X.BUILD]}?`),Z(`LOOSE`,`^${Y[X.LOOSEPLAIN]}$`),Z(`GTLT`,`((?:<|>)?=?)`),Z(`XRANGEIDENTIFIERLOOSE`,`${Y[X.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),Z(`XRANGEIDENTIFIER`,`${Y[X.NUMERICIDENTIFIER]}|x|X|\\*`),Z(`XRANGEPLAIN`,`[v=\\s]*(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:${Y[X.PRERELEASE]})?${Y[X.BUILD]}?)?)?`),Z(`XRANGEPLAINLOOSE`,`[v=\\s]*(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:${Y[X.PRERELEASELOOSE]})?${Y[X.BUILD]}?)?)?`),Z(`XRANGE`,`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAIN]}$`),Z(`XRANGELOOSE`,`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAINLOOSE]}$`),Z(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?`),Z(`COERCE`,`${Y[X.COERCEPLAIN]}(?:$|[^\\d])`),Z(`COERCEFULL`,`${Y[X.COERCEPLAIN]}(?:${Y[X.PRERELEASE]})?(?:${Y[X.BUILD]})?(?:$|[^\\d])`),Z(`COERCERTL`,Y[X.COERCE],!0),Z(`COERCERTLFULL`,Y[X.COERCEFULL],!0),Z(`LONETILDE`,`(?:~>?)`),Z(`TILDETRIM`,`(\\s*)${Y[X.LONETILDE]}\\s+`,!0),Z(`TILDE`,`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAIN]}$`),Z(`TILDELOOSE`,`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAINLOOSE]}$`),Z(`LONECARET`,`(?:\\^)`),Z(`CARETTRIM`,`(\\s*)${Y[X.LONECARET]}\\s+`,!0),Z(`CARET`,`^${Y[X.LONECARET]}${Y[X.XRANGEPLAIN]}$`),Z(`CARETLOOSE`,`^${Y[X.LONECARET]}${Y[X.XRANGEPLAINLOOSE]}$`),Z(`COMPARATORLOOSE`,`^${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]})$|^$`),Z(`COMPARATOR`,`^${Y[X.GTLT]}\\s*(${Y[X.FULLPLAIN]})$|^$`),Z(`COMPARATORTRIM`,`(\\s*)${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]}|${Y[X.XRANGEPLAIN]})`,!0),Z(`HYPHENRANGE`,`^\\s*(${Y[X.XRANGEPLAIN]})\\s+-\\s+(${Y[X.XRANGEPLAIN]})\\s*$`),Z(`HYPHENRANGELOOSE`,`^\\s*(${Y[X.XRANGEPLAINLOOSE]})\\s+-\\s+(${Y[X.XRANGEPLAINLOOSE]})\\s*$`),Z(`STAR`,`(<|>)?=?\\s*\\*`),Z(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),Z(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`);const jv=Object.freeze({loose:!0}),Mv=Object.freeze({});function Nv(e){return e?typeof e==`object`?e:jv:Mv}const Pv=/^\d+$/;var Fv=class e{raw=``;loose=!1;options={};includePrerelease=!1;major=0;minor=0;patch=0;version=``;build=[];prerelease=[];constructor(t,n){let r=Nv(n),i;if(t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;i=t.version}else if(typeof t==`string`)i=t;else throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(i.length>256)throw TypeError(`version is longer than 256 characters`);J(`SemVer`,i,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let a=i.trim().match(r.loose?Tv[X.LOOSE]:Tv[X.FULL]);if(!a)throw TypeError(`Invalid Version: ${i}`);if(this.raw=i,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>xv||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>xv||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>xv||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=a[4]?a[4].split(`.`).map(e=>{if(Pv.test(e)){let t=+e;if(t>=0&&t<xv)return t}return e}):[],this.build=a[5]?a[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}inspect(){return`<SemVer "${this.version}">`}asSemVer(t){return t instanceof e?t:new e(t,this.options)}compare(t){J(`SemVer.compare`,this.version,this.options,t);let n;if(t instanceof e)n=t;else{if(typeof t==`string`&&t===this.version)return 0;n=this.asSemVer(t)}return n.version===this.version?0:this.compareMain(n)||this.comparePre(n)}compareMain(e){let t=this.asSemVer(e);return this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(e){let t=this.asSemVer(e);if(this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let e=this.prerelease[n],r=t.prerelease[n];if(J(`prerelease compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e!==r)return Cv(e,r)}while(++n);return 0}compareBuild(e){let t=this.asSemVer(e),n=0;do{let e=this.build[n],r=t.build[n];if(J(`build compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e!==r)return Cv(e,r)}while(++n);return 0}inc(e,t,n){let r=e,i=t;if(r.startsWith(`pre`)){if(!i&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(i){let e=`-${i}`.match(this.options.loose?Tv[X.PRERELEASELOOSE]:Tv[X.PRERELEASE]);if(!e||e[1]!==i)throw Error(`invalid identifier: ${i}`)}}switch(r){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,i,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,i,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,i,n),this.inc(`pre`,i,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,i,n),this.inc(`pre`,i,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let t=this.prerelease.length;for(;--t>=0;)typeof this.prerelease[t]==`number`&&(this.prerelease[t]=this.prerelease[t]+1,t=-2);if(t===-1){if(i===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(i){let t=[i,e];n===!1&&(t=[i]),Cv(this.prerelease[0],i)===0?Number.isNaN(Number(this.prerelease[1]))&&(this.prerelease=t):this.prerelease=t}break}default:throw Error(`invalid increment argument: ${r}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}};function Iv(e,t,n){return new Fv(e,n).compare(new Fv(t,n))}function Lv(e,t,n){return Iv(e,t,n)===0}function Rv(e,t,n){return Iv(e,t,n)>0}function zv(e,t,n){return Iv(e,t,n)>=0}function Bv(e,t,n){return Iv(e,t,n)<0}function Vv(e,t,n){return Iv(e,t,n)<=0}function Hv(e,t,n){return Iv(e,t,n)!==0}function Uv(e,t,n,r){let i=e=>e instanceof Fv?e.version:e;switch(t){case`===`:return e=i(e),n=i(n),e===n;case`!==`:return e=i(e),n=i(n),e!==n;case``:case`=`:case`==`:return Lv(e,n,r);case`!=`:return Hv(e,n,r);case`>`:return Rv(e,n,r);case`>=`:return zv(e,n,r);case`<`:return Bv(e,n,r);case`<=`:return Vv(e,n,r);default:throw TypeError(`Invalid operator: ${t}`)}}var Wv=class{max;map;constructor(){this.max=1e3,this.map=/* @__PURE__ */ new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;e!==void 0&&this.delete(e)}this.map.set(e,t)}return this}};const Gv=Symbol(`SemVer ANY`),Kv=/\s+/;var qv=class e{options={};loose=!1;operator=``;semver=Gv;value=``;static get ANY(){return Gv}constructor(t,n){let r=Nv(n);if(t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}let i=String(t).trim().split(Kv).join(` `);J(`comparator`,i,r),this.options=r,this.loose=!!r.loose,this.parse(i),this.value=this.semver===Gv?``:this.operator+this.semver.version,J(`comp`,this)}parse(e){let t=this.options.loose?Tv[X.COMPARATORLOOSE]:Tv[X.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);this.operator=n[1]===void 0?``:n[1],this.operator===`=`&&(this.operator=``),this.semver=n[2]?new Fv(n[2],this.options.loose):Gv}toString(){return this.value}test(e){if(J(`Comparator.test`,e,this.options.loose),this.semver===Gv||e===Gv)return!0;if(typeof e==`string`)try{e=new Fv(e,this.options)}catch{return!1}return Uv(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);if(this.operator===``)return this.value===``||new ey(t.value,n).test(this.value);if(t.operator===``)return t.value===``||new ey(this.value,n).test(t.semver);let r=Nv(n);return r.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!r.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver!==Gv&&t.semver!==Gv&&this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||Uv(this.semver,`<`,t.semver,r)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||Uv(this.semver,`>`,t.semver,r)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`))}};const Jv=/\s+/g,Yv=/\s+/,Xv=new Wv,Zv=e=>e.value===`<0.0.0-0`,Qv=e=>e.value===``,$v=e=>e!==qv.ANY;var ey=class e{raw=``;loose=!1;options={};includePrerelease=!1;set=[];formatted;constructor(t,n){let r=Nv(n);if(t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof qv)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=(typeof t==`string`?t:String(t)).trim().replace(Jv,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length>0),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!Zv(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&Qv(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}inspect(){return`<SemVer Range "${this.range}">`}parseRange(e){let t=`${+!!this.options.includePrerelease|(this.options.loose?2:0)}:${e}`,n=Xv.get(t);if(n)return n;let r=this.options.loose,i=r?Tv[X.HYPHENRANGELOOSE]:Tv[X.HYPHENRANGE];e=e.replace(i,fy(!!this.options.includePrerelease)),J(`hyphen replace`,e),e=e.replace(Tv[X.COMPARATORTRIM],`$1$2$3`),J(`comparator trim`,e),e=e.replace(Tv[X.TILDETRIM],`$1~`),J(`tilde trim`,e),e=e.replace(Tv[X.CARETTRIM],`$1^`),J(`caret trim`,e);let a=e.split(` `).map(e=>ny(e,this.options)).join(` `).split(Yv).map(e=>dy(e,this.options));r&&(a=a.filter(e=>(J(`loose invalid filter`,e,this.options),!!e.match(Tv[X.COMPARATORLOOSE])))),J(`range list`,a);let o=/* @__PURE__ */ new Map,s=a.map(e=>new qv(e,this.options));for(let e of s){if(Zv(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let c=[...o.values()];return Xv.set(t,c),c}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>ty(e,n)&&t.set.some(t=>ty(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;let t;if(typeof e==`string`)try{t=new Fv(e,this.options)}catch{return!1}else if(e instanceof Fv)t=e;else return!1;for(let e=0;e<this.set.length;e++)if(py(this.set[e],t,this.options))return!0;return!1}};function ty(e,t){let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;){let e=i;if(!e)break;n=r.every(n=>e.intersects(n,t)),i=r.pop()}return n}function ny(e,t){return e=e.replace(Tv[X.BUILD],``),J(`comp`,e,t),e=oy(e,t),J(`caret`,e),e=iy(e,t),J(`tildes`,e),e=cy(e,t),J(`xrange`,e),e=uy(e,t),J(`stars`,e),e}function ry(e){return!e||e.toLowerCase()===`x`||e===`*`}function iy(e,t){return e.trim().split(Yv).map(e=>ay(e,t)).join(` `)}function ay(e,t){let n=t.loose?Tv[X.TILDELOOSE]:Tv[X.TILDE];return e.replace(n,(t,n,r,i,a)=>{J(`tilde`,e,t,n,r,i,a);let o,s=String(n),c=String(r),l=String(i);return ry(n)?o=``:ry(r)?o=`>=${s}.0.0 <${Number(s)+1}.0.0-0`:ry(i)?o=`>=${s}.${c}.0 <${s}.${Number(c)+1}.0-0`:a?(J(`replaceTilde pr`,a),o=`>=${s}.${c}.${l}-${a} <${s}.${Number(c)+1}.0-0`):o=`>=${s}.${c}.${l} <${s}.${Number(c)+1}.0-0`,J(`tilde return`,o),o})}function oy(e,t){return e.trim().split(Yv).map(e=>sy(e,t)).join(` `)}function sy(e,t){J(`caret`,e,t);let n=t.loose?Tv[X.CARETLOOSE]:Tv[X.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{J(`caret`,e,t,n,i,a,o);let s,c=String(n),l=String(i),u=String(a);return ry(n)?s=``:ry(i)?s=`>=${c}.0.0${r} <${Number(c)+1}.0.0-0`:ry(a)?s=c===`0`?`>=${c}.${l}.0${r} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.0${r} <${Number(c)+1}.0.0-0`:o?(J(`replaceCaret pr`,o),s=c===`0`?l===`0`?`>=${c}.${l}.${u}-${o} <${c}.${l}.${Number(u)+1}-0`:`>=${c}.${l}.${u}-${o} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.${u}-${o} <${Number(c)+1}.0.0-0`):(J(`no pr`),s=c===`0`?l===`0`?`>=${c}.${l}.${u}${r} <${c}.${l}.${Number(u)+1}-0`:`>=${c}.${l}.${u}${r} <${c}.${Number(l)+1}.0-0`:`>=${c}.${l}.${u} <${Number(c)+1}.0.0-0`),J(`caret return`,s),s})}function cy(e,t){return J(`replaceXRanges`,e,t),e.split(Yv).map(e=>ly(e,t)).join(` `)}function ly(e,t){e=e.trim();let n=t.loose?Tv[X.XRANGELOOSE]:Tv[X.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{J(`xRange`,e,n,r,i,a,o,s);let c=ry(i),l=c||ry(a),u=l||ry(o),d=u,f=r,p=String(i),m=String(a),h=String(o),g=s??``;return f===`=`&&d&&(f=``),g=t.includePrerelease?`-0`:``,c?n=f===`>`||f===`<`?`<0.0.0-0`:`*`:f&&d?(l&&(m=0),h=0,f===`>`?(f=`>=`,l?(p=Number(p)+1,m=0,h=0):(m=Number(m)+1,h=0)):f===`<=`&&(f=`<`,l?p=Number(p)+1:m=Number(m)+1),f===`<`&&(g=`-0`),n=`${f+p}.${m}.${h}${g}`):l?n=`>=${p}.0.0${g} <${Number(p)+1}.0.0-0`:u&&(n=`>=${p}.${m}.0${g} <${p}.${Number(m)+1}.0-0`),J(`xRange return`,n),n})}function uy(e,t){return J(`replaceStars`,e,t),e.trim().replace(Tv[X.STAR],``)}function dy(e,t){return J(`replaceGTE0`,e,t),e.trim().replace(Tv[t.includePrerelease?X.GTE0PRE:X.GTE0],``)}function fy(e){return(t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n??``,m=c??``;return p=ry(r)?``:ry(i)?`>=${String(r)}.0.0${e?`-0`:``}`:ry(a)?`>=${String(r)}.${String(i)}.0${e?`-0`:``}`:o?`>=${p}`:`>=${p}${e?`-0`:``}`,m=ry(l)?``:ry(u)?`<${Number(l)+1}.0.0-0`:ry(d)?`<${String(l)}.${Number(u)+1}.0-0`:f?`<=${String(l)}.${String(u)}.${String(d)}-${f}`:e?`<${String(l)}.${String(u)}.${Number(d)+1}-0`:`<=${m}`,`${p} ${m}`.trim()}}function py(e,t,n){for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++){let r=e[n];if(J(r.semver),!$v(r.semver))continue;let i=r.semver;if(i.prerelease.length>0&&i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function my(e,t,n){try{return new ey(t,n).test(e)}catch{return!1}}function hy(e,t){let n=new ey(e,t),r=new Fv(`0.0.0`);if(n.test(r)||(r=new Fv(`0.0.0-0`),n.test(r)))return r;r=null;for(let e=0;e<n.set.length;++e){let t=n.set[e],i=null;t.forEach(e=>{let t=new Fv(e.semver instanceof Fv?e.semver.version:`0.0.0`);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!i||Rv(t,i))&&(i=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),i&&(!r||Rv(r,i))&&(r=i)}return r&&n.test(r)?r:null}function gy(e,t){try{return new ey(e,t).range||`*`}catch{return null}}var Q=/* @__PURE__ */ n((e=>{let t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),c=e=>!!e&&typeof e==`object`&&e[s]===t,l=e=>!!e&&typeof e==`object`&&e[s]===n,u=e=>!!e&&typeof e==`object`&&e[s]===r,d=e=>!!e&&typeof e==`object`&&e[s]===i,f=e=>!!e&&typeof e==`object`&&e[s]===a,p=e=>!!e&&typeof e==`object`&&e[s]===o;function m(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}function h(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1}e.ALIAS=t,e.DOC=n,e.MAP=r,e.NODE_TYPE=s,e.PAIR=i,e.SCALAR=a,e.SEQ=o,e.hasAnchor=e=>(f(e)||m(e))&&!!e.anchor,e.isAlias=c,e.isCollection=m,e.isDocument=l,e.isMap=u,e.isNode=h,e.isPair=d,e.isScalar=f,e.isSeq=p})),_y=/* @__PURE__ */ n((e=>{var t=Q();let n=Symbol(`break visit`),r=Symbol(`skip children`),i=Symbol(`remove node`);function a(e,n){let r=l(n);t.isDocument(e)?o(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):o(null,e,r,Object.freeze([]))}a.BREAK=n,a.SKIP=r,a.REMOVE=i;function o(e,r,a,s){let c=u(e,r,a,s);if(t.isNode(c)||t.isPair(c))return d(e,s,c),o(e,c,a,s);if(typeof c!=`symbol`){if(t.isCollection(r)){s=Object.freeze(s.concat(r));for(let e=0;e<r.items.length;++e){let t=o(e,r.items[e],a,s);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){s=Object.freeze(s.concat(r));let e=o(`key`,r.key,a,s);if(e===n)return n;e===i&&(r.key=null);let t=o(`value`,r.value,a,s);if(t===n)return n;t===i&&(r.value=null)}}return c}async function s(e,n){let r=l(n);t.isDocument(e)?await c(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):await c(null,e,r,Object.freeze([]))}s.BREAK=n,s.SKIP=r,s.REMOVE=i;async function c(e,r,a,o){let s=await u(e,r,a,o);if(t.isNode(s)||t.isPair(s))return d(e,o,s),c(e,s,a,o);if(typeof s!=`symbol`){if(t.isCollection(r)){o=Object.freeze(o.concat(r));for(let e=0;e<r.items.length;++e){let t=await c(e,r.items[e],a,o);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){o=Object.freeze(o.concat(r));let e=await c(`key`,r.key,a,o);if(e===n)return n;e===i&&(r.key=null);let t=await c(`value`,r.value,a,o);if(t===n)return n;t===i&&(r.value=null)}}return s}function l(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function u(e,n,r,i){if(typeof r==`function`)return r(e,n,i);if(t.isMap(n))return r.Map?.(e,n,i);if(t.isSeq(n))return r.Seq?.(e,n,i);if(t.isPair(n))return r.Pair?.(e,n,i);if(t.isScalar(n))return r.Scalar?.(e,n,i);if(t.isAlias(n))return r.Alias?.(e,n,i)}function d(e,n,r){let i=n[n.length-1];if(t.isCollection(i))i.items[e]=r;else if(t.isPair(i))e===`key`?i.key=r:i.value=r;else if(t.isDocument(i))i.contents=r;else{let e=t.isAlias(i)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}e.visit=a,e.visitAsync=s})),vy=/* @__PURE__ */ n((e=>{var t=Q(),n=_y();let r={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},i=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);var a=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+i(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],i=Object.entries(this.tags),a;if(e&&i.length>0&&t.isNode(e.contents)){let r={};n.visit(e.contents,(e,n)=>{t.isNode(n)&&n.tag&&(r[n.tag]=!0)}),a=Object.keys(r)}else a=[];for(let[t,n]of i)t===`!!`&&n===`tag:yaml.org,2002:`||e&&!a.some(e=>e.startsWith(n))||r.push(`%TAG ${t} ${n}`);return r.join(`
185
183
  `)}};a.defaultYaml={explicit:!1,version:`1.2`},a.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=a})),yy=/* @__PURE__ */ n((e=>{var t=Q(),n=_y();function r(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function i(e){let t=/* @__PURE__ */ new Set;return n.visit(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function a(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function o(e,n){let r=[],o=/* @__PURE__ */ new Map,s=null;return{onAnchor:t=>{r.push(t),s??=i(e);let o=a(n,s);return s.add(o),o},setAnchors:()=>{for(let e of r){let n=o.get(e);if(typeof n==`object`&&n.anchor&&(t.isScalar(n.node)||t.isCollection(n.node)))n.node.anchor=n.anchor;else{let t=/* @__PURE__ */ Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:o}}e.anchorIsValid=r,e.anchorNames=i,e.createNodeAnchors=o,e.findNewAnchor=a})),by=/* @__PURE__ */ n((e=>{function t(e,n,r,i){if(i&&typeof i==`object`){if(Array.isArray(i))for(let n=0,r=i.length;n<r;++n){let r=i[n],a=t(e,i,String(n),r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let r=i.get(n),a=t(e,i,n,r);a===void 0?i.delete(n):a!==r&&i.set(n,a)}else if(i instanceof Set)for(let n of Array.from(i)){let r=t(e,i,n,n);r===void 0?i.delete(n):r!==n&&(i.delete(n),i.add(r))}else for(let[n,r]of Object.entries(i)){let a=t(e,i,n,r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}}return e.call(n,r,i)}e.applyReviver=t})),xy=/* @__PURE__ */ n((e=>{var t=Q();function n(e,r,i){if(Array.isArray(e))return e.map((e,t)=>n(e,String(t),i));if(e&&typeof e.toJSON==`function`){if(!i||!t.hasAnchor(e))return e.toJSON(r,i);let n={aliasCount:0,count:1,res:void 0};i.anchors.set(e,n),i.onCreate=e=>{n.res=e,delete i.onCreate};let a=e.toJSON(r,i);return i.onCreate&&i.onCreate(a),a}return typeof e==`bigint`&&!i?.keep?Number(e):e}e.toJS=n})),Sy=/* @__PURE__ */ n((e=>{var t=by(),n=Q(),r=xy();e.NodeBase=class{constructor(e){Object.defineProperty(this,n.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:i,maxAliasCount:a,onAnchor:o,reviver:s}={}){if(!n.isDocument(e))throw TypeError(`A document argument is required`);let c={anchors:/* @__PURE__ */ new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof a==`number`?a:100},l=r.toJS(this,``,c);if(typeof o==`function`)for(let{count:e,res:t}of c.anchors.values())o(t,e);return typeof s==`function`?t.applyReviver(s,{"":l},``,l):l}}})),Cy=/* @__PURE__ */ n((e=>{var t=yy(),n=_y(),r=Q(),i=Sy(),a=xy(),o=class extends i.NodeBase{constructor(e){super(r.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],n.visit(e,{Node:(e,t)=>{(r.isAlias(t)||r.hasAnchor(t))&&i.push(t)}}),t&&(t.aliasResolveCache=i));let o;for(let e of i){if(e===this)break;e.anchor===this.source&&(o=e)}if(o&&t){let{anchors:e,doc:n,maxAliasCount:r}=t,i=e.get(o);
186
184
  /* istanbul ignore if */
187
185
  if(i||=(a.toJS(o,null,t),e.get(o)),i?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(r>=0&&(i.count+=1,i.aliasCount===0&&(i.aliasCount=s(n,o,e)),i.count*i.aliasCount>r))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return o}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,n,r){let i=`*${this.source}`;if(e){if(t.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${i} `}return i}};function s(e,t,n){if(r.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(r.isCollection(t)){let r=0;for(let i of t.items){let t=s(e,i,n);t>r&&(r=t)}return r}if(r.isPair(t)){let r=s(e,t.key,n),i=s(e,t.value,n);return Math.max(r,i)}return 1}e.Alias=o})),wy=/* @__PURE__ */ n((e=>{var t=Q(),n=Sy(),r=xy();let i=e=>!e||typeof e!=`function`&&typeof e!=`object`;var a=class extends n.NodeBase{constructor(e){super(t.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:r.toJS(this.value,e,t)}toString(){return String(this.value)}};a.BLOCK_FOLDED=`BLOCK_FOLDED`,a.BLOCK_LITERAL=`BLOCK_LITERAL`,a.PLAIN=`PLAIN`,a.QUOTE_DOUBLE=`QUOTE_DOUBLE`,a.QUOTE_SINGLE=`QUOTE_SINGLE`,e.Scalar=a,e.isScalarValue=i})),Ty=/* @__PURE__ */ n((e=>{var t=Cy(),n=Q(),r=wy();function i(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function a(e,a,o){if(n.isDocument(e)&&(e=e.contents),n.isNode(e))return e;if(n.isPair(e)){let t=o.schema[n.MAP].createNode?.(o.schema,null,o);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:s,onAnchor:c,onTagObj:l,schema:u,sourceObjects:d}=o,f;if(s&&e&&typeof e==`object`){if(f=d.get(e),f)return f.anchor??(f.anchor=c(e)),new t.Alias(f.anchor);f={anchor:null,node:null},d.set(e,f)}a?.startsWith(`!!`)&&(a=`tag:yaml.org,2002:`+a.slice(2));let p=i(e,a,u.tags);if(!p){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new r.Scalar(e);return f&&(f.node=t),t}p=e instanceof Map?u[n.MAP]:Symbol.iterator in Object(e)?u[n.SEQ]:u[n.MAP]}l&&(l(p),delete o.onTagObj);let m=p?.createNode?p.createNode(o.schema,e,o):typeof p?.nodeClass?.from==`function`?p.nodeClass.from(o.schema,e,o):new r.Scalar(e);return a?m.tag=a:p.default||(m.tag=p.tag),f&&(f.node=m),m}e.createNode=a})),Ey=/* @__PURE__ */ n((e=>{var t=Ty(),n=Q(),r=Sy();function i(e,n,r){let i=r;for(let e=n.length-1;e>=0;--e){let t=n[e];if(typeof t==`number`&&Number.isInteger(t)&&t>=0){let e=[];e[t]=i,i=e}else i=/* @__PURE__ */ new Map([[t,i]])}return t.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:/* @__PURE__ */ new Map})}let a=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done;e.Collection=class extends r.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>n.isNode(t)||n.isPair(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(a(e))this.add(t);else{let[r,...a]=e,o=this.get(r,!0);if(n.isCollection(o))o.addIn(a,t);else if(o===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let i=this.get(t,!0);if(n.isCollection(i))return i.deleteIn(r);throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...i]=e,a=this.get(r,!0);return i.length===0?!t&&n.isScalar(a)?a.value:a:n.isCollection(a)?a.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!n.isPair(t))return!1;let r=t.value;return r==null||e&&n.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let i=this.get(t,!0);return n.isCollection(i)?i.hasIn(r):!1}setIn(e,t){let[r,...a]=e;if(a.length===0)this.set(r,t);else{let e=this.get(r,!0);if(n.isCollection(e))e.setIn(a,t);else if(e===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}},e.collectionFromPath=i,e.isEmptyPath=a})),Dy=/* @__PURE__ */ n((e=>{let t=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function n(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}e.indentComment=n,e.lineComment=(e,t,r)=>e.endsWith(`
@@ -224,7 +222,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
224
222
  `)?(a.push(`...`),a.push(r.indentComment(t,``))):a.push(`... ${t}`)}else a.push(`...`)}else{let t=e.comment;t&&l&&(t=t.replace(/^\n+/,``)),t&&((!l||u)&&a[a.length-1]!==``&&a.push(``),a.push(r.indentComment(c(t),``)))}return a.join(`
225
223
  `)+`
226
224
  `}e.stringifyDocument=i})),sb=/* @__PURE__ */ n((e=>{var t=Cy(),n=Ey(),r=Q(),i=Fy(),a=xy(),o=ab(),s=ob(),c=yy(),l=by(),u=Ty(),d=vy(),f=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,r.NODE_TYPE,{value:r.DOC});let i=null;typeof t==`function`||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=a;let{version:o}=a;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new d.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let t=Object.create(e.prototype,{[r.NODE_TYPE]:{value:r.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=r.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){p(this.contents)&&this.contents.add(e)}addIn(e,t){p(this.contents)&&this.contents.addIn(e,t)}createAlias(e,n){if(!e.anchor){let t=c.anchorNames(this);e.anchor=!n||t.has(n)?c.findNewAnchor(n||`a`,t):n}return new t.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t==`function`)e=t.call({"":e},``,e),i=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:l,onTagObj:d,tag:f}=n??{},{onAnchor:p,setAnchors:m,sourceObjects:h}=c.createNodeAnchors(this,o||`a`),g={aliasDuplicateObjects:a??!0,keepUndefined:l??!1,onAnchor:p,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:h},_=u.createNode(e,f,g);return s&&r.isCollection(_)&&(_.flow=!0),m(),_}createPair(e,t,n={}){let r=this.createNode(e,null,n),a=this.createNode(t,null,n);return new i.Pair(r,a)}delete(e){return p(this.contents)?this.contents.delete(e):!1}deleteIn(e){return n.isEmptyPath(e)?this.contents!=null&&(this.contents=null,!0):p(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return r.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return n.isEmptyPath(e)?!t&&r.isScalar(this.contents)?this.contents.value:this.contents:r.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return r.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return n.isEmptyPath(e)?this.contents!==void 0:r.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=n.collectionFromPath(this.schema,[e],t):p(this.contents)&&this.contents.set(e,t)}setIn(e,t){n.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=n.collectionFromPath(this.schema,Array.from(e),t):p(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new d.Directives({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new d.Directives({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new o.Schema(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){let s={anchors:/* @__PURE__ */ new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},c=a.toJS(this.contents,t??``,s);if(typeof i==`function`)for(let{count:e,res:t}of s.anchors.values())i(t,e);return typeof o==`function`?l.applyReviver(o,{"":c},``,c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return s.stringifyDocument(this,e)}};function p(e){if(r.isCollection(e))return!0;throw Error(`Expected a YAML collection as document contents`)}e.Document=f})),cb=/* @__PURE__ */ n((e=>{var t=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},n=class extends t{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},r=class extends t{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}};e.YAMLError=t,e.YAMLParseError=n,e.YAMLWarning=r,e.prettifyError=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
227
- `),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}}})),lb=/* @__PURE__ */ n((e=>{function t(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}e.resolveProps=t})),ub=/* @__PURE__ */ n((e=>{function t(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
225
+ `),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}}})),lb=/* @__PURE__ */ n((e=>{function t(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:b&&n===`seq-item-ind`||(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}e.resolveProps=t})),ub=/* @__PURE__ */ n((e=>{function t(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
228
226
  `))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let n of e.items){for(let e of n.start)if(e.type===`newline`)return!0;if(n.sep){for(let e of n.sep)if(e.type===`newline`)return!0}if(t(n.key)||t(n.value))return!0}return!1;default:return!0}}e.containsNewline=t})),db=/* @__PURE__ */ n((e=>{var t=ub();function n(e,n,r){if(n?.type===`flow-collection`){let i=n.end[0];i.indent===e&&(i.source===`]`||i.source===`}`)&&t.containsNewline(n)&&r(i,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}e.flowIndentCheck=n})),fb=/* @__PURE__ */ n((e=>{var t=Q();function n(e,n,r){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let a=typeof i==`function`?i:(e,n)=>e===n||t.isScalar(e)&&t.isScalar(n)&&e.value===n.value;return n.some(e=>a(e.key,r))}e.mapIncludes=n})),pb=/* @__PURE__ */ n((e=>{var t=Fy(),n=Ly(),r=lb(),i=ub(),a=db(),o=fb();let s=`All mapping items must start at the same column`;function c({composeNode:e,composeEmptyNode:c},l,u,d,f){let p=new((f?.nodeClass)??n.YAMLMap)(l.schema);l.atRoot&&=!1;let m=u.offset,h=null;for(let n of u.items){let{start:f,key:g,sep:_,value:v}=n,y=r.resolveProps(f,{indicator:`explicit-key-ind`,next:g??_?.[0],offset:m,onError:d,parentIndent:u.indent,startOnNewline:!0}),b=!y.found;if(b){if(g&&(g.type===`block-seq`?d(m,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in g&&g.indent!==u.indent&&d(m,`BAD_INDENT`,s)),!y.anchor&&!y.tag&&!_){h=y.end,y.comment&&(p.comment?p.comment+=`
229
227
  `+y.comment:p.comment=y.comment);continue}(y.newlineAfterProp||i.containsNewline(g))&&d(g??f[f.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else y.found?.indent!==u.indent&&d(m,`BAD_INDENT`,s);l.atKey=!0;let x=y.end,S=g?e(l,g,y,d):c(l,x,f,null,y,d);l.schema.compat&&a.flowIndentCheck(u.indent,g,d),l.atKey=!1,o.mapIncludes(l,p.items,S)&&d(x,`DUPLICATE_KEY`,`Map keys must be unique`);let C=r.resolveProps(_??[],{indicator:`map-value-ind`,next:v,offset:S.range[2],onError:d,parentIndent:u.indent,startOnNewline:!g||g.type===`block-scalar`});if(m=C.end,C.found){b&&(v?.type===`block-map`&&!C.hasNewline&&d(m,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),l.options.strict&&y.start<C.found.offset-1024&&d(S.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let r=v?e(l,v,C,d):c(l,m,_,null,C,d);l.schema.compat&&a.flowIndentCheck(u.indent,v,d),m=r.range[2];let i=new t.Pair(S,r);l.options.keepSourceTokens&&(i.srcToken=n),p.items.push(i)}else{b&&d(S.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),C.comment&&(S.comment?S.comment+=`
230
228
  `+C.comment:S.comment=C.comment);let e=new t.Pair(S);l.options.keepSourceTokens&&(e.srcToken=n),p.items.push(e)}}return h&&h<m&&d(h,`IMPOSSIBLE`,`Map comment with trailing content`),p.range=[u.offset,m,h??m],p}e.resolveBlockMap=c})),mb=/* @__PURE__ */ n((e=>{var t=zy(),n=lb(),r=db();function i({composeNode:e,composeEmptyNode:i},a,o,s,c){let l=new((c?.nodeClass)??t.YAMLSeq)(a.schema);a.atRoot&&=!1,a.atKey&&=!1;let u=o.offset,d=null;for(let{start:t,value:c}of o.items){let f=n.resolveProps(t,{indicator:`seq-item-ind`,next:c,offset:u,onError:s,parentIndent:o.indent,startOnNewline:!0});if(!f.found){if(f.anchor||f.tag||c)c?.type===`block-seq`?s(f.end,`BAD_INDENT`,`All sequence items must start at the same column`):s(u,`MISSING_CHAR`,`Sequence item without - indicator`);else{d=f.end,f.comment&&(l.comment=f.comment);continue}}let p=c?e(a,c,f,s):i(a,f.end,t,null,f,s);a.schema.compat&&r.flowIndentCheck(o.indent,c,s),u=p.range[2],l.items.push(p)}return l.range=[o.offset,u,d??u],l}e.resolveBlockSeq=i})),hb=/* @__PURE__ */ n((e=>{function t(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}e.resolveEnd=t})),gb=/* @__PURE__ */ n((e=>{var t=Q(),n=Fy(),r=Ly(),i=zy(),a=hb(),o=lb(),s=ub(),c=fb();let l=`Block collections are not allowed within flow collections`,u=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function d({composeNode:e,composeEmptyNode:d},f,p,m,h){let g=p.start.source===`{`,_=g?`flow map`:`flow sequence`,v=new((h?.nodeClass)??(g?r.YAMLMap:i.YAMLSeq))(f.schema);v.flow=!0;let y=f.atRoot;y&&(f.atRoot=!1),f.atKey&&=!1;let b=p.offset+p.start.source.length;for(let i=0;i<p.items.length;++i){let a=p.items[i],{start:h,key:y,sep:x,value:S}=a,C=o.resolveProps(h,{flow:_,indicator:`explicit-key-ind`,next:y??x?.[0],offset:b,onError:m,parentIndent:p.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!x&&!S){i===0&&C.comma?m(C.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${_}`):i<p.items.length-1&&m(C.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${_}`),C.comment&&(v.comment?v.comment+=`
@@ -319,11 +317,12 @@ default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.l
319
317
  /* istanbul ignore else should not happen */
320
318
  n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=l(c(t));d(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
321
319
  `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
322
- `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=l(c(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=l(c(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}}})),Mb=/* @__PURE__ */ n((e=>{var t=wb(),n=sb(),r=cb(),i=My(),a=Q(),o=Ab(),s=jb();function c(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new o.LineCounter||null,prettyErrors:t}}function l(e,n={}){let{lineCounter:i,prettyErrors:a}=c(n),o=new s.Parser(i?.addNewLine),l=new t.Composer(n),u=Array.from(l.compose(o.parse(e)));if(a&&i)for(let t of u)t.errors.forEach(r.prettifyError(e,i)),t.warnings.forEach(r.prettifyError(e,i));return u.length>0?u:Object.assign([],{empty:!0},l.streamInfo())}function u(e,n={}){let{lineCounter:i,prettyErrors:a}=c(n),o=new s.Parser(i?.addNewLine),l=new t.Composer(n),u=null;for(let t of l.compose(o.parse(e),!0,e.length))if(!u)u=t;else if(u.options.logLevel!==`silent`){u.errors.push(new r.YAMLParseError(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return a&&i&&(u.errors.forEach(r.prettifyError(e,i)),u.warnings.forEach(r.prettifyError(e,i))),u}function d(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let a=u(e,n);if(!a)return null;if(a.warnings.forEach(e=>i.warn(a.options.logLevel,e)),a.errors.length>0){if(a.options.logLevel!==`silent`)throw a.errors[0];a.errors=[]}return a.toJS(Object.assign({reviver:r},n))}function f(e,t,r){let i=null;if(typeof t==`function`||Array.isArray(t)?i=t:r===void 0&&t&&(r=t),typeof r==`string`&&(r=r.length),typeof r==`number`){let e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=r??t??{};if(!e)return}return a.isDocument(e)&&!i?e.toString(r):new n.Document(e,i,r).toString(r)}e.parse=d,e.parseAllDocuments=l,e.parseDocument=u,e.stringify=f})),Nb=(/* @__PURE__ */ n((e=>{var t=wb(),n=sb(),r=ab(),i=cb(),a=Cy(),o=Q(),s=Fy(),c=wy(),l=Ly(),u=zy();Ob();var d=kb(),f=Ab(),p=jb(),m=Mb(),h=_y();e.Composer=t.Composer,e.Document=n.Document,e.Schema=r.Schema,e.YAMLError=i.YAMLError,e.YAMLParseError=i.YAMLParseError,e.YAMLWarning=i.YAMLWarning,e.Alias=a.Alias,e.isAlias=o.isAlias,e.isCollection=o.isCollection,e.isDocument=o.isDocument,e.isMap=o.isMap,e.isNode=o.isNode,e.isPair=o.isPair,e.isScalar=o.isScalar,e.isSeq=o.isSeq,e.Pair=s.Pair,e.Scalar=c.Scalar,e.YAMLMap=l.YAMLMap,e.YAMLSeq=u.YAMLSeq,e.Lexer=d.Lexer,e.LineCounter=f.LineCounter,e.Parser=p.Parser,e.parse=m.parse,e.parseAllDocuments=m.parseAllDocuments,e.parseDocument=m.parseDocument,e.stringify=m.stringify,e.visit=h.visit,e.visitAsync=h.visitAsync})))();function Pb(e){let t=(0,Nb.parseDocument)(e),n=!1;function r(r){e=r,t=(0,Nb.parseDocument)(e),n=!1}function i(e,r){let i=e.length===1?t.contents:t.getIn(e.slice(0,-1));i||(i=t.createNode({}),t.setIn(e.slice(0,-1),i));let a=e[e.length-1],o=i.items.find(e=>typeof e.key==`string`?e.key===a:e.key.value===a),s=i.items.map(e=>typeof e.key==`string`?e.key:String(e.key.value));if(!o){let e=0;for(;e<s.length&&!(s[e].localeCompare(a)>0);e++);o=new Nb.Pair(a,r),i.items.splice(e,0,o),n=!0}else if((0,Nb.isAlias)(o.value)){let e=Fb(t,o.value);e&&e.value!==r&&(e.value=r,n=!0)}else!o.value||typeof o.value==`string`?o.value!==r&&(o.value=r,n=!0):o.value.value!==r&&(o.value.value=r,n=!0)}function a(e,n,r){let i=t.toJSON()||{},a=e==="default"?i.catalog?.[n]:i.catalogs?.[e]?.[n];if(a===r)return{conflicts:!1,newCatalogName:e,existingSpecifier:a};if(a){let t=Ib(r);return{conflicts:!0,existingSpecifier:a,newCatalogName:e==="default"?`conflicts_${n}_${t}`:`conflicts_${e}_${t}`}}return{conflicts:!1,newCatalogName:e}}function o(e,t,n){let{newCatalogName:r}=a(e,t,n);s(r,t,n)}function s(e,n,r){let a=t.toJSON()?.catalogs?.default!==void 0;i(e==="default"&&!a?[`catalog`,n]:[`catalogs`,e,n],r)}function c(e){let n=[],r=t.toJSON()||{};if(r.catalogs)for(let t of Object.keys(r.catalogs))r.catalogs[t]?.[e]&&n.push(t);return r.catalog&&r.catalog[e]&&n.push(`default`),n}return{getDocument(){return t},setContent:r,hasChanged:()=>n,toJSON:()=>t.toJSON(),toString:n=>{let r=e.split(`'`).length>=e.split(`"`).length;return t.toString({singleQuote:r,...n})},setPath:i,setPackage:s,setPackageNoConflicts:o,getPackageCatalogs:c,hasSpecifierConflicts:a}}function Fb(e,t){let n;return(0,Nb.visit)(e,{Scalar:(e,r,i)=>{r.anchor===t.source&&typeof r.value==`string`&&(n=r)}}),n}function Ib(e){return e.replace(/\^/g,`h`).replace(/~/g,`t`).replace(/\./g,`_`).replace(/</g,`l`).replace(/>/g,`g`).replace(/=/g,`e`).replace(/\*/g,`s`).replace(/@/g,`a`).replace(/\|/g,`p`).replace(/&/g,`n`).replace(/-/g,`m`).replace(/\+/g,`u`).replace(/\s/g,`_`)}function Lb(e){return e??=[],Array.isArray(e)?e:[e]}function Rb(e){return typeof e==`object`&&!!e&&`json`in e&&typeof e.json==`function`}function zb(e){if(Rb(e))return e.json();throw TypeError(`response does not implement json()`)}const Bb=3e4,Vb=`version-upgrade@npm node/${I.version}`,Hb=Object.assign((e,t)=>{let n=new Headers(t?.headers);return n.set(`user-agent`,Vb),cv(e,{...t,headers:n})},{preconnect:()=>{}});async function Ub(e,t,n,r){let i;for(let a=0;a<=r;a++)try{return await Promise.race([e(),new Promise((e,i)=>setTimeout(()=>i(/* @__PURE__ */ Error(`Timeout requesting "${t}" (attempt ${a+1}/${r+1})`)),n))])}catch(e){if(i=e instanceof Error?e:Error(String(e)),a<r){let e=Math.min(1e3*2**a,1e4);await new Promise(t=>setTimeout(t,e))}}throw i??Error(`Unexpected state: all retries exhausted for "${t}" but no error captured`)}async function Wb(e,t=!1,n,r=Bb,i=3){let a=await Ub(()=>Qg(e,{cwd:n,force:t,fetch:Hb,metadata:!0,throw:!1}),e,r,i);if(!qb(a))throw Error(`Invalid package metadata received for "${e}"`);let o=a;if(`error`in o)throw Error(`Failed to fetch package "${e}": ${o.error}`);return Kb(o)}async function Gb(e,t=Bb,n=3){let r=await Ub(()=>Hb(new URL(`${e}/meta.json`,`https://jsr.io/`),{headers:{accept:`application/json`}}).then(e=>zb(e)),e,t,n);if(!Jb(r))throw Error(`Invalid JSR package metadata received for "${e}"`);let i=r;return{versions:Object.keys(i.versions),tags:{latest:i.latest}}}function Kb(e){let t=Object.keys(e.versionsMeta),n=Object.fromEntries(Object.entries(e.versionsMeta).flatMap(([e,t])=>t.deprecated==null?[]:[[e,t.deprecated]])),r=Object.fromEntries(Object.entries(e.versionsMeta).map(([e,t])=>[e,t.engines?.node]).filter(([,e])=>e)),i=Object.fromEntries(Object.entries(e.versionsMeta).map(([e,t])=>[e,t.provenance]).filter(([,e])=>e)),a=Object.fromEntries(Object.entries(e.versionsMeta).map(([e,t])=>[e,t.integrity]).filter(([,e])=>e));return{tags:e.distTags,versions:t,time:{...Object.fromEntries(Object.entries(e.versionsMeta).filter(([,e])=>e.time).map(([e,t])=>[e,t.time])),created:e.timeCreated,modified:e.timeModified},nodeSemver:r,provenance:i,deprecated:Object.keys(n).length>0?n:void 0,integrity:a}}function qb(e){return typeof e==`object`&&!!e&&`versionsMeta`in e&&`distTags`in e}function Jb(e){return typeof e==`object`&&!!e&&`scope`in e&&`name`in e&&`latest`in e&&`versions`in e}let Yb=null;const Xb=()=>(Yb===null&&(Yb=md(`packages/version-upgrade/src/io/cache`)),Yb),Zb=(0,dm.default)(`version-upgrade:cache`);let Qb={},$b=!1;const ex=sm(s.tmpdir(),`version-upgrade`),tx=sm(ex,`cache.json`),nx=18e5;function rx(){return Date.now()}function ix(e){return rx()-e}async function ax(){E(tx)&&ix(D(tx).mtimeMs)<nx?(Zb(`cache loaded from ${tx}`),Qb=JSON.parse(await O.readFile(tx,`utf-8`))):Zb(`no cache found`)}async function ox(){if($b)try{await O.mkdir(ex,{recursive:!0}),await O.writeFile(tx,JSON.stringify(Qb),`utf-8`),Zb(`cache saved to ${tx}`)}catch(e){Xb().error(`Failed to save cache`,e instanceof Error?e:Error(String(e)))}}async function sx(e,t=`npm`,n,r,i){let a,o=`${t}:${e}`;if(Qb[o]){if(ix(Qb[o].cacheTime)<nx)return Zb(`cache hit for ${o}`),Qb[o].data;delete Qb[o]}try{let a=t===`jsr`?await Gb(e,r,i):await Wb(e,!1,n,r,i);if(a)return Qb[o]={data:a,cacheTime:rx()},$b=!0,a}catch(e){a=e}return{tags:{},versions:[],error:a instanceof Error&&a.message||String(a),deprecated:{}}}const cx=[`**/node_modules/**`,`**/dist/**`,`**/public/**`,`**/fixture/**`,`**/fixtures/**`];function lx(e,t=[]){if(!e)return{};let n={};for(let[r,i]of Object.entries(e))if(typeof i==`object`&&i){let e={};for(let[t,n]of Object.entries(i))e[t]=n;n={...n,...lx(e,[...t,r])}}else typeof i==`string`&&(n[r]={version:i,parents:t});return n}function ux(e,t){let n=t.split(`.`).reduce((e,t)=>{if(typeof e==`object`&&e){let n={};for(let[t,r]of Object.entries(e))n[t]=r;return n[t]}},e);if(typeof n==`object`&&n){let e={};for(let[t,r]of Object.entries(n))e[t]=r;return lx(e)}return{}}function dx(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=r;return t}return{}}function fx(e,t,n){let r=t.split(`.`),i=r.pop();if(i===void 0)return;let a=e;for(let e of r){(typeof a[e]!=`object`||a[e]===null)&&(a[e]={});let t=dx(a[e]);a[e]=t,a=t}a[i]=n}function px(e,t,n){return Object.entries(ux(e,t)||{}).map(([e,{version:r,parents:i}])=>mx({name:e,version:r,type:t,shouldUpdate:n,parents:i}))}function mx({name:e,version:t,type:n,shouldUpdate:r,parents:i,hexHash:a}){let o={name:e,currentVersion:t,parents:i,source:n,update:r(e)};return a&&(o.hexHash=a),o}function hx(e,t){let n={};return e.filter(e=>e.source===t).sort((e,t)=>(e.aliasName||e.name).localeCompare(t.aliasName||t.name)).forEach(e=>{let t=e.update?e.targetVersion:e.currentVersion,r=n;if(e.parents&&e.parents.length>0){let t=n;for(let n of e.parents){(typeof t[n]!=`object`||t[n]===null)&&(t[n]={});let e=dx(t[n]);t[n]=e,t=e}r=t}if(e.aliasName===void 0)r[e.name]=t;else{let n=e.protocol?`${e.protocol}:`:``;r[e.aliasName]=`${n}${e.protocol===`jsr`?t:gx(e,t)}`}}),n}function gx(e,t){let n=t?`@${t}`:``;return`${e.name}${n}`}async function _x(e,t,n,r){let i=sm(t.cwd??``,e),a=r??JSON.parse(await se(i,`utf-8`)),o=[];function s(t,r){let o=Object.entries(r).map(([e,t])=>mx({name:e,version:t,type:`bun-workspace`,shouldUpdate:n}));return{name:t,private:!0,version:``,type:`bun-workspace`,relative:e,filepath:i,raw:a,deps:o,resolved:[]}}let c=a?.workspaces;if(c&&typeof c==`object`){let e=bx(c);if(e.catalog&&typeof e.catalog==`object`&&o.push(s(`bun-catalog:default`,xx(e.catalog))),e.catalogs&&typeof e.catalogs==`object`){let t=Sx(e.catalogs);for(let e of Object.keys(t)){let n=t[e];n&&o.push(s(`bun-catalog:${e}`,n))}}}return o}async function vx(e,t){let n=hx(e.resolved,`bun-workspace`);if(Object.keys(n).length&&e.name.startsWith(`bun-catalog:`)){let t=e.name.replace(`bun-catalog:`,``),r=bx(e.raw.workspaces??{});if(e.raw.workspaces=r,t==="default")r.catalog={...xx(r.catalog??{}),...xx(n)};else{let e=Sx(r.catalogs??{});r.catalogs=e,e[t]||(e[t]={}),e[t]={...e[t],...xx(n)}}await yx(e.filepath,e.raw)}}async function yx(e,t){let n;try{n=_v(await se(e,`utf-8`)).indent}catch{}let r=JSON.stringify(t,null,n||` `);await z(e,`${r}\n`,`utf-8`)}function bx(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=r;return t}return{}}function xx(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}return{}}function Sx(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))if(typeof r==`object`&&r&&!Array.isArray(r)){let e={};for(let[t,n]of Object.entries(r))typeof n==`string`&&(e[t]=n);t[n]=e}return t}return{}}let Cx=null;const wx=()=>(Cx===null&&(Cx=md(`packages/version-upgrade/src/addons/vscode`)),Cx);function Tx(e,t){if(typeof e==`object`&&e){for(let[n,r]of Object.entries(e))if(n===t&&typeof r==`string`)return r}}function Ex(e){if(e==null)return!1;let t=e.engines;return Tx(t,`vscode`)!==void 0}function Dx(e){for(let t of[`dependencies`,`devDependencies`,`peerDependencies`]){let n=Tx(e[t],`@types/vscode`);if(n!==void 0)return n}return``}const Ox=[{beforeWrite(e){if(!Ex(e.raw)||e.raw==null)return;let t=e.raw,n=Dx(t);if(!n||n.includes(`:`))return;let r=t.engines,i=Tx(r,`vscode`);if(!i)return;let a=hy(i),o=hy(n);if(a&&o&&Rv(o,a)){wx().info(`[taze addon] Updated VS Code engine field to ${n}`);let e=/[>^<:~]/.test(n)?n:`^${n}`;if(typeof r==`object`&&r){let n={};for(let[t,i]of Object.entries(r))n[t]=t===`vscode`?e:i;t.engines=n}}}}];function kx(e){return L.from(e.slice(7),`base64`).toString(`hex`)}function Ax(e){return typeof e==`object`&&!!e&&`version`in e&&typeof e.version==`string`}const jx=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`,`packageManager`,`pnpm.overrides`,`resolutions`,`overrides`];function Mx(e,t){return t.depFields?.[e]===!1?!1:e!==`peerDependencies`||!!t.peer}async function Nx(e,t,n,r){let i=sm(t.cwd??``,e),a=r??await Qx(i),o=[];for(let e of jx)if(Mx(e,t)){if(e===`packageManager`){let e=a.packageManager;if(typeof e==`string`){let t=e.indexOf(`@`),r=t>0?e.slice(0,t):``,i=t>0?e.slice(t+1):``,a=i.indexOf(`+`),s=a>=0?i.slice(0,a):i,c=a>=0?i.slice(a+1):``,l=c.indexOf(`.`),u=l>=0?c.slice(l+1):void 0;o.push(mx({name:r,version:`^${s}`,type:`packageManager`,shouldUpdate:n,hexHash:u}))}}else o.push(...px(a,e,n))}let s=typeof a.name==`string`?a.name:``,c=typeof a.version==`string`?a.version:``;return[{name:s,private:!!a.private,version:c,type:`package.json`,relative:e,filepath:i,raw:a,deps:o,resolved:[]}]}async function Px(e,t){let n=!1;for(let r of jx)if(Mx(r,t)){if(r===`packageManager`){let t=Object.entries(hx(e.resolved,`packageManager`))[0];if(t){e.raw||={};let[r,i]=t,a=typeof i==`string`?i.replace(`^`,``):String(i),o=`${r}@${a}`,s=e.resolved.find(e=>e.source===`packageManager`&&e.name===r);if(s?.hexHash){let e=s.pkgData?.integrity?.[a];if(e){let t=kx(e);o=`${o}+sha512.${t}`}}e.raw.packageManager=o,n=!0}}else{let t=ux(e.raw,r),i=hx(e.resolved,r),a={};for(let[e,n]of Object.entries(t||{}))Ax(n)&&(a[e]=n.version);for(let[e,t]of Object.entries(i||{}))a[e]=t;Object.keys(a).length>0&&(fx(e.raw,r,a),n=!0)}}if(n){for(let n of t.addons||Ox)await n.beforeWrite?.(e,t);await $x(e.filepath,e.raw||{})}}const Fx=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`,`packageManager`,`pnpm.overrides`,`resolutions`,`overrides`];function Ix(e,t){return e===`peerDependencies`?!!t.peer:t.depFields?.[e]!==!1}async function Lx(e){let t=await oe.readFile(e,`utf-8`);if(!t)return new Nb.Document({});let n=(0,Nb.parseDocument)(t,{merge:!0}),r=n.toJS();if(n.errors.length||typeof r!=`object`||Array.isArray(r))throw TypeError(`Invalid package.yaml structure in ${e}`);return n}async function Rx(e,t){let{amount:n,type:r}=await oe.readFile(e,`utf-8`).then(_v).catch(()=>({amount:2,type:`space`})),i=(0,Nb.stringify)(t,{indent:(r===`tab`?2:n)??2,aliasDuplicateObjects:!1,lineWidth:0}).replace(/^(\s*)"(@[^":]+)":/gm,`$1'$2':`);await oe.writeFile(e,i,`utf-8`)}async function zx(e,t,n){let r=sm(t.cwd??``,e),i=await Lx(r),a=[];for(let e of Fx)if(Ix(e,t)){if(e===`packageManager`){let t=i.get(e);if(typeof t==`string`){let e=t.split(`@`),r=e[0]??``,i=(e[1]??``).split(`+`)[0];a.push(mx({name:r,version:`^${i??``}`,type:`packageManager`,shouldUpdate:n}))}}else{let t={},r=i.toJS();if(typeof r==`object`&&r&&!Array.isArray(r))for(let[e,n]of Object.entries(r))t[e]=n;a.push(...px(t,e,n))}}let o=i.get(`name`),s=i.get(`version`);return[{name:typeof o==`string`?o:``,private:!!i.get(`private`),version:typeof s==`string`?s:``,type:`package.yaml`,relative:e,filepath:r,get raw(){return i.toJS()},deps:a,yamlDocument:i,resolved:[]}]}async function Bx(e,t){let n=!1;if(e.type!==`package.yaml`)throw Error(`Package type is not supported`);let r=e.yamlDocument||new Nb.Document(e.raw);for(let i of Fx)if(Ix(i,t)){if(i===`packageManager`){let t=Object.entries(hx(e.resolved,`packageManager`))[0];if(t){let[e,i]=t,a=typeof i==`string`?i.replace(`^`,``):``;r.set(`packageManager`,`${e}@${a}`),n=!0}}else{let t=ux(Vx(r),i);t&&Object.keys(t).length>0&&(Object.entries(hx(e.resolved,i)).forEach(([e,t])=>r.setIn([...i.split(`.`),e],t)),n=!0)}}if(n){for(let n of t.addons||Ox)await n.beforeWrite?.(e,t);await Rx(e.filepath,r)}}function Vx(e){let t=e.toJS();if(typeof t==`object`&&t&&!Array.isArray(t)){let e={};for(let[n,r]of Object.entries(t))e[n]=r;return e}return{}}async function Hx(e,t,n){let r=sm(t.cwd??``,e),i=Pb(await se(r,`utf-8`)),a=i.getDocument().toJSON(),o=[];function s(t,o){let s=Object.entries(o).map(([e,t])=>mx({name:e,version:t,type:`pnpm-workspace`,shouldUpdate:n}));return{name:t,private:!0,version:``,type:`pnpm-workspace.yaml`,relative:e,filepath:r,raw:a,context:i,deps:s,resolved:[]}}if(a?.catalog&&o.push(s(`pnpm-catalog:default`,a.catalog)),a?.catalogs)for(let e of Object.keys(a.catalogs))o.push(s(`pnpm-catalog:${e}`,a.catalogs[e]));return a?.overrides&&o.push(s(`pnpm-workspace:overrides`,a.overrides)),o}async function Ux(e,t){let n=hx(e.resolved,`pnpm-workspace`);if(Object.keys(n).length){if(e.name.startsWith(`pnpm-catalog:`)){let t=e.name.replace(`pnpm-catalog:`,``);for(let[r,i]of Object.entries(n))typeof i==`string`&&e.context.setPackage(t,r,i)}else{let t=e.name.replace(`pnpm-workspace:`,``).split(/\./g);for(let[r,i]of Object.entries(n))e.context.setPath([...t,r],i)}e.context.hasChanged()&&await Wx(e,e.context)}}function Wx(e,t){return z(e.filepath,t.toString(),`utf8`)}async function Gx(e,t,n){let r=sm(t.cwd??``,e),i=Pb(await se(r,`utf-8`)),a=i.getDocument().toJSON(),o=[];function s(t,o){let s=Object.entries(o).map(([e,t])=>mx({name:e,version:t,type:`yarn-workspace`,shouldUpdate:n}));return{name:t,private:!0,version:``,type:`.yarnrc.yml`,relative:e,filepath:r,raw:a,context:i,deps:s,resolved:[]}}if(a?.catalog&&o.push(s(`yarn-catalog:default`,a.catalog)),a?.catalogs)for(let e of Object.keys(a.catalogs))o.push(s(`yarn-catalog:${e}`,a.catalogs[e]));return o}async function Kx(e,t){let n=hx(e.resolved,`yarn-workspace`);if(Object.keys(n).length){if(e.name.startsWith(`yarn-catalog:`)){let t=e.name.replace(`yarn-catalog:`,``);for(let[r,i]of Object.entries(n))typeof i==`string`&&e.context.setPackage(t,r,i)}else{let t=e.name.replace(`yarn-workspace:`,``).split(/\./g);for(let[r,i]of Object.entries(n))e.context.setPath([...t,r],i)}e.context.hasChanged()&&await qx(e,e.context)}}function qx(e,t){return z(e.filepath,t.toString(),`utf8`)}function Jx(e){return e.replace(/[.+?^${}()|[\]\\]/g,`\\$&`)}function Yx(e){if(e.startsWith(`/`)){let t=e.lastIndexOf(`/`),n=e.substring(1,t),r=e.substring(t+1,e.length);return new RegExp(n,r)}return RegExp(`^${Jx(e).replace(/\*+/g,`.*?`)}$`)}function Xx(e,t=!0){if(!e||e.length===0)return()=>t;let n=Lb(e).flatMap(e=>e.split(`,`)).map(Yx);return e=>{for(let t of n)if(t.test(e))return!0;return!1}}function Zx(e,t){let n=Xx(e,!0),r=Xx(t,!1);return e=>!r(e)&&n(e)}async function Qx(e){return JSON.parse(await O.readFile(e,`utf-8`))}async function $x(e,t){let n=_v(await O.readFile(e,`utf-8`)).indent||` `;await O.writeFile(e,`${JSON.stringify(t,null,n)}\n`,`utf-8`)}async function eS(e,t){switch(e.type){case`package.json`:return Px(e,t);case`package.yaml`:return Bx(e,t);case`pnpm-workspace.yaml`:return Ux(e,t);case`bun-workspace`:return vx(e,t);case`.yarnrc.yml`:return Kx(e,t);default:throw Error(`Unsupported package type: ${e.type}`)}}async function tS(e,t,n){if(e.endsWith(`pnpm-workspace.yaml`))return Hx(e,t,n);if(e.endsWith(`.yarnrc.yml`))return Gx(e,t,n);if(e.endsWith(`package.yaml`))return zx(e,t,n);if(e.endsWith(`package.json`)){let r=sm(t.cwd??``,e);try{let i=await Qx(r),a=i?.workspaces;if(a&&typeof a==`object`&&(`catalog`in a||`catalogs`in a)){let r=sm(t.cwd||I.cwd());if(E(am(r,`bun.lockb`))||E(am(r,`bun.lock`))){let r=await _x(e,t,n,i),a=await Nx(e,t,n,i);return[...r,...a]}}return Nx(e,t,n,i)}catch{}}return Nx(e,t,n)}async function nS(e){let t=[],n=sm(e.cwd||I.cwd()),r=Zx(e.include,e.exclude);if(e.recursive){let n=await Pp(`**/package.yaml`,{ignore:cx.concat(e.ignorePaths||[]),cwd:e.cwd,onlyFiles:!0,dot:!1,expandDirectories:!1}),r=await Pp(`**/package.json`,{ignore:cx.concat(e.ignorePaths||[]),cwd:e.cwd,onlyFiles:!0,dot:!1,expandDirectories:!1}),i=/* @__PURE__ */ new Set;for(let e of n){t.push(e);let n=um(e);i.add(n)}for(let e of r){let n=um(e);i.has(n)||t.push(e)}}else t=await Pp(`package.{yaml,json}`,{cwd:n});return t=t.sort((e,t)=>e.localeCompare(t)),e.ignoreOtherWorkspaces&&(t=(await Promise.all(t.map(async e=>{if(!e.includes(`/`))return[e];let t=am(n,e),r=bv(`.git`,{cwd:t,last:n});if(r&&um(r)!==n)return[];let i=bv(`pnpm-workspace.yaml`,{cwd:t,last:n});if(i&&um(i)!==n)return[];let a=bv(`.yarnrc.yml`,{cwd:t,last:n});if(a&&um(a)!==n)return[];let o=bv(`bun.lockb`,{cwd:t,last:n})||bv(`bun.lock`,{cwd:t,last:n});return o&&um(o)!==n?[]:[e]}))).flat()),E(am(n,`pnpm-workspace.yaml`))&&t.unshift(`pnpm-workspace.yaml`),E(am(n,`.yarnrc.yml`))&&t.unshift(`.yarnrc.yml`),(await Promise.all(t.map(t=>tS(t,e,r)))).flat()}const rS={error:-1,major:0,minor:1,patch:2,"":3};function iS(e){return e.sort((e,t)=>rS[e.diff||``]-rS[t.diff||``])}function aS(e,t){if(t.packageMode){for(let n of Object.keys(t.packageMode))if(Yx(n).test(e))return t.packageMode[n]}}function oS(e,t){let n=[];for(let r of Lb(t.maturityPeriodExclude).flatMap(e=>e.split(`,`))){let t=r.trim();if(!t)continue;let i=t.startsWith(`/`)?-1:t.lastIndexOf(`@`);if(!Yx(i>0?t.slice(0,i):t).test(e))continue;if(i<=0)return!0;let a=t.slice(i+1).split(`||`).map(e=>e.trim()).filter(Boolean);n.push(...a)}return n}function sS(e,t){for(let n of t)if(my(e,n,{includePrerelease:!0}))return!0;return!1}const cS=new re;function lS(e){return e.match(/(@[^/]+\/)?([^/]+)/g)||[]}function uS(e){return e.match(/[^>]+/g)||[]}function dS(e){return/^(?:https?:|git\+|github:)/.test(e)}function fS(e){return/^(?:link|file|workspace|catalog):/.test(e)}function pS(e){return/^(?:npm|jsr):/.test(e)}function mS(e){return e===`npm`?`npm`:e===`jsr`?`jsr`:`npm`}function hS(e){let t=e.indexOf(`:`),n=mS(e.slice(0,t)),r=e.slice(t+1);if(n===`npm`){let e=r.lastIndexOf(`@`);return e>0?{protocol:n,name:r.substring(0,e),version:r.substring(e+1)}:{protocol:n,name:r,version:``}}return{protocol:n,name:``,version:r}}function gS(e){let t=[`>=`,`<=`,`>`,`<`,`~`,`^`],n=e.trim();if(n===`*`||n===``)return`*`;if(n[0]===`~`||n[0]===`^`)return n[0];for(let e of t)if(n.startsWith(e))return e;if(n.includes(`x`)){let e=n.split(`.`);if(e[0]===`x`)return`*`;if(e[1]===`x`)return`^`;if(e[2]===`x`)return`~`}return n.length>0&&n.charCodeAt(0)>=48&&n.charCodeAt(0)<=57?``:null}function _S(e,t){if(!gy(e))return null;if(t==="default")return e;let n=hy(e);return n?{major:`>=`,minor:`^`,patch:`~`}[t]+n:null}function vS(e,t){return e==null||t==null?null:t===`*`?`*`:t+e}function yS(e,t){return vS(t,gS(e))}function bS(e,t,n,r){let i=null;if(n===`latest`){let t=r.latest;i=t!=null&&e.includes(t)?t:e.at(-1)??null}else if(n===`newest`)i=e.at(-1)??null;else if(n===`next`){let t=r.next;i=t!=null&&e.includes(t)?t:e.at(-1)??null}else if(n===`stable`){let n=_S(t,`default`);if(!n)return;e.filter(e=>!e.includes(`-`)).forEach(e=>{my(e,n)&&(!i||Rv(e,i))&&(i=e)})}else if(n==="default"&&(t===`*`||t.trim()===``))return;else{let a=_S(t,n);if(!a)throw Error(`invalid_range`);let o=r.latest??null;o&&!my(o,a)&&(o=null),e.forEach(e=>{my(e,a)&&(!o||Vv(e,o))&&(!i||Rv(e,i))&&(i=e)})}if(i)return i}function xS(e,t){return e.filter(e=>!t[e])}function SS(e,t,n){if(!t||n<=0)return e;let r=/* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).getTime()-n*24*60*60*1e3);return e.filter(e=>{let n=t[e];return!n||new Date(n)<r})}function CS(e,t,n){let{tags:r}=e.pkgData,i=wS(e,n);if(i.length!==0)return e.filteredVersions=i,bS(i,e.currentVersion,t,r)}function wS(e,t){let{versions:n,deprecated:r,time:i}=e.pkgData,a=n;r&&Object.keys(r).length>0&&(a=xS(a,r));let o=oS(e.name,t);if(t.maturityPeriod&&t.maturityPeriod>0&&o!==!0){let e=a;if(a=SS(e,i,t.maturityPeriod),o.length>0){let t=new Set(a);a=e.filter(e=>t.has(e)||sS(e,o))}}return a}function TS(e,t,n){let r=CS(e,`latest`,n);return r&&Rv(r,t)?r:void 0}function ES(e,t,n=!0,r=!1){let i=/^\d+/.test(e.currentVersion);if(i&&!r)e.targetVersion=e.currentVersion,e.targetVersionTime=e.currentVersionTime,e.diff=null,e.update=!1;else{if(e.targetVersion=yS(e.currentVersion,t)||e.currentVersion,e.targetVersionTime=e.pkgData.time?.[t],e.currentProvenance=e.pkgData.provenance?.[e.currentVersion],e.targetProvenance=e.pkgData.provenance?.[e.targetVersion],e.provenanceDowngraded=!(!e.currentProvenance||e.targetProvenance)||e.currentProvenance===`trustedPublisher`&&e.targetProvenance===!0,i&&Lv(e.currentVersion,e.targetVersion)){let{versions:t,time:n={},tags:r}=e.pkgData,i=bS(e.filteredVersions??t,e.currentVersion,`minor`,r);i&&(e.targetVersion=i,e.targetVersionTime=n[e.targetVersion])}try{let t=hy(e.currentVersion),n=hy(e.targetVersion);if(!t||!n)throw Error(`invalid_version`);e.currentVersionTime=e.pkgData.time?.[t.toString()],e.diff=DS(t,n),e.update=e.diff!==null&&Bv(t,n)}catch(t){if(!n)throw t;e.targetVersion=e.currentVersion,e.diff=`error`,e.update=!1}}}function DS(e,t){if(Lv(e,t))return null;let n=my(t,`~${e}`,{includePrerelease:!0}),r=my(t,`^${e}`,{includePrerelease:!0}),i=my(t,`>=${e}`,{includePrerelease:!0});return n?r?`patch`:`major`:r?`minor`:i?`major`:`error`}function OS(e,t){return{...e,diff:null,targetVersion:e.currentVersion,update:!1,provenanceDowngraded:!1,pkgData:{tags:{},versions:[]},...t}}function kS(e){return e!=null&&e!==`ignore`?e:`default`}async function AS(e,t,n=()=>!0){let r={...e,diff:null,targetVersion:e.currentVersion,update:e.update,provenanceDowngraded:!1,pkgData:{tags:{},versions:[]}},i=aS(r.name,t),a=t.mode,o=i?i===a?a:a==="default"?i:`ignore`:a;if(fS(e.currentVersion)||dS(e.currentVersion)||!e.update||!await Promise.resolve(n(e))||o===`ignore`)return OS(e);if(pS(e.currentVersion)){let{name:t,version:n,protocol:i}=hS(e.currentVersion);if(r.name=t||r.name,r.currentVersion=n,r.aliasName=e.name,r.protocol=i,!n)return OS(e,{name:r.name,currentVersion:n,aliasName:e.name,protocol:i})}let s=r.name;r.source===`resolutions`?s=lS(r.name).pop()??r.name:r.source===`pnpm.overrides`&&(s=uS(r.name).pop()??r.name);let c=await sx(s,r.protocol,t.cwd,t.timeout,t.retries),{error:l,deprecated:u}=c;r.pkgData=c;let d=null,f;if(l==null)try{if(u&&typeof u==`object`&&r.currentVersion&&u[r.currentVersion])return OS(e,{name:r.name,currentVersion:r.currentVersion,aliasName:r.aliasName,protocol:r.protocol});if(f=CS(r,kS(o),t),!f)return OS(e,{name:r.name,currentVersion:r.currentVersion,aliasName:r.aliasName,protocol:r.protocol,pkgData:c})}catch(e){d=e instanceof Error?e.message:String(e)}else d=l;f?ES(r,f,void 0,t.includeLocked):r.targetVersion=r.currentVersion,r.targetVersion===r.currentVersion&&(r.diff=null,r.update=!1);try{let e=hy(f||r.targetVersion||``);e&&(r.latestVersionAvailable=TS(r,e,t));let{nodecompat:n=!0}=t;if(n){let t=I.version,{nodeSemver:n}=r.pkgData;if(n&&e?.version&&e?.version in n){let i=n[e.version];r.nodeCompatibleVersion={compatible:i!=null&&my(t,i),semver:i??``}}}}catch{}return d&&(r.diff=`error`,r.update=!1,r.resolveError=d),r}async function jS(e,t,n=()=>!0,r=()=>{}){let i=e.length,a=0,{concurrency:o=10}=t,s=cS.getStore()||qp(o);return Promise.all(e.map(e=>s.add(async()=>{let o=await AS(e,t,n);return a+=1,r(e.name,a,i),o})))}async function MS(e,t,n,r){let i=await jS(e.deps,t,n,(t,n,i)=>r?.(e.name,t,n,i));return iS(i),e.resolved=i,e}async function NS(e,t={}){e.force||await ax();let n=await nS(e);t.afterPackagesLoaded?.(n);let r=n.filter(e=>e.private).map(e=>e.name).filter(e=>e),i=e=>!r.includes(e.name),a=0,o=(e,n,r,i)=>{a++,t.onDependencyResolved?.(e,n,a,i)},s=qp(e.concurrency||10);return await cS.run(s,()=>Promise.all(n.map(async n=>{t.beforePackageStart?.(n),await PS(n,e,i,{...t,onDependencyResolved:o}),t.afterPackageEnd?.(n)}))),t.afterPackagesEnd?.(n),await ox(),{packages:n}}async function PS(e,t,n=()=>!0,r={}){await MS(e,t,n,r.onDependencyResolved);let{resolved:i}=e,a=i.filter(e=>e.update);return t.write&&a.length&&await Promise.resolve(r.beforePackageWrite?.(e))!==!1&&(await eS(e,t),r.afterPackageWrite?.(e)),e}function FS(e){return{ok:!0,value:e}}function IS(e){return{ok:!1,error:e}}const LS=/^[a-z][a-z0-9-]*$/,RS=[`edition-root`,`customer-root`,`single-repo`],zS=Ac([`high`,`normal`,`low`]),BS=Ac(RS),VS=/\S/,HS=yc({id:Fs().regex(LS,`范围 id 非法(应为小写字母开头的字母数字连字符)`),kind:BS,remotes:gc(Fs().regex(VS,`远程位置非法(不得为空串或纯空白)`)).default([]),tags:gc(Fs().regex(VS,`标签非法(不得为空串或纯空白)`)).default([]),priority:zS.default(`normal`),excludes:gc(Fs().min(1)).default([]),projectPriorities:Oc(Fs(),zS).default({})}).check(e=>{e.value.kind===`single-repo`&&(e.value.excludes.length>0&&e.issues.push({code:`custom`,input:e.value,path:[`excludes`],message:`single-repo 范围禁用 excludes(声明的即唯一项目,如需排除请改用 edition-root/customer-root)`}),Object.keys(e.value.projectPriorities).length>0&&e.issues.push({code:`custom`,input:e.value,path:[`projectPriorities`],message:`single-repo 范围禁用 projectPriorities(优先级直接设于 scope 级)`}))}),US=`scopes`,WS=/^[a-z][a-z0-9-]*\.scope\.ts$/;async function GS(e){let t=M(e,US);if(!E(t))return IS({code:`SCOPES_DIR_MISSING`,message:`声明域目录缺失:${t}(应为 project-registry 仓根下 ${US}/,含 *.scope.ts 声明文件)`});let n=A(t).filter(e=>WS.test(e)).sort((e,t)=>e<t?-1:1);if(n.length===0)return IS({code:`SCOPE_REGISTRY_EMPTY`,message:`范围声明域为空:${t}(无 *.scope.ts——范围消失属配置事故,如需清空请显式移除 registryRoot 配置)`});let r=/* @__PURE__ */ new Set,i=[];for(let e of n){let n=M(t,e),a=await import(F(n).href),o=HS.safeParse(a.default);if(!o.success){let e=o.error.issues[0];return IS({code:`SCOPE_DECLARATION_INVALID`,message:`范围声明结构非法:${n}(${e?.path.join(`.`)??``} ${e?.message??``})`})}let s=e.replace(/\.scope\.ts$/,``);if(o.data.id!==s)return IS({code:`SCOPE_ID_MISMATCH`,message:`范围 id 与文件名不一致:${n}(id=${o.data.id},应为 ${s}——命名即身份)`});if(r.has(o.data.id))return IS({code:`SCOPE_ID_CONFLICT`,message:`范围 id 重复:${o.data.id}(声明域内同 id 即同范围,不得重复声明)`});r.add(o.data.id),i.push(o.data)}return FS(i)}const KS=`LZI_PROJECT_REGISTRY_ROOT`,qS=`LZI_PROJECT_MARKDOWN_REGISTRY_ROOT`,JS=`LZI_PROJECT_SCOPE_ROOTS`,YS=`LZI_PROJECT_MARKDOWN_SCOPE_ROOTS`,XS=/^[a-z][a-z0-9-]*=\/\S+$/;function ZS(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e!==``)}function QS(e){let t=/* @__PURE__ */ new Map;for(let n of ZS(e)){if(!XS.test(n))return IS({message:`范围根映射段非法:${n}(应为 id=绝对路径 形态,id 为小写字母开头的字母数字连字符)`});let e=n.indexOf(`=`),r=n.slice(0,e),i=P(n.slice(e+1));if(t.has(r))return IS({message:`范围根映射 id 重复:${r}(同一范围不得重复映射)`});t.set(r,i)}return FS(t)}function $S(e,t,n,r){return e!==void 0&&t!==void 0&&e.trim()!==t.trim()?IS({code:`ACQUISITION_ENV_INVALID`,message:`环境变量双名冲突:${n} 与 ${r} 同时在场且值不一致(请统一使用新名 ${n})`,variables:[n,r]}):FS({value:e??t,variables:e===void 0?t===void 0?[]:[r]:[n]})}function eC(e=process.env){let t=$S(e[KS],e[qS],KS,qS);if(!t.ok)return IS(t.error);let n=$S(e[JS],e[YS],JS,YS);if(!n.ok)return IS(n.error);let r;if(n.value.value!==void 0){let e=QS(n.value.value);if(!e.ok)return IS({code:`ACQUISITION_ENV_INVALID`,message:e.error.message,variables:[...n.value.variables]});r=e.value}return FS({registryRoot:t.value.value===void 0?void 0:P(t.value.value.trim()),scopeRoots:r})}const tC=/^[A-Za-z0-9_][A-Za-z0-9._-]*$/;function nC(e,t){return e.name<t.name?-1:+(e.name>t.name)}function rC(e){return E(M(e,`.git`))}function iC(e,t){return t.get(e.id)}function aC(e,t,n,r){if(n.has(e.id))return IS({code:`SCOPE_ID_CONFLICT`,message:`范围 id 冲突:${e.id}(声明域内不得重复)`});n.add(e.id);let i=iC(e,t);return i===void 0?IS({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${e.id}(声明零本地路径,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 或 LZI_PROJECT_MARKDOWN_SCOPE_ROOTS 补 id=绝对路径 映射)`}):E(i)?FS({def:e,root:i,sourceId:r}):IS({code:`DIR_NOT_FOUND`,message:`范围根不存在:${i}(范围 ${e.id} 机内映射目标)`})}function oC(e,t){let n=[],r=[];for(let i of[...A(e.root,{withFileTypes:!0})].sort(nC)){if(i.name.startsWith(`.`))continue;if(!i.isDirectory()){r.push({scope:e.def.id,entry:i.name,reason:`ROOT_FILE`});continue}if(e.def.excludes.includes(i.name)){r.push({scope:e.def.id,entry:i.name,reason:`EXCLUDED`});continue}let a=M(e.root,i.name);t!==void 0&&P(a)===P(t)?r.push({scope:e.def.id,entry:i.name,reason:`EXCLUDED_PATH`}):!rC(a)||!tC.test(i.name)?r.push({scope:e.def.id,entry:i.name,reason:`NOT_A_REPO`}):n.push({scope:e.def.id,scopeKind:e.def.kind,priority:e.def.projectPriorities[i.name]??e.def.priority,sourceId:e.sourceId,project:i.name,path:a})}return{scope:e.def.id,scopeKind:e.def.kind,priority:e.def.priority,scopeRoot:e.root,sourceId:e.sourceId,projects:n,skipped:r}}function sC(e,t){let n=j(e.root);return t!==void 0&&P(e.root)===P(t)||!rC(e.root)||!tC.test(n)?IS({code:`SCOPE_ROOT_INVALID`,message:`single-repo 范围根非法:${e.root}(应为含 .git 的合规项目目录,且不得为排除路径)`}):FS({scope:e.def.id,scopeKind:`single-repo`,priority:e.def.priority,scopeRoot:e.root,sourceId:e.sourceId,projects:[{scope:e.def.id,scopeKind:`single-repo`,priority:e.def.priority,sourceId:e.sourceId,project:n,path:e.root}]})}function cC(e,t,n){let r=[],i=[],a=/* @__PURE__ */ new Set,o=/* @__PURE__ */ new Map;for(let s of e){let e=aC(s,n.scopeRoots,a,n.sourceId);if(!e.ok)return IS(e.error);let c,l=[];if(s.kind===`single-repo`){let n=sC(e.value,t);if(!n.ok)return IS(n.error);c=n.value}else{let n=oC(e.value,t);c=n,l=n.skipped}for(let e of c.projects){let t=o.get(e.project);if(t!==void 0)return IS({code:`PROJECT_NAME_CONFLICT`,message:`项目名跨范围冲突:${e.project}(${t} 与 ${e.scope} 均含此名;归档平铺要求项目名全局唯一,可在后登记范围的 excludes 中显式排除)`});o.set(e.project,e.scope)}r.push(c),i.push(...l)}return r.sort((e,t)=>e.scope<t.scope?-1:+(e.scope>t.scope)),i.sort((e,t)=>e.scope===t.scope?e.entry<t.entry?-1:+(e.entry>t.entry):e.scope<t.scope?-1:1),FS({scopes:r,skipped:i})}const lC=l(ie);function uC(e){return typeof e==`object`&&!!e&&`stderr`in e}async function dC(e,t){try{let{stdout:n}=await lC(`git`,[`-C`,e,...t],{encoding:`utf8`});return{ok:!0,stdout:n.trim()}}catch(e){let t=uC(e)?e.stderr:void 0;return{ok:!1,stderr:typeof t==`string`?t:String(e)}}}function fC(e){return typeof e==`object`&&!!e}function pC(e){let t=M(e,`package.json`);if(!E(t))return{packageName:null,description:null};let n;try{n=JSON.parse(k(t,`utf8`))}catch{return{packageName:null,description:null}}if(!fC(n))return{packageName:null,description:null};let r=n.name,i=n.description;return{packageName:typeof r==`string`&&r!==``?r:null,description:typeof i==`string`&&i!==``?i:null}}async function mC(e){let t=await dC(e.path,[`rev-parse`,`--git-dir`]);if(!t.ok)return IS({code:`INSPECT_FAILED`,scope:e.scope,project:e.project,message:`仓库健康探测失败:${e.path}(${t.stderr})`});let n=await dC(e.path,[`remote`,`get-url`,`origin`]),r=n.ok&&n.stdout!==``?n.stdout:null,i=pC(e.path);return FS({scope:e.scope,scopeKind:e.scopeKind,priority:e.priority,sourceId:e.sourceId,project:e.project,projectPath:e.path,remoteUrl:r,packageName:i.packageName,description:i.description})}async function hC(e,t,n){let r=Math.max(1,Math.floor(t)),i=[],a=0;for(;a<e.length;){let t=e.slice(a,a+r),o=await Promise.all(t.map((e,t)=>n(e,a+t)));i.push(...o),a+=r}return i}async function gC(e={}){let t=eC(e.processEnv??process.env);if(!t.ok)return IS(t.error);let n=e.registryRoot??t.value.registryRoot;if(n===void 0)return IS({code:`ACQUISITION_ENV_INVALID`,message:`未定位 registry 仓根(请在 .env 配置 LZI_PROJECT_REGISTRY_ROOT 或显式传入 registryRoot)`});let r=await GS(n);if(!r.ok)return IS(r.error);let i=e.scopeRoots??t.value.scopeRoots??/* @__PURE__ */ new Map,a=e.scopeIds===void 0?void 0:new Set(e.scopeIds),o=a===void 0?[]:[...a].filter(e=>!r.value.some(t=>t.id===e));if(o.length>0)return IS({code:`SCOPE_SELECTOR_UNKNOWN`,message:`圈定的范围 id 不在声明域:${o.join(`、`)}(合法范围 id:${r.value.map(e=>e.id).join(`、`)})`});let s=r.value,c=[];if(a!==void 0){s=r.value.filter(e=>a.has(e.id));let e=s.filter(e=>!i.has(e.id)).map(e=>e.id);if(e.length>0)return IS({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${e.join(`、`)}(声明零本地路径,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 补 id=绝对路径 映射)`})}else if(s=r.value.filter(e=>i.has(e.id)),c=r.value.filter(e=>!i.has(e.id)).map(e=>e.id),s.length===0)return IS({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${r.value.map(e=>e.id).join(`、`)}(本机未配置任何范围根映射,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 补 id=绝对路径 映射)`});let l=cC(s,e.excludePath,{scopeRoots:i,sourceId:`scope-declarations`});if(!l.ok)return IS(l.error);let u=l.value.scopes.flatMap(e=>[...e.projects]),d=[],f=/* @__PURE__ */ new Map;if(e.inspect===!0){let e=await hC(u,16,async e=>mC(e));for(let t of e)t.ok?f.set(t.value.project,t.value):d.push({scope:t.error.scope,project:t.error.project,message:t.error.message})}let p=u.map(e=>{let t=f.get(e.project);return{scope:e.scope,scopeKind:e.scopeKind,priority:e.priority,sourceId:e.sourceId,project:e.project,path:e.path,remoteUrl:t?.remoteUrl??null,packageName:t?.packageName??null,description:t?.description??null}});return FS({registryRoot:n,scopes:l.value.scopes,projects:p,skipped:l.value.skipped,unmappedScopes:c,inspectFailures:d,inspected:e.inspect===!0})}const _C={RED:`\x1B[0;31m`,GREEN:`\x1B[0;32m`,YELLOW:`\x1B[1;33m`,BLUE:`\x1B[0;34m`,RESET:`\x1B[0m`};function vC(e){return e.map(e=>{if(typeof e==`string`)return e;if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}).join(` `)}function $(...e){process.stdout.write(`${vC(e)}\n`)}function yC(...e){process.stderr.write(`${vC(e)}\n`)}const bC=async()=>{let e=await Gp();return e?(e.source===`legacy-dev-tools`&&$(`提示: 经 lzi-dev.config.ts 共享读取依赖工具配置,建议补建 lzi-dependencies.config.ts`),e.config):($(`提示: 未找到配置文件 lzi-dependencies.config.ts,使用默认配置`),{})},xC=[`**/node_modules/**`,`**/oh_modules/**`,`**/target/**`,`**/dist/**`,`**/build/**`,`**/.turbo/**`],SC=e=>!e||e.length===0?xC:[...xC,...e],CC=vc({name:Fs().optional(),workspaces:fc().optional(),devDependencies:Oc(Fs(),Fs()).optional()}),wC=async()=>{let e=process.cwd();$(`正在扫描 ${e} 下的 package.json 文件...`);let t=null;try{let n=CC.safeParse(await Bun.file(`${e}/package.json`).json());t=n.success?n.data:null}catch{t=null}t===null&&($(`未找到可解析的 workspace 根 package.json,请在仓库根目录执行本命令`),process.exit(1));let n=await bC(),r=SC(n.hoisting?.ignorePaths),i=new Set(n.hoisting?.allowlist??[]),a=t.devDependencies??{},o=await Pp(`**/package.json`,{cwd:e,ignore:r,onlyFiles:!0,dot:!1}),s=0,c=[];for(let t of o){if(t===`package.json`)continue;let n=null;try{let r=CC.safeParse(await Bun.file(`${e}/${t}`).json());n=r.success?r.data:null}catch{n=null}if(n===null||n.workspaces!==void 0)continue;let r=n.devDependencies??{};if(Object.keys(r).length!==0){s+=1;for(let[o,s]of Object.entries(r)){let r=a[o];r===void 0||i.has(o)||c.push({packageName:n.name??t,relPath:N(e,`${e}/${t}`),dependency:o,subRange:s,rootRange:r,drifted:s!==r})}}}if($(`找到 ${s} 个子包,根声明开发依赖 ${Object.keys(a).length} 项`),c.length===0)$(`所有子包均未重复声明根已有的开发依赖`);else{$(`
323
- 以下子包重复声明根已有的开发依赖:`);for(let e of c){let t=e.drifted?` 版本漂移`:``;$(` ${e.packageName} ${e.relPath}`),$(` ${e.dependency} 子声明 ${e.subRange} 根声明 ${e.rootRange}${t}`)}$(`共 ${c.length} 处重复声明,处置口径见 ADR 0036`),process.exit(1)}},TC=vc({name:Fs().optional(),overrides:Oc(Fs(),fc()).optional(),pnpm:vc({overrides:Oc(Fs(),fc()).optional()}).optional(),resolutions:Oc(Fs(),fc()).optional()}),EC=e=>typeof e==`string`?e:`嵌套对象`,DC=async()=>{let e=process.cwd();$(`正在扫描 ${e} 下的 package.json 文件...`);let t=null;try{let n=TC.safeParse(await Bun.file(`${e}/package.json`).json());t=n.success?n.data:null}catch{t=null}t===null&&($(`未找到可解析的仓库根 package.json,请在仓库根目录执行本命令`),process.exit(1));let n=await bC(),r=SC(n.overrides?.ignorePaths),i=new Set(n.overrides?.allowlist??[]),a=await Pp(`**/package.json`,{cwd:e,ignore:r,onlyFiles:!0,dot:!1}),o=0,s=[];for(let t of a){let n=null;try{let r=TC.safeParse(await Bun.file(`${e}/${t}`).json());n=r.success?r.data:null}catch{n=null}if(n===null)continue;o+=1;let r=[[`overrides`,n.overrides??{}],[`pnpm.overrides`,n.pnpm?.overrides??{}],[`resolutions`,n.resolutions??{}]];for(let[a,o]of r)for(let[r,c]of Object.entries(o))i.has(r)||s.push({packageName:n.name??t,relPath:N(e,`${e}/${t}`),field:a,entry:r,value:EC(c)})}if($(`扫描到 ${o} 个清单,登记豁免条目 ${i.size} 项`),s.length===0)$(`全部清单均未声明未豁免的 overrides 族强制版本字段`);else{$(`
324
- 以下清单声明了未豁免的 overrides 族强制版本字段:`);for(let e of s)$(` ${e.packageName} ${e.relPath}`),$(` ${e.field} ${e.entry} ${e.value}`);$(`共 ${s.length} 处强制版本条目,处置口径见 ADR 0153,豁免须经特别申请登记于 lzi-dependencies.config.ts 的 overrides.allowlist`),process.exit(1)}},OC=`@longzai-intelligence`,kC=async()=>{let e=process.env.npm_config_registry;process.env.npm_config_registry=`https://registry.npmjs.org/`;let t;try{t=await AC(void 0)}finally{e===void 0?delete process.env.npm_config_registry:process.env.npm_config_registry=e}let n=jC(t);$(`
325
- --- 检查结果 ---`);let r=0;if(r+=MC(t,new Set(n),!1),n.length>0){$(`\n回退基线:${n.length} 个内部包在 npm 无记录,按本机 registry 配置复查`);let e=await AC(n);r+=MC(e,new Set(n),!0)}r===0?$(`全部 Longzai Intelligence 包依赖均为最新版`):(yC(`\n共 ${r} 个内部包依赖非最新版,修复指引: 在仓根执行 lzi-dependencies upgrade --write 或 bun run version:upgrade`),process.exit(Math.min(r,255)))},AC=async e=>{let t=(await bC()).upgrade??{},{packages:n}=await NS({cwd:process.cwd(),mode:`latest`,write:!1,recursive:t.recursive??!0,timeout:t.timeout??3e4,retries:t.retries??3,exclude:t.exclude??[],include:e===void 0?t.include??[]:[...e],depFields:t.depFields,ignorePaths:t.ignorePaths??[],concurrency:t.concurrency??10,force:!1,all:!1,install:!1,update:!1,interactive:!1,group:!0,includeLocked:!1,timediff:!0,nodecompat:!0,loglevel:`silent`,silent:!0,failOnOutdated:!1},{afterPackagesLoaded:e=>{$(`扫描到 ${e.length} 个包,正在校验 Longzai Intelligence 依赖新鲜度...`)}});return n},jC=e=>{let t=/* @__PURE__ */ new Set;for(let n of e)for(let e of n.resolved)e.name.startsWith(OC)&&e.resolveError!=null&&t.add(e.name);return[...t]},MC=(e,t,n)=>{let r=0;for(let i of e){let e=i.resolved.filter(e=>!e.update||!e.name.startsWith(OC)?!1:n?t.has(e.name):!t.has(e.name));if(e.length!==0){r+=e.length,$(`\n${i.name||i.relative}:`);for(let t of e){let e=t.diff??``,r=n?`,回退基线`:``;$(` ${t.name}: ${t.currentVersion} -> ${t.targetVersion} ${e}${r}`)}}}return r};function NC(e){let t=e;for(;;){if(E(M(t,`longzai-intelligence-globals`))||E(M(t,`lzi-architecture.yaml`)))return t;let e=M(t,`..`);if(e===t)return;t=e}}function PC(e){return e.filter(e=>E(M(e.path,`package.json`))).map(e=>({name:e.project,dir:e.path}))}async function FC(e){if(e.projectScope!==void 0){let t=await gC({scopeIds:[e.projectScope]});return t.ok||(yC(`错误: 项目范围解析失败: ${t.error.message}`),yC(`提示: 请确认 .env 配置 LZI_PROJECT_REGISTRY_ROOT 与 LZI_PROJECT_SCOPE_ROOTS`),process.exit(1)),{registryRoot:t.value.registryRoot,scopeId:e.projectScope,projects:PC(t.value.projects),source:`env`}}let t=NC(e.cwd??process.cwd());t===void 0&&(yC(`错误: 未定位产品群聚合根(一级子目录应存在 longzai-intelligence-globals 仓)`),yC(`提示: 请自产品群内任意仓库运行,或使用 --project-scope <id> 显式圈定范围`),process.exit(1));let n=j(t),r=M(t,`longzai-intelligence-project-registry`);E(M(r,`scopes`))||(yC(`错误: registry 声明域缺失: ${M(r,`scopes`)}`),yC(`提示: 请确认 longzai-intelligence-project-registry 仓已在聚合根就位`),process.exit(1));let i=await gC({registryRoot:r,scopeIds:[n],scopeRoots:/* @__PURE__ */ new Map([[n,t]])});return i.ok||(yC(`错误: 项目范围解析失败: ${i.error.message}`),process.exit(1)),{registryRoot:r,scopeId:n,projects:PC(i.value.projects),source:`structure`}}const IC=(e,t)=>Bun.spawnSync([`git`,`diff`,`--quiet`,`HEAD`,`--`,t],{cwd:e,stdout:`pipe`,stderr:`pipe`}).exitCode===0,LC=e=>{let t=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`("${t}/[^"]+":\\s*")[^"]*(")`,`g`)},RC=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),zC=e=>/^[~^]?\d/.test(e),BC=(e,t)=>`${/^[~^]/.exec(e)?.[0]??``}${t}`,VC=e=>{let t=Bun.spawnSync([`git`,`ls-files`,`--`,`*/package.json`],{cwd:e,stdout:`pipe`,stderr:`pipe`});return t.exitCode===0?[`package.json`,...(t.stdout?.toString()??``).trim().split(`
326
- `).map(e=>e.trim()).filter(e=>e.length>0).filter(t=>E(M(e,t)))]:[`package.json`]},HC=(e,t,n)=>Bun.spawnSync([`git`,`commit`,...t,`-m`,n],{cwd:e,stdout:`pipe`,stderr:`pipe`}).exitCode===0,UC=async(e,t,n)=>{let r=await Bun.file(e).text(),i=[],a=[],o=[],s;for(t.lastIndex=0;(s=t.exec(r))!==null;){let e=s[0],t=s[1]??``,r=s[2]??``,i=/^"([^"]+)"/.exec(t)?.[1]??``,a=e.slice(t.length,e.length-r.length),c=n(i,a);a!==c&&zC(a)&&o.push({name:i,oldVersion:a,targetVersion:c,prefix:t,suffix:r})}if(o.length===0)return{matchedPackages:i,changes:a};let c=r;for(let e of o){let t=RegExp(`("${RC(e.name)}":\\s*")[^"]*(")`);c=c.replace(t,`$1${e.targetVersion}$2`),i.push(e.name),a.push({name:e.name,from:e.oldVersion,to:e.targetVersion})}return await Bun.write(e,c),{matchedPackages:i,changes:a}},WC=async(e,t,n)=>{let r=await Bun.file(e).text(),i=[],a=[];t.lastIndex=0;let o;for(;(o=t.exec(r))!==null;){let e=o[0],t=o[1]??``,r=o[2]??``,s=/^"([^"]+)"/.exec(t)?.[1]??``,c=e.slice(t.length,e.length-r.length),l=n(s,c);c!==l&&zC(c)&&(i.push(s),a.push({name:s,from:c,to:l}))}return{matchedPackages:i,changes:a}},GC=async(e,t,n,r,i)=>{let{name:a,dir:o}=e,s=VC(o),c=[],l=[],u=[],d=[];for(let e of s){let r=M(o,e),a=await WC(r,t,n);if(a.matchedPackages.length!==0){if(!IC(o,e))u.push(e);else{if(i)c.push(...a.matchedPackages),l.push(...a.changes);else{let e=await UC(r,t,n);c.push(...e.matchedPackages),l.push(...e.changes)}d.push(e)}}}return d.length===0?u.length>0?{name:a,dir:o,matchedPackages:c,changes:l,skippedFiles:u,status:`skipped-dirty`,reason:`package.json 已有未提交改动:${u.join(`,`)}`}:{name:a,dir:o,matchedPackages:c,changes:l,status:`skipped-nochange`,reason:`无匹配 scope 或已是目标版本`}:i||HC(o,d,r)?{name:a,dir:o,matchedPackages:c,changes:l,skippedFiles:u,status:`success`}:{name:a,dir:o,matchedPackages:c,changes:l,skippedFiles:u,status:`failed`,reason:`git commit 失败,文件已修改,需人工介入`}},KC=async(e,t)=>{let n=/* @__PURE__ */ new Set;for(let r of e){let e=VC(r.dir);for(let i of e){let e=M(r.dir,i),a=await Bun.file(e).text();t.lastIndex=0;let o;for(;(o=t.exec(a))!==null;){let e=o[1]??``,t=/^"([^"]+)"/.exec(e)?.[1];t&&n.add(t)}}}return[...n]},qC=async(e,t)=>{let n=/* @__PURE__ */ new Map,r=[],i=0,a=async e=>{let t=await sx(e),i=t.tags?.latest;if(i===void 0){let n=t.error instanceof Error?t.error.message:t.error??`未找到 dist-tags.latest`;r.push({name:e,reason:n})}else n.set(e,i)},o=async()=>{for(;i<e.length;){let t=e[i];i++,t!==void 0&&await a(t)}},s=Array.from({length:Math.min(t,e.length)},()=>o());if(await Promise.all(s),r.length>0){yC(`${_C.RED}错误: 部分包查询 npm latest 失败,已中止(0 文件改动、0 提交)${_C.RESET}`);for(let e of r)yC(` ${e.name}: ${e.reason}`);process.exit(1)}return n},JC=async e=>{let{scope:t,version:n,message:r,dryRun:i}=e,a=e.concurrency??10,o=await FC({projectScope:e.projectScope}),s=n===void 0,c=s?`latest(各自 npm 最新)`:n,l=r??(s?`chore: bump ${t} deps to latest`:`chore: bump ${t} deps to ${n.replace(/^[~^]/,``)}`),u=LC(t);$(`${_C.BLUE}═══ version upgrade-across ═══${_C.RESET}`),$(`项目获取来源: ${o.source===`structure`?`结构锚点(cwd 上溯聚合根)`:`显式圈定(--project-scope)`}`),$(`registry: ${o.registryRoot}`),$(`项目范围: ${o.scopeId}`),$(`升级范围: ${t} 下的所有包 -> ${c}`),$(`并发数: ${a}`),i&&$(`${_C.YELLOW}[dry-run] 预览模式,不写文件、不提交${_C.RESET}`),$(``);let d=o.projects;$(`发现 ${d.length} 个子项目,并发处理(并发 ${a})...`),$(``);let f;if(s){let e=await KC(d,u);if(e.length===0){$(`${_C.YELLOW}未匹配到任何 ${t} 下的包,结束${_C.RESET}`);return}$(`匹配到 ${e.length} 个 ${t} 下的包,查询 npm latest...`);let n=await qC(e,a);f=(e,t)=>BC(t,n.get(e)??``)}else{let e=n??``;f=()=>e}let p=[],m=0,h=d.length;await(async(e,t)=>{let n=0,r=async()=>{for(;n<e.length;){let t=e[n];if(n++,t===void 0)break;let r=await GC(t,u,f,l,i);p.push(r),m++;let a=r.status===`success`?`${_C.GREEN}✓${_C.RESET}`:r.status===`failed`?`${_C.RED}✗${_C.RESET}`:`·`;$(` [${m}/${h}] ${a} ${t.name}`)}},a=Array.from({length:Math.min(t,e.length)},()=>r());await Promise.all(a)})(d,a),$(``),YC(p,i)},YC=(e,t)=>{let n=e.filter(e=>e.status===`success`),r=e.filter(e=>e.status===`skipped-dirty`),i=e.filter(e=>e.status===`skipped-nochange`),a=e.filter(e=>e.status===`failed`);$(`${_C.BLUE}═══ 处理结果 ═══${_C.RESET}`);let o=t?`将提交`:`已提交`;$(`${_C.GREEN}✓ ${o}: ${n.length}${_C.RESET}`);for(let e of n){let t=e.changes.map(e=>`${e.name.split(`/`).pop()}: ${e.from} → ${e.to}`).join(`, `);$(` ${e.name}`),$(` ${t}`),e.skippedFiles!==void 0&&e.skippedFiles.length>0&&$(` ⚠ 脏文件跳过:${e.skippedFiles.join(`,`)}`)}if(r.length>0){$(``),$(`${_C.YELLOW}⚠ 跳过(文件已改动): ${r.length}${_C.RESET}`);for(let e of r)$(` ${e.name}: ${e.reason}`)}if(i.length>0&&($(``),$(`跳过(无匹配/已是目标版本): ${i.length}`)),a.length>0){$(``),$(`${_C.RED}✗ 失败(需人工介入): ${a.length}${_C.RESET}`);for(let e of a)$(` ${e.name}: ${e.reason}`),$(` ${e.changes.map(e=>`${e.name.split(`/`).pop()}: ${e.from} → ${e.to}`).join(`, `)}`)}$(``),$(`${_C.BLUE}汇总: ${n.length} ${o} / ${r.length} 跳过(dirty) / ${i.length} 跳过(无变更) / ${a.length} 失败${_C.RESET}`),!t&&n.length>0&&($(``),$(`下一步:推送到远程`),$(` bun push-all`)),a.length>0&&(process.exitCode=1)},XC=Ac([`default`,`major`,`minor`,`patch`,`latest`,`newest`]).default(`default`),ZC=async e=>{let t=(await bC()).upgrade??{},n=e.mode||t.mode||`default`,r=XC.safeParse(n),i=r.success?r.data:`default`,a=[...e.scope?[`${e.scope}/*`]:[],...t.include??[]],{packages:o}=await NS({cwd:process.cwd(),mode:i,write:!e.dryRun&&e.write,recursive:t.recursive??!0,timeout:t.timeout??3e4,retries:t.retries??3,exclude:t.exclude??[],include:a,depFields:t.depFields,ignorePaths:t.ignorePaths??[],concurrency:t.concurrency??10,force:!1,all:!1,install:!1,update:!1,interactive:!1,group:!0,includeLocked:!1,timediff:!0,nodecompat:!0,loglevel:`info`,silent:!1,failOnOutdated:!1},{afterPackagesLoaded:e=>{$(`扫描到 ${e.length} 个包,正在检查依赖更新...`)},beforePackageStart:e=>{$(`正在检查 ${e.name||e.relative}...`)},afterPackageEnd:e=>{let t=e.resolved.filter(e=>e.update).length;$(t>0?` ✓ ${e.name||e.relative}: 发现 ${t} 个可更新依赖`:` ✓ ${e.name||e.relative}: 所有依赖已是最新`)},afterPackageWrite:e=>{$(` 📝 已写入 ${e.name||e.relative}`)}}),s=0;$(`
327
- --- 检查结果 ---`);for(let e of o){let t=e.resolved.filter(e=>e.update);if(t.length>0){s+=t.length,$(`\n${e.name||e.relative}:`);for(let e of t){let t=e.diff??``;$(` ${e.name}: ${e.currentVersion} -> ${e.targetVersion} (${t})`)}}}s===0?$(`所有依赖已是最新版本`):($(`\n共发现 ${s} 个可更新依赖`),e.write?$(`已写入 package.json`):$(`使用 --write 参数写入 package.json`))};function QC(e){qd(e,{name:`upgrade`,description:`检查依赖版本更新`,arguments:[{signature:`[mode]`,description:`升级模式(major/minor/patch/latest/newest)`},{signature:`[scope]`,description:`可选。仅升级指定 scope 下的依赖(如 @longzai-intelligence-oxlint),内部展开为 include @scope/*`}],options:[{flags:`--write`,description:`将更新写入 package.json`},{flags:`--dry-run`,description:`仅预览`}],schema:bc({write:uc().optional(),dryRun:uc().optional()}),action:async(e,t)=>{let n=t[0],r=t[1];await ZC({mode:n,write:e.write===!0,dryRun:e.dryRun===!0,scope:r})}}),qd(e,{name:`upgrade-across`,description:`跨产品群批量升级依赖(读 lzi-architecture.yaml)`,options:[{flags:`--scope <scope>`,description:`依赖 scope(必填,如 @longzai-intelligence-builder)`},{flags:`--target <version>`,description:`目标版本号(可选,如 ^0.0.8。省略时自动取每个匹配包的 npm latest)`},{flags:`-m, --message <message>`,description:`自定义提交信息`},{flags:`--project-scope <id>`,description:`显式圈定项目范围(缺省自动取当前 edition 范围)`},{flags:`--concurrency <n>`,description:`并发数(默认 10)`},{flags:`--dry-run`,description:`仅预览(不写文件、不提交)`}],schema:bc({scope:Fs().optional(),target:Fs().optional(),message:Fs().optional(),config:Fs().optional(),concurrency:ol().int().positive().optional(),projectScope:Fs().optional(),dryRun:uc().optional()}),action:async e=>{e.scope||(process.stderr.write(`错误: upgrade-across 需要指定 --scope <@scope>
320
+ `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=l(c(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=l(c(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}}})),Mb=/* @__PURE__ */ n((e=>{var t=wb(),n=sb(),r=cb(),i=My(),a=Q(),o=Ab(),s=jb();function c(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new o.LineCounter||null,prettyErrors:t}}function l(e,n={}){let{lineCounter:i,prettyErrors:a}=c(n),o=new s.Parser(i?.addNewLine),l=new t.Composer(n),u=Array.from(l.compose(o.parse(e)));if(a&&i)for(let t of u)t.errors.forEach(r.prettifyError(e,i)),t.warnings.forEach(r.prettifyError(e,i));return u.length>0?u:Object.assign([],{empty:!0},l.streamInfo())}function u(e,n={}){let{lineCounter:i,prettyErrors:a}=c(n),o=new s.Parser(i?.addNewLine),l=new t.Composer(n),u=null;for(let t of l.compose(o.parse(e),!0,e.length))if(!u)u=t;else if(u.options.logLevel!==`silent`){u.errors.push(new r.YAMLParseError(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return a&&i&&(u.errors.forEach(r.prettifyError(e,i)),u.warnings.forEach(r.prettifyError(e,i))),u}function d(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let a=u(e,n);if(!a)return null;if(a.warnings.forEach(e=>i.warn(a.options.logLevel,e)),a.errors.length>0){if(a.options.logLevel!==`silent`)throw a.errors[0];a.errors=[]}return a.toJS(Object.assign({reviver:r},n))}function f(e,t,r){let i=null;if(typeof t==`function`||Array.isArray(t)?i=t:r===void 0&&t&&(r=t),typeof r==`string`&&(r=r.length),typeof r==`number`){let e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=r??t??{};if(!e)return}return a.isDocument(e)&&!i?e.toString(r):new n.Document(e,i,r).toString(r)}e.parse=d,e.parseAllDocuments=l,e.parseDocument=u,e.stringify=f})),Nb=(/* @__PURE__ */ n((e=>{var t=wb(),n=sb(),r=ab(),i=cb(),a=Cy(),o=Q(),s=Fy(),c=wy(),l=Ly(),u=zy();Ob();var d=kb(),f=Ab(),p=jb(),m=Mb(),h=_y();e.Composer=t.Composer,e.Document=n.Document,e.Schema=r.Schema,e.YAMLError=i.YAMLError,e.YAMLParseError=i.YAMLParseError,e.YAMLWarning=i.YAMLWarning,e.Alias=a.Alias,e.isAlias=o.isAlias,e.isCollection=o.isCollection,e.isDocument=o.isDocument,e.isMap=o.isMap,e.isNode=o.isNode,e.isPair=o.isPair,e.isScalar=o.isScalar,e.isSeq=o.isSeq,e.Pair=s.Pair,e.Scalar=c.Scalar,e.YAMLMap=l.YAMLMap,e.YAMLSeq=u.YAMLSeq,e.Lexer=d.Lexer,e.LineCounter=f.LineCounter,e.Parser=p.Parser,e.parse=m.parse,e.parseAllDocuments=m.parseAllDocuments,e.parseDocument=m.parseDocument,e.stringify=m.stringify,e.visit=h.visit,e.visitAsync=h.visitAsync})))();function Pb(e){let t=(0,Nb.parseDocument)(e),n=!1;function r(r){e=r,t=(0,Nb.parseDocument)(e),n=!1}function i(e,r){let i=e.length===1?t.contents:t.getIn(e.slice(0,-1));i||(i=t.createNode({}),t.setIn(e.slice(0,-1),i));let a=e[e.length-1],o=i.items.find(e=>typeof e.key==`string`?e.key===a:e.key.value===a),s=i.items.map(e=>typeof e.key==`string`?e.key:String(e.key.value));if(!o){let e=0;for(;e<s.length&&!(s[e].localeCompare(a)>0);e++);o=new Nb.Pair(a,r),i.items.splice(e,0,o),n=!0}else if((0,Nb.isAlias)(o.value)){let e=Fb(t,o.value);e&&e.value!==r&&(e.value=r,n=!0)}else!o.value||typeof o.value==`string`?o.value!==r&&(o.value=r,n=!0):o.value.value!==r&&(o.value.value=r,n=!0)}function a(e,n,r){let i=t.toJSON()||{},a=e==="default"?i.catalog?.[n]:i.catalogs?.[e]?.[n];if(a===r)return{conflicts:!1,newCatalogName:e,existingSpecifier:a};if(a){let t=Ib(r);return{conflicts:!0,existingSpecifier:a,newCatalogName:e==="default"?`conflicts_${n}_${t}`:`conflicts_${e}_${t}`}}return{conflicts:!1,newCatalogName:e}}function o(e,t,n){let{newCatalogName:r}=a(e,t,n);s(r,t,n)}function s(e,n,r){let a=t.toJSON()?.catalogs?.default!==void 0;i(e==="default"&&!a?[`catalog`,n]:[`catalogs`,e,n],r)}function c(e){let n=[],r=t.toJSON()||{};if(r.catalogs)for(let t of Object.keys(r.catalogs))r.catalogs[t]?.[e]&&n.push(t);return r.catalog&&r.catalog[e]&&n.push(`default`),n}return{getDocument(){return t},setContent:r,hasChanged:()=>n,toJSON:()=>t.toJSON(),toString:n=>{let r=e.split(`'`).length>=e.split(`"`).length;return t.toString({singleQuote:r,...n})},setPath:i,setPackage:s,setPackageNoConflicts:o,getPackageCatalogs:c,hasSpecifierConflicts:a}}function Fb(e,t){let n;return(0,Nb.visit)(e,{Scalar:(e,r,i)=>{r.anchor===t.source&&typeof r.value==`string`&&(n=r)}}),n}function Ib(e){return e.replace(/\^/g,`h`).replace(/~/g,`t`).replace(/\./g,`_`).replace(/</g,`l`).replace(/>/g,`g`).replace(/=/g,`e`).replace(/\*/g,`s`).replace(/@/g,`a`).replace(/\|/g,`p`).replace(/&/g,`n`).replace(/-/g,`m`).replace(/\+/g,`u`).replace(/\s/g,`_`)}function Lb(e){return e??=[],Array.isArray(e)?e:[e]}function Rb(e){return typeof e==`object`&&!!e&&`json`in e&&typeof e.json==`function`}function zb(e){if(Rb(e))return e.json();throw TypeError(`response does not implement json()`)}const Bb=3e4,Vb=`version-upgrade@npm node/${F.version}`,Hb=Object.assign((e,t)=>{let n=new Headers(t?.headers);return n.set(`user-agent`,Vb),cv(e,{...t,headers:n})},{preconnect:()=>{}});async function Ub(e,t,n,r){let i;for(let a=0;a<=r;a++)try{return await Promise.race([e(),new Promise((e,i)=>setTimeout(()=>i(/* @__PURE__ */ Error(`Timeout requesting "${t}" (attempt ${a+1}/${r+1})`)),n))])}catch(e){if(i=e instanceof Error?e:Error(String(e)),a<r){let e=Math.min(1e3*2**a,1e4);await new Promise(t=>setTimeout(t,e))}}throw i??Error(`Unexpected state: all retries exhausted for "${t}" but no error captured`)}async function Wb(e,t=!1,n,r=Bb,i=3){let a=await Ub(()=>Qg(e,{cwd:n,force:t,fetch:Hb,metadata:!0,throw:!1}),e,r,i);if(!qb(a))throw Error(`Invalid package metadata received for "${e}"`);let o=a;if(`error`in o)throw Error(`Failed to fetch package "${e}": ${o.error}`);return Kb(o)}async function Gb(e,t=Bb,n=3){let r=await Ub(()=>Hb(new URL(`${e}/meta.json`,`https://jsr.io/`),{headers:{accept:`application/json`}}).then(e=>zb(e)),e,t,n);if(!Jb(r))throw Error(`Invalid JSR package metadata received for "${e}"`);let i=r;return{versions:Object.keys(i.versions),tags:{latest:i.latest}}}function Kb(e){let t=Object.keys(e.versionsMeta),n=Object.fromEntries(Object.entries(e.versionsMeta).flatMap(([e,t])=>t.deprecated==null?[]:[[e,t.deprecated]])),r=Object.fromEntries(Object.entries(e.versionsMeta).map(([e,t])=>[e,t.engines?.node]).filter(([,e])=>e)),i=Object.fromEntries(Object.entries(e.versionsMeta).map(([e,t])=>[e,t.provenance]).filter(([,e])=>e)),a=Object.fromEntries(Object.entries(e.versionsMeta).map(([e,t])=>[e,t.integrity]).filter(([,e])=>e));return{tags:e.distTags,versions:t,time:{...Object.fromEntries(Object.entries(e.versionsMeta).filter(([,e])=>e.time).map(([e,t])=>[e,t.time])),created:e.timeCreated,modified:e.timeModified},nodeSemver:r,provenance:i,deprecated:Object.keys(n).length>0?n:void 0,integrity:a}}function qb(e){return typeof e==`object`&&!!e&&`versionsMeta`in e&&`distTags`in e}function Jb(e){return typeof e==`object`&&!!e&&`scope`in e&&`name`in e&&`latest`in e&&`versions`in e}let Yb=null;const Xb=()=>(Yb===null&&(Yb=md(`packages/version-upgrade/src/io/cache`)),Yb),Zb=(0,dm.default)(`version-upgrade:cache`);let Qb={},$b=!1;const ex=sm(s.tmpdir(),`version-upgrade`),tx=sm(ex,`cache.json`),nx=18e5;function rx(){return Date.now()}function ix(e){return rx()-e}async function ax(){E(tx)&&ix(D(tx).mtimeMs)<nx?(Zb(`cache loaded from ${tx}`),Qb=JSON.parse(await O.readFile(tx,`utf-8`))):Zb(`no cache found`)}async function ox(){if($b)try{await O.mkdir(ex,{recursive:!0}),await O.writeFile(tx,JSON.stringify(Qb),`utf-8`),Zb(`cache saved to ${tx}`)}catch(e){Xb().error(`Failed to save cache`,e instanceof Error?e:Error(String(e)))}}async function sx(e,t=`npm`,n,r,i){let a,o=`${t}:${e}`;if(Qb[o]){if(ix(Qb[o].cacheTime)<nx)return Zb(`cache hit for ${o}`),Qb[o].data;delete Qb[o]}try{let a=t===`jsr`?await Gb(e,r,i):await Wb(e,!1,n,r,i);if(a)return Qb[o]={data:a,cacheTime:rx()},$b=!0,a}catch(e){a=e}return{tags:{},versions:[],error:a instanceof Error&&a.message||String(a),deprecated:{}}}const cx=[`**/node_modules/**`,`**/dist/**`,`**/public/**`,`**/fixture/**`,`**/fixtures/**`];function lx(e,t=[]){if(!e)return{};let n={};for(let[r,i]of Object.entries(e))if(typeof i==`object`&&i){let e={};for(let[t,n]of Object.entries(i))e[t]=n;n={...n,...lx(e,[...t,r])}}else typeof i==`string`&&(n[r]={version:i,parents:t});return n}function ux(e,t){let n=t.split(`.`).reduce((e,t)=>{if(typeof e==`object`&&e){let n={};for(let[t,r]of Object.entries(e))n[t]=r;return n[t]}},e);if(typeof n==`object`&&n){let e={};for(let[t,r]of Object.entries(n))e[t]=r;return lx(e)}return{}}function dx(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=r;return t}return{}}function fx(e,t,n){let r=t.split(`.`),i=r.pop();if(i===void 0)return;let a=e;for(let e of r){(typeof a[e]!=`object`||a[e]===null)&&(a[e]={});let t=dx(a[e]);a[e]=t,a=t}a[i]=n}function px(e,t,n){return Object.entries(ux(e,t)||{}).map(([e,{version:r,parents:i}])=>mx({name:e,version:r,type:t,shouldUpdate:n,parents:i}))}function mx({name:e,version:t,type:n,shouldUpdate:r,parents:i,hexHash:a}){let o={name:e,currentVersion:t,parents:i,source:n,update:r(e)};return a&&(o.hexHash=a),o}function hx(e,t){let n={};return e.filter(e=>e.source===t).sort((e,t)=>(e.aliasName||e.name).localeCompare(t.aliasName||t.name)).forEach(e=>{let t=e.update?e.targetVersion:e.currentVersion,r=n;if(e.parents&&e.parents.length>0){let t=n;for(let n of e.parents){(typeof t[n]!=`object`||t[n]===null)&&(t[n]={});let e=dx(t[n]);t[n]=e,t=e}r=t}if(e.aliasName===void 0)r[e.name]=t;else{let n=e.protocol?`${e.protocol}:`:``;r[e.aliasName]=`${n}${e.protocol===`jsr`?t:gx(e,t)}`}}),n}function gx(e,t){let n=t?`@${t}`:``;return`${e.name}${n}`}async function _x(e,t,n,r){let i=sm(t.cwd??``,e),a=r??JSON.parse(await ce(i,`utf-8`)),o=[];function s(t,r){let o=Object.entries(r).map(([e,t])=>mx({name:e,version:t,type:`bun-workspace`,shouldUpdate:n}));return{name:t,private:!0,version:``,type:`bun-workspace`,relative:e,filepath:i,raw:a,deps:o,resolved:[]}}let c=a?.workspaces;if(c&&typeof c==`object`){let e=bx(c);if(e.catalog&&typeof e.catalog==`object`&&o.push(s(`bun-catalog:default`,xx(e.catalog))),e.catalogs&&typeof e.catalogs==`object`){let t=Sx(e.catalogs);for(let e of Object.keys(t)){let n=t[e];n&&o.push(s(`bun-catalog:${e}`,n))}}}return o}async function vx(e,t){let n=hx(e.resolved,`bun-workspace`);if(Object.keys(n).length&&e.name.startsWith(`bun-catalog:`)){let t=e.name.replace(`bun-catalog:`,``),r=bx(e.raw.workspaces??{});if(e.raw.workspaces=r,t==="default")r.catalog={...xx(r.catalog??{}),...xx(n)};else{let e=Sx(r.catalogs??{});r.catalogs=e,e[t]||(e[t]={}),e[t]={...e[t],...xx(n)}}await yx(e.filepath,e.raw)}}async function yx(e,t){let n;try{n=_v(await ce(e,`utf-8`)).indent}catch{}let r=JSON.stringify(t,null,n||` `);await R(e,`${r}\n`,`utf-8`)}function bx(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=r;return t}return{}}function xx(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}return{}}function Sx(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))if(typeof r==`object`&&r&&!Array.isArray(r)){let e={};for(let[t,n]of Object.entries(r))typeof n==`string`&&(e[t]=n);t[n]=e}return t}return{}}let Cx=null;const wx=()=>(Cx===null&&(Cx=md(`packages/version-upgrade/src/addons/vscode`)),Cx);function Tx(e,t){if(typeof e==`object`&&e){for(let[n,r]of Object.entries(e))if(n===t&&typeof r==`string`)return r}}function Ex(e){if(e==null)return!1;let t=e.engines;return Tx(t,`vscode`)!==void 0}function Dx(e){for(let t of[`dependencies`,`devDependencies`,`peerDependencies`]){let n=Tx(e[t],`@types/vscode`);if(n!==void 0)return n}return``}const Ox=[{beforeWrite(e){if(!Ex(e.raw)||e.raw==null)return;let t=e.raw,n=Dx(t);if(!n||n.includes(`:`))return;let r=t.engines,i=Tx(r,`vscode`);if(!i)return;let a=hy(i),o=hy(n);if(a&&o&&Rv(o,a)){wx().info(`[taze addon] Updated VS Code engine field to ${n}`);let e=/[>^<:~]/.test(n)?n:`^${n}`;if(typeof r==`object`&&r){let n={};for(let[t,i]of Object.entries(r))n[t]=t===`vscode`?e:i;t.engines=n}}}}];function kx(e){return I.from(e.slice(7),`base64`).toString(`hex`)}function Ax(e){return typeof e==`object`&&!!e&&`version`in e&&typeof e.version==`string`}const jx=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`,`packageManager`,`pnpm.overrides`,`resolutions`,`overrides`];function Mx(e,t){return t.depFields?.[e]===!1?!1:e!==`peerDependencies`||!!t.peer}async function Nx(e,t,n,r){let i=sm(t.cwd??``,e),a=r??await Qx(i),o=[];for(let e of jx)if(Mx(e,t)){if(e===`packageManager`){let e=a.packageManager;if(typeof e==`string`){let t=e.indexOf(`@`),r=t>0?e.slice(0,t):``,i=t>0?e.slice(t+1):``,a=i.indexOf(`+`),s=a>=0?i.slice(0,a):i,c=a>=0?i.slice(a+1):``,l=c.indexOf(`.`),u=l>=0?c.slice(l+1):void 0;o.push(mx({name:r,version:`^${s}`,type:`packageManager`,shouldUpdate:n,hexHash:u}))}}else o.push(...px(a,e,n))}let s=typeof a.name==`string`?a.name:``,c=typeof a.version==`string`?a.version:``;return[{name:s,private:!!a.private,version:c,type:`package.json`,relative:e,filepath:i,raw:a,deps:o,resolved:[]}]}async function Px(e,t){let n=!1;for(let r of jx)if(Mx(r,t)){if(r===`packageManager`){let t=Object.entries(hx(e.resolved,`packageManager`))[0];if(t){e.raw||={};let[r,i]=t,a=typeof i==`string`?i.replace(`^`,``):String(i),o=`${r}@${a}`,s=e.resolved.find(e=>e.source===`packageManager`&&e.name===r);if(s?.hexHash){let e=s.pkgData?.integrity?.[a];if(e){let t=kx(e);o=`${o}+sha512.${t}`}}e.raw.packageManager=o,n=!0}}else{let t=ux(e.raw,r),i=hx(e.resolved,r),a={};for(let[e,n]of Object.entries(t||{}))Ax(n)&&(a[e]=n.version);for(let[e,t]of Object.entries(i||{}))a[e]=t;Object.keys(a).length>0&&(fx(e.raw,r,a),n=!0)}}if(n){for(let n of t.addons||Ox)await n.beforeWrite?.(e,t);await $x(e.filepath,e.raw||{})}}const Fx=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`,`packageManager`,`pnpm.overrides`,`resolutions`,`overrides`];function Ix(e,t){return e===`peerDependencies`?!!t.peer:t.depFields?.[e]!==!1}async function Lx(e){let t=await se.readFile(e,`utf-8`);if(!t)return new Nb.Document({});let n=(0,Nb.parseDocument)(t,{merge:!0}),r=n.toJS();if(n.errors.length||typeof r!=`object`||Array.isArray(r))throw TypeError(`Invalid package.yaml structure in ${e}`);return n}async function Rx(e,t){let{amount:n,type:r}=await se.readFile(e,`utf-8`).then(_v).catch(()=>({amount:2,type:`space`})),i=(0,Nb.stringify)(t,{indent:(r===`tab`?2:n)??2,aliasDuplicateObjects:!1,lineWidth:0}).replace(/^(\s*)"(@[^":]+)":/gm,`$1'$2':`);await se.writeFile(e,i,`utf-8`)}async function zx(e,t,n){let r=sm(t.cwd??``,e),i=await Lx(r),a=[];for(let e of Fx)if(Ix(e,t)){if(e===`packageManager`){let t=i.get(e);if(typeof t==`string`){let e=t.split(`@`),r=e[0]??``,i=(e[1]??``).split(`+`)[0];a.push(mx({name:r,version:`^${i??``}`,type:`packageManager`,shouldUpdate:n}))}}else{let t={},r=i.toJS();if(typeof r==`object`&&r&&!Array.isArray(r))for(let[e,n]of Object.entries(r))t[e]=n;a.push(...px(t,e,n))}}let o=i.get(`name`),s=i.get(`version`);return[{name:typeof o==`string`?o:``,private:!!i.get(`private`),version:typeof s==`string`?s:``,type:`package.yaml`,relative:e,filepath:r,get raw(){return i.toJS()},deps:a,yamlDocument:i,resolved:[]}]}async function Bx(e,t){let n=!1;if(e.type!==`package.yaml`)throw Error(`Package type is not supported`);let r=e.yamlDocument||new Nb.Document(e.raw);for(let i of Fx)if(Ix(i,t)){if(i===`packageManager`){let t=Object.entries(hx(e.resolved,`packageManager`))[0];if(t){let[e,i]=t,a=typeof i==`string`?i.replace(`^`,``):``;r.set(`packageManager`,`${e}@${a}`),n=!0}}else{let t=ux(Vx(r),i);t&&Object.keys(t).length>0&&(Object.entries(hx(e.resolved,i)).forEach(([e,t])=>r.setIn([...i.split(`.`),e],t)),n=!0)}}if(n){for(let n of t.addons||Ox)await n.beforeWrite?.(e,t);await Rx(e.filepath,r)}}function Vx(e){let t=e.toJS();if(typeof t==`object`&&t&&!Array.isArray(t)){let e={};for(let[n,r]of Object.entries(t))e[n]=r;return e}return{}}async function Hx(e,t,n){let r=sm(t.cwd??``,e),i=Pb(await ce(r,`utf-8`)),a=i.getDocument().toJSON(),o=[];function s(t,o){let s=Object.entries(o).map(([e,t])=>mx({name:e,version:t,type:`pnpm-workspace`,shouldUpdate:n}));return{name:t,private:!0,version:``,type:`pnpm-workspace.yaml`,relative:e,filepath:r,raw:a,context:i,deps:s,resolved:[]}}if(a?.catalog&&o.push(s(`pnpm-catalog:default`,a.catalog)),a?.catalogs)for(let e of Object.keys(a.catalogs))o.push(s(`pnpm-catalog:${e}`,a.catalogs[e]));return a?.overrides&&o.push(s(`pnpm-workspace:overrides`,a.overrides)),o}async function Ux(e,t){let n=hx(e.resolved,`pnpm-workspace`);if(Object.keys(n).length){if(e.name.startsWith(`pnpm-catalog:`)){let t=e.name.replace(`pnpm-catalog:`,``);for(let[r,i]of Object.entries(n))typeof i==`string`&&e.context.setPackage(t,r,i)}else{let t=e.name.replace(`pnpm-workspace:`,``).split(/\./g);for(let[r,i]of Object.entries(n))e.context.setPath([...t,r],i)}e.context.hasChanged()&&await Wx(e,e.context)}}function Wx(e,t){return R(e.filepath,t.toString(),`utf8`)}async function Gx(e,t,n){let r=sm(t.cwd??``,e),i=Pb(await ce(r,`utf-8`)),a=i.getDocument().toJSON(),o=[];function s(t,o){let s=Object.entries(o).map(([e,t])=>mx({name:e,version:t,type:`yarn-workspace`,shouldUpdate:n}));return{name:t,private:!0,version:``,type:`.yarnrc.yml`,relative:e,filepath:r,raw:a,context:i,deps:s,resolved:[]}}if(a?.catalog&&o.push(s(`yarn-catalog:default`,a.catalog)),a?.catalogs)for(let e of Object.keys(a.catalogs))o.push(s(`yarn-catalog:${e}`,a.catalogs[e]));return o}async function Kx(e,t){let n=hx(e.resolved,`yarn-workspace`);if(Object.keys(n).length){if(e.name.startsWith(`yarn-catalog:`)){let t=e.name.replace(`yarn-catalog:`,``);for(let[r,i]of Object.entries(n))typeof i==`string`&&e.context.setPackage(t,r,i)}else{let t=e.name.replace(`yarn-workspace:`,``).split(/\./g);for(let[r,i]of Object.entries(n))e.context.setPath([...t,r],i)}e.context.hasChanged()&&await qx(e,e.context)}}function qx(e,t){return R(e.filepath,t.toString(),`utf8`)}function Jx(e){return e.replace(/[.+?^${}()|[\]\\]/g,`\\$&`)}function Yx(e){if(e.startsWith(`/`)){let t=e.lastIndexOf(`/`),n=e.substring(1,t),r=e.substring(t+1,e.length);return new RegExp(n,r)}return RegExp(`^${Jx(e).replace(/\*+/g,`.*?`)}$`)}function Xx(e,t=!0){if(!e||e.length===0)return()=>t;let n=Lb(e).flatMap(e=>e.split(`,`)).map(Yx);return e=>{for(let t of n)if(t.test(e))return!0;return!1}}function Zx(e,t){let n=Xx(e,!0),r=Xx(t,!1);return e=>!r(e)&&n(e)}async function Qx(e){return JSON.parse(await O.readFile(e,`utf-8`))}async function $x(e,t){let n=_v(await O.readFile(e,`utf-8`)).indent||` `;await O.writeFile(e,`${JSON.stringify(t,null,n)}\n`,`utf-8`)}async function eS(e,t){switch(e.type){case`package.json`:return Px(e,t);case`package.yaml`:return Bx(e,t);case`pnpm-workspace.yaml`:return Ux(e,t);case`bun-workspace`:return vx(e,t);case`.yarnrc.yml`:return Kx(e,t);default:throw Error(`Unsupported package type: ${e.type}`)}}async function tS(e,t,n){if(e.endsWith(`pnpm-workspace.yaml`))return Hx(e,t,n);if(e.endsWith(`.yarnrc.yml`))return Gx(e,t,n);if(e.endsWith(`package.yaml`))return zx(e,t,n);if(e.endsWith(`package.json`)){let r=sm(t.cwd??``,e);try{let i=await Qx(r),a=i?.workspaces;if(a&&typeof a==`object`&&(`catalog`in a||`catalogs`in a)){let r=sm(t.cwd||F.cwd());if(E(am(r,`bun.lockb`))||E(am(r,`bun.lock`))){let r=await _x(e,t,n,i),a=await Nx(e,t,n,i);return[...r,...a]}}return Nx(e,t,n,i)}catch{}}return Nx(e,t,n)}async function nS(e){let t=[],n=sm(e.cwd||F.cwd()),r=Zx(e.include,e.exclude);if(e.recursive){let n=await Pp(`**/package.yaml`,{ignore:cx.concat(e.ignorePaths||[]),cwd:e.cwd,onlyFiles:!0,dot:!1,expandDirectories:!1}),r=await Pp(`**/package.json`,{ignore:cx.concat(e.ignorePaths||[]),cwd:e.cwd,onlyFiles:!0,dot:!1,expandDirectories:!1}),i=/* @__PURE__ */ new Set;for(let e of n){t.push(e);let n=um(e);i.add(n)}for(let e of r){let n=um(e);i.has(n)||t.push(e)}}else t=await Pp(`package.{yaml,json}`,{cwd:n});return t=t.sort((e,t)=>e.localeCompare(t)),e.ignoreOtherWorkspaces&&(t=(await Promise.all(t.map(async e=>{if(!e.includes(`/`))return[e];let t=am(n,e),r=bv(`.git`,{cwd:t,last:n});if(r&&um(r)!==n)return[];let i=bv(`pnpm-workspace.yaml`,{cwd:t,last:n});if(i&&um(i)!==n)return[];let a=bv(`.yarnrc.yml`,{cwd:t,last:n});if(a&&um(a)!==n)return[];let o=bv(`bun.lockb`,{cwd:t,last:n})||bv(`bun.lock`,{cwd:t,last:n});return o&&um(o)!==n?[]:[e]}))).flat()),E(am(n,`pnpm-workspace.yaml`))&&t.unshift(`pnpm-workspace.yaml`),E(am(n,`.yarnrc.yml`))&&t.unshift(`.yarnrc.yml`),(await Promise.all(t.map(t=>tS(t,e,r)))).flat()}const rS={error:-1,major:0,minor:1,patch:2,"":3};function iS(e){return e.sort((e,t)=>rS[e.diff||``]-rS[t.diff||``])}function aS(e,t){if(t.packageMode){for(let n of Object.keys(t.packageMode))if(Yx(n).test(e))return t.packageMode[n]}}function oS(e,t){let n=[];for(let r of Lb(t.maturityPeriodExclude).flatMap(e=>e.split(`,`))){let t=r.trim();if(!t)continue;let i=t.startsWith(`/`)?-1:t.lastIndexOf(`@`);if(!Yx(i>0?t.slice(0,i):t).test(e))continue;if(i<=0)return!0;let a=t.slice(i+1).split(`||`).map(e=>e.trim()).filter(Boolean);n.push(...a)}return n}function sS(e,t){for(let n of t)if(my(e,n,{includePrerelease:!0}))return!0;return!1}const cS=new P;function lS(e){return e.match(/(@[^/]+\/)?([^/]+)/g)||[]}function uS(e){return e.match(/[^>]+/g)||[]}function dS(e){return/^(?:https?:|git\+|github:)/.test(e)}function fS(e){return/^(?:link|file|workspace|catalog):/.test(e)}function pS(e){return/^(?:npm|jsr):/.test(e)}function mS(e){return e===`npm`?`npm`:e===`jsr`?`jsr`:`npm`}function hS(e){let t=e.indexOf(`:`),n=mS(e.slice(0,t)),r=e.slice(t+1);if(n===`npm`){let e=r.lastIndexOf(`@`);return e>0?{protocol:n,name:r.substring(0,e),version:r.substring(e+1)}:{protocol:n,name:r,version:``}}return{protocol:n,name:``,version:r}}function gS(e){let t=[`>=`,`<=`,`>`,`<`,`~`,`^`],n=e.trim();if(n===`*`||n===``)return`*`;if(n[0]===`~`||n[0]===`^`)return n[0];for(let e of t)if(n.startsWith(e))return e;if(n.includes(`x`)){let e=n.split(`.`);if(e[0]===`x`)return`*`;if(e[1]===`x`)return`^`;if(e[2]===`x`)return`~`}return n.length>0&&n.charCodeAt(0)>=48&&n.charCodeAt(0)<=57?``:null}function _S(e,t){if(!gy(e))return null;if(t==="default")return e;let n=hy(e);return n?{major:`>=`,minor:`^`,patch:`~`}[t]+n:null}function vS(e,t){return e==null||t==null?null:t===`*`?`*`:t+e}function yS(e,t){return vS(t,gS(e))}function bS(e,t,n,r){let i=null;if(n===`latest`){let t=r.latest;i=t!=null&&e.includes(t)?t:e.at(-1)??null}else if(n===`newest`)i=e.at(-1)??null;else if(n===`next`){let t=r.next;i=t!=null&&e.includes(t)?t:e.at(-1)??null}else if(n===`stable`){let n=_S(t,`default`);if(!n)return;e.filter(e=>!e.includes(`-`)).forEach(e=>{my(e,n)&&(!i||Rv(e,i))&&(i=e)})}else if(n==="default"&&(t===`*`||t.trim()===``))return;else{let a=_S(t,n);if(!a)throw Error(`invalid_range`);let o=r.latest??null;o&&!my(o,a)&&(o=null),e.forEach(e=>{my(e,a)&&(o&&!Vv(e,o)||i&&!Rv(e,i)||(i=e))})}if(i)return i}function xS(e,t){return e.filter(e=>!t[e])}function SS(e,t,n){if(!t||n<=0)return e;let r=/* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).getTime()-n*24*60*60*1e3);return e.filter(e=>{let n=t[e];return!n||new Date(n)<r})}function CS(e,t,n){let{tags:r}=e.pkgData,i=wS(e,n);if(i.length!==0)return e.filteredVersions=i,bS(i,e.currentVersion,t,r)}function wS(e,t){let{versions:n,deprecated:r,time:i}=e.pkgData,a=n;r&&Object.keys(r).length>0&&(a=xS(a,r));let o=oS(e.name,t);if(t.maturityPeriod&&t.maturityPeriod>0&&o!==!0){let e=a;if(a=SS(e,i,t.maturityPeriod),o.length>0){let t=new Set(a);a=e.filter(e=>t.has(e)||sS(e,o))}}return a}function TS(e,t,n){let r=CS(e,`latest`,n);return r&&Rv(r,t)?r:void 0}function ES(e,t,n=!0,r=!1){let i=/^\d+/.test(e.currentVersion);if(i&&!r)e.targetVersion=e.currentVersion,e.targetVersionTime=e.currentVersionTime,e.diff=null,e.update=!1;else{if(e.targetVersion=yS(e.currentVersion,t)||e.currentVersion,e.targetVersionTime=e.pkgData.time?.[t],e.currentProvenance=e.pkgData.provenance?.[e.currentVersion],e.targetProvenance=e.pkgData.provenance?.[e.targetVersion],e.provenanceDowngraded=!(!e.currentProvenance||e.targetProvenance)||e.currentProvenance===`trustedPublisher`&&e.targetProvenance===!0,i&&Lv(e.currentVersion,e.targetVersion)){let{versions:t,time:n={},tags:r}=e.pkgData,i=bS(e.filteredVersions??t,e.currentVersion,`minor`,r);i&&(e.targetVersion=i,e.targetVersionTime=n[e.targetVersion])}try{let t=hy(e.currentVersion),n=hy(e.targetVersion);if(!t||!n)throw Error(`invalid_version`);e.currentVersionTime=e.pkgData.time?.[t.toString()],e.diff=DS(t,n),e.update=e.diff!==null&&Bv(t,n)}catch(t){if(!n)throw t;e.targetVersion=e.currentVersion,e.diff=`error`,e.update=!1}}}function DS(e,t){if(Lv(e,t))return null;let n=my(t,`~${e}`,{includePrerelease:!0}),r=my(t,`^${e}`,{includePrerelease:!0}),i=my(t,`>=${e}`,{includePrerelease:!0});return n?r?`patch`:`major`:r?`minor`:i?`major`:`error`}function OS(e,t){return{...e,diff:null,targetVersion:e.currentVersion,update:!1,provenanceDowngraded:!1,pkgData:{tags:{},versions:[]},...t}}function kS(e){return e!=null&&e!==`ignore`?e:`default`}async function AS(e,t,n=()=>!0){let r={...e,diff:null,targetVersion:e.currentVersion,update:e.update,provenanceDowngraded:!1,pkgData:{tags:{},versions:[]}},i=aS(r.name,t),a=t.mode,o=i?i===a?a:a==="default"?i:`ignore`:a;if(fS(e.currentVersion)||dS(e.currentVersion)||!e.update||!await Promise.resolve(n(e))||o===`ignore`)return OS(e);if(pS(e.currentVersion)){let{name:t,version:n,protocol:i}=hS(e.currentVersion);if(r.name=t||r.name,r.currentVersion=n,r.aliasName=e.name,r.protocol=i,!n)return OS(e,{name:r.name,currentVersion:n,aliasName:e.name,protocol:i})}let s=r.name;r.source===`resolutions`?s=lS(r.name).pop()??r.name:r.source===`pnpm.overrides`&&(s=uS(r.name).pop()??r.name);let c=await sx(s,r.protocol,t.cwd,t.timeout,t.retries),{error:l,deprecated:u}=c;r.pkgData=c;let d=null,f;if(l==null)try{if(u&&typeof u==`object`&&r.currentVersion&&u[r.currentVersion])return OS(e,{name:r.name,currentVersion:r.currentVersion,aliasName:r.aliasName,protocol:r.protocol});if(f=CS(r,kS(o),t),!f)return OS(e,{name:r.name,currentVersion:r.currentVersion,aliasName:r.aliasName,protocol:r.protocol,pkgData:c})}catch(e){d=e instanceof Error?e.message:String(e)}else d=l;f?ES(r,f,void 0,t.includeLocked):r.targetVersion=r.currentVersion,r.targetVersion===r.currentVersion&&(r.diff=null,r.update=!1);try{let e=hy(f||r.targetVersion||``);e&&(r.latestVersionAvailable=TS(r,e,t));let{nodecompat:n=!0}=t;if(n){let t=F.version,{nodeSemver:n}=r.pkgData;if(n&&e?.version&&e?.version in n){let i=n[e.version];r.nodeCompatibleVersion={compatible:i!=null&&my(t,i),semver:i??``}}}}catch{}return d&&(r.diff=`error`,r.update=!1,r.resolveError=d),r}async function jS(e,t,n=()=>!0,r=()=>{}){let i=e.length,a=0,{concurrency:o=10}=t,s=cS.getStore()||qp(o);return Promise.all(e.map(e=>s.add(async()=>{let o=await AS(e,t,n);return a+=1,r(e.name,a,i),o})))}async function MS(e,t,n,r){let i=await jS(e.deps,t,n,(t,n,i)=>r?.(e.name,t,n,i));return iS(i),e.resolved=i,e}async function NS(e,t={}){e.force||await ax();let n=await nS(e);t.afterPackagesLoaded?.(n);let r=n.filter(e=>e.private).map(e=>e.name).filter(e=>e),i=e=>!r.includes(e.name),a=0,o=(e,n,r,i)=>{a++,t.onDependencyResolved?.(e,n,a,i)},s=qp(e.concurrency||10);return await cS.run(s,()=>Promise.all(n.map(async n=>{t.beforePackageStart?.(n),await PS(n,e,i,{...t,onDependencyResolved:o}),t.afterPackageEnd?.(n)}))),t.afterPackagesEnd?.(n),await ox(),{packages:n}}async function PS(e,t,n=()=>!0,r={}){await MS(e,t,n,r.onDependencyResolved);let{resolved:i}=e,a=i.filter(e=>e.update);return t.write&&a.length&&await Promise.resolve(r.beforePackageWrite?.(e))!==!1&&(await eS(e,t),r.afterPackageWrite?.(e)),e}function FS(e){return{ok:!0,value:e}}function IS(e){return{ok:!1,error:e}}const LS=/^[a-z][a-z0-9-]*$/,RS=[`edition-root`,`customer-root`,`single-repo`],zS=Ac([`high`,`normal`,`low`]),BS=Ac(RS),VS=/\S/,HS=yc({id:U().regex(LS,`范围 id 非法(应为小写字母开头的字母数字连字符)`),kind:BS,remotes:gc(U().regex(VS,`远程位置非法(不得为空串或纯空白)`)).default([]),tags:gc(U().regex(VS,`标签非法(不得为空串或纯空白)`)).default([]),priority:zS.default(`normal`),excludes:gc(U().min(1)).default([]),projectPriorities:Oc(U(),zS).default({})}).check(e=>{e.value.kind===`single-repo`&&(e.value.excludes.length>0&&e.issues.push({code:`custom`,input:e.value,path:[`excludes`],message:`single-repo 范围禁用 excludes(声明的即唯一项目,如需排除请改用 edition-root/customer-root)`}),Object.keys(e.value.projectPriorities).length>0&&e.issues.push({code:`custom`,input:e.value,path:[`projectPriorities`],message:`single-repo 范围禁用 projectPriorities(优先级直接设于 scope 级)`}))}),US=`scopes`,WS=/^[a-z][a-z0-9-]*\.scope\.ts$/;async function GS(e){let t=j(e,US);if(!E(t))return IS({code:`SCOPES_DIR_MISSING`,message:`声明域目录缺失:${t}(应为 project-registry 仓根下 ${US}/,含 *.scope.ts 声明文件)`});let n=A(t).filter(e=>WS.test(e)).sort((e,t)=>e<t?-1:1);if(n.length===0)return IS({code:`SCOPE_REGISTRY_EMPTY`,message:`范围声明域为空:${t}(无 *.scope.ts——范围消失属配置事故,如需清空请显式移除 registryRoot 配置)`});let r=/* @__PURE__ */ new Set,i=[];for(let e of n){let n=j(t,e),a=await import(N(n).href),o=HS.safeParse(a.default);if(!o.success){let e=o.error.issues[0];return IS({code:`SCOPE_DECLARATION_INVALID`,message:`范围声明结构非法:${n}(${e?.path.join(`.`)??``} ${e?.message??``})`})}let s=e.replace(/\.scope\.ts$/,``);if(o.data.id!==s)return IS({code:`SCOPE_ID_MISMATCH`,message:`范围 id 与文件名不一致:${n}(id=${o.data.id},应为 ${s}——命名即身份)`});if(r.has(o.data.id))return IS({code:`SCOPE_ID_CONFLICT`,message:`范围 id 重复:${o.data.id}(声明域内同 id 即同范围,不得重复声明)`});r.add(o.data.id),i.push(o.data)}return FS(i)}const KS=`LZI_PROJECT_REGISTRY_ROOT`,qS=`LZI_PROJECT_MARKDOWN_REGISTRY_ROOT`,JS=`LZI_PROJECT_SCOPE_ROOTS`,YS=`LZI_PROJECT_MARKDOWN_SCOPE_ROOTS`,XS=/^[a-z][a-z0-9-]*=\/\S+$/;function ZS(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e!==``)}function QS(e){let t=/* @__PURE__ */ new Map;for(let n of ZS(e)){if(!XS.test(n))return IS({message:`范围根映射段非法:${n}(应为 id=绝对路径 形态,id 为小写字母开头的字母数字连字符)`});let e=n.indexOf(`=`),r=n.slice(0,e),i=M(n.slice(e+1));if(t.has(r))return IS({message:`范围根映射 id 重复:${r}(同一范围不得重复映射)`});t.set(r,i)}return FS(t)}function $S(e,t,n,r){return e!==void 0&&t!==void 0&&e.trim()!==t.trim()?IS({code:`ACQUISITION_ENV_INVALID`,message:`环境变量双名冲突:${n} 与 ${r} 同时在场且值不一致(请统一使用新名 ${n})`,variables:[n,r]}):FS({value:e??t,variables:e===void 0?t===void 0?[]:[r]:[n]})}function eC(e=process.env){let t=$S(e[KS],e[qS],KS,qS);if(!t.ok)return IS(t.error);let n=$S(e[JS],e[YS],JS,YS);if(!n.ok)return IS(n.error);let r;if(n.value.value!==void 0){let e=QS(n.value.value);if(!e.ok)return IS({code:`ACQUISITION_ENV_INVALID`,message:e.error.message,variables:[...n.value.variables]});r=e.value}return FS({registryRoot:t.value.value===void 0?void 0:M(t.value.value.trim()),scopeRoots:r})}const tC=/^[A-Za-z0-9_][A-Za-z0-9._-]*$/;function nC(e,t){return e.name<t.name?-1:+(e.name>t.name)}function rC(e){return E(j(e,`.git`))}function iC(e,t){return t.get(e.id)}function aC(e,t,n,r){if(n.has(e.id))return IS({code:`SCOPE_ID_CONFLICT`,message:`范围 id 冲突:${e.id}(声明域内不得重复)`});n.add(e.id);let i=iC(e,t);return i===void 0?IS({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${e.id}(声明零本地路径,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 或 LZI_PROJECT_MARKDOWN_SCOPE_ROOTS 补 id=绝对路径 映射)`}):E(i)?FS({def:e,root:i,sourceId:r}):IS({code:`DIR_NOT_FOUND`,message:`范围根不存在:${i}(范围 ${e.id} 机内映射目标)`})}function oC(e,t){let n=[],r=[];for(let i of[...A(e.root,{withFileTypes:!0})].sort(nC)){if(i.name.startsWith(`.`))continue;if(!i.isDirectory()){r.push({scope:e.def.id,entry:i.name,reason:`ROOT_FILE`});continue}if(e.def.excludes.includes(i.name)){r.push({scope:e.def.id,entry:i.name,reason:`EXCLUDED`});continue}let a=j(e.root,i.name);t!==void 0&&M(a)===M(t)?r.push({scope:e.def.id,entry:i.name,reason:`EXCLUDED_PATH`}):!rC(a)||!tC.test(i.name)?r.push({scope:e.def.id,entry:i.name,reason:`NOT_A_REPO`}):n.push({scope:e.def.id,scopeKind:e.def.kind,priority:e.def.projectPriorities[i.name]??e.def.priority,sourceId:e.sourceId,project:i.name,path:a})}return{scope:e.def.id,scopeKind:e.def.kind,priority:e.def.priority,scopeRoot:e.root,sourceId:e.sourceId,projects:n,skipped:r}}function sC(e,t){let n=ee(e.root);return t!==void 0&&M(e.root)===M(t)||!rC(e.root)||!tC.test(n)?IS({code:`SCOPE_ROOT_INVALID`,message:`single-repo 范围根非法:${e.root}(应为含 .git 的合规项目目录,且不得为排除路径)`}):FS({scope:e.def.id,scopeKind:`single-repo`,priority:e.def.priority,scopeRoot:e.root,sourceId:e.sourceId,projects:[{scope:e.def.id,scopeKind:`single-repo`,priority:e.def.priority,sourceId:e.sourceId,project:n,path:e.root}]})}function cC(e,t,n){let r=[],i=[],a=/* @__PURE__ */ new Set,o=/* @__PURE__ */ new Map;for(let s of e){let e=aC(s,n.scopeRoots,a,n.sourceId);if(!e.ok)return IS(e.error);let c,l=[];if(s.kind===`single-repo`){let n=sC(e.value,t);if(!n.ok)return IS(n.error);c=n.value}else{let n=oC(e.value,t);c=n,l=n.skipped}for(let e of c.projects){let t=o.get(e.project);if(t!==void 0)return IS({code:`PROJECT_NAME_CONFLICT`,message:`项目名跨范围冲突:${e.project}(${t} 与 ${e.scope} 均含此名;归档平铺要求项目名全局唯一,可在后登记范围的 excludes 中显式排除)`});o.set(e.project,e.scope)}r.push(c),i.push(...l)}return r.sort((e,t)=>e.scope<t.scope?-1:+(e.scope>t.scope)),i.sort((e,t)=>e.scope===t.scope?e.entry<t.entry?-1:+(e.entry>t.entry):e.scope<t.scope?-1:1),FS({scopes:r,skipped:i})}const lC=l(ae);function uC(e){return typeof e==`object`&&!!e&&`stderr`in e}async function dC(e,t){try{let{stdout:n}=await lC(`git`,[`-C`,e,...t],{encoding:`utf8`});return{ok:!0,stdout:n.trim()}}catch(e){let t=uC(e)?e.stderr:void 0;return{ok:!1,stderr:typeof t==`string`?t:String(e)}}}function fC(e){return typeof e==`object`&&!!e}function pC(e){let t=j(e,`package.json`);if(!E(t))return{packageName:null,description:null};let n;try{n=JSON.parse(k(t,`utf8`))}catch{return{packageName:null,description:null}}if(!fC(n))return{packageName:null,description:null};let r=n.name,i=n.description;return{packageName:typeof r==`string`&&r!==``?r:null,description:typeof i==`string`&&i!==``?i:null}}async function mC(e){let t=await dC(e.path,[`rev-parse`,`--git-dir`]);if(!t.ok)return IS({code:`INSPECT_FAILED`,scope:e.scope,project:e.project,message:`仓库健康探测失败:${e.path}(${t.stderr})`});let n=await dC(e.path,[`remote`,`get-url`,`origin`]),r=n.ok&&n.stdout!==``?n.stdout:null,i=pC(e.path);return FS({scope:e.scope,scopeKind:e.scopeKind,priority:e.priority,sourceId:e.sourceId,project:e.project,projectPath:e.path,remoteUrl:r,packageName:i.packageName,description:i.description})}async function hC(e,t,n){let r=Math.max(1,Math.floor(t)),i=[],a=0;for(;a<e.length;){let t=e.slice(a,a+r),o=await Promise.all(t.map((e,t)=>n(e,a+t)));i.push(...o),a+=r}return i}async function gC(e={}){let t=eC(e.processEnv??process.env);if(!t.ok)return IS(t.error);let n=e.registryRoot??t.value.registryRoot;if(n===void 0)return IS({code:`ACQUISITION_ENV_INVALID`,message:`未定位 registry 仓根(请在 .env 配置 LZI_PROJECT_REGISTRY_ROOT 或显式传入 registryRoot)`});let r=await GS(n);if(!r.ok)return IS(r.error);let i=e.scopeRoots??t.value.scopeRoots??/* @__PURE__ */ new Map,a=e.scopeIds===void 0?void 0:new Set(e.scopeIds),o=a===void 0?[]:[...a].filter(e=>!r.value.some(t=>t.id===e));if(o.length>0)return IS({code:`SCOPE_SELECTOR_UNKNOWN`,message:`圈定的范围 id 不在声明域:${o.join(`、`)}(合法范围 id:${r.value.map(e=>e.id).join(`、`)})`});let s=r.value,c=[];if(a!==void 0){s=r.value.filter(e=>a.has(e.id));let e=s.filter(e=>!i.has(e.id)).map(e=>e.id);if(e.length>0)return IS({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${e.join(`、`)}(声明零本地路径,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 补 id=绝对路径 映射)`})}else if(s=r.value.filter(e=>i.has(e.id)),c=r.value.filter(e=>!i.has(e.id)).map(e=>e.id),s.length===0)return IS({code:`SCOPE_ROOT_UNMAPPED`,message:`范围根未映射:${r.value.map(e=>e.id).join(`、`)}(本机未配置任何范围根映射,请在 .env 的 LZI_PROJECT_SCOPE_ROOTS 补 id=绝对路径 映射)`});let l=cC(s,e.excludePath,{scopeRoots:i,sourceId:`scope-declarations`});if(!l.ok)return IS(l.error);let u=l.value.scopes.flatMap(e=>[...e.projects]),d=[],f=/* @__PURE__ */ new Map;if(e.inspect===!0){let e=await hC(u,16,async e=>mC(e));for(let t of e)t.ok?f.set(t.value.project,t.value):d.push({scope:t.error.scope,project:t.error.project,message:t.error.message})}let p=u.map(e=>{let t=f.get(e.project);return{scope:e.scope,scopeKind:e.scopeKind,priority:e.priority,sourceId:e.sourceId,project:e.project,path:e.path,remoteUrl:t?.remoteUrl??null,packageName:t?.packageName??null,description:t?.description??null}});return FS({registryRoot:n,scopes:l.value.scopes,projects:p,skipped:l.value.skipped,unmappedScopes:c,inspectFailures:d,inspected:e.inspect===!0})}const _C={RED:`\x1B[0;31m`,GREEN:`\x1B[0;32m`,YELLOW:`\x1B[1;33m`,BLUE:`\x1B[0;34m`,RESET:`\x1B[0m`};function vC(e){return e.map(e=>{if(typeof e==`string`)return e;if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}).join(` `)}function $(...e){process.stdout.write(`${vC(e)}\n`)}function yC(...e){process.stderr.write(`${vC(e)}\n`)}const bC=async()=>{let e=await Gp();return e?(e.source===`legacy-dev-tools`&&$(`提示: 经 lzi-dev.config.ts 共享读取依赖工具配置,建议补建 lzi-dependencies.config.ts`),e.config):($(`提示: 未找到配置文件 lzi-dependencies.config.ts,使用默认配置`),{})},xC=[`**/node_modules/**`,`**/oh_modules/**`,`**/target/**`,`**/dist/**`,`**/build/**`,`**/.turbo/**`],SC=e=>!e||e.length===0?xC:[...xC,...e],CC=vc({name:U().optional(),workspaces:fc().optional(),devDependencies:Oc(U(),U()).optional()}),wC=async()=>{let e=process.cwd();$(`正在扫描 ${e} 下的 package.json 文件...`);let t=null;try{let n=CC.safeParse(await Bun.file(`${e}/package.json`).json());t=n.success?n.data:null}catch{t=null}t===null&&($(`未找到可解析的 workspace 根 package.json,请在仓库根目录执行本命令`),process.exit(1));let n=await bC(),r=SC(n.hoisting?.ignorePaths),i=new Set(n.hoisting?.allowlist??[]),a=t.devDependencies??{},o=await Pp(`**/package.json`,{cwd:e,ignore:r,onlyFiles:!0,dot:!1}),s=0,c=[];for(let t of o){if(t===`package.json`)continue;let n=null;try{let r=CC.safeParse(await Bun.file(`${e}/${t}`).json());n=r.success?r.data:null}catch{n=null}if(n===null||n.workspaces!==void 0)continue;let r=n.devDependencies??{};if(Object.keys(r).length!==0){s+=1;for(let[o,s]of Object.entries(r)){let r=a[o];r===void 0||i.has(o)||c.push({packageName:n.name??t,relPath:re(e,`${e}/${t}`),dependency:o,subRange:s,rootRange:r,drifted:s!==r})}}}if($(`找到 ${s} 个子包,根声明开发依赖 ${Object.keys(a).length} 项`),c.length===0)$(`所有子包均未重复声明根已有的开发依赖`);else{$(`
321
+ 以下子包重复声明根已有的开发依赖:`);for(let e of c){let t=e.drifted?` 版本漂移`:``;$(` ${e.packageName} ${e.relPath}`),$(` ${e.dependency} 子声明 ${e.subRange} 根声明 ${e.rootRange}${t}`)}$(`共 ${c.length} 处重复声明,处置口径见 ADR 0036`),process.exit(1)}},TC=vc({name:U().optional(),overrides:Oc(U(),fc()).optional(),pnpm:vc({overrides:Oc(U(),fc()).optional()}).optional(),resolutions:Oc(U(),fc()).optional()}),EC=e=>typeof e==`string`?e:`嵌套对象`,DC=async()=>{let e=process.cwd();$(`正在扫描 ${e} 下的 package.json 文件...`);let t=null;try{let n=TC.safeParse(await Bun.file(`${e}/package.json`).json());t=n.success?n.data:null}catch{t=null}t===null&&($(`未找到可解析的仓库根 package.json,请在仓库根目录执行本命令`),process.exit(1));let n=await bC(),r=SC(n.overrides?.ignorePaths),i=new Set(n.overrides?.allowlist??[]),a=await Pp(`**/package.json`,{cwd:e,ignore:r,onlyFiles:!0,dot:!1}),o=0,s=[];for(let t of a){let n=null;try{let r=TC.safeParse(await Bun.file(`${e}/${t}`).json());n=r.success?r.data:null}catch{n=null}if(n===null)continue;o+=1;let r=[[`overrides`,n.overrides??{}],[`pnpm.overrides`,n.pnpm?.overrides??{}],[`resolutions`,n.resolutions??{}]];for(let[a,o]of r)for(let[r,c]of Object.entries(o))i.has(r)||s.push({packageName:n.name??t,relPath:re(e,`${e}/${t}`),field:a,entry:r,value:EC(c)})}if($(`扫描到 ${o} 个清单,登记豁免条目 ${i.size} 项`),s.length===0)$(`全部清单均未声明未豁免的 overrides 族强制版本字段`);else{$(`
322
+ 以下清单声明了未豁免的 overrides 族强制版本字段:`);for(let e of s)$(` ${e.packageName} ${e.relPath}`),$(` ${e.field} ${e.entry} ${e.value}`);$(`共 ${s.length} 处强制版本条目,处置口径见 ADR 0153,豁免须经特别申请登记于 lzi-dependencies.config.ts 的 overrides.allowlist`),process.exit(1)}},OC=/* @__PURE__ */ new Set(/* @__PURE__ */ `@longzai-intelligence-agent-tools/cli.@longzai-intelligence-agent-tools/config.@longzai-intelligence-api/cli.@longzai-intelligence-api/config.@longzai-intelligence-api/core.@longzai-intelligence-builder/cli.@longzai-intelligence-builder/config.@longzai-intelligence-builder/core.@longzai-intelligence-builder/dual.@longzai-intelligence-builder/esm.@longzai-intelligence-builder/utils.@longzai-intelligence-bun/cli.@longzai-intelligence-bun/config.@longzai-intelligence-bun/presets.@longzai-intelligence-changelog/cli.@longzai-intelligence-changelog/config.@longzai-intelligence-decision/cli.@longzai-intelligence-decision/config.@longzai-intelligence-dependencies/cli.@longzai-intelligence-dependencies/config.@longzai-intelligence-dev-tools/cli.@longzai-intelligence-dev-tools/config.@longzai-intelligence-dev-tools/port-registry.@longzai-intelligence-dev-tools/vite-plugin.@longzai-intelligence-env/cli.@longzai-intelligence-env/config.@longzai-intelligence-env/core.@longzai-intelligence-features/cli.@longzai-intelligence-features/config.@longzai-intelligence-features/ledger.@longzai-intelligence-git/cli.@longzai-intelligence-git/config.@longzai-intelligence-issues/cli.@longzai-intelligence-issues/config.@longzai-intelligence-ledger/cli.@longzai-intelligence-ledger/config.@longzai-intelligence-ledger/core.@longzai-intelligence-markdown/cli.@longzai-intelligence-markdown/config.@longzai-intelligence-oxfmt/config.@longzai-intelligence-oxlint/architecture-core-plugin.@longzai-intelligence-oxlint/architecture-domain-plugin.@longzai-intelligence-oxlint/architecture-electron-plugin.@longzai-intelligence-oxlint/architecture-library-plugin.@longzai-intelligence-oxlint/architecture-plugin.@longzai-intelligence-oxlint/cli.@longzai-intelligence-oxlint/code-style-plugin.@longzai-intelligence-oxlint/composer-plugin.@longzai-intelligence-oxlint/core.@longzai-intelligence-oxlint/design-rules-plugin.@longzai-intelligence-oxlint/elysia-route-plugin.@longzai-intelligence-oxlint/eslint-config-plugin.@longzai-intelligence-oxlint/file-naming-plugin.@longzai-intelligence-oxlint/lzi-builder-config-plugin.@longzai-intelligence-oxlint/lzi-config-plugin.@longzai-intelligence-oxlint/nestjs-route-plugin.@longzai-intelligence-oxlint/oxlint-config.@longzai-intelligence-oxlint/package-json-plugin.@longzai-intelligence-oxlint/perfectionist-plugin.@longzai-intelligence-oxlint/presets.@longzai-intelligence-oxlint/react-plugin.@longzai-intelligence-oxlint/schema-type-separation-plugin.@longzai-intelligence-oxlint/stylistic-plugin.@longzai-intelligence-oxlint/testing.@longzai-intelligence-oxlint/tsconfig-plugin.@longzai-intelligence-oxlint/tsdoc-plugin.@longzai-intelligence-oxlint/tsdown-config-plugin.@longzai-intelligence-oxlint/tsup-config-plugin.@longzai-intelligence-oxlint/typeorm-plugin.@longzai-intelligence-oxlint/typescript-eslint-plugin.@longzai-intelligence-oxlint/utils.@longzai-intelligence-oxlint/vitest-config-plugin.@longzai-intelligence-oxlint/zod-plugin.@longzai-intelligence-release/cli.@longzai-intelligence-release/config.@longzai-intelligence-screenshots/cli.@longzai-intelligence-screenshots/config.@longzai-intelligence-screenshots/ledger.@longzai-intelligence-shared-config/core.@longzai-intelligence-standards/cli.@longzai-intelligence-standards/config.@longzai-intelligence-taro/cli.@longzai-intelligence-tsconfig/cli.@longzai-intelligence-tsconfig/config.@longzai-intelligence-tsconfig/core.@longzai-intelligence-tsgo/cli.@longzai-intelligence-typescript/bun-config.@longzai-intelligence-typescript/resolve-aliases.@longzai-intelligence-version/cli.@longzai-intelligence-version/config.@longzai-intelligence-vitest/config.@longzai-intelligence-vscode/cli.@longzai-intelligence-vscode/config.@longzai-intelligence-changeset/core.@longzai-intelligence-cli/core.@longzai-intelligence-cli/standard.@longzai-intelligence-config/cli.@longzai-intelligence-config/core.@longzai-intelligence-config/registry.@longzai-intelligence-deploy/cli.@longzai-intelligence-deploy/config.@longzai-intelligence-dimensions/cli.@longzai-intelligence-dimensions/config.@longzai-intelligence-dimensions/core.@longzai-intelligence-docs/cli.@longzai-intelligence-docs/compile-plugin.@longzai-intelligence-docs/config.@longzai-intelligence-docs/core.@longzai-intelligence-docs/eslint-plugin-markdown-links.@longzai-intelligence-docs/numbering-plugin.@longzai-intelligence-findings/cli.@longzai-intelligence-findings/config.@longzai-intelligence-findings/ledger.@longzai-intelligence-git-commit/cli.@longzai-intelligence-git-commit/config.@longzai-intelligence-git-swarm/cli.@longzai-intelligence-git-swarm/config.@longzai-intelligence-lint/cli.@longzai-intelligence-mechanisms/cli.@longzai-intelligence-mechanisms/config.@longzai-intelligence-mechanisms/core.@longzai-intelligence-npm-registry/cli.@longzai-intelligence-npm-registry/config.@longzai-intelligence-pitfalls/cli.@longzai-intelligence-pitfalls/config.@longzai-intelligence-pitfalls/ledger.@longzai-intelligence-port/cli.@longzai-intelligence-port/core.@longzai-intelligence-port/registry.@longzai-intelligence-prettier/config.@longzai-intelligence-prettier/markdown-plugin.@longzai-intelligence-project-registry/core.@longzai-intelligence-readme/cli.@longzai-intelligence-readme/config.@longzai-intelligence-readme/core.@longzai-intelligence-records/cli.@longzai-intelligence-records/config.@longzai-intelligence-records/ledger.@longzai-intelligence-reflections/cli.@longzai-intelligence-reflections/config.@longzai-intelligence-reflections/ledger.@longzai-intelligence-remote-machine/config.@longzai-intelligence-runtime-registry/cli.@longzai-intelligence-runtime/cli.@longzai-intelligence-runtime/config.@longzai-intelligence-scripts/cli.@longzai-intelligence-scripts/config.@longzai-intelligence-scripts/core.@longzai-intelligence-specs/cli.@longzai-intelligence-specs/config.@longzai-intelligence-specs/ledger.@longzai-intelligence-testing/cli.@longzai-intelligence-testing/config.@longzai-intelligence-testing/registry.@longzai-intelligence-toolchain/cli.@longzai-intelligence-toolchain/config.@longzai-intelligence-tsdoc/cli.@longzai-intelligence-tsdoc/config.@longzai-intelligence-vite/cli.@longzai-intelligence-wifi/cli.@longzai-intelligence-wifi/config.@longzai-intelligence-growth/cli.@longzai-intelligence-growth/config.@longzai-intelligence-growth/core.@longzai-intelligence-inbox/cli.@longzai-intelligence-inbox/config.@longzai-intelligence-inbox/core.@longzai-intelligence-kol/cli.@longzai-intelligence-kol/config.@longzai-intelligence-kol/core.@longzai-intelligence-one-digest/cli.@longzai-intelligence-one-digest/config.@longzai-intelligence-one-digest/core.@longzai-intelligence-closed-loop-markdown/cli.@longzai-intelligence-closed-loop-markdown/config.@longzai-intelligence-code-report/config.@longzai-intelligence-competition-registry/registry.@longzai-intelligence-crossref-markdown/cli.@longzai-intelligence-crossref-markdown/config.@longzai-intelligence-disk-space-markdown/config.@longzai-intelligence-github-trending-markdown/cli.@longzai-intelligence-github-trending-markdown/config.@longzai-intelligence-input-markdown/cli.@longzai-intelligence-input-markdown/config.@longzai-intelligence-journals-markdown/cli.@longzai-intelligence-journals-markdown/config.@longzai-intelligence-journals/config.@longzai-intelligence-knowledge-markdown/cli.@longzai-intelligence-knowledge-markdown/config.@longzai-intelligence-kol-markdown/cli.@longzai-intelligence-kol-markdown/config.@longzai-intelligence-music-video/config.@longzai-intelligence-nation/config.@longzai-intelligence-okr-markdown/config.@longzai-intelligence-open-router-markdown/cli.@longzai-intelligence-open-router-markdown/config.@longzai-intelligence-paper-report/cli.@longzai-intelligence-paper-report/config.@longzai-intelligence-philosophy-markdown/config.@longzai-intelligence-project-markdown/config.@longzai-intelligence-roadmap-markdown/config.@longzai-intelligence-rss-markdown/cli.@longzai-intelligence-rss-markdown/config.@longzai-intelligence-schedule-markdown/config.@longzai-intelligence-task-markdown/config.@longzai-intelligence-workflow-markdown/config.@longzai-intelligence-bilibili-markdown-private/cli.@longzai-intelligence-bilibili-markdown-private/config.@longzai-intelligence-douyin-markdown-private/cli.@longzai-intelligence-douyin-markdown-private/config.@longzai-intelligence-law-markdown-private/cli.@longzai-intelligence-law-markdown-private/config.@longzai-intelligence-release-workflow-private/publish-repository-plugin.@longzai-intelligence-release-workflow-private/workflow-repository-plugin.@longzai-intelligence-research-report-markdown-private/cli.@longzai-intelligence-research-report-markdown-private/config.@longzai-intelligence-research-report-private/core.@longzai-intelligence-runtime-registry-private/data.@longzai-intelligence-strategy-consulting-markdown-private/cli.@longzai-intelligence-strategy-consulting-markdown-private/config.@longzai-intelligence-twitter-markdown-private/cli.@longzai-intelligence-twitter-markdown-private/config.@longzai-intelligence-xiaohongshu-markdown-private/cli.@longzai-intelligence-xiaohongshu-markdown-private/config.@longzai-intelligence-youtube-markdown-private/cli.@longzai-intelligence-youtube-markdown-private/config.@longzai-intelligence-youtube-private/config.@longzai-intelligence-zhihu-markdown-private/config`.split(`.`)),kC=[`dependencies`,`devDependencies`],AC=(e,t)=>{if(e.workspaces===void 0)return{inScope:!1,violations:[]};let n=[];for(let r of kC){let i=e[r]??{};for(let[e]of Object.entries(i))e.startsWith(`@longzai-intelligence-`)&&!t.has(e)&&(OC.has(e)||n.push({dependency:e,field:r}))}return{inScope:!0,violations:n}},jC=`@longzai-intelligence`,MC=vc({workspaces:fc().optional(),dependencies:Oc(U(),U()).optional(),devDependencies:Oc(U(),U()).optional()}),NC=async()=>{let e=await PC(),t=process.env.npm_config_registry;process.env.npm_config_registry=`https://registry.npmjs.org/`;let n;try{n=await IC(void 0)}finally{t===void 0?delete process.env.npm_config_registry:process.env.npm_config_registry=t}let r=LC(n);$(`
323
+ --- 检查结果 ---`);let i=0;if(i+=RC(n,new Set(r),!1),r.length>0){$(`\n回退基线:${r.length} 个内部包在 npm 无记录,按本机 registry 配置复查`);let e=await IC(r);i+=RC(e,new Set(r),!0)}i===0?$(`全部 Longzai Intelligence 包依赖均为最新版`):yC(`\n共 ${i} 个内部包依赖非最新版,修复指引: 在仓根执行 lzi-dependencies upgrade --write 或 bun run version:upgrade`);let a=e+i;a!==0&&process.exit(Math.min(a,255))},PC=async()=>{let e=null;try{let t=MC.safeParse(await Bun.file(`${process.cwd()}/package.json`).json());e=t.success?t.data:null}catch{e=null}if(e===null)return 0;let t=AC(e,await FC());if(!t.inScope)return 0;if($(`
324
+ --- 根清单依赖准入 ---`),t.violations.length===0)return $(`工作区根清单未发现业务依赖`),0;for(let e of t.violations)$(` ${e.dependency} ${e.field}`);return $(`共 ${t.violations.length} 处业务依赖出现在工作区根清单,业务依赖应下沉到实际使用的子包,处置口径见 ADR 0182`),t.violations.length},FC=async()=>{let e=await bC();return new Set(e.rootManifest?.allowlist??[])},IC=async e=>{let t=(await bC()).upgrade??{},{packages:n}=await NS({cwd:process.cwd(),mode:`latest`,write:!1,recursive:t.recursive??!0,timeout:t.timeout??3e4,retries:t.retries??3,exclude:t.exclude??[],include:e===void 0?t.include??[]:[...e],depFields:t.depFields,ignorePaths:t.ignorePaths??[],concurrency:t.concurrency??10,force:!1,all:!1,install:!1,update:!1,interactive:!1,group:!0,includeLocked:!1,timediff:!0,nodecompat:!0,loglevel:`silent`,silent:!0,failOnOutdated:!1},{afterPackagesLoaded:e=>{$(`扫描到 ${e.length} 个包,正在校验 Longzai Intelligence 依赖新鲜度...`)}});return n},LC=e=>{let t=/* @__PURE__ */ new Set;for(let n of e)for(let e of n.resolved)e.name.startsWith(jC)&&e.resolveError!=null&&t.add(e.name);return[...t]},RC=(e,t,n)=>{let r=0;for(let i of e){let e=i.resolved.filter(e=>!e.update||!e.name.startsWith(jC)?!1:n?t.has(e.name):!t.has(e.name));if(e.length!==0){r+=e.length,$(`\n${i.name||i.relative}:`);for(let t of e){let e=t.diff??``,r=n?`,回退基线`:``;$(` ${t.name}: ${t.currentVersion} -> ${t.targetVersion} ${e}${r}`)}}}return r};function zC(e){let t=e;for(;;){if(E(j(t,`longzai-intelligence-globals`))||E(j(t,`lzi-architecture.yaml`)))return t;let e=j(t,`..`);if(e===t)return;t=e}}function BC(e){return e.filter(e=>E(j(e.path,`package.json`))).map(e=>({name:e.project,dir:e.path}))}async function VC(e){if(e.projectScope!==void 0){let t=await gC({scopeIds:[e.projectScope]});return t.ok||(yC(`错误: 项目范围解析失败: ${t.error.message}`),yC(`提示: 请确认 .env 配置 LZI_PROJECT_REGISTRY_ROOT 与 LZI_PROJECT_SCOPE_ROOTS`),process.exit(1)),{registryRoot:t.value.registryRoot,scopeId:e.projectScope,projects:BC(t.value.projects),source:`env`}}let t=zC(e.cwd??process.cwd());t===void 0&&(yC(`错误: 未定位产品群聚合根(一级子目录应存在 longzai-intelligence-globals 仓)`),yC(`提示: 请自产品群内任意仓库运行,或使用 --project-scope <id> 显式圈定范围`),process.exit(1));let n=ee(t),r=j(t,`longzai-intelligence-project-registry`);E(j(r,`scopes`))||(yC(`错误: registry 声明域缺失: ${j(r,`scopes`)}`),yC(`提示: 请确认 longzai-intelligence-project-registry 仓已在聚合根就位`),process.exit(1));let i=await gC({registryRoot:r,scopeIds:[n],scopeRoots:/* @__PURE__ */ new Map([[n,t]])});return i.ok||(yC(`错误: 项目范围解析失败: ${i.error.message}`),process.exit(1)),{registryRoot:r,scopeId:n,projects:BC(i.value.projects),source:`structure`}}const HC=(e,t)=>Bun.spawnSync([`git`,`diff`,`--quiet`,`HEAD`,`--`,t],{cwd:e,stdout:`pipe`,stderr:`pipe`}).exitCode===0,UC=e=>{let t=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`("${t}/[^"]+":\\s*")[^"]*(")`,`g`)},WC=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),GC=e=>/^[~^]?\d/.test(e),KC=(e,t)=>`${/^[~^]/.exec(e)?.[0]??``}${t}`,qC=e=>{let t=Bun.spawnSync([`git`,`ls-files`,`--`,`*/package.json`],{cwd:e,stdout:`pipe`,stderr:`pipe`});return t.exitCode===0?[`package.json`,...(t.stdout?.toString()??``).trim().split(`
325
+ `).map(e=>e.trim()).filter(e=>e.length>0).filter(t=>E(j(e,t)))]:[`package.json`]},JC=(e,t,n)=>Bun.spawnSync([`git`,`commit`,...t,`-m`,n],{cwd:e,stdout:`pipe`,stderr:`pipe`}).exitCode===0,YC=async(e,t,n)=>{let r=await Bun.file(e).text(),i=[],a=[],o=[],s;for(t.lastIndex=0;(s=t.exec(r))!==null;){let e=s[0],t=s[1]??``,r=s[2]??``,i=/^"([^"]+)"/.exec(t)?.[1]??``,a=e.slice(t.length,e.length-r.length),c=n(i,a);a!==c&&GC(a)&&o.push({name:i,oldVersion:a,targetVersion:c,prefix:t,suffix:r})}if(o.length===0)return{matchedPackages:i,changes:a};let c=r;for(let e of o){let t=RegExp(`("${WC(e.name)}":\\s*")[^"]*(")`);c=c.replace(t,`$1${e.targetVersion}$2`),i.push(e.name),a.push({name:e.name,from:e.oldVersion,to:e.targetVersion})}return await Bun.write(e,c),{matchedPackages:i,changes:a}},XC=async(e,t,n)=>{let r=await Bun.file(e).text(),i=[],a=[];t.lastIndex=0;let o;for(;(o=t.exec(r))!==null;){let e=o[0],t=o[1]??``,r=o[2]??``,s=/^"([^"]+)"/.exec(t)?.[1]??``,c=e.slice(t.length,e.length-r.length),l=n(s,c);c!==l&&GC(c)&&(i.push(s),a.push({name:s,from:c,to:l}))}return{matchedPackages:i,changes:a}},ZC=async(e,t,n,r,i)=>{let{name:a,dir:o}=e,s=qC(o),c=[],l=[],u=[],d=[];for(let e of s){let r=j(o,e),a=await XC(r,t,n);if(a.matchedPackages.length!==0){if(!HC(o,e))u.push(e);else{if(i)c.push(...a.matchedPackages),l.push(...a.changes);else{let e=await YC(r,t,n);c.push(...e.matchedPackages),l.push(...e.changes)}d.push(e)}}}return d.length===0?u.length>0?{name:a,dir:o,matchedPackages:c,changes:l,skippedFiles:u,status:`skipped-dirty`,reason:`package.json 已有未提交改动:${u.join(`,`)}`}:{name:a,dir:o,matchedPackages:c,changes:l,status:`skipped-nochange`,reason:`无匹配 scope 或已是目标版本`}:i||JC(o,d,r)?{name:a,dir:o,matchedPackages:c,changes:l,skippedFiles:u,status:`success`}:{name:a,dir:o,matchedPackages:c,changes:l,skippedFiles:u,status:`failed`,reason:`git commit 失败,文件已修改,需人工介入`}},QC=async(e,t)=>{let n=/* @__PURE__ */ new Set;for(let r of e){let e=qC(r.dir);for(let i of e){let e=j(r.dir,i),a=await Bun.file(e).text();t.lastIndex=0;let o;for(;(o=t.exec(a))!==null;){let e=o[1]??``,t=/^"([^"]+)"/.exec(e)?.[1];t&&n.add(t)}}}return[...n]},$C=async(e,t)=>{let n=/* @__PURE__ */ new Map,r=[],i=0,a=async e=>{let t=await sx(e),i=t.tags?.latest;if(i===void 0){let n=t.error instanceof Error?t.error.message:t.error??`未找到 dist-tags.latest`;r.push({name:e,reason:n})}else n.set(e,i)},o=async()=>{for(;i<e.length;){let t=e[i];i++,t!==void 0&&await a(t)}},s=Array.from({length:Math.min(t,e.length)},()=>o());if(await Promise.all(s),r.length>0){yC(`${_C.RED}错误: 部分包查询 npm latest 失败,已中止(0 文件改动、0 提交)${_C.RESET}`);for(let e of r)yC(` ${e.name}: ${e.reason}`);process.exit(1)}return n},ew=async e=>{let{scope:t,version:n,message:r,dryRun:i}=e,a=e.concurrency??10,o=await VC({projectScope:e.projectScope}),s=n===void 0,c=s?`latest(各自 npm 最新)`:n,l=r??(s?`chore: bump ${t} deps to latest`:`chore: bump ${t} deps to ${n.replace(/^[~^]/,``)}`),u=UC(t);$(`${_C.BLUE}═══ version upgrade-across ═══${_C.RESET}`),$(`项目获取来源: ${o.source===`structure`?`结构锚点(cwd 上溯聚合根)`:`显式圈定(--project-scope)`}`),$(`registry: ${o.registryRoot}`),$(`项目范围: ${o.scopeId}`),$(`升级范围: ${t} 下的所有包 -> ${c}`),$(`并发数: ${a}`),i&&$(`${_C.YELLOW}[dry-run] 预览模式,不写文件、不提交${_C.RESET}`),$(``);let d=o.projects;$(`发现 ${d.length} 个子项目,并发处理(并发 ${a})...`),$(``);let f;if(s){let e=await QC(d,u);if(e.length===0){$(`${_C.YELLOW}未匹配到任何 ${t} 下的包,结束${_C.RESET}`);return}$(`匹配到 ${e.length} 个 ${t} 下的包,查询 npm latest...`);let n=await $C(e,a);f=(e,t)=>KC(t,n.get(e)??``)}else{let e=n??``;f=()=>e}let p=[],m=0,h=d.length;await(async(e,t)=>{let n=0,r=async()=>{for(;n<e.length;){let t=e[n];if(n++,t===void 0)break;let r=await ZC(t,u,f,l,i);p.push(r),m++;let a=r.status===`success`?`${_C.GREEN}✓${_C.RESET}`:r.status===`failed`?`${_C.RED}✗${_C.RESET}`:`·`;$(` [${m}/${h}] ${a} ${t.name}`)}},a=Array.from({length:Math.min(t,e.length)},()=>r());await Promise.all(a)})(d,a),$(``),tw(p,i)},tw=(e,t)=>{let n=e.filter(e=>e.status===`success`),r=e.filter(e=>e.status===`skipped-dirty`),i=e.filter(e=>e.status===`skipped-nochange`),a=e.filter(e=>e.status===`failed`);$(`${_C.BLUE}═══ 处理结果 ═══${_C.RESET}`);let o=t?`将提交`:`已提交`;$(`${_C.GREEN}✓ ${o}: ${n.length}${_C.RESET}`);for(let e of n){let t=e.changes.map(e=>`${e.name.split(`/`).pop()}: ${e.from} → ${e.to}`).join(`, `);$(` ${e.name}`),$(` ${t}`),e.skippedFiles!==void 0&&e.skippedFiles.length>0&&$(` ⚠ 脏文件跳过:${e.skippedFiles.join(`,`)}`)}if(r.length>0){$(``),$(`${_C.YELLOW}⚠ 跳过(文件已改动): ${r.length}${_C.RESET}`);for(let e of r)$(` ${e.name}: ${e.reason}`)}if(i.length>0&&($(``),$(`跳过(无匹配/已是目标版本): ${i.length}`)),a.length>0){$(``),$(`${_C.RED}✗ 失败(需人工介入): ${a.length}${_C.RESET}`);for(let e of a)$(` ${e.name}: ${e.reason}`),$(` ${e.changes.map(e=>`${e.name.split(`/`).pop()}: ${e.from} → ${e.to}`).join(`, `)}`)}$(``),$(`${_C.BLUE}汇总: ${n.length} ${o} / ${r.length} 跳过(dirty) / ${i.length} 跳过(无变更) / ${a.length} 失败${_C.RESET}`),!t&&n.length>0&&($(``),$(`下一步:推送到远程`),$(` bun push-all`)),a.length>0&&(process.exitCode=1)},nw=Ac([`default`,`major`,`minor`,`patch`,`latest`,`newest`]).default(`default`),rw=async e=>{let t=(await bC()).upgrade??{},n=e.mode||t.mode||`default`,r=nw.safeParse(n),i=r.success?r.data:`default`,a=[...e.scope?[`${e.scope}/*`]:[],...t.include??[]],{packages:o}=await NS({cwd:process.cwd(),mode:i,write:!e.dryRun&&e.write,recursive:t.recursive??!0,timeout:t.timeout??3e4,retries:t.retries??3,exclude:t.exclude??[],include:a,depFields:t.depFields,ignorePaths:t.ignorePaths??[],concurrency:t.concurrency??10,force:!1,all:!1,install:!1,update:!1,interactive:!1,group:!0,includeLocked:!1,timediff:!0,nodecompat:!0,loglevel:`info`,silent:!1,failOnOutdated:!1},{afterPackagesLoaded:e=>{$(`扫描到 ${e.length} 个包,正在检查依赖更新...`)},beforePackageStart:e=>{$(`正在检查 ${e.name||e.relative}...`)},afterPackageEnd:e=>{let t=e.resolved.filter(e=>e.update).length;$(t>0?` ✓ ${e.name||e.relative}: 发现 ${t} 个可更新依赖`:` ✓ ${e.name||e.relative}: 所有依赖已是最新`)},afterPackageWrite:e=>{$(` 📝 已写入 ${e.name||e.relative}`)}}),s=0;$(`
326
+ --- 检查结果 ---`);for(let e of o){let t=e.resolved.filter(e=>e.update);if(t.length>0){s+=t.length,$(`\n${e.name||e.relative}:`);for(let e of t){let t=e.diff??``;$(` ${e.name}: ${e.currentVersion} -> ${e.targetVersion} (${t})`)}}}s===0?$(`所有依赖已是最新版本`):($(`\n共发现 ${s} 个可更新依赖`),e.write?$(`已写入 package.json`):$(`使用 --write 参数写入 package.json`))};function iw(e){qd(e,{name:`upgrade`,description:`检查依赖版本更新`,arguments:[{signature:`[mode]`,description:`升级模式(major/minor/patch/latest/newest)`},{signature:`[scope]`,description:`可选。仅升级指定 scope 下的依赖(如 @longzai-intelligence-oxlint),内部展开为 include @scope/*`}],options:[{flags:`--write`,description:`将更新写入 package.json`},{flags:`--dry-run`,description:`仅预览`}],schema:bc({write:uc().optional(),dryRun:uc().optional()}),action:async(e,t)=>{let n=t[0],r=t[1];await rw({mode:n,write:e.write===!0,dryRun:e.dryRun===!0,scope:r})}}),qd(e,{name:`upgrade-across`,description:`跨产品群批量升级依赖(项目清单经 project-registry 声明域获取)`,options:[{flags:`--scope <scope>`,description:`依赖 scope(必填,如 @longzai-intelligence-builder)`},{flags:`--target <version>`,description:`目标版本号(可选,如 ^0.0.8。省略时自动取每个匹配包的 npm latest)`},{flags:`-m, --message <message>`,description:`自定义提交信息`},{flags:`--project-scope <id>`,description:`显式圈定项目范围(缺省自动取当前 edition 范围)`},{flags:`--concurrency <n>`,description:`并发数(默认 10)`},{flags:`--dry-run`,description:`仅预览(不写文件、不提交)`}],schema:bc({scope:U().optional(),target:U().optional(),message:U().optional(),config:U().optional(),concurrency:ol().int().positive().optional(),projectScope:U().optional(),dryRun:uc().optional()}),action:async e=>{e.scope||(process.stderr.write(`错误: upgrade-across 需要指定 --scope <@scope>
328
327
  `),process.stderr.write(`示例: --scope @longzai-intelligence-builder
329
- `),process.exit(1)),await JC({scope:e.scope,version:e.target,message:e.message,projectScope:e.projectScope,concurrency:e.concurrency,dryRun:e.dryRun===!0})}}),qd(e,{name:`check`,description:`校验全部 Longzai Intelligence 包依赖是否为 registry 最新版`,schema:bc({}),action:async()=>{await kC()}})}function $C(e){qd(e,{name:`hoisting check`,description:`检查子包开发依赖是否重复声明 workspace 根已有依赖`,schema:bc({}),action:async()=>{await wC()}})}function ew(e){qd(e,{name:`overrides check`,description:`检查 package.json 是否声明未豁免的强制版本字段`,schema:bc({}),action:async()=>{await DC()}})}function tw(){let e=Hd({name:`lzi-dependencies`,description:`Longzai Intelligence 依赖版本管理工具`,version:`0.0.9`});return QC(e),$C(e),ew(e),e}async function nw(){await tw().parseAsync(process.argv)}import.meta.main===!0&&await nw();export{tw as buildProgram};
328
+ `),process.exit(1)),await ew({scope:e.scope,version:e.target,message:e.message,projectScope:e.projectScope,concurrency:e.concurrency,dryRun:e.dryRun===!0})}}),qd(e,{name:`check`,description:`校验全部 Longzai Intelligence 包依赖是否为 registry 最新版`,schema:bc({}),action:async()=>{await NC()}})}function aw(e){qd(e,{name:`hoisting check`,description:`检查子包开发依赖是否重复声明 workspace 根已有依赖`,schema:bc({}),action:async()=>{await wC()}})}function ow(e){qd(e,{name:`overrides check`,description:`检查 package.json 是否声明未豁免的强制版本字段`,schema:bc({}),action:async()=>{await DC()}})}function sw(){let e=Hd({name:`lzi-dependencies`,description:`Longzai Intelligence 依赖版本管理工具`,version:`0.0.11`});return iw(e),aw(e),ow(e),e}async function cw(){await sw().parseAsync(process.argv)}import.meta.main===!0&&await cw();export{sw as buildProgram};