@longzai-intelligence-docs/cli 0.0.10 → 0.0.12

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.
Files changed (2) hide show
  1. package/dist/index.js +132 -145
  2. package/package.json +14 -7
package/dist/index.js CHANGED
@@ -1,102 +1,39 @@
1
- import{createRequire as e}from"node:module";import*as t from"node:os";import*as n from"node:fs";import{existsSync as r,readFileSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";import*as c from"node:path";import{join as l,posix as u}from"node:path";import{pathToFileURL as d}from"node:url";import{AsyncLocalStorage as f}from"node:async_hooks";import p,{stdin as m,stdout as h}from"node:process";import{stripVTControlCharacters as g}from"node:util";import*as _ from"node:readline";import v from"node:readline";import{Writable as y}from"node:stream";var b=Object.create,x=Object.defineProperty,S=Object.getOwnPropertyDescriptor,C=Object.getOwnPropertyNames,w=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty,E=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),D=(e,t)=>{let n={};for(var r in e)x(n,r,{get:e[r],enumerable:!0});return t||x(n,Symbol.toStringTag,{value:`Module`}),n},ee=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=C(t),a=0,o=i.length,s;a<o;a++)s=i[a],!T.call(e,s)&&s!==n&&x(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=S(t,s))||r.enumerable});return e},O=(e,t,n)=>(n=e==null?{}:b(w(e)),ee(t||!e||!e.__esModule||!T.call(e,`default`)?x(n,`default`,{value:e,enumerable:!0}):n,e)),k=/* @__PURE__ */ e(import.meta.url),A=/* @__PURE__ */ E(((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+`
1
+ #!/usr/bin/env bun
2
+ import{createRequire as e}from"node:module";import*as t from"node:os";import{stripVTControlCharacters as n}from"node:util";import*as r from"node:fs";import{existsSync as i,readFileSync as a,readdirSync as o,realpathSync as s,statSync as c}from"node:fs";import*as l from"node:path";import{dirname as u,join as d,posix as f,resolve as p}from"node:path";import{pathToFileURL as m}from"node:url";import{AsyncLocalStorage as h}from"node:async_hooks";import g,{stdin as _,stdout as v}from"node:process";import y,*as b from"node:readline";import{Writable as x}from"node:stream";import{readdir as S}from"node:fs/promises";var C=Object.create,w=Object.defineProperty,T=Object.getOwnPropertyDescriptor,ee=Object.getOwnPropertyNames,E=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,O=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),k=(e,t)=>{let n={};for(var r in e)w(n,r,{get:e[r],enumerable:!0});return t||w(n,Symbol.toStringTag,{value:`Module`}),n},A=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=ee(t),a=0,o=i.length,s;a<o;a++)s=i[a],!D.call(e,s)&&s!==n&&w(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=T(t,s))||r.enumerable});return e},te=(e,t,n)=>(n=e==null?{}:C(E(e)),A(t||!e||!e.__esModule||!D.call(e,`default`)?w(n,`default`,{value:e,enumerable:!0}):n,e)),j=/* @__PURE__ */ e(import.meta.url),ne=/* @__PURE__ */ O(((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+`
2
3
  causes have become circular...`;let o=r(e);return o?(t.add(e),a+`
3
- 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)}})),j=/* @__PURE__ */ E(((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}}})),te=/* @__PURE__ */ E(((e,t)=>{t.exports=l;let{messageWithCauses:n,stackWithCauses:r,isErrorLike:i}=A(),{pinoErrProto:a,pinoErrorSymbols:o}=j(),{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}})),ne=/* @__PURE__ */ E(((e,t)=>{t.exports=s;let{isErrorLike:n}=A(),{pinoErrProto:r,pinoErrorSymbols:i}=j(),{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}})),M=/* @__PURE__ */ E(((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)}}})),re=/* @__PURE__ */ E(((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)}}})),ie=/* @__PURE__ */ E(((e,t)=>{let n=te(),r=ne(),i=M(),a=re();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))}}}})),N=/* @__PURE__ */ E(((e,t)=>{function n(e,t){return t}t.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=n;let t=(/* @__PURE__ */ Error()).stack;if(Error.prepareStackTrace=e,!Array.isArray(t))return;let r=t.slice(2),i=[];for(let e of r)e&&i.push(e.getFileName());return i}})),ae=/* @__PURE__ */ E(((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})),oe=/* @__PURE__ */ E(((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`),ee=Symbol(`pino.wildcardFirst`),O=Symbol.for(`pino.serializers`),k=Symbol.for(`pino.formatters`),A=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:O,redactFmtSym:p,timeSym:m,timeSliceIndexSym:h,streamSym:g,stringifySym:_,stringifySafeSym:v,stringifiersSym:y,endSym:b,formatOptsSym:x,messageKeySym:S,errorKeySym:C,nestedKeySym:w,wildcardFirstSym:ee,needsMetadataGsym:Symbol.for(`pino.metadata`),useOnlyCustomLevelsSym:s,formattersSym:k,hooksSym:A,nestedKeyStrSym:T,mixinMergeStrategySym:E,msgPrefixSym:D}})),se=/* @__PURE__ */ E(((e,t)=>{let n=ae(),{redactFmtSym:r,wildcardFirstSym:i}=oe(),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},{}),d={[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})),ce=/* @__PURE__ */ E(((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"`}}})),le=/* @__PURE__ */ E(((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)}})),ue=/* @__PURE__ */ E(((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}})),de=/* @__PURE__ */ E(((e,t)=>{let n=k(`fs`),r=k(`events`),i=k(`util`).inherits,a=k(`path`),o=ue(),s=k(`assert`),c=Buffer.allocUnsafe(0),l=`buffer`,u=`utf8`,[d,f]=(process.versions.node||`0.0`).split(`.`).map(Number),p=d>=22&&f>=7;function m(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`,o=t.mode;if(t.sync)try{t.mkdir&&n.mkdirSync(a.dirname(e),{recursive:!0}),r(null,n.openSync(e,i,o))}catch(e){throw r(e),e}else t.mkdir?n.mkdir(a.dirname(e),{recursive:!0},t=>{if(t)return r(t);n.open(e,i,o,r)}):n.open(e,i,o,r)}function h(e){if(!(this instanceof h))return new h(e);let{fd:t,dest:r,minLength:i,maxLength:a,maxWrite:s,periodicFlush:d,sync:f,append:p=!0,mkdir:v,retryEAGAIN:x,fsync:O,contentMode:k,mode:A}=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=s||16384,this._periodicFlush=d||0,this._periodicFlushTimer=void 0,this.sync=f||!1,this.writable=!0,this._fsync=O||!1,this.append=p||!1,this.mode=A,this.retryEAGAIN=x||(()=>!0),this.mkdir=v||!1;let j,te;if(k===l)this._writingBuf=c,this.write=b,this.flush=C,this.flushSync=T,this._actualWrite=D,j=()=>n.writeSync(this.fd,this._writingBuf),te=()=>n.write(this.fd,this._writingBuf,this.release);else if(k===void 0||k===u)this._writingBuf=``,this.write=y,this.flush=S,this.flushSync=w,this._actualWrite=E,j=()=>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 "${u}" and "${l}", but passed ${k}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)m(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{o(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=g(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=j(),t=g(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,ee(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(_,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 g(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 _(e){e.listenerCount(`drain`)>0&&(e._asyncDrainScheduled=!1,e.emit(`drain`))}i(h,r);function v(e,t){return e.length===0?c:e.length===1?e[0]:Buffer.concat(e,t)}function y(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 b(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 x(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 S(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}if(this.minLength<=0){e?.();return}e&&x.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(``),this._actualWrite())}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}if(this.minLength<=0){e?.();return}e&&x.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}h.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)})}),m(this.file,this)},h.prototype.end=function(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():ee(this)))};function w(){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=g(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;o(100)}}try{n.fsyncSync(this.fd)}catch{}}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=c);let e=c;for(;this._bufs.length||e.length;){e.length<=0&&(e=v(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;o(100)}}}h.prototype.destroy=function(){this.destroyed||ee(this)};function E(){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 D(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:v(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,n.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else p&&(this._writingBuf=Buffer.from(this._writingBuf)),n.write(this.fd,this._writingBuf,e)}function ee(e){if(e.fd===-1){e.once(`ready`,ee.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],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){if(t){e.emit(`error`,t);return}e._ending&&!e._writing&&e.emit(`finish`),e.emit(`close`)}}h.SonicBoom=h,h.default=h,t.exports=h})),fe=/* @__PURE__ */ E(((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;
4
+ 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)}})),M=/* @__PURE__ */ O(((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}}})),re=/* @__PURE__ */ O(((e,t)=>{t.exports=l;let{messageWithCauses:n,stackWithCauses:r,isErrorLike:i}=ne(),{pinoErrProto:a,pinoErrorSymbols:o}=M(),{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}})),ie=/* @__PURE__ */ O(((e,t)=>{t.exports=s;let{isErrorLike:n}=ne(),{pinoErrProto:r,pinoErrorSymbols:i}=M(),{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}})),ae=/* @__PURE__ */ O(((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)}}})),oe=/* @__PURE__ */ O(((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)}}})),se=/* @__PURE__ */ O(((e,t)=>{let n=re(),r=ie(),i=ae(),a=oe();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))}}}})),ce=/* @__PURE__ */ O(((e,t)=>{let n=j(`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}})),le=/* @__PURE__ */ O(((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})),ue=/* @__PURE__ */ O(((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`),ee=Symbol(`pino.mixinMergeStrategy`),E=Symbol(`pino.msgPrefix`),D=Symbol(`pino.wildcardFirst`),O=Symbol.for(`pino.serializers`),k=Symbol.for(`pino.formatters`),A=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:O,redactFmtSym:p,timeSym:m,timeSliceIndexSym:h,streamSym:g,stringifySym:_,stringifySafeSym:v,stringifiersSym:y,endSym:b,formatOptsSym:x,messageKeySym:S,errorKeySym:C,nestedKeySym:w,wildcardFirstSym:D,needsMetadataGsym:Symbol.for(`pino.metadata`),useOnlyCustomLevelsSym:s,formattersSym:k,hooksSym:A,nestedKeyStrSym:T,mixinMergeStrategySym:ee,msgPrefixSym:E,transportUsesMultistreamSym:Symbol.for(`pino.transport.usesMultistream`)}})),de=/* @__PURE__ */ O(((e,t)=>{let n=le(),{redactFmtSym:r,wildcardFirstSym:i}=ue(),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})),fe=/* @__PURE__ */ O(((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"`}}})),pe=/* @__PURE__ */ O(((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)}})),me=/* @__PURE__ */ O(((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}})),he=/* @__PURE__ */ O(((e,t)=>{let n=j(`fs`),r=j(`events`),i=j(`util`).inherits,a=j(`path`),o=me(),s=j(`assert`),c=Buffer.allocUnsafe(0),l=`buffer`,u=`utf8`,[d,f]=(process.versions.node||`0.0`).split(`.`).map(Number),p=d>=22&&f>=7;function m(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`,o=t.mode;if(t.sync)try{t.mkdir&&n.mkdirSync(a.dirname(e),{recursive:!0}),r(null,n.openSync(e,i,o))}catch(e){throw r(e),e}else t.mkdir?n.mkdir(a.dirname(e),{recursive:!0},t=>{if(t)return r(t);n.open(e,i,o,r)}):n.open(e,i,o,r)}function h(e){if(!(this instanceof h))return new h(e);let{fd:t,dest:r,minLength:i,maxLength:a,maxWrite:s,periodicFlush:d,sync:f,append:p=!0,mkdir:v,retryEAGAIN:x,fsync:O,contentMode:k,mode:A}=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=s||16384,this._periodicFlush=d||0,this._periodicFlushTimer=void 0,this.sync=f||!1,this.writable=!0,this._fsync=O||!1,this.append=p||!1,this.mode=A,this.retryEAGAIN=x||(()=>!0),this.mkdir=v||!1;let te,j;if(k===l)this._writingBuf=c,this.write=b,this.flush=C,this.flushSync=T,this._actualWrite=E,te=()=>n.writeSync(this.fd,this._writingBuf),j=()=>n.write(this.fd,this._writingBuf,this.release);else if(k===void 0||k===u)this._writingBuf=``,this.write=y,this.flush=S,this.flushSync=w,this._actualWrite=ee,te=()=>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 "${u}" and "${l}", but passed ${k}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)m(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{o(100),this.release(void 0,0)}catch(e){this.release(e)}else setTimeout(j,100)}else this._writing=!1,this.emit(`error`,e);return}this.emit(`write`,t);let r=g(this._writingBuf,this._len,t);if(this._len=r.len,this._writingBuf=r.writingBuf,this._writingBuf.length){if(!this.sync){j();return}try{do{let e=te(),t=g(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,D(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(_,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 g(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 _(e){e.listenerCount(`drain`)>0&&(e._asyncDrainScheduled=!1,e.emit(`drain`))}i(h,r);function v(e,t){return e.length===0?c:e.length===1?e[0]:Buffer.concat(e,t)}function y(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 b(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 x(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 S(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&&x.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(``),this._actualWrite()))}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&&x.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite()))}h.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)})}),m(this.file,this)},h.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():D(this)))};function w(){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=g(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;o(100)}}try{n.fsyncSync(this.fd)}catch{}}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=c);let e=c;for(;this._bufs.length||e.length;){e.length<=0&&(e=v(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;o(100)}}}h.prototype.destroy=function(){this.destroyed||D(this)};function ee(){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 E(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:v(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,n.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else p&&(this._writingBuf=Buffer.from(this._writingBuf)),n.write(this.fd,this._writingBuf,e)}function D(e){if(e.fd===-1){e.once(`ready`,D.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],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`))}}h.SonicBoom=h,h.default=h,t.exports=h})),ge=/* @__PURE__ */ O(((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;
4
5
  /* istanbul ignore else */
5
- 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}})),P=/* @__PURE__ */ E(((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`}})),pe=/* @__PURE__ */ E(((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=>{if(e===`ok`){a(null,`ok`);return}s()}):setImmediate(s)};s()}t.exports={wait:r,waitDiff:i}})),me=/* @__PURE__ */ E(((e,t)=>{t.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}})),he=/* @__PURE__ */ E(((e,t)=>{let{version:n}=P(),{EventEmitter:r}=k(`events`),{Worker:i}=k(`worker_threads`),{join:a}=k(`path`),{pathToFileURL:o}=k(`url`),{wait:s}=pe(),{WRITE_INDEX:c,READ_INDEX:l,SEQ_INDEX:u}=me(),d=k(`buffer`),f=k(`assert`),p=Symbol(`kImpl`),m=d.constants.MAX_STRING_LENGTH;function h(){}function g(e,t){Atomics.add(e[p].state,u,1),t(),Atomics.add(e[p].state,u,1),Atomics.notify(e[p].state,u)}function _(e){g(e,()=>{Atomics.store(e[p].state,l,0),Atomics.store(e[p].state,c,0)})}var v=class{constructor(e){this._value=e}deref(){return this._value}},y=class{register(){}unregister(){}};let b=process.env.NODE_V8_COVERAGE?y:global.FinalizationRegistry||y,x=process.env.NODE_V8_COVERAGE?v:global.WeakRef||v,S=new b(e=>{e.exited||e.terminate()});function C(e,t){let{filename:r,workerData:s}=t,c=(`__bundlerPathsOverrides`in globalThis?globalThis.__bundlerPathsOverrides:{})[`thread-stream-worker`]||a(__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:o(r).href,dataBuf:e[p].dataBuf,stateBuf:e[p].stateBuf,workerData:{$context:{threadStreamVersion:n},...s}}});return l.stream=new v(e),l.on(`message`,E),l.on(`exit`,D),S.register(e,l),l}function w(e){f(!e[p].sync),e[p].needDrain&&(e[p].needDrain=!1,e.emit(`drain`))}function T(e){for(;;){let t=Atomics.load(e[p].state,c),n=e[p].data.length-t;if(n>0){if(e[p].bufLen===0){e[p].flushing=!1,e[p].ending?ie(e):e[p].needDrain&&process.nextTick(w,e);return}re(e,n,h);continue}if(n===0){if(t===0&&e[p].bufLen===0)return;A(e,()=>{e.destroyed||(_(e),T(e))});return}M(e,/* @__PURE__ */ Error(`overwritten`));return}}function E(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}if(e?.code!=null)switch(e.code){case`READY`:this.stream=new x(t),A(t,()=>{t[p].ready=!0,t.emit(`ready`)});break;case`ERROR`:M(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`){M(t,/* @__PURE__ */ Error(`this should not happen: `+e.code));break}let n=t[p].flushCallbacks.get(e.id);n&&(t[p].flushCallbacks.delete(e.id),process.nextTick(n));break}case`WARNING`:process.emitWarning(e.err);break;default:M(t,/* @__PURE__ */ Error(`this should not happen: `+e.code))}}function D(e){let t=this.stream.deref();t!==void 0&&(S.unregister(t),t.worker.exited=!0,t.worker.off(`exit`,D),M(t,e===0?null:/* @__PURE__ */ Error(`the worker thread exited`)))}var ee=class extends r{constructor(e={}){if(super(),e.bufferSize<4)throw Error(`bufferSize must at least fit a 4-byte utf-8 char`);this[p]={},this[p].stateBuf=new SharedArrayBuffer(128),this[p].state=new Int32Array(this[p].stateBuf),this[p].dataBuf=new SharedArrayBuffer(e.bufferSize||4194304),this[p].data=Buffer.from(this[p].dataBuf),this[p].sync=e.sync||!1,this[p].ending=!1,this[p].ended=!1,this[p].needDrain=!1,this[p].destroyed=!1,this[p].flushing=!1,this[p].ready=!1,this[p].finished=!1,this[p].errored=null,this[p].closed=!1,this[p].buf=[],this[p].bufHead=0,this[p].bufLen=0,this[p].flushCallbacks=/* @__PURE__ */ new Map,this[p].nextFlushId=0,this.worker=C(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[p].destroyed)return ne(this,/* @__PURE__ */ Error(`the worker has exited`)),!1;if(this[p].ending)return ne(this,/* @__PURE__ */ Error(`the worker is ending`)),!1;if(this[p].flushing&&this[p].bufLen+t.length>=m)try{N(this),this[p].flushing=!0}catch(e){return M(this,e),!1}if(this[p].buf.push(t),this[p].bufLen+=t.length,this[p].sync)try{return N(this),!0}catch(e){return M(this,e),!1}return this[p].flushing||(this[p].flushing=!0,setImmediate(T,this)),this[p].needDrain=this[p].data.length-this[p].bufLen-Atomics.load(this[p].state,c)<=0,!this[p].needDrain}end(){this[p].destroyed||(this[p].ending=!0,ie(this))}flush(e){e=typeof e==`function`?e:h,O(this,t=>{if(t){process.nextTick(e,t);return}j(this,e)})}flushSync(){this[p].destroyed||(N(this),ae(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[p].ready}get destroyed(){return this[p].destroyed}get closed(){return this[p].closed}get writable(){return!this[p].destroyed&&!this[p].ending}get writableEnded(){return this[p].ending}get writableFinished(){return this[p].finished}get writableNeedDrain(){return this[p].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[p].errored}};function O(e,t){if(e[p].destroyed){process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`));return}if(!e[p].sync&&(e[p].flushing||e[p].bufLen>0)){setImmediate(O,e,t);return}A(e,t)}function A(e,t){let n=Atomics.load(e[p].state,c);s(e[p].state,l,n,1/0,(n,r)=>{if(n){M(e,n),t(n);return}if(r!==`ok`){A(e,t);return}t()})}function j(e,t){if(e[p].destroyed){process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`));return}if(!e[p].ready){let n=()=>{i(),j(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[p].nextFlushId;e[p].flushCallbacks.set(n,t);try{e.worker.postMessage({code:`FLUSH`,context:`thread-stream`,id:n})}catch(r){e[p].flushCallbacks.delete(n),M(e,r),process.nextTick(t,r)}}function te(e,t){let n=e[p].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 ne(e,t){setImmediate(()=>{e.emit(`error`,t)})}function M(e,t){e[p].destroyed||(e[p].destroyed=!0,te(e,t),t&&(e[p].errored=t,ne(e,t)),e.worker.exited?setImmediate(()=>{e[p].closed=!0,e.emit(`close`)}):e.worker.terminate().catch(()=>{}).then(()=>{e[p].closed=!0,e.emit(`close`)}))}function re(e,t,n){let r=Atomics.load(e[p].state,c),i=t;for(;i>0&&e[p].bufLen!==0;){let t=e[p].bufHead,n=e[p].buf[t];if(n.length<=i){n.copy(e[p].data,r),r+=n.length,i-=n.length,e[p].bufLen-=n.length,e[p].bufHead=t+1,e[p].bufHead===e[p].buf.length?(e[p].buf.length=0,e[p].bufHead=0):e[p].bufHead>=1024&&e[p].bufHead*2>=e[p].buf.length&&(e[p].buf.splice(0,e[p].bufHead),e[p].bufHead=0);continue}n.copy(e[p].data,r,0,i),e[p].buf[t]=n.subarray(i),e[p].bufLen-=i,r+=i,i=0}return g(e,()=>{Atomics.store(e[p].state,c,r)}),n(),!0}function ie(e){if(!(e[p].ended||!e[p].ending||e[p].flushing)){e[p].ended=!0;try{e.flushSync();let t=Atomics.load(e[p].state,l);g(e,()=>{Atomics.store(e[p].state,c,-1)});let n=0;for(;t!==-1;){if(Atomics.wait(e[p].state,l,t,1e3),t=Atomics.load(e[p].state,l),t===-2){M(e,/* @__PURE__ */ Error(`end() failed`));return}if(++n===10){M(e,/* @__PURE__ */ Error(`end() took too long (10s)`));return}}process.nextTick(()=>{e[p].finished=!0,e.emit(`finish`)})}catch(t){M(e,t)}}}function N(e){let t=()=>{e[p].ending?ie(e):e[p].needDrain&&process.nextTick(w,e)};for(e[p].flushing=!1;e[p].bufLen!==0;){let n=Atomics.load(e[p].state,c),r=e[p].data.length-n;if(r===0){ae(e),_(e);continue}if(r<0)throw Error(`overwritten`);re(e,r,t)}}function ae(e){if(e[p].flushing)throw Error(`unable to flush while flushing`);let t=Atomics.load(e[p].state,c),n=0;for(;;){let r=Atomics.load(e[p].state,l);if(r===-2)throw Error(`_flushSync failed`);if(r!==t)Atomics.wait(e[p].state,l,r,1e3);else break;if(++n===10)throw Error(`_flushSync took too long (10s)`)}}t.exports=ee})),ge=/* @__PURE__ */ E(((e,t)=>{let{createRequire:n}=k(`module`),{existsSync:r}=k(`node:fs`),i=N(),{join:a,isAbsolute:o,sep:s}=k(`node:path`),{fileURLToPath:c}=k(`node:url`),l=ue(),u=fe(),d=he();function f(e){u.register(e,v),u.registerBeforeExit(e,y),e.on(`close`,function(){u.unregister(e)})}function p(){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 m(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&&h(a)){r=!0,e++;continue}n.push(i),a&&(n.push(a),e++);continue}if((i.startsWith(`--require=`)||i.startsWith(`-r=`)||i.startsWith(`--import=`))&&h(i.slice(i.indexOf(`=`)+1))){r=!0;continue}n.push(i)}return r?n.join(` `):e}function h(e){let t=g(e);if(!t)return!1;let n=t;if(n.startsWith(`file://`))try{n=c(n)}catch{return!1}return o(n)&&!r(n)}function g(e){let t=e[0],n=e[e.length-1];return t===`"`&&n===`"`||t===`'`&&n===`'`?e.slice(1,-1):e}function _(e,t,n,r,i){if(!n.execArgv&&p()&&k.main===void 0&&(n={...n,execArgv:[]}),!n.env&&process.env.NODE_OPTIONS){let e=m(process.env.NODE_OPTIONS);e!==process.env.NODE_OPTIONS&&(n={...n,env:{...process.env,NODE_OPTIONS:e}})}n={...n,name:i};let a=new d({filename:e,workerData:t,workerOpts:n,sync:r});a.on(`ready`,o),a.on(`close`,function(){process.removeListener(`exit`,s)}),process.on(`exit`,s);function o(){process.removeListener(`exit`,s),a.unref(),n.autoEnd!==!1&&f(a)}function s(){
6
+ 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}})),_e=/* @__PURE__ */ O(((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`}})),ve=/* @__PURE__ */ O(((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}})),ye=/* @__PURE__ */ O(((e,t)=>{t.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}})),be=/* @__PURE__ */ O(((e,t)=>{let{version:n}=_e(),{EventEmitter:r}=j(`events`),{Worker:i}=j(`worker_threads`),{join:a}=j(`path`),{pathToFileURL:o}=j(`url`),{wait:s}=ve(),{WRITE_INDEX:c,READ_INDEX:l,SEQ_INDEX:u}=ye(),d=j(`buffer`),f=j(`assert`),p=Symbol(`kImpl`),m=d.constants.MAX_STRING_LENGTH;function h(){}function g(e,t){Atomics.add(e[p].state,u,1),t(),Atomics.add(e[p].state,u,1),Atomics.notify(e[p].state,u)}function _(e){g(e,()=>{Atomics.store(e[p].state,l,0),Atomics.store(e[p].state,c,0)})}var v=class{constructor(e){this._value=e}deref(){return this._value}},y=class{register(){}unregister(){}};let b=process.env.NODE_V8_COVERAGE?y:global.FinalizationRegistry||y,x=process.env.NODE_V8_COVERAGE?v:global.WeakRef||v,S=new b(e=>{e.exited||e.terminate()});function C(e,t){let{filename:r,workerData:s}=t,c=(`__bundlerPathsOverrides`in globalThis?globalThis.__bundlerPathsOverrides:{})[`thread-stream-worker`]||a(__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:o(r).href,dataBuf:e[p].dataBuf,stateBuf:e[p].stateBuf,workerData:{$context:{threadStreamVersion:n},...s}}});return l.stream=new v(e),l.on(`message`,ee),l.on(`exit`,E),S.register(e,l),l}function w(e){f(!e[p].sync),e[p].needDrain&&(e[p].needDrain=!1,e.emit(`drain`))}function T(e){for(;;){let t=Atomics.load(e[p].state,c),n=e[p].data.length-t;if(n>0){if(e[p].bufLen===0){e[p].flushing=!1,e[p].ending?ie(e):e[p].needDrain&&process.nextTick(w,e);return}re(e,n,h)}else{if(n===0){if(t===0&&e[p].bufLen===0)return;k(e,()=>{e.destroyed||(_(e),T(e))});return}M(e,/* @__PURE__ */ Error(`overwritten`));return}}}function ee(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 x(t),k(t,()=>{t[p].ready=!0,t.emit(`ready`)});break;case`ERROR`:M(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`){M(t,/* @__PURE__ */ Error(`this should not happen: `+e.code));break}let n=t[p].flushCallbacks.get(e.id);n&&(t[p].flushCallbacks.delete(e.id),process.nextTick(n));break}case`WARNING`:process.emitWarning(e.err);break;default:M(t,/* @__PURE__ */ Error(`this should not happen: `+e.code))}}function E(e){let t=this.stream.deref();t!==void 0&&(S.unregister(t),t.worker.exited=!0,t.worker.off(`exit`,E),M(t,e===0?null:/* @__PURE__ */ Error(`the worker thread exited`)))}var D=class extends r{constructor(e={}){if(super(),e.bufferSize<4)throw Error(`bufferSize must at least fit a 4-byte utf-8 char`);this[p]={},this[p].stateBuf=new SharedArrayBuffer(128),this[p].state=new Int32Array(this[p].stateBuf),this[p].dataBuf=new SharedArrayBuffer(e.bufferSize||4194304),this[p].data=Buffer.from(this[p].dataBuf),this[p].sync=e.sync||!1,this[p].ending=!1,this[p].ended=!1,this[p].needDrain=!1,this[p].destroyed=!1,this[p].flushing=!1,this[p].ready=!1,this[p].finished=!1,this[p].errored=null,this[p].closed=!1,this[p].buf=[],this[p].bufHead=0,this[p].bufLen=0,this[p].flushCallbacks=/* @__PURE__ */ new Map,this[p].nextFlushId=0,this.worker=C(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[p].destroyed)return ne(this,/* @__PURE__ */ Error(`the worker has exited`)),!1;if(this[p].ending)return ne(this,/* @__PURE__ */ Error(`the worker is ending`)),!1;if(this[p].flushing&&this[p].bufLen+t.length>=m)try{ae(this),this[p].flushing=!0}catch(e){return M(this,e),!1}if(this[p].buf.push(t),this[p].bufLen+=t.length,this[p].sync)try{return ae(this),!0}catch(e){return M(this,e),!1}return this[p].flushing||(this[p].flushing=!0,setImmediate(T,this)),this[p].needDrain=this[p].data.length-this[p].bufLen-Atomics.load(this[p].state,c)<=0,!this[p].needDrain}end(){this[p].destroyed||(this[p].ending=!0,ie(this))}flush(e){e=typeof e==`function`?e:h,O(this,t=>{t?process.nextTick(e,t):A(this,e)})}flushSync(){this[p].destroyed||(ae(this),oe(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[p].ready}get destroyed(){return this[p].destroyed}get closed(){return this[p].closed}get writable(){return!this[p].destroyed&&!this[p].ending}get writableEnded(){return this[p].ending}get writableFinished(){return this[p].finished}get writableNeedDrain(){return this[p].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[p].errored}};function O(e,t){e[p].destroyed?process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`)):!e[p].sync&&(e[p].flushing||e[p].bufLen>0)?setImmediate(O,e,t):k(e,t)}function k(e,t){let n=Atomics.load(e[p].state,c);s(e[p].state,l,n,1/0,(n,r)=>{n?(M(e,n),t(n)):r===`ok`?t():k(e,t)})}function A(e,t){if(e[p].destroyed){process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`));return}if(!e[p].ready){let n=()=>{i(),A(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[p].nextFlushId;e[p].flushCallbacks.set(n,t);try{e.worker.postMessage({code:`FLUSH`,context:`thread-stream`,id:n})}catch(r){e[p].flushCallbacks.delete(n),M(e,r),process.nextTick(t,r)}}function te(e,t){let n=e[p].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 ne(e,t){setImmediate(()=>{e.emit(`error`,t)})}function M(e,t){e[p].destroyed||(e[p].destroyed=!0,te(e,t),t&&(e[p].errored=t,ne(e,t)),e.worker.exited?setImmediate(()=>{e[p].closed=!0,e.emit(`close`)}):e.worker.terminate().catch(()=>{}).then(()=>{e[p].closed=!0,e.emit(`close`)}))}function re(e,t,n){let r=Atomics.load(e[p].state,c),i=t;for(;i>0&&e[p].bufLen!==0;){let t=e[p].bufHead,n=e[p].buf[t];n.length<=i?(n.copy(e[p].data,r),r+=n.length,i-=n.length,e[p].bufLen-=n.length,e[p].bufHead=t+1,e[p].bufHead===e[p].buf.length?(e[p].buf.length=0,e[p].bufHead=0):e[p].bufHead>=1024&&e[p].bufHead*2>=e[p].buf.length&&(e[p].buf.splice(0,e[p].bufHead),e[p].bufHead=0)):(n.copy(e[p].data,r,0,i),e[p].buf[t]=n.subarray(i),e[p].bufLen-=i,r+=i,i=0)}return g(e,()=>{Atomics.store(e[p].state,c,r)}),n(),!0}function ie(e){if(!(e[p].ended||!e[p].ending||e[p].flushing)){e[p].ended=!0;try{e.flushSync();let t=Atomics.load(e[p].state,l);g(e,()=>{Atomics.store(e[p].state,c,-1)});let n=0;for(;t!==-1;){if(Atomics.wait(e[p].state,l,t,1e3),t=Atomics.load(e[p].state,l),t===-2){M(e,/* @__PURE__ */ Error(`end() failed`));return}if(++n===10){M(e,/* @__PURE__ */ Error(`end() took too long (10s)`));return}}process.nextTick(()=>{e[p].finished=!0,e.emit(`finish`)})}catch(t){M(e,t)}}}function ae(e){let t=()=>{e[p].ending?ie(e):e[p].needDrain&&process.nextTick(w,e)};for(e[p].flushing=!1;e[p].bufLen!==0;){let n=Atomics.load(e[p].state,c),r=e[p].data.length-n;if(r===0)oe(e),_(e);else{if(r<0)throw Error(`overwritten`);re(e,r,t)}}}function oe(e){if(e[p].flushing)throw Error(`unable to flush while flushing`);let t=Atomics.load(e[p].state,c),n=0;for(;;){let r=Atomics.load(e[p].state,l);if(r===-2)throw Error(`_flushSync failed`);if(r!==t)Atomics.wait(e[p].state,l,r,1e3);else break;if(++n===10)throw Error(`_flushSync took too long (10s)`)}}t.exports=D})),xe=/* @__PURE__ */ O(((e,t)=>{let{createRequire:n}=j(`module`),{existsSync:r}=j(`node:fs`),i=ce(),{join:a,isAbsolute:o,sep:s}=j(`node:path`),{fileURLToPath:c}=j(`node:url`),l=me(),u=ge(),d=be(),{transportUsesMultistreamSym:f}=ue();function p(e){u.register(e,y),u.registerBeforeExit(e,b),e.on(`close`,function(){u.unregister(e)})}function m(){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 h(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&&g(a)){r=!0,e++;continue}n.push(i),a&&(n.push(a),e++)}else(i.startsWith(`--require=`)||i.startsWith(`-r=`)||i.startsWith(`--import=`))&&g(i.slice(i.indexOf(`=`)+1))?r=!0:n.push(i)}return r?n.join(` `):e}function g(e){let t=_(e);if(!t)return!1;let n=t;if(n.startsWith(`file://`))try{n=c(n)}catch{return!1}return o(n)&&!r(n)}function _(e){let t=e[0],n=e[e.length-1];return t===`"`&&n===`"`||t===`'`&&n===`'`?e.slice(1,-1):e}function v(e,t,n,r,i){if(!n.execArgv&&m()&&j.main===void 0&&(n={...n,execArgv:[]}),!n.env&&process.env.NODE_OPTIONS){let e=h(process.env.NODE_OPTIONS);e!==process.env.NODE_OPTIONS&&(n={...n,env:{...process.env,NODE_OPTIONS:e}})}n={...n,name:i};let a=new d({filename:e,workerData:t,workerOpts:n,sync:r});a.on(`ready`,o),a.on(`close`,function(){process.removeListener(`exit`,s)}),process.on(`exit`,s);function o(){process.removeListener(`exit`,s),a.unref(),n.autoEnd!==!1&&p(a)}function s(){
6
7
  /* istanbul ignore next */
7
- a.closed||(a.flushSync(),l(100),a.end())}return a}function v(e){e.ref(),e.flushSync(),e.end(),e.once(`close`,function(){e.unref()})}function y(e){e.flushSync()}function b(e){let{pipeline:t,targets:r,levels:c,dedupe:l,worker:u={},caller:d=i(),sync:f=!1}=e,p={...e.options},m=typeof d==`string`?[d]:d,h=typeof globalThis==`object`&&Object.prototype.hasOwnProperty.call(globalThis,`__bundlerPathsOverrides`)&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides==`object`?globalThis.__bundlerPathsOverrides:Object.create(null),g=e.target;if(g&&r)throw Error(`only one of target or targets can be specified`);r?(g=h[`pino-worker`]||a(__dirname,`worker.js`),p.targets=r.filter(e=>e.target).map(e=>({...e,target:y(e.target)})),p.pipelines=r.filter(e=>e.pipeline).map(e=>e.pipeline.map(t=>({...t,level:e.level,target:y(t.target)})))):t&&(g=h[`pino-worker`]||a(__dirname,`worker.js`),p.pipelines=[t.map(e=>({...e,target:y(e.target)}))]),c&&(p.levels=c),l&&(p.dedupe=l),p.pinoWillSendConfig=!0;let v=r||t?`pino.transport`:g;return _(y(g),p,u,f,v);function y(e){if(e=h[e]||e,o(e)||e.indexOf(`file://`)===0)return e;if(e===`pino/file`)return a(__dirname,`..`,`file.js`);let t;for(let r of m)try{let i=r===`node:repl`?process.cwd()+s:r;t=n(i).resolve(e);break}catch{continue}if(!t)throw Error(`unable to determine transport target for "${e}"`);return t}}t.exports=b})),F=/* @__PURE__ */ E(((e,t)=>{let n=k(`node:diagnostics_channel`),r=le(),{mapHttpRequest:i,mapHttpResponse:a}=ie(),o=de(),s=fe(),{lsCacheSym:c,chindingsSym:l,writeSym:u,serializersSym:d,formatOptsSym:f,endSym:p,stringifiersSym:m,stringifySym:h,stringifySafeSym:g,wildcardFirstSym:_,nestedKeySym:v,formattersSym:y,messageKeySym:b,errorKeySym:x,nestedKeyStrSym:S,msgPrefixSym:C}=oe(),{isMainThread:w}=k(`worker_threads`),T=ge(),[E]=process.versions.node.split(`.`).map(e=>Number(e)),D=n.tracingChannel(`pino_asJson`),ee=E>=25?e=>JSON.stringify(e):j;function O(){}function A(e,t){return t?function(...r){t.call(this,r,n,e)}:n;function n(t,...n){if(typeof t==`object`){let o=t;t!==null&&(t.method&&t.headers&&t.socket?t=i(t):typeof t.setHeader==`function`&&(t=a(t)));let s;o===null&&n.length===0?s=[null]:(o=n.shift(),s=n),typeof this[C]==`string`&&o!=null&&(o=this[C]+o),this[u](t,r(o,s,this[f]),e)}else{let i=t===void 0?n.shift():t;typeof this[C]==`string`&&i!=null&&(i=this[C]+i),this[u](null,r(i,n,this[f]),e)}}}function j(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(D.hasSubscribers===!1)return ne.call(this,e,t,n,r);let i={instance:this,arguments};return D.traceSync(ne,i,this,e,t,n,r)}function ne(e,t,n,r){let i=this[h],a=this[g],o=this[m],s=this[p],u=this[l],f=this[d],C=this[y],w=this[b],T=this[x],E=this[c][n]+r;E+=u;let D;C.log&&(e=C.log(e));let O=o[_],k=``;for(let t in e)if(D=e[t],Object.prototype.hasOwnProperty.call(e,t)&&D!==void 0){f[t]?D=f[t](D):t===T&&f.err&&(D=f.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||ee)(D);break;default:D=(e||i)(D,a)}if(D===void 0)continue;let n=ee(t);k+=`,`+n+`:`+D}let A=``;if(t!==void 0){D=f[w]?f[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)),A=`,"`+w+`":`+D;break;case`string`:D=(e||ee)(D),A=`,"`+w+`":`+D;break;default:D=(e||i)(D,a),A=`,"`+w+`":`+D}}return this[v]&&k?E+this[S]+k.slice(1)+`}`+A+s:E+k+A+s}function M(e,t){let n,r=e[l],i=e[h],a=e[g],o=e[m],s=o[_],c=e[d],u=e[y].bindings;t=u(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+=`,"`+e+`":`+n}return r}function re(e){return e.write!==e.constructor.prototype.write}function N(e){let t=new o(e);return t.on(`error`,n),!e.sync&&w&&(s.register(t,ae),t.on(`close`,function(){s.unregister(t)})),t;function n(e){
8
+ a.closed||(a.flushSync(),l(100),a.end())}return a}function y(e){e.ref(),e.flushSync(),e.end(),e.once(`close`,function(){e.unref()})}function b(e){e.flushSync()}function x(e){let{pipeline:t,targets:r,levels:c,dedupe:l,worker:u={},caller:d=i(),sync:p=!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),y=e.target;if(y&&r)throw Error(`only one of target or targets can be specified`);if(r){y=_[`pino-worker`]||a(__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&&(y=_[`pino-worker`]||a(__dirname,`worker.js`),m.pipelines=[t.map(e=>({...e,target:S(e.target)}))]);c&&(m.levels=c),l&&(m.dedupe=l),m.pinoWillSendConfig=!0;let b=r||t?`pino.transport`:y,x=v(S(y),m,u,p,b);return h&&(x[f]=!0),x;function S(e){if(e=_[e]||e,o(e)||e.indexOf(`file://`)===0)return e;if(e===`pino/file`)return a(__dirname,`..`,`file.js`);let t;for(let r of g)try{let i=r===`node:repl`?process.cwd()+s:r;t=n(i).resolve(e);break}catch{continue}if(!t)throw Error(`unable to determine transport target for "${e}"`);return t}}t.exports=x})),Se=/* @__PURE__ */ O(((e,t)=>{let n=j(`node:diagnostics_channel`),r=pe(),{mapHttpRequest:i,mapHttpResponse:a}=se(),o=he(),s=ge(),{lsCacheSym:c,chindingsSym:l,writeSym:u,serializersSym:d,formatOptsSym:f,endSym:p,stringifiersSym:m,stringifySym:h,stringifySafeSym:g,wildcardFirstSym:_,nestedKeySym:v,formattersSym:y,messageKeySym:b,errorKeySym:x,nestedKeyStrSym:S,msgPrefixSym:C}=ue(),{isMainThread:w}=j(`worker_threads`),T=xe(),[ee]=process.versions.node.split(`.`).map(e=>Number(e)),E=n.tracingChannel(`pino_asJson`),D=ee>=25?e=>JSON.stringify(e):A;function O(){}function k(e,t){return t?function(...r){t.call(this,r,n,e)}:n;function n(t,...n){if(typeof t==`object`){let o=t;t!==null&&(t.method&&t.headers&&t.socket?t=i(t):typeof t.setHeader==`function`&&(t=a(t)));let s;o===null&&n.length===0?s=[null]:(o=n.shift(),s=n),typeof this[C]==`string`&&o!=null&&(o=this[C]+o),this[u](t,r(o,s,this[f]),e)}else{let i=t===void 0?n.shift():t;typeof this[C]==`string`&&i!=null&&(i=this[C]+i),this[u](null,r(i,n,this[f]),e)}}}function A(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(E.hasSubscribers===!1)return ne.call(this,e,t,n,r);let i={instance:this,arguments};return E.traceSync(ne,i,this,e,t,n,r)}function ne(e,t,n,r){let i=this[h],a=this[g],o=this[m],s=this[p],u=this[l],f=this[d],C=this[y],w=this[b],T=this[x],ee=this[c][n]+r;ee+=u;let E;C.log&&(e=C.log(e));let O=o[_],k=``;for(let t in e)if(E=e[t],Object.prototype.hasOwnProperty.call(e,t)&&E!==void 0){f[t]?E=f[t](E):t===T&&f.err&&(E=f.err(E));let e=o[t]||O;switch(typeof E){case`undefined`:case`function`:continue;case`number`:Number.isFinite(E)===!1&&(E=null);case`boolean`:e&&(E=e(E));break;case`string`:E=(e||D)(E);break;default:E=(e||i)(E,a)}if(E===void 0)continue;let n=D(t);k+=`,`+n+`:`+E}let A=``;if(t!==void 0){E=f[w]?f[w](t):t;let e=o[w]||O;switch(typeof E){case`function`:break;case`number`:Number.isFinite(E)===!1&&(E=null);case`boolean`:e&&(E=e(E)),A=`,"`+w+`":`+E;break;case`string`:E=(e||D)(E),A=`,"`+w+`":`+E;break;default:E=(e||i)(E,a),A=`,"`+w+`":`+E}}return this[v]&&k?ee+this[S]+k.slice(1)+`}`+A+s:ee+k+A+s}function M(e,t){let n,r=e[l],i=e[h],a=e[g],o=e[m],s=o[_],c=e[d],u=e[y].bindings;t=u(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+=`,`+D(e)+`:`+n}return r}function re(e){return e.write!==e.constructor.prototype.write}function ie(e){let t=new o(e);return t.on(`error`,n),!e.sync&&w&&(s.register(t,ae),t.on(`close`,function(){s.unregister(t)})),t;function n(e){
8
9
  /* istanbul ignore next */
9
- if(e.code===`EPIPE`){t.write=O,t.end=O,t.flushSync=O,t.destroy=O;return}t.removeListener(`error`,n),t.emit(`error`,e)}}function ae(e,t){
10
+ e.code===`EPIPE`?(t.write=O,t.end=O,t.flushSync=O,t.destroy=O):(t.removeListener(`error`,n),t.emit(`error`,e))}}function ae(e,t){
10
11
  /* istanbul ignore next */
11
12
  e.destroyed||(t===`beforeExit`?(e.flush(),e.on(`drain`,function(){e.end()})):
12
13
  /* istanbul ignore next */
13
- e.flushSync())}function se(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 o||r.writable||r._writableState)i=r,r={};else if(r.transport){if(r.transport instanceof o||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=T({caller:n,...r.transport,levels:e})}if(r=Object.assign({},e,r),r.serializers=Object.assign({},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:s}=r;return a===!1&&(r.level=`silent`),s||(r.onChild=O),i||=re(process.stdout)?process.stdout:N({fd:process.stdout.fd||1}),{opts:r,stream:i}}}function ce(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[g])(e)}catch{return`"[unable to serialize, circular reference is too complex to analyze]"`}}}function ue(e,t,n){return{level:e,bindings:t,log:n}}function P(e){let t=Number(e);return typeof e==`string`&&Number.isFinite(t)?t:e===void 0?1:e}t.exports={noop:O,buildSafeSonicBoom:N,asChindings:M,asJson:te,genLog:A,createArgsNormalizer:se,stringify:ce,buildFormatters:ue,normalizeDestFileDescriptor:P}})),_e=/* @__PURE__ */ E(((e,t)=>{t.exports={DEFAULT_LEVELS:{trace:10,debug:20,info:30,warn:40,error:50,fatal:60},SORTING_ORDER:{ASC:`ASC`,DESC:`DESC`}}})),ve=/* @__PURE__ */ E(((e,t)=>{let{lsCacheSym:n,levelValSym:r,useOnlyCustomLevelsSym:i,streamSym:a,formattersSym:o,hooksSym:s,levelCompSym:c}=oe(),{noop:l,genLog:u}=F(),{DEFAULT_LEVELS:d,SORTING_ORDER:f}=_e(),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){if(f(n[e],o)===!1){this[e]=l;continue}this[e]=_(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`);return}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}})),ye=/* @__PURE__ */ E(((e,t)=>{t.exports={version:`10.3.1`}})),be=/* @__PURE__ */ E(((e,t)=>{let{EventEmitter:n}=k(`node:events`),{lsCacheSym:r,levelValSym:i,setLevelSym:a,getLevelSym:o,chindingsSym:s,mixinSym:c,asJsonSym:l,writeSym:u,mixinMergeStrategySym:d,timeSym:f,timeSliceIndexSym:p,streamSym:m,serializersSym:h,formattersSym:g,errorKeySym:_,messageKeySym:v,useOnlyCustomLevelsSym:y,needsMetadataGsym:b,redactFmtSym:x,stringifySym:S,formatOptsSym:C,stringifiersSym:w,msgPrefixSym:T,hooksSym:E}=oe(),{getLevel:D,setLevel:ee,isLevelEnabled:O,mappings:A,initialLsCache:j,genLsCache:te,assertNoLevelCollisions:ne}=ve(),{asChindings:M,asJson:re,buildFormatters:ie,stringify:N,noop:ae}=F(),{version:ce}=ye(),le=se(),ue={constructor:class{},child:fe,bindings:P,setBindings:pe,flush:ge,isLevelEnabled:O,version:ce,get level(){return this[o]()},set level(e){this[a](e)},get levelVal(){return this[i]},set levelVal(e){throw Error(`levelVal is read-only`)},get msgPrefix(){return this[T]},get[Symbol.toStringTag](){return`Pino`},[r]:j,[u]:he,[l]:re,[o]:D,[a]:ee};Object.setPrototypeOf(ue,n.prototype),t.exports=function(){return Object.create(ue)};let de=e=>e;function fe(e,t){if(!e)throw Error(`missing bindings for child Pino`);let n=this[h],r=this[g],i=Object.create(this);if(t==null)return i[g].bindings!==de&&(i[g]=ie(r.level,de,r.log)),i[s]=M(i,e),this.onChild!==ae&&this.onChild(i),i;if(t.hasOwnProperty(`serializers`)===!0){i[h]=Object.create(null);for(let e in n)i[h][e]=n[e];let e=Object.getOwnPropertySymbols(n);for(var o=0;o<e.length;o++){let t=e[o];i[h][t]=n[t]}for(let e in t.serializers)i[h][e]=t.serializers[e];let r=Object.getOwnPropertySymbols(t.serializers);for(var c=0;c<r.length;c++){let e=r[c];i[h][e]=t.serializers[e]}}else i[h]=n;if(t.hasOwnProperty(`formatters`)){let{level:e,bindings:n,log:a}=t.formatters;i[g]=ie(e||r.level,n||de,a||r.log)}else i[g]=ie(r.level,de,r.log);if(t.hasOwnProperty(`customLevels`)===!0&&(ne(this.levels,t.customLevels),i.levels=A(t.customLevels,i[y]),te(i)),typeof t.redact==`object`&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let e=le(i.redact,N),n={stringify:e[x]};i[S]=N,i[w]=e,i[C]=n}if(typeof t.msgPrefix==`string`&&(i[T]=(this[T]||``)+t.msgPrefix),i[s]=M(i,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty(`customLevels`)){let e=t.level||this.level;i[a](e)}return this.onChild(i),i}function P(){let e=`{${this[s].substr(1)}}`,t=JSON.parse(e);return delete t.pid,delete t.hostname,t}function pe(e){let t=M(this,e);this[s]=t}function me(e,t){return Object.assign(t,e)}function he(e,t,n){let r=this[f](),i=this[c],a=this[_],o=this[v],s=this[d]||me,u,h=this[E].streamWrite;e==null?u={}:e instanceof Error?(u={[a]:e},t===void 0&&(t=e.message)):(u=e,t===void 0&&e[o]===void 0&&e[a]&&(t=e[a].message)),i&&(u=s(u,i(u,n,this)));let g=this[l](u,t,n,r),y=this[m];y[b]===!0&&(y.lastLevel=n,y.lastObj=u,y.lastMsg=t,y.lastTime=r.slice(this[p]),y.lastLogger=this),y.write(h?h(g):g)}function ge(e){if(e!=null&&typeof e!=`function`)throw Error(`callback must be a function`);let t=this[m];typeof t.flush==`function`?t.flush(e||ae):e&&e()}})),xe=/* @__PURE__ */ E(((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}})),Se=/* @__PURE__ */ E(((e,t)=>{let n=Symbol.for(`pino.metadata`),{DEFAULT_LEVELS:r}=_e(),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=this.lastLevel,{streams:a}=this,o=0,u;for(let d=s(a.length,t.dedupe);l(d,a.length,t.dedupe);d=c(d,t.dedupe))if(r=a[d],r.level<=i){if(o!==0&&o!==r.level)break;if(u=r.stream,u[n]){let{lastTime:e,lastMsg:t,lastObj:n,lastLogger:r}=this;u.lastLevel=i,u.lastTime=e,u.lastMsg=t,u.lastObj=n,u.lastLogger=r}u.write(e),t.dedupe&&(o=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 u;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,u}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),u}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,minLevel:e,streams:t,clone:_,emit:f,flushSync:p,[n]:!0}}}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})),Ce=/* @__PURE__ */ O((/* @__PURE__ */ E(((e,t)=>{let n=k(`node:os`),r=ie(),i=N(),a=se(),o=ce(),s=be(),c=oe(),{configure:l}=xe(),{assertDefaultLevelFound:u,mappings:d,genLsCache:f,genLevelComparison:p,assertLevelComparison:m}=ve(),{DEFAULT_LEVELS:h,SORTING_ORDER:g}=_e(),{createArgsNormalizer:_,asChindings:v,buildSafeSonicBoom:y,buildFormatters:b,stringify:x,normalizeDestFileDescriptor:S,noop:C}=F(),{version:w}=ye(),{chindingsSym:T,redactFmtSym:E,serializersSym:D,timeSym:ee,timeSliceIndexSym:O,streamSym:A,stringifySym:j,stringifySafeSym:te,stringifiersSym:ne,setLevelSym:M,endSym:re,formatOptsSym:ae,messageKeySym:le,errorKeySym:ue,nestedKeySym:de,mixinSym:fe,levelCompSym:P,useOnlyCustomLevelsSym:pe,formattersSym:me,hooksSym:he,nestedKeyStrSym:Ce,mixinMergeStrategySym:we,msgPrefixSym:Te}=c,{epochTime:I,nullTime:Ee}=o,{pid:L}=process,De=n.hostname(),Oe=r.err,ke=_({level:`info`,levelComparison:g.ASC,levels:h,messageKey:`msg`,errorKey:`err`,nestedKey:null,enabled:!0,base:{pid:L,hostname:De},serializers:Object.assign(Object.create(null),{err:Oe}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:I,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100}),Ae=Object.assign(Object.create(null),r);function je(...e){let t={},{opts:n,stream:r}=ke(t,i(),...e);n.level&&typeof n.level==`string`&&h[n.level.toLowerCase()]!==void 0&&(n.level=n.level.toLowerCase());let{redact:o,crlf:c,serializers:g,timestamp:_,messageKey:y,errorKey:S,nestedKey:w,base:k,name:ie,level:N,customLevels:oe,levelComparison:se,mixin:ce,mixinMergeStrategy:ge,useOnlyCustomLevels:F,formatters:_e,hooks:ve,depthLimit:ye,edgeLimit:be,onChild:xe,msgPrefix:Se}=n,L=l({maximumDepth:ye,maximumBreadth:be}),De=b(_e.level,_e.bindings,_e.log),Oe=x.bind({[te]:L}),Ae=o?a(o,Oe):{},je=o?{stringify:Ae[E]}:{stringify:Oe},Me=`}`+(c?`\r
14
+ e.flushSync())}function oe(e){return function(t,n,r={},i){if(typeof r==`string`)i=ie({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=ie({dest:i})}else if(r instanceof o||r.writable||r._writableState)i=r,r={};else if(r.transport){if(r.transport instanceof o||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=T({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:s}=r;return a===!1&&(r.level=`silent`),s||(r.onChild=O),i||=re(process.stdout)?process.stdout:ie({fd:process.stdout.fd||1}),{opts:r,stream:i}}}function ce(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[g])(e)}catch{return`"[unable to serialize, circular reference is too complex to analyze]"`}}}function le(e,t,n){return{level:e,bindings:t,log:n}}function de(e){let t=Number(e);return typeof e==`string`&&Number.isFinite(t)?t:e===void 0?1:e}t.exports={noop:O,buildSafeSonicBoom:ie,asChindings:M,asJson:te,genLog:k,createArgsNormalizer:oe,stringify:ce,buildFormatters:le,normalizeDestFileDescriptor:de}})),Ce=/* @__PURE__ */ O(((e,t)=>{t.exports={DEFAULT_LEVELS:{trace:10,debug:20,info:30,warn:40,error:50,fatal:60},SORTING_ORDER:{ASC:`ASC`,DESC:`DESC`}}})),we=/* @__PURE__ */ O(((e,t)=>{let{lsCacheSym:n,levelValSym:r,useOnlyCustomLevelsSym:i,streamSym:a,formattersSym:o,hooksSym:s,levelCompSym:c}=ue(),{noop:l,genLog:u}=Se(),{DEFAULT_LEVELS:d,SORTING_ORDER:f}=Ce(),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 ee(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:ee}})),Te=/* @__PURE__ */ O(((e,t)=>{t.exports={version:`10.4.0`}})),Ee=/* @__PURE__ */ O(((e,t)=>{let{EventEmitter:n}=j(`node:events`),{lsCacheSym:r,levelValSym:i,setLevelSym:a,getLevelSym:o,chindingsSym:s,mixinSym:c,asJsonSym:l,writeSym:u,mixinMergeStrategySym:d,timeSym:f,timeSliceIndexSym:p,streamSym:m,serializersSym:h,formattersSym:g,errorKeySym:_,messageKeySym:v,useOnlyCustomLevelsSym:y,needsMetadataGsym:b,redactFmtSym:x,stringifySym:S,formatOptsSym:C,stringifiersSym:w,msgPrefixSym:T,hooksSym:ee}=ue(),{getLevel:E,setLevel:D,isLevelEnabled:O,mappings:k,initialLsCache:A,genLsCache:te,assertNoLevelCollisions:ne}=we(),{asChindings:M,asJson:re,buildFormatters:ie,stringify:ae,noop:oe}=Se(),{version:se}=Te(),ce=de(),le={constructor:class{},child:pe,bindings:me,setBindings:he,flush:ve,isLevelEnabled:O,version:se,get level(){return this[o]()},set level(e){this[a](e)},get levelVal(){return this[i]},set levelVal(e){throw Error(`levelVal is read-only`)},get msgPrefix(){return this[T]},get[Symbol.toStringTag](){return`Pino`},[r]:A,[u]:_e,[l]:re,[o]:E,[a]:D};Object.setPrototypeOf(le,n.prototype),t.exports=function(){return Object.create(le)};let fe=e=>e;function pe(e,t){if(!e)throw Error(`missing bindings for child Pino`);let n=this[h],r=this[g],i=Object.create(this);if(t==null)return i[g].bindings!==fe&&(i[g]=ie(r.level,fe,r.log)),i[s]=M(i,e),this.onChild!==oe&&this.onChild(i),i;if(t.hasOwnProperty(`serializers`)===!0){i[h]=Object.create(null);for(let e in n)i[h][e]=n[e];let e=Object.getOwnPropertySymbols(n);for(var o=0;o<e.length;o++){let t=e[o];i[h][t]=n[t]}for(let e in t.serializers)i[h][e]=t.serializers[e];let r=Object.getOwnPropertySymbols(t.serializers);for(var c=0;c<r.length;c++){let e=r[c];i[h][e]=t.serializers[e]}}else i[h]=n;if(t.hasOwnProperty(`formatters`)){let{level:e,bindings:n,log:a}=t.formatters;i[g]=ie(e||r.level,n||fe,a||r.log)}else i[g]=ie(r.level,fe,r.log);if(t.hasOwnProperty(`customLevels`)===!0&&(ne(this.levels,t.customLevels),i.levels=k(t.customLevels,i[y]),te(i)),typeof t.redact==`object`&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let e=ce(i.redact,ae),n={stringify:e[x]};i[S]=ae,i[w]=e,i[C]=n}if(typeof t.msgPrefix==`string`&&(i[T]=(this[T]||``)+t.msgPrefix),i[s]=M(i,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty(`customLevels`)){let e=t.level||this.level;i[a](e)}return this.onChild(i),i}function me(){let e=`{${this[s].substr(1)}}`,t=JSON.parse(e);return delete t.pid,delete t.hostname,t}function he(e){let t=M(this,e);this[s]=t}function ge(e,t){return Object.assign(t,e)}function _e(e,t,n){let r=this[f](),i=this[c],a=this[_],o=this[v],s=this[d]||ge,u,h=this[ee].streamWrite;e==null?u={}:e instanceof Error?(u={[a]:e},t===void 0&&(t=e.message)):(u=e,t===void 0&&e[o]===void 0&&e[a]&&(t=e[a].message)),i&&(u=s(u,i(u,n,this)));let g=this[l](u,t,n,r),y=this[m];y[b]===!0&&(y.lastLevel=n,y.lastObj=u,y.lastMsg=t,y.lastTime=r.slice(this[p]),y.lastLogger=this),y.write(h?h(g):g)}function ve(e){if(e!=null&&typeof e!=`function`)throw Error(`callback must be a function`);let t=this[m];typeof t.flush==`function`?t.flush(e||oe):e&&e()}})),De=/* @__PURE__ */ O(((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}})),Oe=/* @__PURE__ */ O(((e,t)=>{let n=Symbol.for(`pino.metadata`),{DEFAULT_LEVELS:r}=Ce(),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})),ke=/* @__PURE__ */ te((/* @__PURE__ */ O(((e,t)=>{let n=j(`node:os`),r=se(),i=ce(),a=de(),o=fe(),s=Ee(),c=ue(),{configure:l}=De(),{assertDefaultLevelFound:u,mappings:d,genLsCache:f,genLevelComparison:p,assertLevelComparison:m}=we(),{DEFAULT_LEVELS:h,SORTING_ORDER:g}=Ce(),{createArgsNormalizer:_,asChindings:v,buildSafeSonicBoom:y,buildFormatters:b,stringify:x,normalizeDestFileDescriptor:S,noop:C}=Se(),{version:w}=Te(),{chindingsSym:T,redactFmtSym:ee,serializersSym:E,timeSym:D,timeSliceIndexSym:O,streamSym:k,stringifySym:A,stringifySafeSym:te,stringifiersSym:ne,setLevelSym:M,endSym:re,formatOptsSym:ie,messageKeySym:ae,errorKeySym:oe,nestedKeySym:le,mixinSym:pe,levelCompSym:me,useOnlyCustomLevelsSym:he,formattersSym:ge,hooksSym:_e,nestedKeyStrSym:ve,mixinMergeStrategySym:ye,msgPrefixSym:be,transportUsesMultistreamSym:ke}=c,{epochTime:Ae,nullTime:je}=o,{pid:Me}=process,Ne=n.hostname(),Pe=r.err,Fe=_({level:`info`,levelComparison:g.ASC,levels:h,messageKey:`msg`,errorKey:`err`,nestedKey:null,enabled:!0,base:{pid:Me,hostname:Ne},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:Ae,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100}),Ie=Object.assign(Object.create(null),r);function Le(...e){let t={},{opts:n,stream:r}=Fe(t,i(),...e);n.level&&typeof n.level==`string`&&h[n.level.toLowerCase()]!==void 0&&(n.level=n.level.toLowerCase());let{redact:o,crlf:c,serializers:g,timestamp:_,messageKey:y,errorKey:S,nestedKey:w,base:j,name:se,level:ce,customLevels:ue,levelComparison:de,mixin:fe,mixinMergeStrategy:xe,useOnlyCustomLevels:Se,formatters:Ce,hooks:we,depthLimit:Te,edgeLimit:Ee,onChild:De,msgPrefix:Oe}=n,Me=l({maximumDepth:Te,maximumBreadth:Ee}),Ne=b(Ce.level,Ce.bindings,Ce.log),Pe=x.bind({[te]:Me}),Ie=o?Object.assign(Object.create(null),a(o,Pe)):Object.create(null),Le=o?{stringify:Ie[ee]}:{stringify:Pe},Re=`}`+(c?`\r
14
15
  `:`
15
- `),Ne=v.bind(null,{[T]:``,[D]:g,[ne]:Ae,[j]:x,[te]:L,[me]:De}),Pe=``;k!==null&&(Pe=Ne(ie===void 0?k:Object.assign({},k,{name:ie})));let Fe=_ instanceof Function?_:_?I:Ee,Ie=Fe().indexOf(`:`)+1;if(F&&!oe)throw Error(`customLevels is required if useOnlyCustomLevels is set true`);if(ce&&typeof ce!=`function`)throw Error(`Unknown mixin type "${typeof ce}" - expected "function"`);if(Se&&typeof Se!=`string`)throw Error(`Unknown msgPrefix type "${typeof Se}" - expected "string"`);u(N,oe,F);let Le=d(oe,F);typeof r.emit==`function`&&r.emit(`message`,{code:`PINO_CONFIG`,config:{levels:Le,messageKey:y,errorKey:S}}),m(se);let Re=p(se);return Object.assign(t,{levels:Le,[P]:Re,[pe]:F,[A]:r,[ee]:Fe,[O]:Ie,[j]:x,[te]:L,[ne]:Ae,[re]:Me,[ae]:je,[le]:y,[ue]:S,[de]:w,[Ce]:w?`,${JSON.stringify(w)}:{`:``,[D]:g,[fe]:ce,[we]:ge,[T]:Pe,[me]:De,[he]:ve,silent:C,onChild:xe,[Te]:Se}),Object.setPrototypeOf(t,s()),f(t),t[M](N),t}t.exports=je,t.exports.destination=(e=process.stdout.fd)=>typeof e==`object`?(e.dest=S(e.dest||process.stdout.fd),y(e)):y({dest:S(e),minLength:0}),t.exports.transport=ge(),t.exports.multistream=Se(),t.exports.levels=d(),t.exports.stdSerializers=Ae,t.exports.stdTimeFunctions=Object.assign({},o),t.exports.symbols=c,t.exports.version=w,t.exports.default=je,t.exports.pino=je})))(),1);const we={debug:0,info:1,warn:2,error:3};function Te(e){return{level:e}}function I(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}let Ee={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,base:{},formatters:{level:Te},timestamp:I}};function L(){return Ee}function De(){return 0}const Oe={debug:`debug`,info:`info`,warn:`warn`,error:`error`};function ke(e){return{level:e}}function Ae(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function je(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}const Me={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,formatters:{level:ke},timestamp:je}};var Ne=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?{...Me,...t}:{...Me,...L()},this.builtConfigVersion=De(),this.pinoLogger=this.buildPinoLogger(this.config)}buildPinoLogger(e){let t={...e.pinoOptions,level:e.minLevel},n=e.pinoOptions?.base;return t.base={...Ae(n)?n:{},module:this.context.module},e.transport&&(t.transport=e.transport),(0,Ce.default)(t)}getActivePinoLogger(){if(this.hasExplicitConfig)return this.pinoLogger;let e=De();return e!==this.builtConfigVersion&&(this.config.minLevel=L().minLevel??Me.minLevel,this.config.transport=L().transport,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){this.log(`error`,e,n,t)}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;o&&(i.traceId=o.traceId,i.spanId=o.spanId),r&&(i.error={name:r.name,message:r.message,stack:r.stack});let s=Oe[e],c=`[${this.context.module}${a?`:${a}`:``}] ${t}`;Object.keys(i).length>0?this.getActivePinoLogger()[s](i,c):this.getActivePinoLogger()[s](c)}shouldLog(e){return we[e]>=we[this.hasExplicitConfig?this.config.minLevel:L().minLevel??Me.minLevel]}getPinoLogger(){return this.getActivePinoLogger()}};function Pe(e){return new Ne(e,L())}Pe(`App`),new f;var Fe=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 Ie(e=`Noop`){return new Fe(e)}Ie(`App`);function Le(e){return Pe(e)}Le(`App`);var Re=/* @__PURE__ */ E((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})),ze=/* @__PURE__ */ E((e=>{let{InvalidArgumentError:t}=Re();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})),Be=/* @__PURE__ */ E((e=>{let{humanReadableArgName:t}=ze();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(`
16
+ `),ze=v.bind(null,{[T]:``,[E]:g,[ne]:Ie,[A]:x,[te]:Me,[ge]:Ne}),Be=``;j!==null&&(Be=ze(se===void 0?j:Object.assign({},j,{name:se})));let Ve=_ instanceof Function?_:_?Ae:je,He=Ve().indexOf(`:`)+1;if(Se&&!ue)throw Error(`customLevels is required if useOnlyCustomLevels is set true`);if(fe&&typeof fe!=`function`)throw Error(`Unknown mixin type "${typeof fe}" - expected "function"`);if(Oe&&typeof Oe!=`string`)throw Error(`Unknown msgPrefix type "${typeof Oe}" - expected "string"`);u(ce,ue,Se);let Ue=d(ue,Se);if(r&&r[ke]===!0){let e=typeof ce==`string`?ce:void 0;(!e||Ue[e]===void 0)&&(e=Object.keys(Ue)[0]);let t=Ue[e],n=!1;try{let r=Ce.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:Ue,messageKey:y,errorKey:S}}),m(de);let We=p(de);return Object.assign(t,{levels:Ue,[me]:We,[he]:Se,[k]:r,[D]:Ve,[O]:He,[A]:x,[te]:Me,[ne]:Ie,[re]:Re,[ie]:Le,[ae]:y,[oe]:S,[le]:w,[ve]:w?`,${JSON.stringify(w)}:{`:``,[E]:g,[pe]:fe,[ye]:xe,[T]:Be,[ge]:Ne,[_e]:we,silent:C,onChild:De,[be]:Oe}),Object.setPrototypeOf(t,s()),f(t),t[M](ce),t}t.exports=Le,t.exports.destination=(e=process.stdout.fd)=>typeof e==`object`?(e.dest=S(e.dest||process.stdout.fd),y(e)):y({dest:S(e),minLength:0}),t.exports.transport=xe(),t.exports.multistream=Oe(),t.exports.levels=d(),t.exports.stdSerializers=Ie,t.exports.stdTimeFunctions=Object.assign({},o),t.exports.symbols=c,t.exports.version=w,t.exports.default=Le,t.exports.pino=Le})))(),1);const Ae={debug:0,info:1,warn:2,error:3};function je(e){return{level:e}}function Me(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}let Ne={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,base:{},formatters:{level:je},timestamp:Me}};function Pe(){return Ne}function Fe(){return 0}const Ie={debug:`debug`,info:`info`,warn:`warn`,error:`error`};function Le(e){return{level:e}}function Re(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ze(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}const Be={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,formatters:{level:Le},timestamp:ze}};var Ve=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===Pe();this.hasExplicitConfig=!i&&!a,this.config=this.hasExplicitConfig?{...Be,...t}:{...Be,...Pe()},this.builtConfigVersion=Fe(),this.pinoLogger=this.buildPinoLogger(this.config)}buildPinoLogger(e){let t={...e.pinoOptions,level:e.minLevel},n=e.pinoOptions?.base;return t.base={...Re(n)?n:{},module:this.context.module},e.transport&&(t.transport=e.transport),(0,ke.default)(t)}getActivePinoLogger(){if(this.hasExplicitConfig)return this.pinoLogger;let e=Fe();return e!==this.builtConfigVersion&&(this.config.minLevel=Pe().minLevel??Be.minLevel,this.config.transport=Pe().transport,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){this.log(`error`,e,n,t)}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;o&&(i.traceId=o.traceId,i.spanId=o.spanId),r&&(i.error={name:r.name,message:r.message,stack:r.stack});let s=Ie[e],c=`[${this.context.module}${a?`:${a}`:``}] ${t}`;Object.keys(i).length>0?this.getActivePinoLogger()[s](i,c):this.getActivePinoLogger()[s](c)}shouldLog(e){return Ae[e]>=Ae[this.hasExplicitConfig?this.config.minLevel:Pe().minLevel??Be.minLevel]}getPinoLogger(){return this.getActivePinoLogger()}};function He(e){return new Ve(e,Pe())}He(`App`),new h;var Ue=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 We(e=`Noop`){return new Ue(e)}We(`App`);function Ge(e){return He(e)}Ge(`App`);var Ke=/* @__PURE__ */ O((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})),qe=/* @__PURE__ */ O((e=>{let{InvalidArgumentError:t}=Ke();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})),Je=/* @__PURE__ */ O((e=>{let{humanReadableArgName:t}=qe();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(`
16
17
  `)}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,`
17
18
  `+` `.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(`
18
- `)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),Ve=/* @__PURE__ */ E((e=>{let{InvalidArgumentError:t}=Re();var n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}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}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=/* @__PURE__ */ new Map,this.negativeOptions=/* @__PURE__ */ new Map,this.dualOptions=/* @__PURE__ */ new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r!==void 0&&r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
19
+ `)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),Ye=/* @__PURE__ */ O((e=>{let{InvalidArgumentError:t}=Ke();var n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}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}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=/* @__PURE__ */ new Map,this.negativeOptions=/* @__PURE__ */ new Map,this.dualOptions=/* @__PURE__ */ new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r!==void 0&&r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
19
20
  - a short flag is a single dash and a single character
20
21
  - either use a single dash and a single character (for a short flag)
21
22
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(t)?Error(`${n}
22
23
  - too many short flags`):i.test(t)?Error(`${n}
23
24
  - too many long flags`):Error(`${n}
24
- - unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}e.Option=n,e.DualOptions=r})),He=/* @__PURE__ */ E((e=>{function t(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let a=1;a=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+a),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function n(e,n){if(!n||n.length===0)return``;n=Array.from(new Set(n));let r=e.startsWith(`--`);r&&(e=e.slice(2),n=n.map(e=>e.slice(2)));let i=[],a=3;return n.forEach(n=>{if(n.length<=1)return;let r=t(e,n),o=Math.max(e.length,n.length);(o-r)/o>.4&&(r<a?(a=r,i=[n]):r===a&&i.push(n))}),i.sort((e,t)=>e.localeCompare(t)),r&&(i=i.map(e=>`--${e}`)),i.length>1?`\n(Did you mean one of ${i.join(`, `)}?)`:i.length===1?`\n(Did you mean ${i[0]}?)`:``}e.suggestSimilar=n})),Ue=/* @__PURE__ */ E((e=>{let t=k(`node:events`).EventEmitter,n=k(`node:child_process`),r=k(`node:path`),i=k(`node:fs`),a=k(`node:process`),{Argument:o,humanReadableArgName:s}=ze(),{CommanderError:c}=Re(),{Help:l,stripColor:u}=Be(),{Option:d,DualOptions:f}=Ve(),{suggestSimilar:p}=He();var m=class e extends t{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||``,this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description=``,this._summary=``,this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>a.stdout.write(e),writeErr:e=>a.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>a.stdout.isTTY?a.stdout.columns:void 0,getErrHelpWidth:()=>a.stderr.isTTY?a.stderr.columns:void 0,getOutHasColors:()=>g()??(a.stdout.isTTY&&a.stdout.hasColors?.()),getErrHasColors:()=>g()??(a.stderr.isTTY&&a.stderr.hasColors?.()),stripColor:e=>u(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;typeof r==`object`&&r&&(i=r,r=null),i||={};let[,a,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return r&&(s.description(r),s._executableHandler=!0),i.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(i.noHelp||i.hidden),s._executableFile=i.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),r?this:s}createCommand(t){return new e(t)}createHelp(){return Object.assign(new l,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!=`string`&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
25
+ - unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}e.Option=n,e.DualOptions=r})),Xe=/* @__PURE__ */ O((e=>{function t(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let a=1;a=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+a),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function n(e,n){if(!n||n.length===0)return``;n=Array.from(new Set(n));let r=e.startsWith(`--`);r&&(e=e.slice(2),n=n.map(e=>e.slice(2)));let i=[],a=3;return n.forEach(n=>{if(n.length<=1)return;let r=t(e,n),o=Math.max(e.length,n.length);(o-r)/o>.4&&(r<a?(a=r,i=[n]):r===a&&i.push(n))}),i.sort((e,t)=>e.localeCompare(t)),r&&(i=i.map(e=>`--${e}`)),i.length>1?`\n(Did you mean one of ${i.join(`, `)}?)`:i.length===1?`\n(Did you mean ${i[0]}?)`:``}e.suggestSimilar=n})),Ze=/* @__PURE__ */ O((e=>{let t=j(`node:events`).EventEmitter,n=j(`node:child_process`),r=j(`node:path`),i=j(`node:fs`),a=j(`node:process`),{Argument:o,humanReadableArgName:s}=qe(),{CommanderError:c}=Ke(),{Help:l,stripColor:u}=Je(),{Option:d,DualOptions:f}=Ye(),{suggestSimilar:p}=Xe();var m=class e extends t{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||``,this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description=``,this._summary=``,this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>a.stdout.write(e),writeErr:e=>a.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>a.stdout.isTTY?a.stdout.columns:void 0,getErrHelpWidth:()=>a.stderr.isTTY?a.stderr.columns:void 0,getOutHasColors:()=>g()??(a.stdout.isTTY&&a.stdout.hasColors?.()),getErrHasColors:()=>g()??(a.stderr.isTTY&&a.stderr.hasColors?.()),stripColor:e=>u(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;typeof r==`object`&&r&&(i=r,r=null),i||={};let[,a,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return r&&(s.description(r),s._executableHandler=!0),i.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(i.noHelp||i.hidden),s._executableFile=i.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),r?this:s}createCommand(t){return new e(t)}createHelp(){return Object.assign(new l,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!=`string`&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
25
26
  - specify the name in Command constructor or using .name()`);return t||={},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new o(e,t)}argument(e,t,n,r){let i=this.createArgument(e,t);return typeof n==`function`?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==`boolean`)return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let[,n,r]=(e??`help [command]`).match(/([^ ]+) *(.*)/),i=t??`display help for command`,a=this.createCommand(n);return a.helpOption(!1),r&&a.arguments(r),i&&a.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return typeof e==`object`?(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this):(this.helpCommand(e,t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand(`help`))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=[`preSubcommand`,`preAction`,`postAction`];if(!n.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
26
27
  Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if(e.code!==`commander.executeSubCommandAsync`)throw e}),this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new c(e,t,n)),a.exit(e)}action(e){let t=t=>{let n=this.registeredArguments.length,r=t.slice(0,n);return r[n]=this._storeOptionsAsProperties?this:this.opts(),r.push(this),e.apply(this,r)};return this._actionHandler=t,this}createOption(e,t){return new d(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if(e.code===`commander.invalidArgument`){let t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
27
28
  - already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){let r=t(this._findCommand(n)).join(`|`),i=t(e).join(`|`);throw Error(`cannot add command '${i}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let t=e.long.replace(/^--no-/,`--`);this._findOption(t)||this.setOptionValueWithSource(n,e.defaultValue===void 0||e.defaultValue,`default`)}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,`default`);let r=(t,r,i)=>{t==null&&e.presetArg!==void 0&&(t=e.presetArg);let a=this.getOptionValue(n);t!==null&&e.parseArg?t=this._callParseArg(e,t,a,r):t!==null&&e.variadic&&(t=e._collectValue(t,a)),t??=e.negate?!1:e.isBoolean()||e.optional?!0:``,this.setOptionValueWithSource(n,t,i)};return this.on(`option:`+t,t=>{let n=`error: option '${e.flags}' argument '${t}' is invalid.`;r(t,n,`cli`)}),e.envVar&&this.on(`optionEnv:`+t,t=>{let n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;r(t,n,`env`)}),this}_optionEx(e,t,n,r,i){if(typeof t==`object`&&t instanceof d)throw Error(`To add an Option object use addOption() instead of option() or requiredOption()`);let a=this.createOption(t,n);if(a.makeOptionMandatory(!!e.mandatory),typeof r==`function`)a.default(i).argParser(r);else if(r instanceof RegExp){let e=r;r=(t,n)=>{let r=e.exec(t);return r?r[0]:n},a.default(i).argParser(r)}else a.default(r);return this.addOption(a)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error(`call .storeOptionsAsProperties() before adding options`);if(Object.keys(this._optionValues).length)throw Error(`call .storeOptionsAsProperties() before setting option values`);return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error(`first parameter to parse must be array or undefined`);if(t||={},e===void 0&&t.from===void 0){a.versions?.electron&&(t.from=`electron`);let e=a.execArgv??[];(e.includes(`-e`)||e.includes(`--eval`)||e.includes(`-p`)||e.includes(`--print`))&&(t.from=`eval`)}e===void 0&&(e=a.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case`node`:this._scriptPath=e[1],n=e.slice(2);break;case`electron`:a.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case`user`:n=e.slice(0);break;case`eval`:n=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||`program`,n}parse(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
28
29
  - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,n){if(i.existsSync(e))return;let r=`'${e}' does not exist
29
30
  - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
30
31
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
31
- - ${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 o=!1,s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function l(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=l(d,u);if(!t&&!e._executableFile&&this._scriptPath){let n=r.basename(this._scriptPath,r.extname(this._scriptPath));n!==this._name&&(t=l(d,`${n}-${e._name}`))}u=t||u}o=s.includes(r.extname(u));let f;a.platform===`win32`?(this._checkForMissingExecutable(u,d,e._name),t.unshift(u),t=h(a.execArgv).concat(t),f=n.spawn(a.execPath,t,{stdio:`inherit`})):o?(t.unshift(u),t=h(a.execArgv).concat(t),f=n.spawn(a.argv[0],t,{stdio:`inherit`})):f=n.spawn(u,t,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{a.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e??=1,p?p(new c(e,`commander.executeSubCommandAsync`,`(close)`)):a.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)a.exit(1);else{let e=new c(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);continue}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(`
32
+ - ${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 o=!1,s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function l(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=l(d,u);if(!t&&!e._executableFile&&this._scriptPath){let n=r.basename(this._scriptPath,r.extname(this._scriptPath));n!==this._name&&(t=l(d,`${n}-${e._name}`))}u=t||u}o=s.includes(r.extname(u));let f;a.platform===`win32`?(this._checkForMissingExecutable(u,d,e._name),t.unshift(u),t=h(a.execArgv).concat(t),f=n.spawn(a.execPath,t,{stdio:`inherit`})):o?(t.unshift(u),t=h(a.execArgv).concat(t),f=n.spawn(a.argv[0],t,{stdio:`inherit`})):f=n.spawn(u,t,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{a.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e??=1,p?p(new c(e,`commander.executeSubCommandAsync`,`(close)`)):a.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)a.exit(1);else{let e=new c(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(`
32
33
  `),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 a.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()}`,a.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new f(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=p(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=p(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=>s(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(a.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.
33
- 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 h(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 g(){if(a.env.NO_COLOR||a.env.FORCE_COLOR===`0`||a.env.FORCE_COLOR===`false`)return!1;if(a.env.FORCE_COLOR||a.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=m,e.useColor=g}));const{program:We,createCommand:Ge,createArgument:Ke,createOption:qe,CommanderError:Je,InvalidArgumentError:Ye,InvalidOptionArgumentError:Xe,Command:Ze,Argument:R,Option:Qe,Help:$e}=(/* @__PURE__ */ O((/* @__PURE__ */ E((e=>{let{Argument:t}=ze(),{Command:n}=Ue(),{CommanderError:r,InvalidArgumentError:i}=Re(),{Help:a}=Be(),{Option:o}=Ve();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,et=Le(`@longzai-intelligence-cli/core/provider`),tt={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 nt={select:async(e,t)=>t[0]?.value??``,textInput:async(e,t)=>t?.defaultValue??``,confirm:async(e,t)=>t?.defaultValue??!1,spinner:()=>({start:e=>et.info(e),stop:e=>et.info(e)}),note:(e,t)=>{t?et.info(`${t}: ${e}`):et.info(e)},log:{info:e=>et.info(e),success:e=>et.info(e),warn:e=>et.warn(e),error:e=>et.error(e),step:e=>et.info(e)}},rt=tt;function it(e){nt=e}function at(e){rt=e}function ot(){return nt}function st(){return rt}const ct=()=>`0.0.8`;function lt(e){let t=e.version??ct();e.interaction&&it(e.interaction),e.color&&at(e.color);let n=new Ze;return n.name(e.name).version(t,`-v, --version`,`输出 ${e.name} 的版本号`),e.description&&n.description(e.description),n}Le(`@longzai-intelligence-cli/core/output`),Le(`@longzai-intelligence-cli/core/progress`);const z=Le(`@longzai-intelligence-cli/core/define-command`);function ut(e,t){let n=e.command(t.name);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 Ze))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(`, `);z.error(st().red(`参数校验失败: ${e}`)),ot().log.error(`参数校验失败: ${e}`),process.exit(1)}await t.action(a.data,i)})}var dt=/* @__PURE__ */ E(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}})),ft=/* @__PURE__ */ E(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})),B=dt(),V=/* @__PURE__ */ O(ft(),1);function pt({onlyFirst:e=!1}={}){let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))`].join(`|`);return new RegExp(t,e?void 0:`g`)}const mt=pt();function ht(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(mt,``)}function gt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var _t={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(e){var t=e.charCodeAt(0),n=e.length==2?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t&=1023,n&=1023,r=t<<10|n,r+=65536),r==12288||65281<=r&&r<=65376||65504<=r&&r<=65510?`F`:r==8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?`H`:4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?`W`:32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r==172||r==175||10214<=r&&r<=10221||10629<=r&&r<=10630?`Na`:r==161||r==164||167<=r&&r<=168||r==170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r==198||r==208||215<=r&&r<=216||222<=r&&r<=225||r==230||232<=r&&r<=234||236<=r&&r<=237||r==240||242<=r&&r<=243||247<=r&&r<=250||r==252||r==254||r==257||r==273||r==275||r==283||294<=r&&r<=295||r==299||305<=r&&r<=307||r==312||319<=r&&r<=322||r==324||328<=r&&r<=331||r==333||338<=r&&r<=339||358<=r&&r<=359||r==363||r==462||r==464||r==466||r==468||r==470||r==472||r==474||r==476||r==593||r==609||r==708||r==711||713<=r&&r<=715||r==717||r==720||728<=r&&r<=731||r==733||r==735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r==1025||1040<=r&&r<=1103||r==1105||r==8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r==8240||8242<=r&&r<=8243||r==8245||r==8251||r==8254||r==8308||r==8319||8321<=r&&r<=8324||r==8364||r==8451||r==8453||r==8457||r==8467||r==8470||8481<=r&&r<=8482||r==8486||r==8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r==8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r==8658||r==8660||r==8679||r==8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r==8715||r==8719||r==8721||r==8725||r==8730||8733<=r&&r<=8736||r==8739||r==8741||8743<=r&&r<=8748||r==8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r==8776||r==8780||r==8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r==8853||r==8857||r==8869||r==8895||r==8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r==9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r==9711||9733<=r&&r<=9734||r==9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r==9756||r==9758||r==9792||r==9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r==9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r==9955||9960<=r&&r<=9983||r==10045||r==10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r==65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?`A`:`N`},t.characterLength=function(e){var t=this.eastAsianWidth(e);return t==`F`||t==`W`||t==`A`?2:1};function n(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(e){for(var t=n(e),r=0,i=0;i<t.length;i++)r+=this.characterLength(t[i]);return r},t.slice=function(e,r,i){textLen=t.length(e),r||=0,i||=1,r<0&&(r=textLen+r),i<0&&(i=textLen+i);for(var a=``,o=0,s=n(e),c=0;c<s.length;c++){var l=s[c],u=t.length(l);if(o>=r-+(u==2)){if(o+u<=i)a+=l;else break}o+=u}return a}})(_t);var vt=_t.exports;const yt=gt(vt),bt=gt(function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g});function xt(e,t={}){if(typeof e!=`string`||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=ht(e),e.length===0))return 0;e=e.replace(bt(),` `);let n=t.ambiguousIsNarrow?1:2,r=0;for(let t of e){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159||e>=768&&e<=879))switch(yt.eastAsianWidth(t)){case`F`:case`W`:r+=2;break;case`A`:r+=n;break;default:r+=1}}return r}const St=(e=0)=>t=>`\x1B[${t+e}m`,Ct=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,wt=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,H={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(H.modifier);const Tt=Object.keys(H.color),Et=Object.keys(H.bgColor);[...Tt,...Et];function Dt(){let e=/* @__PURE__ */ new Map;for(let[t,n]of Object.entries(H)){for(let[t,r]of Object.entries(n))H[t]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[t]=H[t],e.set(r[0],r[1]);Object.defineProperty(H,t,{value:n,enumerable:!1})}return Object.defineProperty(H,"codes",{value:e,enumerable:!1}),H.color.close=`\x1B[39m`,H.bgColor.close=`\x1B[49m`,H.color.ansi=St(),H.color.ansi256=Ct(),H.color.ansi16m=wt(),H.bgColor.ansi=St(10),H.bgColor.ansi256=Ct(10),H.bgColor.ansi16m=wt(10),Object.defineProperties(H,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>H.rgbToAnsi256(...H.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>H.ansi256ToAnsi(H.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>H.ansi256ToAnsi(H.hexToAnsi256(e)),enumerable:!1}}),H}const Ot=Dt(),kt=/* @__PURE__ */ new Set([`\x1B`,`›`]),At=`]8;;`,jt=e=>`${kt.values().next().value}[${e}m`,U=e=>`${kt.values().next().value}${At}${e}`,Mt=e=>e.split(` `).map(e=>xt(e)),Nt=(e,t,n)=>{let r=[...t],i=!1,a=!1,o=xt(ht(e[e.length-1]));for(let[t,s]of r.entries()){let c=xt(s);if(o+c<=n?e[e.length-1]+=s:(e.push(s),o=0),kt.has(s)&&(i=!0,a=r.slice(t+1).join(``).startsWith(At)),i){a?s===`\x07`&&(i=!1,a=!1):s===`m`&&(i=!1);continue}o+=c,o===n&&t<r.length-1&&(e.push(``),o=0)}!o&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Pt=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(xt(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ft=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=Mt(e),s=[``];for(let[r,i]of e.split(` `).entries()){n.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let e=xt(s[s.length-1]);if(r!==0&&(e>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),e=0),(e>0||n.trim===!1)&&(s[s.length-1]+=` `,e++)),n.hard&&o[r]>t){let n=t-e,a=1+Math.floor((o[r]-n-1)/t);Math.floor((o[r]-1)/t)<a&&s.push(``),Nt(s,i,t);continue}if(e+o[r]>t&&e>0&&o[r]>0){if(n.wordWrap===!1&&e<t){Nt(s,i,t);continue}s.push(``)}if(e+o[r]>t&&n.wordWrap===!1){Nt(s,i,t);continue}s[s.length-1]+=i}n.trim!==!1&&(s=s.map(e=>Pt(e)));let c=[...s.join(`
34
- `)];for(let[e,t]of c.entries()){if(r+=t,kt.has(t)){let{groups:t}=RegExp(`(?:\\[(?<code>\\d+)m|\\${At}(?<uri>.*))`).exec(c.slice(e).join(``))||{groups:{}};if(t.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}let n=Ot.codes.get(Number(i));c[e+1]===`
35
- `?(a&&(r+=U(``)),i&&n&&(r+=jt(n))):t===`
36
- `&&(i&&n&&(r+=jt(i)),a&&(r+=U(a)))}return r};function It(e,t,n){return String(e).normalize().replace(/\r\n/g,`
37
- `).split(`
38
- `).map(e=>Ft(e,t,n)).join(`
39
- `)}const Lt={actions:/* @__PURE__ */ new Set([`up`,`down`,`left`,`right`,`space`,`enter`,`cancel`]),aliases:/* @__PURE__ */ new Map([[`k`,`up`],[`j`,`down`],[`h`,`left`],[`l`,`right`],[``,`cancel`],[`escape`,`cancel`]])};function Rt(e,t){if(typeof e==`string`)return Lt.aliases.get(e)===t;for(let n of e)if(n!==void 0&&Rt(n,t))return!0;return!1}function zt(e,t){if(e===t)return;let n=e.split(`
40
- `),r=t.split(`
41
- `),i=[];for(let e=0;e<Math.max(n.length,r.length);e++)n[e]!==r[e]&&i.push(e);return i}const Bt=globalThis.process.platform.startsWith(`win`),Vt=Symbol(`clack:cancel`);function Ht(e){return e===Vt}function Ut(e,t){let n=e;n.isTTY&&n.setRawMode(t)}function Wt({input:e=m,output:t=h,overwrite:n=!0,hideCursor:r=!0}={}){let i=_.createInterface({input:e,output:t,prompt:``,tabSize:1});_.emitKeypressEvents(e,i),e.isTTY&&e.setRawMode(!0);let a=(i,{name:o,sequence:s})=>{if(Rt([String(i),o,s],`cancel`)){r&&t.write(B.cursor.show),process.exit(0);return}if(!n)return;let c=o===`return`?0:-1,l=o===`return`?-1:0;_.moveCursor(t,c,l,()=>{_.clearLine(t,1,()=>{e.once(`keypress`,a)})})};return r&&t.write(B.cursor.hide),e.once(`keypress`,a),()=>{e.off(`keypress`,a),r&&t.write(B.cursor.show),e.isTTY&&!Bt&&e.setRawMode(!1),i.terminal=!1,i.close()}}var Gt=Object.defineProperty,Kt=(e,t,n)=>t in e?Gt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qt=(e,t,n)=>(Kt(e,typeof t==`symbol`?t:t+``,n),n),Jt=class{constructor(e,t=!0){qt(this,`input`),qt(this,`output`),qt(this,`_abortSignal`),qt(this,`rl`),qt(this,`opts`),qt(this,`_render`),qt(this,`_track`,!1),qt(this,`_prevFrame`,``),qt(this,`_subscribers`,/* @__PURE__ */ new Map),qt(this,`_cursor`,0),qt(this,`state`,`initial`),qt(this,`error`,``),qt(this,`value`);let{input:n=m,output:r=h,render:i,signal:a,...o}=e;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=t,this._abortSignal=a,this.input=n,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let n=this._subscribers.get(e)??[];n.push(t),this._subscribers.set(e,n)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let n=this._subscribers.get(e)??[],r=[];for(let e of n)e.cb(...t),e.once&&r.push(()=>n.splice(n.indexOf(e),1));for(let e of r)e()}prompt(){return new Promise((e,t)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state=`cancel`,this.close(),e(Vt);this._abortSignal.addEventListener(`abort`,()=>{this.state=`cancel`,this.close()},{once:!0})}let n=new y;n._write=(e,t,n)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,``),this._cursor=this.rl?.cursor??0,this.emit(`value`,this.value)),n()},this.input.pipe(n),this.rl=v.createInterface({input:this.input,output:n,tabSize:2,prompt:``,escapeCodeTimeout:50,terminal:!0}),v.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on(`keypress`,this.onKeypress),Ut(this.input,!0),this.output.on(`resize`,this.render),this.render(),this.once(`submit`,()=>{this.output.write(B.cursor.show),this.output.off(`resize`,this.render),Ut(this.input,!1),e(this.value)}),this.once(`cancel`,()=>{this.output.write(B.cursor.show),this.output.off(`resize`,this.render),Ut(this.input,!1),e(Vt)})})}onKeypress(e,t){if(this.state===`error`&&(this.state=`active`),t?.name&&(!this._track&&Lt.aliases.has(t.name)&&this.emit(`cursor`,Lt.aliases.get(t.name)),Lt.actions.has(t.name)&&this.emit(`cursor`,t.name)),e&&(e.toLowerCase()===`y`||e.toLowerCase()===`n`)&&this.emit(`confirm`,e.toLowerCase()===`y`),e===` `&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit(`value`,this.opts.placeholder))),e&&this.emit(`key`,e.toLowerCase()),t?.name===`return`){if(this.opts.validate){let e=this.opts.validate(this.value);e&&(this.error=e instanceof Error?e.message:e,this.state=`error`,this.rl?.write(this.value))}this.state!==`error`&&(this.state=`submit`)}Rt([e,t?.name,t?.sequence],`cancel`)&&(this.state=`cancel`),(this.state===`submit`||this.state===`cancel`)&&this.emit(`finalize`),this.render(),(this.state===`submit`||this.state===`cancel`)&&this.close()}close(){this.input.unpipe(),this.input.removeListener(`keypress`,this.onKeypress),this.output.write(`
42
- `),Ut(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=It(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
43
- `).length-1;this.output.write(B.cursor.move(-999,e*-1))}render(){let e=It(this._render(this)??``,process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state===`initial`)this.output.write(B.cursor.hide);else{let t=zt(this._prevFrame,e);if(this.restoreCursor(),t&&t?.length===1){let n=t[0];this.output.write(B.cursor.move(0,n)),this.output.write(B.erase.lines(1));let r=e.split(`
44
- `);this.output.write(r[n]),this._prevFrame=e,this.output.write(B.cursor.move(0,r.length-n-1));return}if(t&&t?.length>1){let n=t[0];this.output.write(B.cursor.move(0,n)),this.output.write(B.erase.down());let r=e.split(`
45
- `).slice(n);this.output.write(r.join(`
46
- `)),this._prevFrame=e;return}this.output.write(B.erase.down())}this.output.write(e),this.state===`initial`&&(this.state=`active`),this._prevFrame=e}}},Yt=class extends Jt{get cursor(){return+!this.value}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on(`value`,()=>{this.value=this._value}),this.on(`confirm`,e=>{this.output.write(B.cursor.move(0,-1)),this.value=e,this.state=`submit`,this.close()}),this.on(`cursor`,()=>{this.value=!this.value})}},Xt=Object.defineProperty,Zt=(e,t,n)=>t in e?Xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qt=(e,t,n)=>(Zt(e,typeof t==`symbol`?t:t+``,n),n),$t=class extends Jt{constructor(e){super(e,!1),Qt(this,`options`),Qt(this,`cursor`,0),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case`down`:case`right`:this.cursor=this.cursor===this.options.length-1?0:this.cursor+1}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}},en=class extends Jt{get valueWithCursor(){if(this.state===`submit`)return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[t,...n]=this.value.slice(this.cursor);return`${e}${V.default.inverse(t)}${n.join(``)}`}get cursor(){return this._cursor}constructor(e){super(e),this.on(`finalize`,()=>{this.value||=e.defaultValue})}};function tn(){return p.platform===`win32`?!!p.env.CI||!!p.env.WT_SESSION||!!p.env.TERMINUS_SUBLIME||p.env.ConEmuTask===`{cmd::Cmder}`||p.env.TERM_PROGRAM===`Terminus-Sublime`||p.env.TERM_PROGRAM===`vscode`||p.env.TERM===`xterm-256color`||p.env.TERM===`alacritty`||p.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:p.env.TERM!==`linux`}const nn=tn(),rn=(e,t)=>nn?e:t,an=rn(`◆`,`*`),on=rn(`■`,`x`),sn=rn(`▲`,`x`),cn=rn(`◇`,`o`),W=rn(`│`,`|`),ln=rn(`└`,`—`),un=rn(`●`,`>`),dn=rn(`○`,` `),fn=rn(`─`,`-`),pn=rn(`╮`,`+`),mn=rn(`├`,`+`),hn=rn(`╯`,`+`),gn=rn(`●`,`•`),_n=rn(`◆`,`*`),vn=rn(`▲`,`!`),yn=rn(`■`,`x`),bn=e=>{switch(e){case`initial`:case`active`:return V.default.cyan(an);case`cancel`:return V.default.red(on);case`error`:return V.default.yellow(sn);case`submit`:return V.default.green(cn)}},xn=e=>{let{cursor:t,options:n,style:r}=e,i=e.maxItems??1/0,a=Math.max(process.stdout.rows-4,0),o=Math.min(a,Math.max(i,5)),s=0;t>=s+o-3?s=Math.max(Math.min(t-o+3,n.length-o),0):t<s+2&&(s=Math.max(t-2,0));let c=o<n.length&&s>0,l=o<n.length&&s+o<n.length;return n.slice(s,s+o).map((e,n,i)=>{let a=n===0&&c,o=n===i.length-1&&l;return a||o?V.default.dim(`...`):r(e,n+s===t)})},Sn=e=>new en({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,render(){let t=`${V.default.gray(W)}
47
- ${bn(this.state)} ${e.message}
48
- `,n=e.placeholder?V.default.inverse(e.placeholder[0])+V.default.dim(e.placeholder.slice(1)):V.default.inverse(V.default.hidden(`_`)),r=this.value?this.valueWithCursor:n;switch(this.state){case`error`:return`${t.trim()}
49
- ${V.default.yellow(W)} ${r}
50
- ${V.default.yellow(ln)} ${V.default.yellow(this.error)}
51
- `;case`submit`:return`${t}${V.default.gray(W)} ${V.default.dim(this.value||e.placeholder)}`;case`cancel`:return`${t}${V.default.gray(W)} ${V.default.strikethrough(V.default.dim(this.value??``))}${this.value?.trim()?`
52
- ${V.default.gray(W)}`:``}`;default:return`${t}${V.default.cyan(W)} ${r}
53
- ${V.default.cyan(ln)}
54
- `}}}).prompt(),Cn=e=>{let t=e.active??`Yes`,n=e.inactive??`No`;return new Yt({active:t,inactive:n,initialValue:e.initialValue??!0,render(){let r=`${V.default.gray(W)}
55
- ${bn(this.state)} ${e.message}
56
- `,i=this.value?t:n;switch(this.state){case`submit`:return`${r}${V.default.gray(W)} ${V.default.dim(i)}`;case`cancel`:return`${r}${V.default.gray(W)} ${V.default.strikethrough(V.default.dim(i))}
57
- ${V.default.gray(W)}`;default:return`${r}${V.default.cyan(W)} ${this.value?`${V.default.green(un)} ${t}`:`${V.default.dim(dn)} ${V.default.dim(t)}`} ${V.default.dim(`/`)} ${this.value?`${V.default.dim(dn)} ${V.default.dim(n)}`:`${V.default.green(un)} ${n}`}
58
- ${V.default.cyan(ln)}
59
- `}}}).prompt()},wn=e=>{let t=(e,t)=>{let n=e.label??String(e.value);switch(t){case`selected`:return`${V.default.dim(n)}`;case`active`:return`${V.default.green(un)} ${n} ${e.hint?V.default.dim(`(${e.hint})`):``}`;case`cancelled`:return`${V.default.strikethrough(V.default.dim(n))}`;default:return`${V.default.dim(dn)} ${V.default.dim(n)}`}};return new $t({options:e.options,initialValue:e.initialValue,render(){let n=`${V.default.gray(W)}
60
- ${bn(this.state)} ${e.message}
61
- `;switch(this.state){case`submit`:return`${n}${V.default.gray(W)} ${t(this.options[this.cursor],`selected`)}`;case`cancel`:return`${n}${V.default.gray(W)} ${t(this.options[this.cursor],`cancelled`)}
62
- ${V.default.gray(W)}`;default:return`${n}${V.default.cyan(W)} ${xn({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(e,n)=>t(e,n?`active`:`inactive`)}).join(`
63
- ${V.default.cyan(W)} `)}
64
- ${V.default.cyan(ln)}
65
- `}}}).prompt()},Tn=(e=``,t=``)=>{let n=`
66
- ${e}
67
- `.split(`
68
- `),r=g(t).length,i=Math.max(n.reduce((e,t)=>{let n=g(t);return n.length>e?n.length:e},0),r)+2,a=n.map(e=>`${V.default.gray(W)} ${V.default.dim(e)}${` `.repeat(i-g(e).length)}${V.default.gray(W)}`).join(`
69
- `);process.stdout.write(`${V.default.gray(W)}
70
- ${V.default.green(cn)} ${V.default.reset(t)} ${V.default.gray(fn.repeat(Math.max(i-r-1,1))+pn)}
71
- ${a}
72
- ${V.default.gray(mn+fn.repeat(i+2)+hn)}
73
- `)},En=(e=``)=>{process.stdout.write(`${V.default.gray(ln)} ${V.default.red(e)}
74
-
75
- `)},Dn={message:(e=``,{symbol:t=V.default.gray(W)}={})=>{let n=[`${V.default.gray(W)}`];if(e){let[r,...i]=e.split(`
76
- `);n.push(`${t} ${r}`,...i.map(e=>`${V.default.gray(W)} ${e}`))}process.stdout.write(`${n.join(`
77
- `)}
78
- `)},info:e=>{Dn.message(e,{symbol:V.default.blue(gn)})},success:e=>{Dn.message(e,{symbol:V.default.green(_n)})},step:e=>{Dn.message(e,{symbol:V.default.green(cn)})},warn:e=>{Dn.message(e,{symbol:V.default.yellow(vn)})},warning:e=>{Dn.warn(e)},error:e=>{Dn.message(e,{symbol:V.default.red(yn)})}};`${V.default.gray(W)}`;const On=({indicator:e=`dots`}={})=>{let t=nn?[`◒`,`◐`,`◓`,`◑`]:[`•`,`o`,`O`,`0`],n=nn?80:120,r=process.env.CI===`true`,i,a,o=!1,s=``,c,l=performance.now(),u=e=>{o&&y(e>1?`Something went wrong`:`Canceled`,e)},d=()=>u(2),f=()=>u(1),p=()=>{process.on(`uncaughtExceptionMonitor`,d),process.on(`unhandledRejection`,d),process.on(`SIGINT`,f),process.on(`SIGTERM`,f),process.on(`exit`,u)},m=()=>{process.removeListener(`uncaughtExceptionMonitor`,d),process.removeListener(`unhandledRejection`,d),process.removeListener(`SIGINT`,f),process.removeListener(`SIGTERM`,f),process.removeListener(`exit`,u)},h=()=>{if(c===void 0)return;r&&process.stdout.write(`
79
- `);let e=c.split(`
80
- `);process.stdout.write(B.cursor.move(-999,e.length-1)),process.stdout.write(B.erase.down(e.length))},g=e=>e.replace(/\.+$/,``),_=e=>{let t=(performance.now()-e)/1e3,n=Math.floor(t/60),r=Math.floor(t%60);return n>0?`[${n}m ${r}s]`:`[${r}s]`},v=(u=``)=>{o=!0,i=Wt(),s=g(u),l=performance.now(),process.stdout.write(`${V.default.gray(W)}
81
- `);let d=0,f=0;p(),a=setInterval(()=>{if(r&&s===c)return;h(),c=s;let n=V.default.magenta(t[d]);if(r)process.stdout.write(`${n} ${s}...`);else if(e===`timer`)process.stdout.write(`${n} ${s} ${_(l)}`);else{let e=`.`.repeat(Math.floor(f)).slice(0,3);process.stdout.write(`${n} ${s}${e}`)}d=d+1<t.length?d+1:0,f=f<t.length?f+.125:0},n)},y=(t=``,n=0)=>{o=!1,clearInterval(a),h();let r=n===0?V.default.green(cn):n===1?V.default.red(on):V.default.red(sn);s=g(t??s),e===`timer`?process.stdout.write(`${r} ${s} ${_(l)}
82
- `):process.stdout.write(`${r} ${s}
83
- `),m(),i()};return{start:v,stop:y,message:(e=``)=>{s=g(e??s)}}},kn={red:e=>V.default.red(e),green:e=>V.default.green(e),yellow:e=>V.default.yellow(e),blue:e=>V.default.blue(e),cyan:e=>V.default.cyan(e),magenta:e=>V.default.magenta(e),gray:e=>V.default.gray(e),bold:e=>V.default.bold(e),dim:e=>V.default.dim(e)},An={async select(e,t){let n=await wn({message:e,options:t.map(e=>({value:e.value,label:e.label,hint:e.hint}))});return Ht(n)&&(En(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async textInput(e,t){let n=await Sn({message:e,placeholder:t?.placeholder,defaultValue:t?.defaultValue});return Ht(n)&&(En(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async confirm(e,t){let n=await Cn({message:e,initialValue:t?.defaultValue??!1});return Ht(n)&&(En(`操作已取消`),process.exit(0)),typeof n==`boolean`?n:!!n},spinner(){let e=On();return{start(t){e.start(t)},stop(t){e.stop(t)}}},note(e,t){Tn(e,t)},log:{info(e){Dn.info(V.default.blue(e))},success(e){Dn.success(V.default.green(e))},warn(e){Dn.warn(V.default.yellow(e))},error(e){Dn.error(V.default.red(e))},step(e){Dn.step(e)}}};var jn=/* @__PURE__ */ O((/* @__PURE__ */ E(((e,t)=>{(()=>{var e={"./node_modules/.pnpm/mlly@1.8.2/node_modules/mlly/dist lazy recursive"(e){function t(e){return Promise.resolve().then(function(){var t=/* @__PURE__ */ Error(`Cannot find module '`+e+`'`);throw t.code=`MODULE_NOT_FOUND`,t})}t.keys=()=>[],t.resolve=t,t.id=`./node_modules/.pnpm/mlly@1.8.2/node_modules/mlly/dist lazy recursive`,e.exports=t},fs(e){e.exports=k(`fs`)},"node:fs"(e){e.exports=k(`node:fs`)},"node:module"(e){e.exports=k(`node:module`)},"node:path"(e){e.exports=k(`node:path`)},os(e){e.exports=k(`os`)},path(e){e.exports=k(`path`)},"./node_modules/.pnpm/get-tsconfig@4.14.0/node_modules/get-tsconfig/dist/index.cjs"(e,t,n){var r=Object.defineProperty,i=(e,t)=>r(e,`name`,{value:t,configurable:!0}),a=n(`node:path`),o=n(`node:fs`),s=n(`node:module`),c=n(`./node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.cjs`),l=n(`fs`),u=n(`os`),d=n(`path`);function f(e){return e.startsWith(`\\\\?\\`)?e:e.replace(/\\/g,`/`)}i(f,`slash`);let p=i(e=>{let t=o[e];return(n,...r)=>{let i=`${e}:${r.join(`:`)}`,a=n?.get(i);return a===void 0&&(a=Reflect.apply(t,o,r),n?.set(i,a)),a}},`cacheFs`),m=p(`existsSync`),h=p(`readFileSync`),g=p(`statSync`),_=i((e,t,n)=>{for(;;){let r=a.posix.join(e,t);if(m(n,r))return r;let i=a.dirname(e);if(i===e)return;e=i}},`findUp`),v=/^\.{1,2}(\/.*)?$/,y=i(e=>{let t=f(e);return v.test(t)?t:`./${t}`},`normalizeRelativePath`);function b(e,t=!1){let n=e.length,r=0,a=``,o=0,s=16,c=0,l=0,u=0,d=0,f=0;function p(t,n){let i=0,a=0;for(;i<t;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=16*a+t-48;else if(t>=65&&t<=70)a=16*a+t-65+10;else{if(!(t>=97&&t<=102))break;a=16*a+t-97+10}r++,i++}return i<t&&(a=-1),a}function m(e){r=e,a=``,o=0,s=16,f=0}function h(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&C(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46){if(r++,!(r<e.length&&C(e.charCodeAt(r))))return f=3,e.substring(t,r);for(r++;r<e.length&&C(e.charCodeAt(r));)r++}let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101)){if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&C(e.charCodeAt(r))){for(r++;r<e.length&&C(e.charCodeAt(r));)r++;n=r}else f=3}return e.substring(t,n)}function g(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),f=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a!==92){if(a>=0&&a<=31){if(S(a)){t+=e.substring(i,r),f=2;break}f=6}r++}else{if(t+=e.substring(i,r),r++,r>=n){f=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
84
- `;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=p(4);e>=0?t+=String.fromCharCode(e):f=4;break;default:f=5}i=r}}return t}function _(){if(a=``,f=0,o=r,l=c,d=u,r>=n)return o=n,s=17;let t=e.charCodeAt(r);if(x(t)){do r++,a+=String.fromCharCode(t),t=e.charCodeAt(r);while(x(t));return s=15}if(S(t))return r++,a+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,a+=`
85
- `),c++,u=r,s=14;switch(t){case 123:return r++,s=1;case 125:return r++,s=2;case 91:return r++,s=3;case 93:return r++,s=4;case 58:return r++,s=6;case 44:return r++,s=5;case 34:return r++,a=g(),s=10;case 47:let i=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!S(e.charCodeAt(r));)r++;return a=e.substring(i,r),s=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,o=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,o=!0;break}r++,S(t)&&(t===13&&e.charCodeAt(r)===10&&r++,c++,u=r)}return o||(r++,f=1),a=e.substring(i,r),s=13}return a+=String.fromCharCode(t),r++,s=16;case 45:if(a+=String.fromCharCode(t),r++,r===n||!C(e.charCodeAt(r)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return a+=h(),s=11;default:for(;r<n&&v(t);)r++,t=e.charCodeAt(r);if(o!==r){switch(a=e.substring(o,r),a){case`true`:return s=8;case`false`:return s=9;case`null`:return s=7}return s=16}return a+=String.fromCharCode(t),r++,s=16}}function v(e){if(x(e)||S(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function y(){let e;do e=_();while(e>=12&&e<=15);return e}return i(p,`scanHexDigits`),i(m,`setPosition`),i(h,`scanNumber`),i(g,`scanString`),i(_,`scanNext`),i(v,`isUnknownContentCharacter`),i(y,`scanNextNonTrivia`),{setPosition:m,getPosition:i(()=>r,`getPosition`),scan:t?y:_,getToken:i(()=>s,`getToken`),getTokenValue:i(()=>a,`getTokenValue`),getTokenOffset:i(()=>o,`getTokenOffset`),getTokenLength:i(()=>r-o,`getTokenLength`),getTokenStartLine:i(()=>l,`getTokenStartLine`),getTokenStartCharacter:i(()=>o-d,`getTokenStartCharacter`),getTokenError:i(()=>f,`getTokenError`)}}function x(e){return e===32||e===9}function S(e){return e===10||e===13}function C(e){return e>=48&&e<=57}var w,T;i(b,`createScanner`),i(x,`isWhiteSpace`),i(S,`isLineBreak`),i(C,`isDigit`),(T=w||={})[T.lineFeed=10]=`lineFeed`,T[T.carriageReturn=13]=`carriageReturn`,T[T.space=32]=`space`,T[T._0=48]=`_0`,T[T._1=49]=`_1`,T[T._2=50]=`_2`,T[T._3=51]=`_3`,T[T._4=52]=`_4`,T[T._5=53]=`_5`,T[T._6=54]=`_6`,T[T._7=55]=`_7`,T[T._8=56]=`_8`,T[T._9=57]=`_9`,T[T.a=97]=`a`,T[T.b=98]=`b`,T[T.c=99]=`c`,T[T.d=100]=`d`,T[T.e=101]=`e`,T[T.f=102]=`f`,T[T.g=103]=`g`,T[T.h=104]=`h`,T[T.i=105]=`i`,T[T.j=106]=`j`,T[T.k=107]=`k`,T[T.l=108]=`l`,T[T.m=109]=`m`,T[T.n=110]=`n`,T[T.o=111]=`o`,T[T.p=112]=`p`,T[T.q=113]=`q`,T[T.r=114]=`r`,T[T.s=115]=`s`,T[T.t=116]=`t`,T[T.u=117]=`u`,T[T.v=118]=`v`,T[T.w=119]=`w`,T[T.x=120]=`x`,T[T.y=121]=`y`,T[T.z=122]=`z`,T[T.A=65]=`A`,T[T.B=66]=`B`,T[T.C=67]=`C`,T[T.D=68]=`D`,T[T.E=69]=`E`,T[T.F=70]=`F`,T[T.G=71]=`G`,T[T.H=72]=`H`,T[T.I=73]=`I`,T[T.J=74]=`J`,T[T.K=75]=`K`,T[T.L=76]=`L`,T[T.M=77]=`M`,T[T.N=78]=`N`,T[T.O=79]=`O`,T[T.P=80]=`P`,T[T.Q=81]=`Q`,T[T.R=82]=`R`,T[T.S=83]=`S`,T[T.T=84]=`T`,T[T.U=85]=`U`,T[T.V=86]=`V`,T[T.W=87]=`W`,T[T.X=88]=`X`,T[T.Y=89]=`Y`,T[T.Z=90]=`Z`,T[T.asterisk=42]=`asterisk`,T[T.backslash=92]=`backslash`,T[T.closeBrace=125]=`closeBrace`,T[T.closeBracket=93]=`closeBracket`,T[T.colon=58]=`colon`,T[T.comma=44]=`comma`,T[T.dot=46]=`dot`,T[T.doubleQuote=34]=`doubleQuote`,T[T.minus=45]=`minus`,T[T.openBrace=123]=`openBrace`,T[T.openBracket=91]=`openBracket`,T[T.plus=43]=`plus`,T[T.slash=47]=`slash`,T[T.formFeed=12]=`formFeed`,T[T.tab=9]=`tab`,Array(20).fill(0).map((e,t)=>` `.repeat(t));var E,D,ee;function O(e,t=[],n=E.DEFAULT){let r=null,a=[],o=[];function s(e){Array.isArray(a)?a.push(e):r!==null&&(a[r]=e)}return i(s,`onValue`),k(e,{onObjectBegin:i(()=>{let e={};s(e),o.push(a),a=e,r=null},`onObjectBegin`),onObjectProperty:i(e=>{r=e},`onObjectProperty`),onObjectEnd:i(()=>{a=o.pop()},`onObjectEnd`),onArrayBegin:i(()=>{let e=[];s(e),o.push(a),a=e,r=null},`onArrayBegin`),onArrayEnd:i(()=>{a=o.pop()},`onArrayEnd`),onLiteralValue:s,onError:i((e,n,r)=>{t.push({error:e,offset:n,length:r})},`onError`)},n),a[0]}function k(e,t,n=E.DEFAULT){let r=b(e,!1),a=[],o=0;function s(e){return e?()=>o===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>o===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function l(e){return e?t=>o===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>a.slice()):()=>!0}function u(e){return e?()=>{o>0?o++:!1===e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>a.slice())&&(o=1)}:()=>!0}function d(e){return e?()=>{o>0&&o--,o===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}i(s,`toNoArgVisit`),i(c,`toOneArgVisit`),i(l,`toOneArgVisitWithPath`),i(u,`toBeginVisit`),i(d,`toEndVisit`);let f=u(t.onObjectBegin),p=l(t.onObjectProperty),m=d(t.onObjectEnd),h=u(t.onArrayBegin),g=d(t.onArrayEnd),_=l(t.onLiteralValue),v=c(t.onSeparator),y=s(t.onComment),x=c(t.onError),S=n&&n.disallowComments,C=n&&n.allowTrailingComma;function w(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:T(14);break;case 5:T(15);break;case 3:T(13);break;case 1:S||T(11);break;case 2:T(12);break;case 6:T(16)}switch(e){case 12:case 13:S?T(10):y();break;case 16:T(1);break;case 15:case 14:break;default:return e}}}function T(e,t=[],n=[]){if(x(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){w();break}if(n.indexOf(e)!==-1)break;e=w()}}}function D(e){let t=r.getTokenValue();return e?_(t):(p(t),a.push(t)),w(),!0}function ee(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(T(2),t=0),_(t);break;case 7:_(null);break;case 8:_(!0);break;case 9:_(!1);break;default:return!1}return w(),!0}function O(){return r.getToken()===10?(D(!1),r.getToken()===6?(v(`:`),w(),j()||T(4,[],[2,5])):T(5,[],[2,5]),a.pop(),!0):(T(3,[],[2,5]),!1)}function k(){f(),w();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||T(4,[],[]),v(`,`),w(),r.getToken()===2&&C)break}else e&&T(6,[],[]);O()||T(4,[],[2,5]),e=!0}return m(),r.getToken()===2?w():T(7,[2],[]),!0}function A(){h(),w();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||T(4,[],[]),v(`,`),w(),r.getToken()===4&&C)break}else t&&T(6,[],[]);e?(a.push(0),e=!1):a[a.length-1]++,j()||T(4,[],[4,5]),t=!0}return g(),e||a.pop(),r.getToken()===4?w():T(8,[4],[]),!0}function j(){switch(r.getToken()){case 3:return A();case 1:return k();case 10:return D(!0);default:return ee()}}return i(w,`scanNext`),i(T,`handleError`),i(D,`parseString`),i(ee,`parseLiteral`),i(O,`parseProperty`),i(k,`parseObject`),i(A,`parseArray`),i(j,`parseValue`),w(),r.getToken()===17?!!n.allowEmptyContent||(T(4,[],[]),!1):j()?(r.getToken()!==17&&T(9,[],[]),!0):(T(4,[],[]),!1)}Array(200).fill(0).map((e,t)=>`
86
- `+` `.repeat(t)),Array(200).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(200).fill(0).map((e,t)=>`\r
87
- `+` `.repeat(t)),Array(200).fill(0).map((e,t)=>`
88
- `+` `.repeat(t)),Array(200).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(200).fill(0).map((e,t)=>`\r
89
- `+` `.repeat(t)),function(e){e.DEFAULT={allowTrailingComma:!1}}(E||={}),i(O,`parse$1`),i(k,`visit`),function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`}(D||={}),function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`}(ee||={});let A=O;var j;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(j||={});let te=i((e,t)=>A(h(t,e,`utf8`)),`readJsonc`),ne=Symbol(`implicitBaseUrl`),M="${configDir}",re=i(()=>{let{findPnpApi:e}=s;return e&&e(process.cwd())},`getPnpApi`),ie=i((e,t,n,r)=>{let i=`resolveFromPackageJsonPath:${e}:${t}:${n}`;if(r!=null&&r.has(i))return r.get(i);let o=te(e,r);if(!o)return;let s=t||`tsconfig.json`;if(!n&&o.exports)try{let[e]=c.resolveExports(o.exports,t,[`require`,`types`]);s=e}catch{return!1}else!t&&o.tsconfig&&(s=o.tsconfig);return s=a.join(e,`..`,s),r?.set(i,s),s},`resolveFromPackageJsonPath`),N=`package.json`,ae=`tsconfig.json`,oe=i((e,t,n)=>{let r=e;if(e===`..`&&(r=a.join(r,ae)),e[0]===`.`&&(r=a.resolve(t,r)),a.isAbsolute(r)){if(m(n,r)){if(g(n,r).isFile())return r}else if(!r.endsWith(`.json`)){let e=`${r}.json`;if(m(n,e))return e}return}let[i,...o]=e.split(`/`),s=i[0]===`@`?`${i}/${o.shift()}`:i,c=o.join(`/`),l=re();if(l){let{resolveRequest:r}=l;try{if(s===e){let e=r(a.join(s,N),t);if(e){let t=ie(e,c,!1,n);if(t&&m(n,t))return t}}else{let n;try{n=r(e,t,{extensions:[`.json`]})}catch{n=r(a.join(e,ae),t)}if(n)return n}}catch{}}let u=_(a.resolve(t),a.join(`node_modules`,s),n);if(!u||!g(n,u).isDirectory())return;let d=a.join(u,N);if(m(n,d)){let e=ie(d,c,!1,n);if(!1===e)return;if(e&&m(n,e)&&g(n,e).isFile())return e}let f=a.join(u,c),p=f.endsWith(`.json`);if(!p){let e=`${f}.json`;if(m(n,e))return e}if(m(n,f)){if(g(n,f).isDirectory()){let e=a.join(f,N);if(m(n,e)){let t=ie(e,``,!0,n);if(t&&m(n,t))return t}let t=a.join(f,ae);if(m(n,t))return t}else if(p)return f}},`resolveExtendsPath`),se=i((e,t)=>y(a.relative(e,t)),`pathRelative`),ce=[`files`,`include`,`exclude`],le=i((e,t,n)=>{let r=a.join(t,n);return f(a.relative(e,r))||`./`},`resolveAndRelativize`),ue=i((e,t,n)=>{let r=a.relative(e,t);return r?f(`${r}/${n.startsWith(`./`)?n.slice(2):n}`):n},`prefixPattern`),de=i((e,t,n,r)=>{let i=oe(e,t,r);if(!i)throw Error(`File '${e}' not found.`);if(n.has(i))throw Error(`Circularity detected while resolving configuration: ${i}`);n.add(i);let o=a.dirname(i),s=P(i,r,n);delete s.references;let{compilerOptions:c}=s;if(c){let{baseUrl:e}=c;e&&!e.startsWith(M)&&(c.baseUrl=le(t,o,e));let{outDir:n}=c;n&&!n.startsWith(M)&&(c.outDir=le(t,o,n));let{declarationDir:r}=c;r&&!r.startsWith(M)&&(c.declarationDir=le(t,o,r));let{rootDir:i}=c;i&&!i.startsWith(M)&&(c.rootDir=le(t,o,i));let{rootDirs:a}=c;a&&(c.rootDirs=a.map(e=>e.startsWith(M)?e:le(t,o,e)));let{typeRoots:s}=c;s&&(c.typeRoots=s.map(e=>e.startsWith(M)?e:le(t,o,e)))}for(let e of ce){let n=s[e];n&&(s[e]=n.map(e=>e.startsWith(M)?e:ue(t,o,e)))}return s},`resolveExtends`),fe=[`outDir`,`declarationDir`],P=i((e,t,n=/* @__PURE__ */ new Set)=>{let r;try{r=te(e,t)||{}}catch{throw Error(`Cannot resolve tsconfig at path: ${e}`)}if(typeof r!=`object`)throw SyntaxError(`Failed to parse tsconfig at: ${e}`);let i=a.dirname(e);if(r.compilerOptions){let{compilerOptions:e}=r;e.paths&&!e.baseUrl&&(e[ne]=i)}if(r.extends){let e=Array.isArray(r.extends)?r.extends:[r.extends];delete r.extends;for(let a of e.reverse()){let e=de(a,i,new Set(n),t),o={...e,...r,compilerOptions:{...e.compilerOptions,...r.compilerOptions}};e.watchOptions&&(o.watchOptions={...e.watchOptions,...r.watchOptions}),r=o}}if(r.compilerOptions){let{compilerOptions:e}=r;for(let t of[`baseUrl`,`rootDir`]){let n=e[t];if(n&&!n.startsWith(M)){let r=a.resolve(i,n);e[t]=se(i,r)}}for(let t of fe){let n=e[t];n&&(Array.isArray(r.exclude)||(r.exclude=fe.map(t=>e[t]).filter(Boolean)),n.startsWith(M)||(n=y(n)),e[t]=n)}}else r.compilerOptions={};if(r.include&&(r.include=r.include.map(f)),r.files&&(r.files=r.files.map(e=>e.startsWith(M)?e:y(e))),r.watchOptions){let{watchOptions:e}=r;e.excludeDirectories&&=e.excludeDirectories.map(e=>f(a.resolve(i,e))),e.excludeFiles&&=e.excludeFiles.map(e=>f(a.resolve(i,e))),e.watchFile&&=e.watchFile.toLowerCase(),e.watchDirectory&&=e.watchDirectory.toLowerCase(),e.fallbackPolling&&=e.fallbackPolling.toLowerCase()}return r},`_parseTsconfig`),pe=i((e,t)=>{if(e.startsWith(M))return f(a.join(t,e.slice(12)))},`interpolateConfigDir`),me=[`outDir`,`declarationDir`,`outFile`,`rootDir`,`baseUrl`,`tsBuildInfoFile`],he=i(e=>{if(e.strict)for(let t of[`noImplicitAny`,`noImplicitThis`,`strictNullChecks`,`strictFunctionTypes`,`strictBindCallApply`,`strictPropertyInitialization`,`strictBuiltinIteratorReturn`,`alwaysStrict`,`useUnknownInCatchVariables`])e[t]===void 0&&(e[t]=!0);if(e.composite&&(e.declaration??=!0,e.incremental??=!0),e.target){let t=e.target.toLowerCase();t===`es2015`&&(t=`es6`),e.target=t,t===`esnext`&&(e.module??=`es6`,e.useDefineForClassFields??=!0),(t===`es6`||t===`es2016`||t===`es2017`||t===`es2018`||t===`es2019`||t===`es2020`||t===`es2021`||t===`es2022`||t===`es2023`||t===`es2024`)&&(e.module??=`es6`),(t===`es2022`||t===`es2023`||t===`es2024`)&&(e.useDefineForClassFields??=!0)}if(e.module){let t=e.module.toLowerCase();if(t===`es2015`&&(t=`es6`),e.module=t,(t===`es6`||t===`es2020`||t===`es2022`||t===`esnext`||t===`none`||t===`system`||t===`umd`||t===`amd`)&&(e.moduleResolution??=`classic`),t===`system`&&(e.allowSyntheticDefaultImports??=!0),(t===`node16`||t===`node18`||t===`node20`||t===`nodenext`||t===`preserve`)&&(e.esModuleInterop??=!0,e.allowSyntheticDefaultImports??=!0),(t===`node16`||t===`node18`||t===`node20`||t===`nodenext`)&&(e.moduleDetection??=`force`),t===`node16`&&(e.target??=`es2022`,e.moduleResolution??=`node16`),t===`node18`&&(e.target??=`es2022`,e.moduleResolution??=`node16`),t===`node20`&&(e.target??=`es2023`,e.moduleResolution??=`node16`,e.resolveJsonModule??=!0),t===`nodenext`&&(e.target??=`esnext`,e.moduleResolution??=`nodenext`,e.resolveJsonModule??=!0),t===`node16`||t===`node18`||t===`node20`||t===`nodenext`){let t=e.target;(t===`es3`||t===`es2022`||t===`es2023`||t===`es2024`||t===`esnext`)&&(e.useDefineForClassFields??=!0)}t===`preserve`&&(e.moduleResolution??=`bundler`)}if(e.moduleResolution){let t=e.moduleResolution.toLowerCase();t===`node`&&(t=`node10`),e.moduleResolution=t,(t===`node16`||t===`nodenext`||t===`bundler`)&&(e.resolvePackageJsonExports??=!0,e.resolvePackageJsonImports??=!0),t===`bundler`&&(e.allowSyntheticDefaultImports??=!0,e.resolveJsonModule??=!0)}e.jsx&&=e.jsx.toLowerCase(),e.moduleDetection&&=e.moduleDetection.toLowerCase(),e.importsNotUsedAsValues&&=e.importsNotUsedAsValues.toLowerCase(),e.newLine&&=e.newLine.toLowerCase(),e.esModuleInterop&&(e.allowSyntheticDefaultImports??=!0),e.verbatimModuleSyntax&&(e.isolatedModules??=!0,e.preserveConstEnums??=!0),e.isolatedModules&&(e.preserveConstEnums??=!0),e.rewriteRelativeImportExtensions&&(e.allowImportingTsExtensions??=!0),e.lib&&=e.lib.map(e=>e.toLowerCase()),e.checkJs&&(e.allowJs??=!0)},`normalizeCompilerOptions`),ge=i((e,t=/* @__PURE__ */ new Map)=>{let n=a.resolve(e),r=P(n,t),i=a.dirname(n),{compilerOptions:o}=r;if(o){for(let e of me){let t=o[e];if(t){let n=pe(t,i);o[e]=n?se(i,n):t}}for(let e of[`rootDirs`,`typeRoots`]){let t=o[e];t&&(o[e]=t.map(e=>{let t=pe(e,i);return t?se(i,t):y(e)}))}let{paths:e}=o;if(e)for(let t of Object.keys(e))e[t]=e[t].map(e=>pe(e,i)??e);he(o)}for(let e of ce){let t=r[e];t&&(r[e]=t.map(e=>pe(e,i)??e))}return r},`parseTsconfig`);var F=Object.defineProperty,_e=i((e,t)=>F(e,`name`,{value:t,configurable:!0}),`s`);let ve=_e(e=>{let t=``;for(let n=0;n<e.length;n+=1){let r=e[n],i=r.toUpperCase();t+=r===i?r.toLowerCase():i}return t},`invertCase`),ye=/* @__PURE__ */ new Map,be=_e((e,t)=>{let n=d.join(e,`.is-fs-case-sensitive-test-${process.pid}`);try{return t.writeFileSync(n,``),!t.existsSync(ve(n))}finally{try{t.unlinkSync(n)}catch{}}},`checkDirectoryCaseWithWrite`),xe=_e((e,t,n)=>{try{return be(e,n)}catch(e){if(t===void 0)return be(u.tmpdir(),n);throw e}},`checkDirectoryCaseWithFallback`),Se=_e((e,t=l,n=!0)=>{let r=e??process.cwd();if(n&&ye.has(r))return ye.get(r);let i,a=ve(r);return i=a!==r&&t.existsSync(r)?!t.existsSync(a):xe(r,e,t),n&&ye.set(r,i),i},`isFsCaseSensitive`),{join:Ce}=a.posix,we={ts:[`.ts`,`.tsx`,`.d.ts`],cts:[`.cts`,`.d.cts`],mts:[`.mts`,`.d.mts`]},Te=i(e=>{let t=[...we.ts],n=[...we.cts],r=[...we.mts];return e!=null&&e.allowJs&&(t.push(`.js`,`.jsx`),n.push(`.cjs`),r.push(`.mjs`)),[...t,...n,...r]},`getSupportedExtensions`),I=i(e=>{let t=[];if(!e)return t;let{outDir:n,declarationDir:r}=e;return n&&t.push(n),r&&t.push(r),t},`getDefaultExcludeSpec`),Ee=i(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),`escapeForRegexp`),L=`(?!(${[`node_modules`,`bower_components`,`jspm_packages`].join(`|`)})(/|$))`,De=/(?:^|\/)[^.*?]+$/,Oe=`**/*`,ke=`[^/]`,Ae=`[^./]`,je=process.platform===`win32`,Me=i(({config:e,path:t},n=Se())=>{if(`extends`in e)throw Error(`tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.`);if(!a.isAbsolute(t))throw Error(`The tsconfig path must be absolute`);je&&(t=f(t));let r=a.dirname(t),{files:o,include:s,exclude:c,compilerOptions:l}=e,u=i(e=>a.isAbsolute(e)?e:Ce(r,e),`resolvePattern`),d=o?.map(u),p=Te(l),m=n?``:`i`,h=(c||I(l)).map(e=>{let t=u(e),n=Ee(t).replaceAll(String.raw`\*\*/`,`(.+/)?`).replaceAll(String.raw`\*`,`${ke}*`).replaceAll(String.raw`\?`,ke);return RegExp(`^${n}($|/)`,m)}),g=o||s?s:[Oe],_=g?g.map(e=>{let t=u(e);De.test(t)&&(t=Ce(t,Oe));let n=Ee(t).replaceAll(String.raw`/\*\*`,`(/${L}${Ae}${ke}*)*?`).replaceAll(/(\/)?\\\*/g,(e,t)=>{let n=`(${Ae}|(\\.(?!min\\.js$))?)*`;return t?`/${L}${Ae}${n}`:n}).replaceAll(/(\/)?\\\?/g,(e,t)=>t?`/${L}${ke}`:ke);return RegExp(`^${n}$`,m)}):void 0;return t=>{if(!a.isAbsolute(t))throw Error(`filePath must be absolute`);return je&&(t=f(t)),d!=null&&d.includes(t)||p.some(e=>t.endsWith(e))&&!h.some(e=>e.test(t))&&_&&_.some(e=>e.test(t))?e:void 0}},`createFilesMatcher`),Ne=i((e,t,n)=>{let r=a.resolve(e),i=f(e);for(;;){let e=_(i,t,n);if(!e)return;let o=a.resolve(e),s=ge(o,n),c={path:f(o),config:s};if(Me(c)(r))return c;let l=a.dirname(e),u=a.dirname(l);if(u===l)return;i=u}},`findConfigApplicable`),Pe=i((e=process.cwd(),t=`tsconfig.json`,n=/* @__PURE__ */ new Map,r=!1)=>r?Ne(e,t,n)?.path:_(f(e),t,n),`findTsconfig`),Fe=i((e=process.cwd(),t=`tsconfig.json`,n=/* @__PURE__ */ new Map,r=!1)=>{if(!r){let r=Pe(e,t,n);return r?{path:r,config:ge(r,n)}:null}return Ne(e,t,n)??null},`getTsconfig`),Ie=/\*/g,Le=i((e,t)=>{let n=e.match(Ie);if(n&&n.length>1)throw Error(t)},`assertStarCount`),Re=i(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{prefix:t,suffix:n}}return e},`parsePattern`),ze=i(({prefix:e,suffix:t},n)=>n.startsWith(e)&&n.endsWith(t),`isPatternMatch`),Be=i((e,t,n)=>Object.entries(e).map(([e,r])=>(Le(e,`Pattern '${e}' can have at most one '*' character.`),{pattern:Re(e),substitutions:r.map(r=>{if(Le(r,`Substitution '${r}' in pattern '${e}' can have at most one '*' character.`),!t&&!v.test(r)&&!a.isAbsolute(r))throw Error(`Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?`);return a.resolve(n,r)})})),`parsePaths`);t.createPathsMatcher=i(e=>{let{compilerOptions:t}=e.config;if(!t)return null;let{baseUrl:n,paths:r}=t;if(!n&&!r)return null;let i=ne in t&&t[ne],o=a.resolve(a.dirname(e.path),n||i||`.`),s=r?Be(r,n,o):[];return e=>{if(v.test(e))return[];let t=[];for(let n of s){if(n.pattern===e)return n.substitutions.map(f);typeof n.pattern!=`string`&&t.push(n)}let r,i=-1;for(let n of t)ze(n.pattern,e)&&n.pattern.prefix.length>i&&(i=n.pattern.prefix.length,r=n);if(!r)return n?[f(a.join(o,e))]:[];let c=e.slice(r.pattern.prefix.length,e.length-r.pattern.suffix.length);return r.substitutions.map(e=>f(e.replace(`*`,c)))}},`createPathsMatcher`),t.getTsconfig=Fe},"./node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.cjs"(e,t){Object.defineProperty(t,"__esModule",{value:!0});let n=e=>typeof e==`object`&&!!e,r=(e,t)=>Object.assign(/* @__PURE__ */ Error(`[${e}]: ${t}`),{code:e}),i=`ERR_INVALID_PACKAGE_CONFIG`,a=`ERR_INVALID_PACKAGE_TARGET`,o=/^\d+$/,s=/^(\.{1,2}|node_modules)$/i,c=/\/|\\/;var l,u=((l=u||{}).Export=`exports`,l.Import=`imports`,l);let d=(e,t,l,u,f)=>{if(t==null)return[];if(typeof t==`string`){let[n,...i]=t.split(c);if(n===`..`||i.some(e=>s.test(e)))throw r(a,`Invalid "${e}" target "${t}" defined in the package config`);return[f?t.replace(/\*/g,f):t]}if(Array.isArray(t))return t.flatMap(t=>d(e,t,l,u,f));if(n(t)){for(let n of Object.keys(t)){if(o.test(n))throw r(i,`Cannot contain numeric property keys`);if(n==="default"||u.includes(n))return d(e,t[n],l,u,f)}return[]}throw r(a,`Invalid "${e}" target "${t}"`)},f=(e,t)=>{let n=e.indexOf(`*`),r=t.indexOf(`*`);return n===r?t.length>e.length:r>n};function p(e,t){if(!t.includes(`*`)&&e.hasOwnProperty(t))return[t];let n,r;for(let i of Object.keys(e))if(i.includes(`*`)){let[e,a,o]=i.split(`*`);if(o===void 0&&t.startsWith(e)&&t.endsWith(a)){let o=t.slice(e.length,-a.length||void 0);o&&(!n||f(n,i))&&(n=i,r=o)}}return[n,r]}let m=/^\w+:/;t.resolveExports=(e,t,o)=>{if(!e)throw Error(`"exports" is required`);t=t===``?`.`:`./${t}`,(typeof e==`string`||Array.isArray(e)||n(e)&&(e=>Object.keys(e).reduce((e,t)=>{let n=t===``||t[0]!==`.`;if(e===void 0||e===n)return n;throw r(i,`"exports" cannot contain some keys starting with "." and some not`)},void 0))(e))&&(e={".":e});let[s,c]=p(e,t),l=d(u.Export,e[s],t,o,c);if(l.length===0)throw r(`ERR_PACKAGE_PATH_NOT_EXPORTED`,t===`.`?`No "exports" main defined`:`Package subpath '${t}' is not defined by "exports"`);for(let e of l)if(!e.startsWith(`./`)&&!m.test(e))throw r(a,`Invalid "exports" target "${e}" defined in the package config`);return l},t.resolveImports=(e,t,n)=>{if(!e)throw Error(`"imports" is required`);let[i,a]=p(e,t),o=d(u.Import,e[i],t,n,a);if(o.length===0)throw r(`ERR_PACKAGE_IMPORT_NOT_DEFINED`,`Package import specifier "${t}" is not defined in package`);return o}}},n={};function r(t){var i=n[t];if(i!==void 0)return i.exports;var a=n[t]={exports:{}};return e[t](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};(()=>{r.d(i,{default:()=>Qr});let e=k(`node:os`);var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],a=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,o={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},s=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,c={5:s,"5module":s+` export import`,6:s+` const class extends export import super`},l=/^in(stanceof)?$/,u=RegExp(`[`+a+`]`),d=RegExp(`[`+a+`‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・]`);function f(e,t){for(var n=65536,r=0;r<t.length;r+=2){if((n+=t[r])>e)return!1;if((n+=t[r+1])>=e)return!0}return!1}function p(e,t){return e<65?e===36:e<91||(e<97?e===95:e<123||(e<=65535?e>=170&&u.test(String.fromCharCode(e)):!1!==t&&f(e,n)))}function m(e,r){return e<48?e===36:e<58||!(e<65)&&(e<91||(e<97?e===95:e<123||(e<=65535?e>=170&&d.test(String.fromCharCode(e)):!1!==r&&(f(e,n)||f(e,t)))))}var h=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function g(e,t){return new h(e,{beforeExpr:!0,binop:t})}var _={beforeExpr:!0},v={startsExpr:!0},y={};function b(e,t){return t===void 0&&(t={}),t.keyword=e,y[e]=new h(e,t)}var x={num:new h(`num`,v),regexp:new h(`regexp`,v),string:new h(`string`,v),name:new h(`name`,v),privateId:new h(`privateId`,v),eof:new h(`eof`),bracketL:new h(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new h(`]`),braceL:new h(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new h(`}`),parenL:new h(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new h(`)`),comma:new h(`,`,_),semi:new h(`;`,_),colon:new h(`:`,_),dot:new h(`.`),question:new h(`?`,_),questionDot:new h(`?.`),arrow:new h(`=>`,_),template:new h(`template`),invalidTemplate:new h(`invalidTemplate`),ellipsis:new h(`...`,_),backQuote:new h("`",v),dollarBraceL:new h("${",{beforeExpr:!0,startsExpr:!0}),eq:new h(`=`,{beforeExpr:!0,isAssign:!0}),assign:new h(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new h(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new h(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:g(`||`,1),logicalAND:g(`&&`,2),bitwiseOR:g(`|`,3),bitwiseXOR:g(`^`,4),bitwiseAND:g(`&`,5),equality:g(`==/!=/===/!==`,6),relational:g(`</>/<=/>=`,7),bitShift:g(`<</>>/>>>`,8),plusMin:new h(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:g(`%`,10),star:g(`*`,10),slash:g(`/`,10),starstar:new h(`**`,{beforeExpr:!0}),coalesce:g(`??`,1),_break:b(`break`),_case:b(`case`,_),_catch:b(`catch`),_continue:b(`continue`),_debugger:b(`debugger`),_default:b(`default`,_),_do:b(`do`,{isLoop:!0,beforeExpr:!0}),_else:b(`else`,_),_finally:b(`finally`),_for:b(`for`,{isLoop:!0}),_function:b(`function`,v),_if:b(`if`),_return:b(`return`,_),_switch:b(`switch`),_throw:b(`throw`,_),_try:b(`try`),_var:b(`var`),_const:b(`const`),_while:b(`while`,{isLoop:!0}),_with:b(`with`),_new:b(`new`,{beforeExpr:!0,startsExpr:!0}),_this:b(`this`,v),_super:b(`super`,v),_class:b(`class`,v),_extends:b(`extends`,_),_export:b(`export`),_import:b(`import`,v),_null:b(`null`,v),_true:b(`true`,v),_false:b(`false`,v),_in:b(`in`,{beforeExpr:!0,binop:7}),_instanceof:b(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:b(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:b(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:b(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},S=/\r\n?|\n|\u2028|\u2029/,C=new RegExp(S.source,`g`);function w(e){return e===10||e===13||e===8232||e===8233}function T(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(w(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var E=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,D=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ee=Object.prototype,O=ee.hasOwnProperty,A=ee.toString,j=Object.hasOwn||function(e,t){return O.call(e,t)},te=Array.isArray||function(e){return A.call(e)===`[object Array]`},ne=Object.create(null);function M(e){return ne[e]||(ne[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function re(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}var ie=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,N=function(e,t){this.line=e,this.column=t};N.prototype.offset=function(e){return new N(this.line,this.column+e)};var ae=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function oe(e,t){for(var n=1,r=0;;){var i=T(e,r,t);if(i<0)return new N(n,t-r);++n,r=i}}var se={ecmaVersion:null,sourceType:`script`,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},ce=!1;function le(e){var t={};for(var n in se)t[n]=e&&j(e,n)?e[n]:se[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!ce&&typeof console==`object`&&console.warn&&(ce=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
90
- Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,e&&e.allowHashBang!=null||(t.allowHashBang=t.ecmaVersion>=14),te(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}if(te(t.onComment)&&(t.onComment=function(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new ae(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}(t,t.onComment)),t.sourceType===`commonjs`&&t.allowAwaitOutsideFunction)throw Error(`Cannot use allowAwaitOutsideFunction with sourceType: commonjs`);return t}var ue=256,de=259;function fe(e,t){return 2|(e?4:0)|(t?8:0)}var P=function(e,t,n){this.options=e=le(e),this.sourceFile=e.sourceFile,this.keywords=M(c[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;!0!==e.allowReserved&&(r=o[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=M(r);var i=(r?r+` `:``)+o.strict;this.reservedWordsStrict=M(i),this.reservedWordsStrictBind=M(i+` `+o.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(`
91
- `,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(S).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=x.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType===`commonjs`?2:1),this.regexpState=null,this.privateNameStack=[]},pe={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};P.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},pe.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},pe.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},pe.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},pe.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t)return!1;if(2&t)return(4&t)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},pe.allowReturn.get=function(){return!!this.inFunction||!!(this.options.allowReturnOutsideFunction&&1&this.currentVarScope().flags)},pe.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0||this.options.allowSuperOutsideMethod},pe.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},pe.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},pe.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t||2&t&&!(16&t))return!0}return!1},pe.allowUsing.get=function(){var e=this.currentScope().flags;return!(1024&e)&&!(!this.inModule&&1&e)},pe.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ue)>0},P.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},P.parse=function(e,t){return new this(t,e).parse()},P.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},P.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(P.prototype,pe);var me=P.prototype,he=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;me.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){D.lastIndex=e,e+=D.exec(this.input)[0].length;var t=he.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){D.lastIndex=e+t[0].length;var n=D.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||S.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`)}e+=t[0].length,D.lastIndex=e,e+=D.exec(this.input)[0].length,this.input[e]===`;`&&e++}},me.eat=function(e){return this.type===e&&(this.next(),!0)},me.isContextual=function(e){return this.type===x.name&&this.value===e&&!this.containsEsc},me.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},me.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},me.canInsertSemicolon=function(){return this.type===x.eof||this.type===x.braceR||S.test(this.input.slice(this.lastTokEnd,this.start))},me.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},me.semicolon=function(){this.eat(x.semi)||this.insertSemicolon()||this.unexpected()},me.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},me.expect=function(e){this.eat(e)||this.unexpected()},me.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var ge=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};me.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},me.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},me.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},me.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var F=P.prototype;F.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==x.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType===`commonjs`?`script`:this.options.sourceType,this.finishNode(e,`Program`)};var _e={kind:`loop`},ve={kind:`switch`};F.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;D.lastIndex=this.pos;var t=D.exec(this.input),n=this.pos+t[0].length,r=this.fullCharCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(p(r)){var i=n;do n+=r<=65535?1:2;while(m(r=this.fullCharCodeAt(n)));if(r===92)return!0;var a=this.input.slice(i,n);if(!l.test(a))return!0}return!1},F.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;D.lastIndex=this.pos;var e,t=D.exec(this.input),n=this.pos+t[0].length;return!(S.test(this.input.slice(this.pos,n))||this.input.slice(n,n+8)!==`function`||n+8!==this.input.length&&(m(e=this.fullCharCodeAt(n+8))||e===92))},F.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;D.lastIndex=this.pos;var n=D.exec(this.input),r=this.pos+n[0].length;if(S.test(this.input.slice(this.pos,r)))return!1;if(e){var i,a=r+5;if(this.input.slice(r,a)!==`using`||a===this.input.length||m(i=this.fullCharCodeAt(a))||i===92)return!1;D.lastIndex=a;var o=D.exec(this.input);if(r=a+o[0].length,o&&S.test(this.input.slice(a,r)))return!1}var s=this.fullCharCodeAt(r);if(!p(s)&&s!==92)return!1;var c=r;do r+=s<=65535?1:2;while(m(s=this.fullCharCodeAt(r)));if(s===92)return!0;var u=this.input.slice(c,r);return!(l.test(u)||t&&u===`of`)},F.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},F.isUsing=function(e){return this.isUsingKeyword(!1,e)},F.parseStatement=function(e,t,n){var r,i=this.type,a=this.startNode();switch(this.isLet(e)&&(i=x._var,r=`let`),i){case x._break:case x._continue:return this.parseBreakContinueStatement(a,i.keyword);case x._debugger:return this.parseDebuggerStatement(a);case x._do:return this.parseDoStatement(a);case x._for:return this.parseForStatement(a);case x._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(a,!1,!e);case x._class:return e&&this.unexpected(),this.parseClass(a,!0);case x._if:return this.parseIfStatement(a);case x._return:return this.parseReturnStatement(a);case x._switch:return this.parseSwitchStatement(a);case x._throw:return this.parseThrowStatement(a);case x._try:return this.parseTryStatement(a);case x._const:case x._var:return r||=this.value,e&&r!==`var`&&this.unexpected(),this.parseVarStatement(a,r);case x._while:return this.parseWhileStatement(a);case x._with:return this.parseWithStatement(a);case x.braceL:return this.parseBlock(!0,a);case x.semi:return this.parseEmptyStatement(a);case x._export:case x._import:if(this.options.ecmaVersion>10&&i===x._import){D.lastIndex=this.pos;var o=D.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(a,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),i===x._import?this.parseImport(a):this.parseExport(a,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(a,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(a,!1,l),this.semicolon(),this.finishNode(a,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return i===x.name&&d.type===`Identifier`&&this.eat(x.colon)?this.parseLabeledStatement(a,u,d,e):this.parseExpressionStatement(a,d)}},F.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(x.semi)||this.insertSemicolon()?e.label=null:this.type===x.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},F.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},F.parseDoStatement=function(e){return this.next(),this.labels.push(_e),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(x._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(x.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},F.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(_e),this.enterScope(0),this.expect(x.parenL),this.type===x.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===x._var||this.type===x._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.parseVar(c,!0,s),this.finishNode(c,`VariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new ge,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===x._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===x._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start!==d||l||f.type!==`Identifier`||f.name!==`async`?this.options.ecmaVersion>=9&&(e.await=!1):this.unexpected()),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},F.parseForAfterInit=function(e,t,n){return(this.type===x._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===x._in?n>-1&&this.unexpected(n):e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},F.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,be|(n?0:xe),!1,t)},F.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(x._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},F.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,`'return' outside of function`),this.next(),this.eat(x.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},F.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(x.braceL),this.labels.push(ve),this.enterScope(1024);for(var n=!1;this.type!==x.braceR;)if(this.type===x._case||this.type===x._default){var r=this.type===x._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(x.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},F.parseThrowStatement=function(e){return this.next(),S.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var ye=[];F.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?32:0),this.checkLValPattern(e,t?4:2),this.expect(x.parenR),e},F.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===x._catch){var t=this.startNode();this.next(),this.eat(x.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(x._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},F.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},F.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(_e),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},F.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},F.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},F.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===x._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart!==e.start)break;c.statementStart=this.start,c.kind=o}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},F.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},F.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(x.braceL),e&&this.enterScope(0);this.type!==x.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},F.parseFor=function(e,t){return e.init=t,this.expect(x.semi),e.test=this.type===x.semi?null:this.parseExpression(),this.expect(x.semi),e.update=this.type===x.parenR?null:this.parseExpression(),this.expect(x.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},F.parseForIn=function(e,t){var n=this.type===x._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(x.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},F.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(x.eq)?i.init=this.parseMaybeAssign(t):r||n!==`const`||this.type===x._in||this.options.ecmaVersion>=6&&this.isContextual(`of`)?r||n!==`using`&&n!==`await using`||!(this.options.ecmaVersion>=17)||this.type===x._in||this.isContextual(`of`)?r||i.id.type===`Identifier`||t&&(this.type===x._in||this.isContextual(`of`))?i.init=null:this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):this.unexpected(),e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(x.comma))break}return e},F.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?1:2,!1)};var be=1,xe=2;function Se(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type!==`MethodDefinition`||t.kind!==`get`&&t.kind!==`set`||(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):!!r||(e[n]=i,!1)}function Ce(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}F.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===x.star&&t&xe&&this.unexpected(),e.generator=this.eat(x.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&be&&(e.id=4&t&&this.type!==x.name?null:this.parseIdent(),!e.id||t&xe||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(fe(e.async,e.generator)),t&be||(e.id=this.type===x.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&be?`FunctionDeclaration`:`FunctionExpression`)},F.parseFunctionParams=function(e){this.expect(x.parenL),e.params=this.parseBindingList(x.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},F.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(x.braceL);this.type!==x.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&Se(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},F.parseClassElement=function(e){if(this.eat(x.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(x.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===x.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&(!this.isClassElementNameStart()&&this.type!==x.star||this.canInsertSemicolon()?r=`async`:a=!0),!r&&(t>=9||!a)&&this.eat(x.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===x.parenL||o!==`method`||i||a){var l=!n.static&&Ce(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},F.isClassElementNameStart=function(){return this.type===x.name||this.type===x.privateId||this.type===x.num||this.type===x.string||this.type===x.bracketL||this.type.keyword},F.parseClassElementName=function(e){this.type===x.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},F.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&Ce(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},F.parseClassField=function(e){return Ce(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&Ce(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(x.eq)?(this.enterScope(576),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},F.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(320);this.type!==x.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},F.parseClassId=function(e,t){this.type===x.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},F.parseClassSuper=function(e){e.superClass=this.eat(x._extends)?this.parseExprSubscripts(null,!1):null},F.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},F.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];j(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}},F.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==x.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},F.parseExport=function(e,t){if(this.next(),this.eat(x.star))return this.parseExportAllDeclaration(e,t);if(this.eat(x._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==x.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},F.parseExportDeclaration=function(e){return this.parseStatement(null)},F.parseExportDefaultDeclaration=function(){var e;if(this.type===x._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,4|be,!1,e)}if(this.type===x._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}var r=this.parseMaybeAssign();return this.semicolon(),r},F.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),j(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},F.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},F.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},F.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},F.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},F.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(x.braceL);!this.eat(x.braceR);){if(n)n=!1;else if(this.expect(x.comma),this.afterTrailingComma(x.braceR))break;t.push(this.parseExportSpecifier(e))}return t},F.parseImport=function(e){return this.next(),this.type===x.string?(e.specifiers=ye,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===x.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},F.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,2),this.finishNode(e,`ImportSpecifier`)},F.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,`ImportDefaultSpecifier`)},F.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,`ImportNamespaceSpecifier`)},F.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===x.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(x.comma)))return e;if(this.type===x.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(x.braceL);!this.eat(x.braceR);){if(t)t=!1;else if(this.expect(x.comma),this.afterTrailingComma(x.braceR))break;e.push(this.parseImportSpecifier())}return e},F.parseWithClause=function(){var e=[];if(!this.eat(x._with))return e;this.expect(x.braceL);for(var t={},n=!0;!this.eat(x.braceR);){if(n)n=!1;else if(this.expect(x.comma),this.afterTrailingComma(x.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;j(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},F.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===x.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(x.colon),this.type!==x.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},F.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===x.string){var e=this.parseLiteral(this.value);return ie.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},F.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},F.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var we=P.prototype;we.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type!==`RestElement`||a.argument.type!==`ArrayPattern`&&a.argument.type!==`ObjectPattern`||this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},we.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},we.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},we.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==x.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},we.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case x.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(x.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case x.braceL:return this.parseObj(!0)}return this.parseIdent()},we.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(x.comma),t&&this.type===x.comma)i.push(null);else{if(n&&this.afterTrailingComma(e))break;if(this.type===x.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===x.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}i.push(this.parseAssignableListItem(r))}return i},we.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},we.parseBindingListItem=function(e){return e},we.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(x.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},we.checkLValSimple=function(e,t,n){t===void 0&&(t=0);var r=t!==0;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===2&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(j(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==5&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},we.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=0),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},we.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=0),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var Te=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},I={b_stat:new Te(`{`,!1),b_expr:new Te(`{`,!0),b_tmpl:new Te("${",!1),p_stat:new Te(`(`,!1),p_expr:new Te(`(`,!0),q_tmpl:new Te("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Te(`function`,!1),f_expr:new Te(`function`,!0),f_expr_gen:new Te(`function`,!0,!1,null,!0),f_gen:new Te(`function`,!1,!1,null,!0)},Ee=P.prototype;Ee.initialContext=function(){return[I.b_stat]},Ee.curContext=function(){return this.context[this.context.length-1]},Ee.braceIsBlock=function(e){var t=this.curContext();return t===I.f_expr||t===I.f_stat||(e!==x.colon||t!==I.b_stat&&t!==I.b_expr?e===x._return||e===x.name&&this.exprAllowed?S.test(this.input.slice(this.lastTokEnd,this.start)):e===x._else||e===x.semi||e===x.eof||e===x.parenR||e===x.arrow||(e===x.braceL?t===I.b_stat:e!==x._var&&e!==x._const&&e!==x.name&&!this.exprAllowed):!t.isExpr)},Ee.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},Ee.updateContext=function(e){var t,n=this.type;n.keyword&&e===x.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},Ee.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},x.parenR.updateContext=x.braceR.updateContext=function(){if(this.context.length!==1){var e=this.context.pop();e===I.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},x.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?I.b_stat:I.b_expr),this.exprAllowed=!0},x.dollarBraceL.updateContext=function(){this.context.push(I.b_tmpl),this.exprAllowed=!0},x.parenL.updateContext=function(e){var t=e===x._if||e===x._for||e===x._with||e===x._while;this.context.push(t?I.p_stat:I.p_expr),this.exprAllowed=!0},x.incDec.updateContext=function(){},x._function.updateContext=x._class.updateContext=function(e){!e.beforeExpr||e===x._else||e===x.semi&&this.curContext()!==I.p_stat||e===x._return&&S.test(this.input.slice(this.lastTokEnd,this.start))||(e===x.colon||e===x.braceL)&&this.curContext()===I.b_stat?this.context.push(I.f_stat):this.context.push(I.f_expr),this.exprAllowed=!1},x.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},x.backQuote.updateContext=function(){this.curContext()===I.q_tmpl?this.context.pop():this.context.push(I.q_tmpl),this.exprAllowed=!1},x.star.updateContext=function(e){if(e===x._function){var t=this.context.length-1;this.context[t]===I.f_expr?this.context[t]=I.f_expr_gen:this.context[t]=I.f_gen}this.exprAllowed=!0},x.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==x.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var L=P.prototype;function De(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&De(e.expression)}function Oe(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&Oe(e.expression)||e.type===`ParenthesizedExpression`&&Oe(e.expression)}L.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r,i=e.key;switch(i.type){case`Identifier`:r=i.name;break;case`Literal`:r=String(i.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6)r===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=i.start):this.raiseRecoverable(i.start,`Redefinition of __proto__ property`)),t.proto=!0);else{var o=t[r=`$`+r];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(i.start,`Redefinition of property`):o=t[r]={init:!1,get:!1,set:!1},o[a]=!0}}},L.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===x.comma){var a=this.startNodeAt(n,r);for(a.expressions=[i];this.eat(x.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,`SequenceExpression`)}return i},L.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new ge,r=!0);var s=this.start,c=this.startLoc;this.type!==x.parenL&&this.type!==x.name||(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===x.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===x.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},L.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(x.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(x.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},L.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},L.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==x._in)&&a>r){var o=this.type===x.logicalOR||this.type===x.logicalAND,s=this.type===x.coalesce;s&&(a=x.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===x.coalesce||s&&(this.type===x.logicalOR||this.type===x.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},L.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},L.parseMaybeUnary=function(e,t,n,r){var i,a=this.start,o=this.startLoc;if(this.isContextual(`await`)&&this.canAwait)i=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===x.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&De(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&Oe(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,i=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(t||this.type!==x.privateId){if(i=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return i;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(a,o);l.operator=this.value,l.prefix=!1,l.argument=i,this.checkLValSimple(i),this.next(),i=this.finishNode(l,`UpdateExpression`)}}else(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),i=this.parsePrivateIdent(),this.type!==x._in&&this.unexpected();return n||!this.eat(x.starstar)?i:t?void this.unexpected(this.lastTokStart):this.buildBinary(a,o,i,this.parseMaybeUnary(null,!1,!1,r),`**`,!1)},L.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if(i.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return i;var a=this.parseSubscripts(i,n,r,!1,t);return e&&a.type===`MemberExpression`&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a},L.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s===e||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s}},L.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(x.arrow)},L.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},L.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(x.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(x.bracketL);if(l||c&&this.type!==x.parenL&&this.type!==x.backQuote||this.eat(x.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(x.bracketR)):u.property=this.type===x.privateId&&e.type!==`Super`?this.parsePrivateIdent():this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(x.parenL)){var d=new ge,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(x.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===x.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},L.parseExprAtom=function(e,t,n){this.type===x.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case x._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type!==x.parenL||this.allowDirectSuper||this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==x.dot&&this.type!==x.bracketL&&this.type!==x.parenL&&this.unexpected(),this.finishNode(r,`Super`);case x._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case x.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(x._function))return this.overrideContext(I.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(x.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===x.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(x.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case x.regexp:var l=this.value;return(r=this.parseLiteral(l.value)).regex={pattern:l.pattern,flags:l.flags},r;case x.num:case x.string:return this.parseLiteral(this.value);case x._null:case x._true:case x._false:return(r=this.startNode()).value=this.type===x._null?null:this.type===x._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case x.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case x.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(x.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case x.braceL:return this.overrideContext(I.b_expr),this.parseObj(!1,e);case x._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case x._class:return this.parseClass(this.startNode(),!1);case x._new:return this.parseNew();case x.backQuote:return this.parseTemplate();case x._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},L.parseExprAtomDefault=function(){this.unexpected()},L.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===x.parenL&&!e)return this.parseDynamicImport(t);if(this.type===x.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}this.unexpected()},L.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(x.parenR)?e.options=null:(this.expect(x.comma),this.afterTrailingComma(x.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(x.parenR)||(this.expect(x.comma),this.afterTrailingComma(x.parenR)||this.unexpected())));else if(!this.eat(x.parenR)){var t=this.start;this.eat(x.comma)&&this.eat(x.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},L.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType===`module`||this.options.allowImportExportEverywhere||this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},L.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},L.parseParenExpression=function(){this.expect(x.parenL);var e=this.parseExpression();return this.expect(x.parenR),e},L.shouldParseArrow=function(e){return!this.canInsertSemicolon()},L.parseParenAndDistinguishExpression=function(e,t){var n,r=this.start,i=this.startLoc,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o,s=this.start,c=this.startLoc,l=[],u=!0,d=!1,f=new ge,p=this.yieldPos,m=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==x.parenR;){if(u?u=!1:this.expect(x.comma),a&&this.afterTrailingComma(x.parenR,!0)){d=!0;break}if(this.type===x.ellipsis){o=this.start,l.push(this.parseParenItem(this.parseRestBinding())),this.type===x.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}l.push(this.parseMaybeAssign(!1,f,this.parseParenItem))}var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(x.parenR),e&&this.shouldParseArrow(l)&&this.eat(x.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=m,this.parseParenArrowList(r,i,l,t);l.length&&!d||this.unexpected(this.lastTokStart),o&&this.unexpected(o),this.checkExpressionErrors(f,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=m||this.awaitPos,l.length>1?((n=this.startNodeAt(s,c)).expressions=l,this.finishNodeAt(n,`SequenceExpression`,h,g)):n=l[0]}else n=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(r,i);return _.expression=n,this.finishNode(_,`ParenthesizedExpression`)}return n},L.parseParenItem=function(e){return e},L.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var ke=[];L.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===x.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),e.arguments=this.eat(x.parenL)?this.parseExprList(x.parenR,this.options.ecmaVersion>=8,!1):ke,this.finishNode(e,`NewExpression`)},L.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===x.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
92
- `),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
93
- `),cooked:this.value},this.next(),n.tail=this.type===x.backQuote,this.finishNode(n,`TemplateElement`)},L.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===x.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(x.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(x.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},L.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===x.name||this.type===x.num||this.type===x.string||this.type===x.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===x.star)&&!S.test(this.input.slice(this.lastTokEnd,this.start))},L.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(x.braceR);){if(r)r=!1;else if(this.expect(x.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(x.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},L.parseProperty=function(e,t){var n,r,i,a,o=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(x.ellipsis))return e?(o.argument=this.parseIdent(!1),this.type===x.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(o,`RestElement`)):(o.argument=this.parseMaybeAssign(!1,t),this.type===x.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(o,`SpreadElement`));this.options.ecmaVersion>=6&&(o.method=!1,o.shorthand=!1,(e||t)&&(i=this.start,a=this.startLoc),e||(n=this.eat(x.star)));var s=this.containsEsc;return this.parsePropertyName(o),!e&&!s&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(o)?(r=!0,n=this.options.ecmaVersion>=9&&this.eat(x.star),this.parsePropertyName(o)):r=!1,this.parsePropertyValue(o,e,n,r,i,a,t,s),this.finishNode(o,`Property`)},L.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind===`get`?0:1;if(e.value.params.length!==n){var r=e.value.start;e.kind===`get`?this.raiseRecoverable(r,`getter should have no params`):this.raiseRecoverable(r,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},L.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===x.colon&&this.unexpected(),this.eat(x.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===x.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,r),e.kind=`init`):t||s||!(this.options.ecmaVersion>=5)||e.computed||e.key.type!==`Identifier`||e.key.name!==`get`&&e.key.name!==`set`||this.type===x.comma||this.type===x.braceR||this.type===x.eq?this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name!==`await`||this.awaitIdentPos||(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===x.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind=`init`,e.shorthand=!0):this.unexpected():((n||r)&&this.unexpected(),this.parseGetterSetter(e))},L.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(x.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(x.bracketR),e.key;e.computed=!1}return e.key=this.type===x.num||this.type===x.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},L.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},L.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|fe(t,r.generator)|(n?128:0)),this.expect(x.parenL),r.params=this.parseBindingList(x.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},L.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(16|fe(n,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},L.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==x.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);a&&!s||(o=this.strictDirective(this.end))&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`);var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,5),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},L.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},L.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,1,t?null:n)}},L.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(x.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===x.comma?o=null:this.type===x.ellipsis?(o=this.parseSpread(r),r&&this.type===x.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},L.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),this.currentThisScope().flags&de||r!==`arguments`||this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),!this.inClassStaticBlock||r!==`arguments`&&r!==`await`||this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1||(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(this.inAsync||r!==`await`||this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},L.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name!==`await`||this.awaitIdentPos||(this.awaitIdentPos=t.start)),t},L.parseIdentNode=function(){var e=this.startNode();return this.type===x.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,e.name!==`class`&&e.name!==`function`||this.lastTokEnd===this.lastTokStart+1&&this.input.charCodeAt(this.lastTokStart)===46||this.context.pop(),this.type=x.name):this.unexpected(),e},L.parsePrivateIdent=function(){var e=this.startNode();return this.type===x.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},L.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===x.semi||this.canInsertSemicolon()||this.type!==x.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(x.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},L.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var Ae=P.prototype;Ae.raise=function(e,t){var n=oe(this.input,e);t+=` (`+n.line+`:`+n.column+`)`,this.sourceFile&&(t+=` in `+this.sourceFile);var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},Ae.raiseRecoverable=Ae.raise,Ae.curPosition=function(){if(this.options.locations)return new N(this.curLine,this.pos-this.lineStart)};var je=P.prototype,Me=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};je.enterScope=function(e){this.scopeStack.push(new Me(e))},je.exitScope=function(){this.scopeStack.pop()},je.treatFunctionsAsVarInScope=function(e){return 2&e.flags||!this.inModule&&1&e.flags},je.declareName=function(e,t,n){var r=!1;if(t===2){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&1&i.flags&&delete this.undefinedExports[e]}else if(t===4)this.currentScope().lexical.push(e);else if(t===3){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(32&s.flags&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&1&s.flags&&delete this.undefinedExports[e],s.flags&de)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},je.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},je.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},je.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags)return t}},je.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags&&!(16&t.flags))return t}};var Ne=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new ae(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Pe=P.prototype;function Fe(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}Pe.startNode=function(){return new Ne(this,this.start,this.startLoc)},Pe.startNodeAt=function(e,t){return new Ne(this,e,t)},Pe.finishNode=function(e,t){return Fe.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Pe.finishNodeAt=function(e,t,n,r){return Fe.call(this,e,t,n,r)},Pe.copyNode=function(e){var t=new Ne(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var Ie=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,Le=Ie+` Extended_Pictographic`,Re=Le+` EBase EComp EMod EPres ExtPict`,ze={9:Ie,10:Le,11:Le,12:Re,13:Re,14:Re},Be={9:``,10:``,11:``,12:``,13:``,14:`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`},Ve=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,He=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,Ue=He+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,We=Ue+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,Ge=We+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,Ke=Ge+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,qe={9:He,10:Ue,11:We,12:Ge,13:Ke,14:Ke+` Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz`},Je={};function Ye(e){var t=Je[e]={binary:M(ze[e]+` `+Ve),binaryOfStrings:M(Be[e]),nonBinary:{General_Category:M(Ve),Script:M(qe[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var Xe=0,Ze=[9,10,11,12,13,14];Xe<Ze.length;Xe+=1)Ye(Ze[Xe]);var R=P.prototype,Qe=function(e,t){this.parent=e,this.base=t||this};Qe.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},Qe.prototype.sibling=function(){return new Qe(this.parent,this.base)};var $e=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=Je[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function et(e){return e===105||e===109||e===115}function tt(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}function nt(e){return e>=65&&e<=90||e>=97&&e<=122}$e.prototype.reset=function(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=0|e,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},$e.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},$e.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!t&&!this.switchU||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},$e.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i,a=n.charCodeAt(e);return!t&&!this.switchU||a<=55295||a>=57344||e+1>=r||(i=n.charCodeAt(e+1))<56320||i>57343?e+1:e+2},$e.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},$e.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},$e.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},$e.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},$e.prototype.eatChars=function(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},R.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)},R.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&function(e){for(var t in e)return!0;return!1}(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},R.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},R.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Qe(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},R.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},R.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},R.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},R.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},R.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},R.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},R.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},R.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},R.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);n||o||e.current()!==58||e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},R.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},R.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&et(n);)t+=re(n),e.advance();return t},R.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},R.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},R.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!tt(t)&&(e.lastIntValue=t,e.advance(),!0)},R.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!tt(n);)e.advance();return e.pos!==t},R.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(t===-1||t===36||t>=40&&t<=43||t===46||t===63||t===91||t===94||t===124)&&(e.advance(),!0)},R.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n){if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`)}t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},R.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},R.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=re(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=re(e.lastIntValue);return!0}return!1},R.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),function(e){return p(e,!0)||e===36||e===95}(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)},R.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),function(e){return m(e,!0)||e===36||e===95||e===8204||e===8205}(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)},R.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},R.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},R.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},R.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},R.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},R.regexp_eatZero=function(e){return e.current()===48&&!at(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},R.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114&&(e.lastIntValue=13,e.advance(),!0)},R.regexp_eatControlLetter=function(e){var t=e.current();return!!nt(t)&&(e.lastIntValue=t%32,e.advance(),!0)},R.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n,r=e.pos,i=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(i&&a>=55296&&a<=56319){var o=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(s>=56320&&s<=57343)return e.lastIntValue=1024*(a-55296)+(s-56320)+65536,!0}e.pos=o,e.lastIntValue=a}return!0}if(i&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&(n=e.lastIntValue)>=0&&n<=1114111)return!0;i&&e.raise(`Invalid unicode escape`),e.pos=r}return!1},R.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(t===99||e.switchN&&t===107)&&(e.lastIntValue=t,e.advance(),!0)},R.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};function rt(e){return nt(e)||e===95}function it(e){return rt(e)||at(e)}function at(e){return e>=48&&e<=57}function ot(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function st(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function ct(e){return e>=48&&e<=55}R.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return e===100||e===68||e===115||e===83||e===119||e===87}(t))return e.lastIntValue=-1,e.advance(),1;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){var r;if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===2&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return 0},R.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),1}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return 0},R.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){j(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},R.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?1:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?2:void e.raise(`Invalid property name`)},R.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;rt(t=e.current());)e.lastStringValue+=re(t),e.advance();return e.lastStringValue!==``},R.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;it(t=e.current());)e.lastStringValue+=re(t),e.advance();return e.lastStringValue!==``},R.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},R.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===2&&e.raise(`Negated character class may contain strings`),!0}return!1},R.regexp_classContents=function(e){return e.current()===93?1:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),1)},R.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;!e.switchU||t!==-1&&n!==-1||e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},R.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||ct(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r!==93&&(e.lastIntValue=r,e.advance(),!0)},R.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},R.regexp_classSetExpression=function(e){var t,n=1;if(!this.regexp_eatClassSetRange(e)){if(t=this.regexp_eatClassSetOperand(e)){t===2&&(n=2);for(var r=e.pos;e.eatChars([38,38]);)e.current()!==38&&(t=this.regexp_eatClassSetOperand(e))?t!==2&&(n=1):e.raise(`Invalid character in character class`);if(r!==e.pos)return n;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return n}else e.raise(`Invalid character in character class`)}for(;;)if(!this.regexp_eatClassSetRange(e)){if(!(t=this.regexp_eatClassSetOperand(e)))return n;t===2&&(n=2)}},R.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},R.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?1:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},R.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===2&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},R.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},R.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===2&&(t=2);return t},R.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?1:2},R.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return!(!this.regexp_eatCharacterEscape(e)&&!this.regexp_eatClassSetReservedPunctuator(e))||(e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1));var n=e.current();return!(n<0||n===e.lookahead()&&function(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}(n))&&!function(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}(n)&&(e.advance(),e.lastIntValue=n,!0)},R.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return!!function(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}(t)&&(e.lastIntValue=t,e.advance(),!0)},R.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!at(t)&&t!==95)&&(e.lastIntValue=t%32,e.advance(),!0)},R.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},R.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;at(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t},R.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;ot(n=e.current());)e.lastIntValue=16*e.lastIntValue+st(n),e.advance();return e.pos!==t},R.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;e.lastIntValue=t<=3&&this.regexp_eatOctalDigit(e)?64*t+8*n+e.lastIntValue:8*t+n}else e.lastIntValue=t;return!0}return!1},R.regexp_eatOctalDigit=function(e){var t=e.current();return ct(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},R.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!ot(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+st(i),e.advance()}return!0};var lt=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new ae(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},z=P.prototype;function ut(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}z.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new lt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},z.getToken=function(){return this.next(),new lt(this)},typeof Symbol<`u`&&(z[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===x.eof,value:t}}}}),z.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(x.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},z.readToken=function(e){return p(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},z.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888},z.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},z.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=T(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},z.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!w(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},z.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&E.test(String.fromCharCode(e))))break e;++this.pos}}},z.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},z.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(x.ellipsis)):(++this.pos,this.finishToken(x.dot))},z.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(x.assign,2):this.finishOp(x.slash,1)},z.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?x.star:x.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=x.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(x.assign,n+1):this.finishOp(r,n)},z.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(x.assign,3):this.finishOp(e===124?x.logicalOR:x.logicalAND,2):t===61?this.finishOp(x.assign,2):this.finishOp(e===124?x.bitwiseOR:x.bitwiseAND,1)},z.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(x.assign,2):this.finishOp(x.bitwiseXOR,1)},z.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t!==45||this.inModule||this.input.charCodeAt(this.pos+2)!==62||this.lastTokEnd!==0&&!S.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(x.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):t===61?this.finishOp(x.assign,2):this.finishOp(x.plusMin,1)},z.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(x.assign,n+1):this.finishOp(x.bitShift,n)):t!==33||e!==60||this.inModule||this.input.charCodeAt(this.pos+2)!==45||this.input.charCodeAt(this.pos+3)!==45?(t===61&&(n=2),this.finishOp(x.relational,n)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},z.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(x.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(x.arrow)):this.finishOp(e===61?x.eq:x.prefix,1)},z.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(x.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(x.assign,3):this.finishOp(x.coalesce,2)}return this.finishOp(x.question,1)},z.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,p(e=this.fullCharCodeAtPos(),!0)||e===92))return this.finishToken(x.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+re(e)+`'`)},z.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(x.parenL);case 41:return++this.pos,this.finishToken(x.parenR);case 59:return++this.pos,this.finishToken(x.semi);case 44:return++this.pos,this.finishToken(x.comma);case 91:return++this.pos,this.finishToken(x.bracketL);case 93:return++this.pos,this.finishToken(x.bracketR);case 123:return++this.pos,this.finishToken(x.braceL);case 125:return++this.pos,this.finishToken(x.braceR);case 58:return++this.pos,this.finishToken(x.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(x.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(x.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+re(e)+`'`)},z.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},z.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(S.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new $e(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(x.regexp,{pattern:i,flags:o,value:c})},z.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95)i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;else{if((d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0)>=e)break;s=u,o=o*e+d}}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o},z.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=ut(this.input.slice(t,this.pos)),++this.pos):p(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(x.num,n)},z.readNumber=function(e){var t=this.pos;e||this.readInt(10,void 0,!0)!==null||this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=ut(this.input.slice(t,this.pos));return++this.pos,p(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(x.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r!==46||n||(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),r!==69&&r!==101||n||((r=this.input.charCodeAt(++this.pos))!==43&&r!==45||++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),p(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a,o=(a=this.input.slice(t,this.pos),n?parseInt(a,8):parseFloat(a.replace(/_/g,``)));return this.finishToken(x.num,o)},z.readCodePoint=function(){var e;if(this.input.charCodeAt(this.pos)===123){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,`Code point out of bounds`)}else e=this.readHexChar(4);return e},z.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(w(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(x.string,t)};var dt={};z.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==dt)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},z.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw dt;this.raise(e,t)},z.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos!==this.start||this.type!==x.template&&this.type!==x.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(x.template,e)):n===36?(this.pos+=2,this.finishToken(x.dollarBraceL)):(++this.pos,this.finishToken(x.backQuote));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(w(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
94
- `;break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},z.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(x.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
95
- `&&++this.pos;case`
96
- `:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,`Unterminated template`)},z.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
97
- `;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return re(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),r===`0`&&t!==56&&t!==57||!this.strict&&!e||this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return w(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},z.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},z.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(m(i,r))this.pos+=i<=65535?1:2;else{if(i!==92)break;this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?p:m)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=re(o),n=this.pos}t=!1}return e+this.input.slice(n,this.pos)},z.readWord=function(){var e=this.readWord1(),t=x.name;return this.keywords.test(e)&&(t=y[e]),this.finishToken(t,e)},P.acorn={Parser:P,version:`8.16.0`,defaultOptions:se,Position:N,SourceLocation:ae,getLineInfo:oe,Node:Ne,TokenType:h,tokTypes:x,keywordTypes:y,TokContext:Te,tokContexts:I,isIdentifierChar:m,isIdentifierStart:p,Token:lt,isNewLine:w,lineBreak:S,lineBreakG:C,nonASCIIwhitespace:E};var ft=r(`node:module`),B=r(`node:fs`);String.fromCharCode;let V=/\/$|\/\?|\/#/,pt=/^\.?\//;function mt(e=``,t){return t?V.test(e):e.endsWith(`/`)}function ht(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(mt(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 gt(e){return e&&e!==`/`}function _t(e,...t){let n=e||``;for(let e of t.filter(e=>gt(e)))if(n){let t=e.replace(pt,``);n=ht(n)+t}else n=e;return n}let vt=/^[A-Za-z]:\//;function yt(e=``){return e&&e.replace(/\\/g,`/`).replace(vt,e=>e.toUpperCase())}let bt=/^[/\\]{2}/,xt=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,St=/^[A-Za-z]:$/,Ct=/.(\.[^./]+|\.)$/,wt=function(e){if(e.length===0)return`.`;let t=(e=yt(e)).match(bt),n=Ot(e),r=e[e.length-1]===`/`;return(e=Dt(e,!n)).length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),St.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!Ot(e)?`/${e}`:e)},H=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 wt(t)};function Tt(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}let Et=function(...e){let t=``,n=!1;for(let r=(e=e.map(e=>yt(e))).length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:Tt();i&&i.length!==0&&(t=`${i}/${t}`,n=Ot(i))}return t=Dt(t,!n),n&&!Ot(t)?`/${t}`:t.length>0?t:`.`};function Dt(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;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}let Ot=function(e){return xt.test(e)},kt=function(e){if(e===`..`)return``;let t=Ct.exec(yt(e));return t&&t[1]||``},At=function(e){let t=yt(e).replace(/\/$/,``).split(`/`).slice(0,-1);return t.length===1&&St.test(t[0])&&(t[0]+=`/`),t.join(`/`)||(Ot(e)?`/`:`.`)},jt=function(e,t){let n=yt(e).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return t&&r.endsWith(t)?r.slice(0,-t.length):r},U=k(`node:url`),Mt=k(`node:assert`),Nt=k(`node:process`);var Pt=r(`node:path`);let Ft=k(`node:v8`),It=k(`node:util`),Lt=new Set(ft.builtinModules);function Rt(e){return e.replace(/\\/g,`/`)}let zt={}.hasOwnProperty,Bt=/^([A-Z][a-z\d]*)+$/,Vt=/* @__PURE__ */ new Set([`string`,`function`,`number`,`object`,`Function`,`Object`,`boolean`,`bigint`,`symbol`]),Ht={};function Ut(e,t=`and`){return e.length<3?e.join(` ${t} `):`${e.slice(0,-1).join(`, `)}, ${t} ${e[e.length-1]}`}let Wt=/* @__PURE__ */ new Map,Gt;function Kt(e,t,n){return Wt.set(e,t),function(e,t){return n;function n(...n){let r=Error.stackTraceLimit;qt()&&(Error.stackTraceLimit=0);let i=new e;qt()&&(Error.stackTraceLimit=r);let a=function(e,t,n){let r=Wt.get(e);if(Mt.ok(r!==void 0,"expected `message` to be found"),typeof r==`function`)return Mt.ok(r.length<=t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${r.length}).`),Reflect.apply(r,n,t);let i=/%[dfijoOs]/g,a=0;for(;i.exec(r)!==null;)a++;return Mt.ok(a===t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${a}).`),t.length===0?r:(t.unshift(r),Reflect.apply(It.format,null,t))}(t,n,i);return Object.defineProperties(i,{message:{value:a,enumerable:!1,writable:!0,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},enumerable:!1,writable:!0,configurable:!0}}),Jt(i),i.code=t,i}}(n,e)}function qt(){try{if(Ft.startupSnapshot.isBuildingSnapshot())return!1}catch{}let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):zt.call(e,`writable`)&&e.writable!==void 0?e.writable:e.set!==void 0}Ht.ERR_INVALID_ARG_TYPE=Kt(`ERR_INVALID_ARG_TYPE`,(e,t,n)=>{Mt.ok(typeof e==`string`,`'name' must be a string`),Array.isArray(t)||(t=[t]);let r=`The `;if(e.endsWith(` argument`))r+=`${e} `;else{let t=e.includes(`.`)?`property`:`argument`;r+=`"${e}" ${t} `}r+=`must be `;let i=[],a=[],o=[];for(let e of t)Mt.ok(typeof e==`string`,`All expected entries have to be of type string`),Vt.has(e)?i.push(e.toLowerCase()):Bt.exec(e)===null?(Mt.ok(e!==`object`,`The value "object" should be written as "Object"`),o.push(e)):a.push(e);if(a.length>0){let e=i.indexOf(`object`);e!==-1&&(i.slice(e,1),a.push(`Object`))}return i.length>0&&(r+=`${i.length>1?`one of type`:`of type`} ${Ut(i,`or`)}`,(a.length>0||o.length>0)&&(r+=` or `)),a.length>0&&(r+=`an instance of ${Ut(a,`or`)}`,o.length>0&&(r+=` or `)),o.length>0&&(o.length>1?r+=`one of ${Ut(o,`or`)}`:(o[0].toLowerCase()!==o[0]&&(r+=`an `),r+=`${o[0]}`)),r+=`. Received ${function(e){if(e==null)return String(e);if(typeof e==`function`&&e.name)return`function ${e.name}`;if(typeof e==`object`)return e.constructor&&e.constructor.name?`an instance of ${e.constructor.name}`:`${(0,It.inspect)(e,{depth:-1})}`;let t=(0,It.inspect)(e,{colors:!1});return t.length>28&&(t=`${t.slice(0,25)}...`),`type ${typeof e} (${t})`}(n)}`,r},TypeError),Ht.ERR_INVALID_MODULE_SPECIFIER=Kt(`ERR_INVALID_MODULE_SPECIFIER`,(e,t,n=void 0)=>`Invalid module "${e}" ${t}${n?` imported from ${n}`:``}`,TypeError),Ht.ERR_INVALID_PACKAGE_CONFIG=Kt(`ERR_INVALID_PACKAGE_CONFIG`,(e,t,n)=>`Invalid package config ${e}${t?` while importing ${t}`:``}${n?`. ${n}`:``}`,Error),Ht.ERR_INVALID_PACKAGE_TARGET=Kt(`ERR_INVALID_PACKAGE_TARGET`,(e,t,n,r=!1,i=void 0)=>{let a=typeof n==`string`&&!r&&n.length>0&&!n.startsWith(`./`);return t===`.`?(Mt.ok(!1===r),`Invalid "exports" main target ${JSON.stringify(n)} defined in the package config ${e}package.json${i?` imported from ${i}`:``}${a?`; targets must start with "./"`:``}`):`Invalid "${r?`imports`:`exports`}" target ${JSON.stringify(n)} defined for '${t}' in the package config ${e}package.json${i?` imported from ${i}`:``}${a?`; targets must start with "./"`:``}`},Error),Ht.ERR_MODULE_NOT_FOUND=Kt(`ERR_MODULE_NOT_FOUND`,(e,t,n=!1)=>`Cannot find ${n?`module`:`package`} '${e}' imported from ${t}`,Error),Ht.ERR_NETWORK_IMPORT_DISALLOWED=Kt(`ERR_NETWORK_IMPORT_DISALLOWED`,`import of '%s' by %s is not supported: %s`,Error),Ht.ERR_PACKAGE_IMPORT_NOT_DEFINED=Kt(`ERR_PACKAGE_IMPORT_NOT_DEFINED`,(e,t,n)=>`Package import specifier "${e}" is not defined${t?` in package ${t}package.json`:``} imported from ${n}`,TypeError),Ht.ERR_PACKAGE_PATH_NOT_EXPORTED=Kt(`ERR_PACKAGE_PATH_NOT_EXPORTED`,(e,t,n=void 0)=>t===`.`?`No "exports" main defined in ${e}package.json${n?` imported from ${n}`:``}`:`Package subpath '${t}' is not defined by "exports" in ${e}package.json${n?` imported from ${n}`:``}`,Error),Ht.ERR_UNSUPPORTED_DIR_IMPORT=Kt(`ERR_UNSUPPORTED_DIR_IMPORT`,`Directory import '%s' is not supported resolving ES modules imported from %s`,Error),Ht.ERR_UNSUPPORTED_RESOLVE_REQUEST=Kt(`ERR_UNSUPPORTED_RESOLVE_REQUEST`,`Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.`,TypeError),Ht.ERR_UNKNOWN_FILE_EXTENSION=Kt(`ERR_UNKNOWN_FILE_EXTENSION`,(e,t)=>`Unknown file extension "${e}" for ${t}`,TypeError),Ht.ERR_INVALID_ARG_VALUE=Kt(`ERR_INVALID_ARG_VALUE`,(e,t,n=`is invalid`)=>{let r=(0,It.inspect)(t);return r.length>128&&(r=`${r.slice(0,128)}...`),`The ${e.includes(`.`)?`property`:`argument`} '${e}' ${n}. Received ${r}`},TypeError);let Jt=function(e){let t=`__node_internal_`+e.name;return Object.defineProperty(e,"name",{value:t}),e}(function(e){let t=qt();return t&&(Gt=Error.stackTraceLimit,Error.stackTraceLimit=1/0),Error.captureStackTrace(e),t&&(Error.stackTraceLimit=Gt),e}),Yt={}.hasOwnProperty,{ERR_INVALID_PACKAGE_CONFIG:Xt}=Ht,Zt=/* @__PURE__ */ new Map;function Qt(e,{base:t,specifier:n}){let r=Zt.get(e);if(r)return r;let i;try{i=B.readFileSync(Pt.toNamespacedPath(e),`utf8`)}catch(e){let t=e;if(t.code!==`ENOENT`)throw t}let a={exists:!1,pjsonPath:e,main:void 0,name:void 0,type:`none`,exports:void 0,imports:void 0};if(i!==void 0){let r;try{r=JSON.parse(i)}catch(r){let i=r,a=new Xt(e,(t?`"${n}" from `:``)+(0,U.fileURLToPath)(t||n),i.message);throw a.cause=i,a}a.exists=!0,Yt.call(r,`name`)&&typeof r.name==`string`&&(a.name=r.name),Yt.call(r,`main`)&&typeof r.main==`string`&&(a.main=r.main),Yt.call(r,`exports`)&&(a.exports=r.exports),Yt.call(r,`imports`)&&(a.imports=r.imports),!Yt.call(r,`type`)||r.type!==`commonjs`&&r.type!==`module`||(a.type=r.type)}return Zt.set(e,a),a}function $t(e){let t=new URL(`package.json`,e);for(;!t.pathname.endsWith(`node_modules/package.json`);){let n=Qt((0,U.fileURLToPath)(t),{specifier:e});if(n.exists)return n;let r=t;if(t=new URL(`../package.json`,t),t.pathname===r.pathname)break}return{pjsonPath:(0,U.fileURLToPath)(t),exists:!1,type:`none`}}function en(e){return $t(e).type}let{ERR_UNKNOWN_FILE_EXTENSION:tn}=Ht,nn={}.hasOwnProperty,rn={__proto__:null,".cjs":`commonjs`,".js":`module`,".json":`json`,".mjs":`module`},an={__proto__:null,"data:":function(e){let{1:t}=/^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(e.pathname)||[null,null,null];return function(e){return e&&/\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(e)?`module`:e===`application/json`?`json`:null}(t)},"file:":function(e,t,n){let r=function(e){let t=e.pathname,n=t.length;for(;n--;){let e=t.codePointAt(n);if(e===47)return``;if(e===46)return t.codePointAt(n-1)===47?``:t.slice(n)}return``}(e);if(r===`.js`){let t=en(e);return t===`none`?`commonjs`:t}if(r===``){let t=en(e);return t===`none`||t===`commonjs`?`commonjs`:`module`}let i=rn[r];if(i)return i;if(n)return;let a=(0,U.fileURLToPath)(e);throw new tn(r,a)},"http:":on,"https:":on,"node:":()=>`builtin`};function on(){}let sn=Object.freeze([`node`,`import`]),cn=new Set(sn);function W(e){return cn}let ln=RegExp.prototype[Symbol.replace],{ERR_INVALID_MODULE_SPECIFIER:un,ERR_INVALID_PACKAGE_CONFIG:dn,ERR_INVALID_PACKAGE_TARGET:fn,ERR_MODULE_NOT_FOUND:pn,ERR_PACKAGE_IMPORT_NOT_DEFINED:mn,ERR_PACKAGE_PATH_NOT_EXPORTED:hn,ERR_UNSUPPORTED_DIR_IMPORT:gn,ERR_UNSUPPORTED_RESOLVE_REQUEST:_n}=Ht,vn={}.hasOwnProperty,yn=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i,bn=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i,xn=/^\.|%|\\/,Sn=/\*/g,Cn=/%2f|%5c/i,wn=/* @__PURE__ */ new Set,Tn=/[/\\]{2}/;function En(e,t,n,r,i,a,o){if(Nt.noDeprecation)return;let s=(0,U.fileURLToPath)(r),c=Tn.exec(o?e:t)!==null;Nt.emitWarning(`Use of deprecated ${c?`double slash`:`leading or trailing slash matching`} resolving "${e}" for module request "${t}" ${t===n?``:`matched to "${n}" `}in the "${i?`imports`:`exports`}" field module resolution of the package at ${s}${a?` imported from ${(0,U.fileURLToPath)(a)}`:``}.`,`DeprecationWarning`,`DEP0166`)}function Dn(e,t,n,r){if(Nt.noDeprecation||function(e,t){let n=e.protocol;return nn.call(an,n)&&an[n](e,t,!0)||null}(e,{parentURL:n.href})!==`module`)return;let i=(0,U.fileURLToPath)(e.href),a=(0,U.fileURLToPath)(new URL(`.`,t)),o=(0,U.fileURLToPath)(n);r?Pt.resolve(a,r)!==i&&Nt.emitWarning(`Package ${a} has a "main" field set to "${r}", excluding the full filename and extension to the resolved file at "${i.slice(a.length)}", imported from ${o}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`,`DeprecationWarning`,`DEP0151`):Nt.emitWarning(`No "main" or "exports" field defined in the package.json for ${a} resolving the main entry point "${i.slice(a.length)}", imported from ${o}.\nDefault "index" lookups for the main are deprecated for ES modules.`,`DeprecationWarning`,`DEP0151`)}function On(e){try{return(0,B.statSync)(e)}catch{}}function kn(e){let t=(0,B.statSync)(e,{throwIfNoEntry:!1}),n=t?t.isFile():void 0;return n!=null&&n}function An(e,t,n){let r;if(t.main!==void 0){if(r=new URL(t.main,e),kn(r))return r;let i=[`./${t.main}.js`,`./${t.main}.json`,`./${t.main}.node`,`./${t.main}/index.js`,`./${t.main}/index.json`,`./${t.main}/index.node`],a=-1;for(;++a<i.length&&(r=new URL(i[a],e),!kn(r));)r=void 0;if(r)return Dn(r,e,n,t.main),r}let i=[`./index.js`,`./index.json`,`./index.node`],a=-1;for(;++a<i.length&&(r=new URL(i[a],e),!kn(r));)r=void 0;if(r)return Dn(r,e,n,t.main),r;throw new pn((0,U.fileURLToPath)(new URL(`.`,e)),(0,U.fileURLToPath)(n))}function jn(e,t,n){return new hn((0,U.fileURLToPath)(new URL(`.`,t)),e,n&&(0,U.fileURLToPath)(n))}function Mn(e,t,n,r,i){return t=typeof t==`object`&&t?JSON.stringify(t,null,``):`${t}`,new fn((0,U.fileURLToPath)(new URL(`.`,n)),e,t,r,i&&(0,U.fileURLToPath)(i))}function Nn(e,t,n,r,i,a,o,s,c){if(t!==``&&!a&&e[e.length-1]!==`/`)throw Mn(n,e,r,o,i);if(!e.startsWith(`./`)){if(o&&!e.startsWith(`../`)&&!e.startsWith(`/`)){let n=!1;try{new URL(e),n=!0}catch{}if(!n)return Bn(a?ln.call(Sn,e,()=>t):e+t,r,c)}throw Mn(n,e,r,o,i)}if(yn.exec(e.slice(2))!==null){if(bn.exec(e.slice(2))!==null)throw Mn(n,e,r,o,i);if(!s){let s=a?n.replace(`*`,()=>t):n+t;En(a?ln.call(Sn,e,()=>t):e,s,n,r,o,i,!0)}}let l=new URL(e,r),u=l.pathname,d=new URL(`.`,r).pathname;if(!u.startsWith(d))throw Mn(n,e,r,o,i);if(t===``)return l;if(yn.exec(t)!==null){let c=a?n.replace(`*`,()=>t):n+t;bn.exec(t)===null?s||En(a?ln.call(Sn,e,()=>t):e,c,n,r,o,i,!1):(function(e,t,n,r,i){let a=`request is not a valid match in pattern "${t}" for the "${r?`imports`:`exports`}" resolution of ${(0,U.fileURLToPath)(n)}`;throw new un(e,a,i&&(0,U.fileURLToPath)(i))})(c,n,r,o,i)}return a?new URL(ln.call(Sn,l.href,()=>t)):new URL(t,l)}function Pn(e){let t=Number(e);return`${t}`===e&&t>=0&&t<4294967295}function Fn(e,t,n,r,i,a,o,s,c){if(typeof t==`string`)return Nn(t,n,r,e,i,a,o,s,c);if(Array.isArray(t)){let l=t;if(l.length===0)return null;let u,d=-1;for(;++d<l.length;){let t=l[d],f;try{f=Fn(e,t,n,r,i,a,o,s,c)}catch(e){if(u=e,e.code===`ERR_INVALID_PACKAGE_TARGET`)continue;throw e}if(f!==void 0){if(f!==null)return f;u=null}}if(u==null)return null;throw u}if(typeof t==`object`&&t){let l=Object.getOwnPropertyNames(t),u=-1;for(;++u<l.length;)if(Pn(l[u]))throw new dn((0,U.fileURLToPath)(e),i,`"exports" cannot contain numeric property keys.`);for(u=-1;++u<l.length;){let d=l[u];if(d==="default"||c&&c.has(d)){let l=Fn(e,t[d],n,r,i,a,o,s,c);if(l===void 0)continue;return l}}return null}if(t===null)return null;throw Mn(r,t,e,o,i)}function In(e,t,n){if(Nt.noDeprecation)return;let r=(0,U.fileURLToPath)(t);wn.has(r+`|`+e)||(wn.add(r+`|`+e),Nt.emitWarning(`Use of deprecated trailing slash pattern mapping "${e}" in the "exports" field module resolution of the package at ${r}${n?` imported from ${(0,U.fileURLToPath)(n)}`:``}. Mapping specifiers ending in "/" is no longer supported.`,`DeprecationWarning`,`DEP0155`))}function Ln(e,t,n,r,i){let a=n.exports;if(function(e,t,n){if(typeof e==`string`||Array.isArray(e))return!0;if(typeof e!=`object`||!e)return!1;let r=Object.getOwnPropertyNames(e),i=!1,a=0,o=-1;for(;++o<r.length;){let e=r[o],s=e===``||e[0]!==`.`;if(a++===0)i=s;else if(i!==s)throw new dn((0,U.fileURLToPath)(t),n,`"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`)}return i}(a,e,r)&&(a={".":a}),vn.call(a,t)&&!t.includes(`*`)&&!t.endsWith(`/`)){let n=Fn(e,a[t],``,t,r,!1,!1,!1,i);if(n==null)throw jn(t,e,r);return n}let o=``,s=``,c=Object.getOwnPropertyNames(a),l=-1;for(;++l<c.length;){let n=c[l],i=n.indexOf(`*`);if(i!==-1&&t.startsWith(n.slice(0,i))){t.endsWith(`/`)&&In(t,e,r);let a=n.slice(i+1);t.length>=n.length&&t.endsWith(a)&&Rn(o,n)===1&&n.lastIndexOf(`*`)===i&&(o=n,s=t.slice(i,t.length-a.length))}}if(o){let n=Fn(e,a[o],s,o,r,!0,!1,t.endsWith(`/`),i);if(n==null)throw jn(t,e,r);return n}throw jn(t,e,r)}function Rn(e,t){let n=e.indexOf(`*`),r=t.indexOf(`*`),i=n===-1?e.length:n+1,a=r===-1?t.length:r+1;return i>a?-1:a>i||n===-1?1:r===-1||e.length>t.length?-1:+(t.length>e.length)}function zn(e,t,n){if(e===`#`||e.startsWith(`#/`)||e.endsWith(`/`))throw new un(e,`is not a valid internal imports specifier name`,(0,U.fileURLToPath)(t));let r,i=$t(t);if(i.exists){r=(0,U.pathToFileURL)(i.pjsonPath);let a=i.imports;if(a){if(vn.call(a,e)&&!e.includes(`*`)){let i=Fn(r,a[e],``,e,t,!1,!0,!1,n);if(i!=null)return i}else{let i=``,o=``,s=Object.getOwnPropertyNames(a),c=-1;for(;++c<s.length;){let t=s[c],n=t.indexOf(`*`);if(n!==-1&&e.startsWith(t.slice(0,-1))){let r=t.slice(n+1);e.length>=t.length&&e.endsWith(r)&&Rn(i,t)===1&&t.lastIndexOf(`*`)===n&&(i=t,o=e.slice(n,e.length-r.length))}}if(i){let e=Fn(r,a[i],o,i,t,!0,!0,!1,n);if(e!=null)return e}}}}throw function(e,t,n){return new mn(e,t&&(0,U.fileURLToPath)(new URL(`.`,t)),(0,U.fileURLToPath)(n))}(e,r,t)}function Bn(e,t,n){if(ft.builtinModules.includes(e))return new URL(`node:`+e);let{packageName:r,packageSubpath:i,isScoped:a}=function(e,t){let n=e.indexOf(`/`),r=!0,i=!1;e[0]===`@`&&(i=!0,n===-1||e.length===0?r=!1:n=e.indexOf(`/`,n+1));let a=n===-1?e:e.slice(0,n);if(xn.exec(a)!==null&&(r=!1),!r)throw new un(e,`is not a valid package name`,(0,U.fileURLToPath)(t));return{packageName:a,packageSubpath:`.`+(n===-1?``:e.slice(n)),isScoped:i}}(e,t),o=$t(t);if(o.exists){let e=(0,U.pathToFileURL)(o.pjsonPath);if(o.name===r&&o.exports!==void 0&&o.exports!==null)return Ln(e,i,o,t,n)}let s,c=new URL(`./node_modules/`+r+`/package.json`,t),l=(0,U.fileURLToPath)(c);do{let o=On(l.slice(0,-13));if(!o||!o.isDirectory()){s=l,c=new URL((a?`../../../../node_modules/`:`../../../node_modules/`)+r+`/package.json`,c),l=(0,U.fileURLToPath)(c);continue}let u=Qt(l,{base:t,specifier:e});return u.exports!==void 0&&u.exports!==null?Ln(c,i,u,t,n):i===`.`?An(c,u,t):new URL(i,c)}while(l.length!==s.length)}function Vn(e,t,n,r){n===void 0&&(n=W());let i=t.protocol,a=i===`data:`||i===`http:`||i===`https:`,o;if(function(e){return e!==``&&(e[0]===`/`||function(e){return!(e[0]!==`.`||e.length!==1&&e[1]!==`/`&&(e[1]!==`.`||e.length!==2&&e[2]!==`/`))}(e))}(e))try{o=new URL(e,t)}catch(n){let r=new _n(e,t);throw r.cause=n,r}else if(i===`file:`&&e[0]===`#`)o=zn(e,t,n);else try{o=new URL(e)}catch(r){if(a&&!ft.builtinModules.includes(e)){let n=new _n(e,t);throw n.cause=r,n}o=Bn(e,t,n)}return Mt.ok(o!==void 0,`expected to be defined`),o.protocol===`file:`?function(e,t){if(Cn.exec(e.pathname)!==null)throw new un(e.pathname,`must not include encoded "/" or "\\" characters`,(0,U.fileURLToPath)(t));let n;try{n=(0,U.fileURLToPath)(e)}catch(n){let r=n;throw Object.defineProperty(r,"input",{value:String(e)}),Object.defineProperty(r,"module",{value:String(t)}),r}let r=On(n.endsWith(`/`)?n.slice(-1):n);if(r&&r.isDirectory()){let r=new gn(n,(0,U.fileURLToPath)(t));throw r.url=String(e),r}if(!r||!r.isFile()){let r=new pn(n||e.pathname,t&&(0,U.fileURLToPath)(t),!0);throw r.url=String(e),r}{let t=(0,B.realpathSync)(n),{search:r,hash:i}=e;(e=(0,U.pathToFileURL)(t+(n.endsWith(Pt.sep)?`/`:``))).search=r,e.hash=i}return e}(o,t):o}function Hn(e){return typeof e!=`string`||e.startsWith(`file://`)?Rt((0,U.fileURLToPath)(e)):Rt(e)}function Un(e){return(0,U.pathToFileURL)(Hn(e)).toString()}let Wn=/* @__PURE__ */ new Set([`node`,`import`]),Gn=[`.mjs`,`.cjs`,`.js`,`.json`],Kn=/* @__PURE__ */ new Set([`ERR_MODULE_NOT_FOUND`,`ERR_UNSUPPORTED_DIR_IMPORT`,`MODULE_NOT_FOUND`,`ERR_PACKAGE_PATH_NOT_EXPORTED`]);function qn(e,t,n){try{return Vn(e,t,n)}catch(e){if(!Kn.has(e?.code))throw e}}function Jn(e,t={}){if(typeof e!=`string`){if(!(e instanceof URL))throw TypeError("input must be a `string` or `URL`");e=Hn(e)}if(/(?:node|data|http|https):/.test(e))return e;if(Lt.has(e))return`node:`+e;if(e.startsWith(`file://`)&&(e=Hn(e)),Ot(e))try{if((0,B.statSync)(e).isFile())return Un(e)}catch(e){if(e?.code!==`ENOENT`)throw e}let n=t.conditions?new Set(t.conditions):Wn,r=(Array.isArray(t.url)?t.url:[t.url]).filter(Boolean).map(e=>new URL(function(e){return typeof e!=`string`&&(e=e.toString()),/(?:node|data|http|https|file):/.test(e)?e:Lt.has(e)?`node:`+e:`file://`+encodeURI(Rt(e))}(e.toString())));r.length===0&&r.push(new URL(Un(process.cwd())));let i=[...r];for(let e of r)e.protocol===`file:`&&i.push(new URL(`./`,e),new URL(_t(e.pathname,`_index.js`),e),new URL(`node_modules`,e));let a;for(let r of i){if(a=qn(e,r,n),a)break;for(let i of[``,`/index`]){for(let o of t.extensions||Gn)if(a=qn(_t(e,i)+o,r,n),a)break;if(a)break}if(a)break}if(!a){let t=/* @__PURE__ */ Error(`Cannot find module ${e} imported from ${i.join(`, `)}`);throw t.code=`ERR_MODULE_NOT_FOUND`,t}return Un(a)}function Yn(e,t){return Jn(e,t)}function Xn(e,t){return Hn(Yn(e,t))}let Zn=/(?:[\s;]|^)(?:import[\s\w*,{}]*from|import\s*["'*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m,Qn=/\/\*.+?\*\/|\/\/.*(?=[nr])/g;function $n(e,t={}){return t.stripComments&&(e=e.replace(Qn,``)),Zn.test(e)}function er(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}let tr=/* @__PURE__ */ new Set([`/`,`\\`,void 0]),nr=Symbol.for(`pathe:normalizedAlias`),rr=/[/\\]/;function ir(e){if(e[nr])return e;let t=Object.fromEntries(Object.entries(e).sort(([e],[t])=>function(e,t){return t.split(`/`).length-e.split(`/`).length}(e,t)));for(let e in t)for(let n in t)n===e||e.startsWith(n)||t[e]?.startsWith(n)&&tr.has(t[e][n.length])&&(t[e]=t[n]+t[e].slice(n.length));return Object.defineProperty(t,nr,{value:!0,enumerable:!1}),t}function ar(e=`/`){let t=e[e.length-1];return t===`/`||t===`\\`}var or={rE:`2.6.1`};let sr=k(`node:crypto`);var cr=r.n(sr);let G=globalThis.process?.env||Object.create(null),lr=globalThis.process||{env:G},ur=lr!==void 0&&lr.env&&lr.env.NODE_ENV||void 0,dr=[[`claude`,[`CLAUDECODE`,`CLAUDE_CODE`]],[`replit`,[`REPL_ID`]],[`gemini`,[`GEMINI_CLI`]],[`codex`,[`CODEX_SANDBOX`,`CODEX_THREAD_ID`]],[`opencode`,[`OPENCODE`]],[`pi`,[fr(`PATH`,/\.pi[\\/]agent/)]],[`auggie`,[`AUGMENT_AGENT`]],[`goose`,[`GOOSE_PROVIDER`]],[`devin`,[fr(`EDITOR`,/devin/)]],[`cursor`,[`CURSOR_AGENT`]],[`kiro`,[fr(`TERM_PROGRAM`,/kiro/)]]];function fr(e,t){return()=>{let n=G[e];return!!n&&t.test(n)}}let pr=function(){let e=G.AI_AGENT;if(e)return{name:e.toLowerCase()};for(let[e,t]of dr)for(let n of t)if(typeof n==`string`?G[n]:n())return{name:e};return{}}(),mr=(pr.name,pr.name,[[`APPVEYOR`],[`AWS_AMPLIFY`,`AWS_APP_ID`,{ci:!0}],[`AZURE_PIPELINES`,`SYSTEM_TEAMFOUNDATIONCOLLECTIONURI`],[`AZURE_STATIC`,`INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN`],[`APPCIRCLE`,`AC_APPCIRCLE`],[`BAMBOO`,`bamboo_planKey`],[`BITBUCKET`,`BITBUCKET_COMMIT`],[`BITRISE`,`BITRISE_IO`],[`BUDDY`,`BUDDY_WORKSPACE_ID`],[`BUILDKITE`],[`CIRCLE`,`CIRCLECI`],[`CIRRUS`,`CIRRUS_CI`],[`CLOUDFLARE_PAGES`,`CF_PAGES`,{ci:!0}],[`CLOUDFLARE_WORKERS`,`WORKERS_CI`,{ci:!0}],[`GOOGLE_CLOUDRUN`,`K_SERVICE`],[`GOOGLE_CLOUDRUN_JOB`,`CLOUD_RUN_JOB`],[`CODEBUILD`,`CODEBUILD_BUILD_ARN`],[`CODEFRESH`,`CF_BUILD_ID`],[`DRONE`],[`DRONE`,`DRONE_BUILD_EVENT`],[`DSARI`],[`GITHUB_ACTIONS`],[`GITLAB`,`GITLAB_CI`],[`GITLAB`,`CI_MERGE_REQUEST_ID`],[`GOCD`,`GO_PIPELINE_LABEL`],[`LAYERCI`],[`JENKINS`,`JENKINS_URL`],[`HUDSON`,`HUDSON_URL`],[`MAGNUM`],[`NETLIFY`],[`NETLIFY`,`NETLIFY_LOCAL`,{ci:!1}],[`NEVERCODE`],[`RENDER`],[`SAIL`,`SAILCI`],[`SEMAPHORE`],[`SCREWDRIVER`],[`SHIPPABLE`],[`SOLANO`,`TDDIUM`],[`STRIDER`],[`TEAMCITY`,`TEAMCITY_VERSION`],[`TRAVIS`],[`VERCEL`,`NOW_BUILDER`],[`VERCEL`,`VERCEL`,{ci:!1}],[`VERCEL`,`VERCEL_ENV`,{ci:!1}],[`APPCENTER`,`APPCENTER_BUILD_ID`],[`CODESANDBOX`,`CODESANDBOX_SSE`,{ci:!1}],[`CODESANDBOX`,`CODESANDBOX_HOST`,{ci:!1}],[`STACKBLITZ`],[`STORMKIT`],[`CLEAVR`],[`ZEABUR`],[`CODESPHERE`,`CODESPHERE_APP_ID`,{ci:!0}],[`RAILWAY`,`RAILWAY_PROJECT_ID`],[`RAILWAY`,`RAILWAY_SERVICE_ID`],[`DENO-DEPLOY`,`DENO_DEPLOY`],[`DENO-DEPLOY`,`DENO_DEPLOYMENT_ID`],[`FIREBASE_APP_HOSTING`,`FIREBASE_APP_HOSTING`,{ci:!0}],[`EDGEONE_PAGES`,`EO_PAGES_CI`,{ci:!0}]]),hr=function(){for(let e of mr)if(G[e[1]||e[0]])return{name:e[0].toLowerCase(),...e[2]};return G.SHELL===`/bin/jsh`&&lr.versions?.webcontainer?{name:`stackblitz`,ci:!1}:{name:``,ci:!1}}(),gr=(hr.name,lr.platform||``);G.CI||hr.ci;let _r=!!lr.stdout?.isTTY;G.DEBUG,ur===`test`||G.TEST;let vr=(ur===`production`||G.MODE,ur===`dev`||ur===`development`||G.MODE,G.MINIMAL,/^win/i.test(gr)),yr=(/^linux/i.test(gr),/^darwin/i.test(gr),!G.NO_COLOR&&(G.FORCE_COLOR||(_r||vr)&&G.TERM),(lr.versions?.node||``).replace(/^v/,``)||null),br=(Number(yr?.split(`.`)[0]),!!lr?.versions?.node),xr=`Bun`in globalThis,Sr=`Deno`in globalThis,Cr=`fastly`in globalThis,wr=[[`Netlify`in globalThis,`netlify`],[`EdgeRuntime`in globalThis,`edge-light`],[globalThis.navigator?.userAgent===`Cloudflare-Workers`,`workerd`],[Cr,`fastly`],[Sr,`deno`],[xr,`bun`],[br,`node`]];(function(){let e=wr.find(e=>e[0]);e&&e[1]})();let Tr=k(`node:tty`)?.WriteStream?.prototype?.hasColors?.()??!1,K=(e,t)=>{if(!Tr)return e=>e;let n=`[${e}m`,r=`[${t}m`;return e=>{let i=e+``,a=i.indexOf(r);if(a===-1)return n+i+r;let o=n,s=0,c=(t===22?r:``)+n;for(;a!==-1;)o+=i.slice(s,a)+c,s=a+r.length,a=i.indexOf(r,s);return o+=i.slice(s)+r,o}},Er=(K(0,0),K(1,22),K(2,22),K(3,23),K(4,24),K(53,55),K(7,27),K(8,28),K(9,29),K(30,39),K(31,39)),Dr=K(32,39),Or=K(33,39),kr=K(34,39),Ar=(K(35,39),K(36,39)),jr=(K(37,39),K(90,39));K(40,49),K(41,49),K(42,49),K(43,49),K(44,49),K(45,49),K(46,49),K(47,49),K(100,49),K(91,39),K(92,39),K(93,39),K(94,39),K(95,39),K(96,39),K(97,39),K(101,49),K(102,49),K(103,49),K(104,49),K(105,49),K(106,49),K(107,49);function Mr(e){if(typeof e!=`string`||e.startsWith(`file://`))return!1;try{return(0,B.lstatSync)(e).isDirectory()}catch{return!1}}function Nr(e,t=8){return(function(){if(Ir!==void 0)return Ir;try{return Ir=!!cr().getFips?.(),Ir}catch{return Ir=!1,Ir}}()?cr().createHash(`sha256`):cr().createHash(`md5`)).update(e).digest(`hex`).slice(0,t)}let Pr={true:Dr(`true`),false:Or(`false`),"[rebuild]":Or(`[rebuild]`),"[esm]":kr(`[esm]`),"[cjs]":Dr(`[cjs]`),"[import]":kr(`[import]`),"[require]":Dr(`[require]`),"[native]":Ar(`[native]`),"[transpile]":Or(`[transpile]`),"[fallback]":Er(`[fallback]`),"[unknown]":Er(`[unknown]`),"[hit]":Dr(`[hit]`),"[miss]":Or(`[miss]`),"[json]":Dr(`[json]`),"[data]":Dr(`[data]`)};function q(e,...t){if(!e.opts.debug)return;let n=process.cwd();console.log(jr([`[jiti]`,...t.map(e=>e in Pr?Pr[e]:typeof e==`string`?e.replace(n,`.`):JSON.stringify(e))].join(` `)))}function Fr(e,t){return e.opts.interopDefault?function(e){let t=typeof e;if(e===null||t!==`object`&&t!==`function`)return e;let n=e.default,r=typeof n,i=n==null,a=r===`object`||r===`function`;if(i&&e instanceof Promise)return e;let o=r===`function`&&t!==`function`,s=a&&!(n instanceof Promise),c=/* @__PURE__ */ new Map;return new Proxy(e,{get(t,r){if(c.has(r))return c.get(r);let a;return r==="__esModule"?a=!0:r==="default"?a=i?e:typeof n?.default==`function`&&e.__esModule?n.default:n:r in t?a=t[r]:s&&(a=n[r],typeof a==`function`&&(a=a.bind(n))),c.set(r,a),a},apply:o?(e,t,r)=>Reflect.apply(n,t,r):void 0})}(t):t}let Ir;function Lr(e,t){return!!Rr(e,t)}function Rr(e,t,n){let r=process.env[e];if(!(e in process.env))return t;try{return JSON.parse(r)}catch{return n?r:t}}let zr=/\.(c|m)?j(sx?)$/,J=/\.(c|m)?t(sx?)$/;function Br(e,t,n){let r,i;if(e.isNativeRe.test(t))return t;if(e.resolveTsConfigPaths&&!n.skipTsConfigPaths){let r=e.resolveTsConfigPaths(t);for(let t of r){let r=Br(e,t,{...n,try:!0,skipTsConfigPaths:!0});if(r)return r}}e.alias&&(t=function(e,t){let n=yt(e);t=ir(t);for(let[e,r]of Object.entries(t))if(n.startsWith(e)&&ar(n[(ar(e)?e.slice(0,-1):e).length]))return H(r,n.slice(e.length));return n}(t,e.alias));let a=n?.parentURL||e.url;Mr(a)&&(a=H(a,`_index.js`));let o=(n?.async?[n?.conditions,[`node`,`import`],[`node`,`require`]]:[n?.conditions,[`node`,`require`],[`node`,`import`]]).filter(Boolean);for(let n of o){try{r=Xn(t,{url:a,conditions:n,extensions:e.opts.extensions})}catch(e){i=e}if(r)return r}try{return e.nativeRequire.resolve(t,{paths:n.paths})}catch(e){i=e}for(let i of e.additionalExts)if(r=Vr(e,t+i,a,n)||Vr(e,t+`/index`+i,a,n),r||(J.test(e.filename)||J.test(e.parentModule?.filename||``)||zr.test(t))&&(r=Vr(e,t.replace(zr,`.$1t$2`),a,n),r))return r;if(!n?.try)throw i}function Vr(e,t,n,r){try{return e.nativeRequire.resolve(t,{...r,paths:[At(Hn(n)),...r?.paths||[]]})}catch{}}let Hr=k(`node:fs/promises`),Ur=k(`node:perf_hooks`),Wr=k(`node:vm`);var Gr=r.n(Wr);function Y(e,t,n){let r=e.parentCache||{};if(t.startsWith(`node:`))return Kr(e,t,n.async);if(t.startsWith(`file:`))t=(0,U.fileURLToPath)(t);else if(t.startsWith(`data:`)){if(!n.async)throw Error("`data:` URLs are only supported in ESM context. Use `import` or `jiti.import` instead.");return q(e,`[native]`,`[data]`,`[import]`,t),Kr(e,t,!0)}if(ft.builtinModules.includes(t)||t===`.pnp.js`)return Kr(e,t,n.async);if(e.opts.virtualModules&&t in e.opts.virtualModules){q(e,`[virtual]`,t);let r=e.opts.virtualModules[t];return n.async?Promise.resolve(Fr(e,r)):Fr(e,r)}if(e.opts.tryNative&&!e.opts.transformOptions)try{if(!(t=Br(e,t,n))&&n.try)return;if(q(e,`[try-native]`,n.async&&e.nativeImport?`[import]`:`[require]`,t),n.async&&e.nativeImport)return e.nativeImport(t).then(n=>(!1===e.opts.moduleCache&&delete e.nativeRequire.cache[t],Fr(e,n))).catch(r=>(q(e,`[try-native] Using fallback for ${t} because of an error:`,r),Y({...e,opts:{...e.opts,tryNative:!1}},t,n)));{let n=e.nativeRequire(t);return!1===e.opts.moduleCache&&delete e.nativeRequire.cache[t],Fr(e,n)}}catch(n){q(e,`[try-native] Using fallback for ${t} because of an error:`,n)}let i=Br(e,t,n);if(!i&&n.try)return;let a=kt(i);if(a===`.json`){q(e,`[json]`,i);let t=e.nativeRequire(i);return t&&!(`default`in t)&&Object.defineProperty(t,"default",{value:t,enumerable:!1}),t}if(a&&!e.opts.extensions.includes(a))return q(e,`[native]`,`[unknown]`,n.async?`[import]`:`[require]`,i),Kr(e,i,n.async);if(e.isNativeRe.test(i))return q(e,`[native]`,n.async?`[import]`:`[require]`,i),Kr(e,i,n.async);if(r[i])return Fr(e,r[i]?.exports);if(e.opts.moduleCache){let t=e.nativeRequire.cache[i];if(t?.loaded)return Fr(e,t.exports)}return Xr(e,(0,B.readFileSync)(i,`utf8`),{id:t,filename:i,ext:a,cache:r,async:n.async})}function Kr(e,t,n){return n&&e.nativeImport?e.nativeImport(function(e){return vr&&Ot(e)?Un(e):e}(t)).then(t=>Fr(e,t)):Fr(e,e.nativeRequire(t))}function qr(e,t,n){if(!e.opts.fsCache||!t.filename)return n();let r=` /* v9-${Nr(t.source,16)} */\n`,i=`${jt(At(t.filename))}-${function(e){let t=e.split(rr).pop();if(!t)return;let n=t.lastIndexOf(`.`);return n<=0?t:t.slice(0,n)}(t.filename)}`+(e.opts.sourceMaps?`+map`:``)+(t.interopDefault?`.i`:``)+`.${Nr(t.filename)}`+(t.async?`.mjs`:`.cjs`);t.jsx&&t.filename.endsWith(`x`)&&(i+=`x`);let a=e.opts.fsCache,o=H(a,i);if(!e.opts.rebuildFsCache&&(0,B.existsSync)(o)){let n=(0,B.readFileSync)(o,`utf8`);if(n.endsWith(r))return q(e,`[cache]`,`[hit]`,t.filename,`~>`,o),n}q(e,`[cache]`,`[miss]`,t.filename);let s=n();return s.includes(`__JITI_ERROR__`)||((0,B.writeFileSync)(o,s+r,`utf8`),q(e,`[cache]`,`[store]`,t.filename,`~>`,o)),s}function Jr(t){if(!0===t.opts.fsCache&&(t.opts.fsCache=function(t){let n=t.filename&&Et(t.filename,`../node_modules`);if(n&&(0,B.existsSync)(n))return H(n,`.cache/jiti`);let r=(0,e.tmpdir)();if(process.env.TMPDIR&&r===process.cwd()&&!process.env.JITI_RESPECT_TMPDIR_ENV){let t=process.env.TMPDIR;delete process.env.TMPDIR,r=(0,e.tmpdir)(),process.env.TMPDIR=t}return H(r,`jiti`)}(t)),t.opts.fsCache)try{if((0,B.mkdirSync)(t.opts.fsCache,{recursive:!0}),!function(e){try{return(0,B.accessSync)(e,B.constants.W_OK),!0}catch{return!1}}(t.opts.fsCache))throw Error(`directory is not writable!`)}catch(e){q(t,`Error creating cache directory at `,t.opts.fsCache,e),t.opts.fsCache=!1}}function Yr(e,t){let n=qr(e,t,()=>{let n=e.opts.transform({...e.opts.transformOptions,babel:{...e.opts.sourceMaps?{sourceFileName:t.filename,sourceMaps:`inline`}:{},...e.opts.transformOptions?.babel},interopDefault:e.opts.interopDefault,...t});return n.error&&e.opts.debug&&q(e,n.error),n.code});return n.startsWith(`#!`)&&(n=`// `+n),n}function Xr(t,n,r={}){let i=r.id||(r.filename?jt(r.filename):`_jitiEval.${r.ext||(r.async?`mjs`:`js`)}`),a=r.filename||Br(t,i,{async:r.async}),o=r.ext||kt(a),s=r.cache||t.parentCache||{},c=/\.[cm]?tsx?$/.test(o),l=o===`.mjs`||o===`.js`&&function(e){for(;e&&e!==`.`&&e!==`/`;){e=H(e,`..`);try{let t=(0,B.readFileSync)(H(e,`package.json`),`utf8`);try{return JSON.parse(t)}catch{}break}catch{}}}(a)?.type===`module`,u=o===`.cjs`,d=r.forceTranspile??(!u&&!(l&&r.async)&&(c||l||t.isTransformRe.test(a)||$n(n))),f=Ur.performance.now();if(d){n=Yr(t,{filename:a,source:n,ts:c,async:r.async??!1,jsx:t.opts.jsx});let e=Math.round(1e3*(Ur.performance.now()-f))/1e3;q(t,`[transpile]`,r.async?`[esm]`:`[cjs]`,a,`(${e}ms)`)}else{if(q(t,`[native]`,r.async?`[import]`:`[require]`,a),r.async)return Promise.resolve(Kr(t,a,r.async)).catch(e=>(q(t,`Native import error:`,e),q(t,`[fallback]`,a),Xr(t,n,{...r,forceTranspile:!0})));try{return Kr(t,a,r.async)}catch(e){q(t,`Native require error:`,e),q(t,`[fallback]`,a),n=Yr(t,{filename:a,source:n,ts:c,async:r.async??!1,jsx:t.opts.jsx})}}let p=new ft.Module(a);p.filename=a,t.parentModule&&(p.parent=t.parentModule,Array.isArray(t.parentModule.children)&&!t.parentModule.children.includes(p)&&t.parentModule.children.push(p));let m=Qr(a,t.opts,{parentModule:p,parentCache:s,nativeImport:t.nativeImport,onError:t.onError,createRequire:t.createRequire},!0),h;p.require=m,p.path=At(a),p.paths=ft.Module._nodeModulePaths(p.path),s[a]=p,t.opts.moduleCache&&(t.nativeRequire.cache[a]=p);let g=function(e,t){return`(${t?.async?`async `:``}function (exports, require, module, __filename, __dirname, jitiImport, jitiESMResolve) { ${e}\n});`}(n,{async:r.async});try{h=Gr().runInThisContext(g,{filename:a,lineOffset:0,displayErrors:!1})}catch(n){n.name===`SyntaxError`&&r.async&&t.nativeImport?(q(t,`[esm]`,`[import]`,`[fallback]`,a),h=function(t,n,r,i,a){let o=`export default ${n}`,s=a?void 0:`data:text/javascript;base64,${Buffer.from(o).toString(`base64`)}`;return(...n)=>{let a,c=()=>(a=function(t,n){let r=H((0,e.tmpdir)(),`jiti-esm`);try{(0,B.mkdirSync)(r,{recursive:!0})}catch{}let i=H(r,`${jt(n,kt(n))}-${Date.now()}-${Math.random().toString(36).slice(2)}.mjs`);return(0,B.writeFileSync)(i,t),i}(o,r),q(t,`[esm]`,`[tempfile]`,a),i(Un(a)));return(s?i(s).catch(e=>{if(e?.code!==`ENAMETOOLONG`)throw e;return c()}):c()).then(e=>e.default(...n)).finally(()=>{a&&(0,Hr.unlink)(a).catch(()=>{})})}}(t,g,a,t.nativeImport,t.opts.esmEvalTempFile)):(t.opts.moduleCache&&delete t.nativeRequire.cache[a],t.onError(n))}let _;try{_=h(p.exports,p.require,p,p.filename,At(p.filename),m.import,m.esmResolve)}catch(e){t.opts.moduleCache&&delete t.nativeRequire.cache[a],t.onError(e)}function v(){if(p.exports&&p.exports.__JITI_ERROR__){let{filename:e,line:n,column:r,code:i,message:a}=p.exports.__JITI_ERROR__,o=/* @__PURE__ */ Error(`${i}: ${a} \n ${`${e}:${n}:${r}`}`);Error.captureStackTrace(o,Y),t.onError(o)}return p.loaded=!0,Fr(t,p.exports)}return r.async?Promise.resolve(_).then(v):v()}let Zr=(0,e.platform)()===`win32`;function Qr(e,t={},n,i=!1){let a=i?t:function(e){let t={fsCache:Lr(`JITI_FS_CACHE`,Lr(`JITI_CACHE`,!0)),rebuildFsCache:Lr(`JITI_REBUILD_FS_CACHE`,!1),moduleCache:Lr(`JITI_MODULE_CACHE`,Lr(`JITI_REQUIRE_CACHE`,!0)),debug:Lr(`JITI_DEBUG`,!1),sourceMaps:Lr(`JITI_SOURCE_MAPS`,!1),interopDefault:Lr(`JITI_INTEROP_DEFAULT`,!0),extensions:Rr(`JITI_EXTENSIONS`,[`.js`,`.mjs`,`.cjs`,`.ts`,`.tsx`,`.mts`,`.cts`,`.mtsx`,`.ctsx`]),alias:Rr(`JITI_ALIAS`,{}),nativeModules:Rr(`JITI_NATIVE_MODULES`,[]),transformModules:Rr(`JITI_TRANSFORM_MODULES`,[]),tryNative:Rr(`JITI_TRY_NATIVE`,`Bun`in globalThis),esmEvalTempFile:Lr(`JITI_ESM_EVAL_TEMP_FILE`,!1),jsx:Lr(`JITI_JSX`,!1),tsconfigPaths:Rr(`JITI_TSCONFIG_PATHS`,!1,!0)};t.jsx&&t.extensions.push(`.jsx`,`.tsx`);let n={};return e.cache!==void 0&&(n.fsCache=e.cache),e.requireCache!==void 0&&(n.moduleCache=e.requireCache),{...t,...n,...e}}(t);typeof e==`string`&&e.startsWith(`file://`)&&(e=Hn(e));let o=a.alias&&Object.keys(a.alias).length>0?ir(a.alias||{}):void 0,s;if(a.tsconfigPaths){let{getTsconfig:t,createPathsMatcher:n}=r(`./node_modules/.pnpm/get-tsconfig@4.14.0/node_modules/get-tsconfig/dist/index.cjs`),i=t(typeof a.tsconfigPaths==`string`?a.tsconfigPaths:At(e));i&&(s=n(i))}let c=[`typescript`,`jiti`,...a.nativeModules||[]],l=RegExp(`node_modules/(${c.map(e=>er(e)).join(`|`)})/`),u=[...a.transformModules||[]],d=RegExp(`node_modules/(${u.map(e=>er(e)).join(`|`)})/`);e||=process.cwd(),!i&&Mr(e)&&(e=H(e,`_index.js`));let f=Un(e),p=[...a.extensions].filter(e=>e!==`.js`),m=n.createRequire(Zr?e.replace(/\//g,`\\`):e),h={filename:e,url:f,opts:a,alias:o,resolveTsConfigPaths:s,nativeModules:c,transformModules:u,isNativeRe:l,isTransformRe:d,additionalExts:p,nativeRequire:m,onError:n.onError,parentModule:n.parentModule,parentCache:n.parentCache,nativeImport:n.nativeImport,createRequire:n.createRequire};return i||q(h,`[init]`,...[[`version:`,or.rE],[`module-cache:`,a.moduleCache],[`fs-cache:`,a.fsCache],[`rebuild-fs-cache:`,a.rebuildFsCache],[`interop-defaults:`,a.interopDefault]].flat()),i||Jr(h),Object.assign(function(e){return Y(h,e,{async:!1})},{cache:a.moduleCache?m.cache:Object.create(null),extensions:m.extensions,main:m.main,options:a,resolve:Object.assign(function(e,t){return Br(h,e,{...t,async:!1})},{paths:m.resolve.paths}),transform:e=>Yr(h,e),evalModule:(e,t)=>Xr(h,e,t),async import(e,t){let n=await Y(h,e,{...t,async:!0});return t?.default?n?.default??n:n},esmResolve(e,t){typeof t==`string`&&(t={parentURL:t});let n=Br(h,e,{parentURL:f,...t,async:!0});return!n||typeof n!=`string`||n.startsWith(`file://`)?n:Un(n)}})}})(),t.exports=i.default})()})))(),1);function Mn(e){throw e}const Nn=e=>import(e);let Pn;function Fn(...t){return Pn||=e(import.meta.url)(`../dist/babel.cjs`),Pn(...t)}function In(t,n={}){return n.transform||(n={...n,transform:Fn}),(0,jn.default)(t,n,{onError:Mn,nativeImport:Nn,createRequire:e})}function Ln(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 Rn(e,t=`|`){return e.map(e=>lr(e)).join(t)}function zn(e,t){return typeof t==`bigint`?t.toString():t}var Bn=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 Vn(e){return new Bn(e)}function Hn(e){return e==null}function Un(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Wn(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 Gn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Kn(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function qn(e){return Kn(e._zod.def)??e._zod.def.shape}function Jn(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Gn(this,t,e),e},enumerable:!0,configurable:!0})}function Yn(e,t,n){t in e?Gn(e,t,n):e[t]=n}function Xn(e,t,n,r){let i=qn(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?Jn(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):Yn(e,a,r?r(n.value,a):n.value))}}function Zn(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Jn(e,n,()=>t[n]):Yn(e,n,r.value))}}function Qn(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function $n(e){return JSON.stringify(e)}function er(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const tr=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function nr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const rr=/* @__PURE__*/ Vn(()=>{if(Jr.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function ir(e){if(nr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return nr(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ar(e){return ir(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const or=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function sr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function cr(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function G(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 lr(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ur(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}const dr={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},fr={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function pr(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 Xn(i,e,mr(e,t)),cr(e,Qn(n,{shape:i,checks:[]}))}function mr(e,t){let n=qn(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 hr(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(mr(e,t)),a={};return Xn(a,e,Reflect.ownKeys(qn(e)).filter(e=>!i.has(e))),cr(e,Qn(n,{shape:a,checks:[]}))}function gr(e,t){if(!ir(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=qn(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 cr(e,Qn(e._zod.def,{shape:_r(e,t)}))}function _r(e,t){let n={};return Xn(n,e,Reflect.ownKeys(qn(e))),Zn(n,t),n}function vr(e,t){if(!ir(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return cr(e,Qn(e._zod.def,{shape:_r(e,t)}))}function yr(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 Xn(n,e,Reflect.ownKeys(qn(e))),Xn(n,t,Reflect.ownKeys(qn(t))),cr(e,Qn(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function br(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(mr(t,n)):void 0,o={};return Xn(o,t,Reflect.ownKeys(qn(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),cr(t,Qn(t._zod.def,{shape:o,checks:[]}))}function xr(e,t,n){let r=n?new Set(mr(t,n)):void 0,i={};return Xn(i,t,Reflect.ownKeys(qn(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),cr(t,Qn(t._zod.def,{shape:i}))}function Sr(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 Cr(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 wr(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Tr(e){return typeof e==`string`?e:e?.message}function K(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Er(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:Tr(e.inst?._zod.def?.error?.(e))??Tr(a?.(e))??Tr(t?.error?.(e))??Tr(n.customError?.(e))??Tr(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 Dr=/[\uD800-\uDBFF]/;function Or(e){let t=e.length;if(!Dr.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 kr(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ar(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 jr(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Mr(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Fr(e,n,r.value)}}function Nr(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Pr(e,t,n){return Nr(e,t,n,!1)}function q(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Nr(this,n,r(this))},set(e){Nr(this,n,e)}})}return t}function Fr(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Nr(this,t,n.bind(this))},set(e){Nr(this,t,e)}})}function Ir(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let Lr,Rr=!1;const zr={configurable:!0,get(){Rr=!0}};function J(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Lr!==e._zod){Lr=void 0;return}Lr=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,zr);let e=Rr;Rr=!1;try{let r=n(this);return Rr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Rr||=e,r}catch(n){throw delete this[t],Rr||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function Br(e,t,n,r){let i=Ir(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 Vr(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var Hr;const Ur={value:void 0,enumerable:!1};let Wr=`captureStackTrace`in Error?Error:null;function Gr(e){let t=Wr;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Wr=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function Y(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){Ur.value=new a(r);try{Object.defineProperty(n,"_zod",Ur)}finally{Ur.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),Mr(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?Gr(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 Kr=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},qr=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Hr=globalThis).__zod_globalConfig??(Hr.__zod_globalConfig={});const Jr=globalThis.__zod_globalConfig;function Yr(e){return e&&Object.assign(Jr,e),Jr}function Xr(){let e=this._zod;return e.message??=JSON.stringify(e.def,zn,2),e.message}function Zr(e){this._zod.message=e}const Qr={get:Xr,set:Zr,enumerable:!0,configurable:!0},$r={value:void 0,enumerable:!1},ei=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),ti=(e,t)=>{e.name=`$ZodError`,$r.value=t,Object.defineProperty(e,"issues",$r),$r.value=void 0,Object.defineProperty(e,"message",Qr);let n=Object.getPrototypeOf(e);ei.has(n)||(ei.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})}}))},ni=Y(`$ZodError`,ti);Y(`$ZodError`,ti,void 0,{Parent:Error});function ri(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 ii(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?ri(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function ai(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 oi(e,t){return{callee:t?.callee??e,Err:t?.Err}}const si=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 Kr;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Er(e,o,Yr())));throw tr(n,a?.callee??t),n}return s.value};return t},ci=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=>Er(e,o,Yr())));throw tr(n,a?.callee??t),n}return s.value};return t},li=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 Kr;return a.issues.length?ui(e,a.issues,i):{success:!0,data:a.value}};function ui(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Er(e,n,Yr()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const di=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?ui(e,a.issues,i):{success:!0,data:a.value}},fi=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),pi=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),mi=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==fi)return!0;if(r.definite===!0&&n===void 0)return!1}return hi(e,t,n)});function hi(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[pi]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Kr;return a.issues.length===0}const gi=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},_i=e=>{let t=si(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,oi(n,a))};return n},vi=e=>{let t=si(e),n=(e,r,i,a)=>t(e,r,i,oi(n,a));return n},yi=e=>{let t=ci(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,oi(n,a))};return n},bi=e=>{let t=ci(e),n=async(e,r,i,a)=>await t(e,r,i,oi(n,a));return n},xi=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return li(e)(t,n,i)},Si=e=>(t,n,r)=>li(e)(t,n,r),Ci=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return di(e)(t,n,i)},wi=e=>async(t,n,r)=>di(e)(t,n,r),Ti=/^[cC][0-9a-z]{6,}$/,Ei=/^[0-9a-z]+$/,Di=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Oi=/^[0-9a-vA-V]{20}$/,ki=/^[A-Za-z0-9]{27}$/,Ai=/^[a-zA-Z0-9_-]{21}$/;function ji(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const Mi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ni=/^([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})$/,Pi=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)$/,Fi=/^(?:[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 Ii(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}const Li=/^(?:(?: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])$/,Ri=/^(([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}|:))$/,zi=/^((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])$/,Bi=/^(([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])$/,Vi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Hi=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Ui=/^https?$/,Wi=/^\+[1-9]\d{6,14}$/,Gi=`(?:(?:\\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 Ki(e){return RegExp(`^${e}$`)}const qi=/*@__PURE__*/ Ki(Gi);function Ji(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 Yi(e){return RegExp(`^${Ji(e)}$`)}function Xi(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Ji({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Ji({precision:e.precision})}`:n;return RegExp(`^${Gi}T(?:${r})$`)}const Zi=/^[\s\S]{0,}$/,Qi=/^-?\d+(?:\.\d+)?$/,$i=/^(?:true|false)$/i,ea=/^[^A-Z]*$/,ta=/^[^a-z]*$/,na=/*@__PURE__*/ Y(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ra=e=>{let t=e.value;return!Hn(t)&&t.length!==void 0},ia={number:`number`,bigint:`bigint`,object:`date`},aa=/*@__PURE__*/ Y(`$ZodCheckLessThan`,(e,t)=>{na.init(e,t);let n=ia[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:ia[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})}}),oa=/*@__PURE__*/ Y(`$ZodCheckGreaterThan`,(e,t)=>{na.init(e,t);let n=ia[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:ia[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})}}),sa=/*@__PURE__*/ Y(`$ZodCheckMultipleOf`,(e,t)=>{na.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):Wn(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})}}),ca=/*@__PURE__*/ Y(`$ZodCheckNumberFormat`,(e,t)=>{na.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=dr[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})}}),la=/*@__PURE__*/ Y(`$ZodCheckMaxLength`,(e,t)=>{var n;na.init(e,t),(n=e._zod.def).when??(n.when=ra),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Or(r):i)<=t.maximum)return;let a=kr(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ua=/*@__PURE__*/ Y(`$ZodCheckMinLength`,(e,t)=>{var n;na.init(e,t),(n=e._zod.def).when??(n.when=ra),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Or(r):i)>=t.minimum)return;let a=kr(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),da=/*@__PURE__*/ Y(`$ZodCheckLengthEquals`,(e,t)=>{var n;na.init(e,t),(n=e._zod.def).when??(n.when=ra),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Or(r):i;if(a===t.length)return;let o=kr(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})}}),fa=/*@__PURE__*/ Y(`$ZodCheckStringFormat`,(e,t)=>{var n,r;na.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=()=>{})}),pa=/*@__PURE__*/ Y(`$ZodCheckRegex`,(e,t)=>{fa.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})}}),ma=/*@__PURE__*/ Y(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=ea,fa.init(e,t)}),ha=/*@__PURE__*/ Y(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=ta,fa.init(e,t)}),ga=/*@__PURE__*/ Y(`$ZodCheckIncludes`,(e,t)=>{na.init(e,t);let n=sr(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})}}),_a=/*@__PURE__*/ Y(`$ZodCheckStartsWith`,(e,t)=>{na.init(e,t);let n=RegExp(`^${sr(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})}}),va=/*@__PURE__*/ Y(`$ZodCheckEndsWith`,(e,t)=>{na.init(e,t);let n=RegExp(`.*${sr(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})}}),ya=/*@__PURE__*/ Y(`$ZodCheckOverwrite`,(e,t)=>{na.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var ba=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(`
34
+ 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 h(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 g(){if(a.env.NO_COLOR||a.env.FORCE_COLOR===`0`||a.env.FORCE_COLOR===`false`)return!1;if(a.env.FORCE_COLOR||a.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=m,e.useColor=g}));const{program:Qe,createCommand:$e,createArgument:et,createOption:tt,CommanderError:nt,InvalidArgumentError:rt,InvalidOptionArgumentError:it,Command:at,Argument:ot,Option:st,Help:ct}=(/* @__PURE__ */ te((/* @__PURE__ */ O((e=>{let{Argument:t}=qe(),{Command:n}=Ze(),{CommanderError:r,InvalidArgumentError:i}=Ke(),{Help:a}=Je(),{Option:o}=Ye();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;function lt(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 ut(e,t=`|`){return e.map(e=>Ft(e)).join(t)}function dt(e,t){return typeof t==`bigint`?t.toString():t}var ft=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 pt(e){return new ft(e)}function mt(e){return e==null}function ht(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function gt(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 _t(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function vt(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function yt(e){return vt(e._zod.def)??e._zod.def.shape}function bt(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return _t(this,t,e),e},enumerable:!0,configurable:!0})}function xt(e,t,n){t in e?_t(e,t,n):e[t]=n}function St(e,t,n,r){let i=yt(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?bt(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):xt(e,a,r?r(n.value,a):n.value))}}function Ct(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?bt(e,n,()=>t[n]):xt(e,n,r.value))}}function wt(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Tt(e){return JSON.stringify(e)}function Et(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Dt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Ot(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const kt=/* @__PURE__*/ pt(()=>{if(Cn.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function At(e){if(Ot(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Ot(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function jt(e){return At(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Mt=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function Nt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Pt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function N(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 Ft(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function It(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}const Lt={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Rt={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function zt(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 St(i,e,Bt(e,t)),Pt(e,wt(n,{shape:i,checks:[]}))}function Bt(e,t){let n=yt(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 Vt(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(Bt(e,t)),a={};return St(a,e,Reflect.ownKeys(yt(e)).filter(e=>!i.has(e))),Pt(e,wt(n,{shape:a,checks:[]}))}function Ht(e,t){if(!At(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=yt(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 Pt(e,wt(e._zod.def,{shape:Ut(e,t)}))}function Ut(e,t){let n={};return St(n,e,Reflect.ownKeys(yt(e))),Ct(n,t),n}function Wt(e,t){if(!At(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Pt(e,wt(e._zod.def,{shape:Ut(e,t)}))}function Gt(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 St(n,e,Reflect.ownKeys(yt(e))),St(n,t,Reflect.ownKeys(yt(t))),Pt(e,wt(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Kt(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(Bt(t,n)):void 0,o={};return St(o,t,Reflect.ownKeys(yt(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Pt(t,wt(t._zod.def,{shape:o,checks:[]}))}function qt(e,t,n){let r=n?new Set(Bt(t,n)):void 0,i={};return St(i,t,Reflect.ownKeys(yt(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Pt(t,wt(t._zod.def,{shape:i}))}function Jt(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 Yt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Xt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Zt(e){return typeof e==`string`?e:e?.message}function Qt(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function $t(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:Zt(e.inst?._zod.def?.error?.(e))??Zt(a?.(e))??Zt(t?.error?.(e))??Zt(n.customError?.(e))??Zt(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 en=/[\uD800-\uDBFF]/;function tn(e){let t=e.length;if(!en.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 nn(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function rn(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 an(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function on(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):un(e,n,r.value)}}function sn(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function cn(e,t,n){return sn(e,t,n,!1)}function ln(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return sn(this,n,r(this))},set(e){sn(this,n,e)}})}return t}function un(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:sn(this,t,n.bind(this))},set(e){sn(this,t,e)}})}function dn(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let fn,pn=!1;const mn={configurable:!0,get(){pn=!0}};function P(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&fn!==e._zod?fn=void 0:(fn=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,mn);let e=pn;pn=!1;try{let r=n(this);return pn?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),pn||=e,r}catch(n){throw delete this[t],pn||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function hn(e,t,n,r){let i=dn(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 gn(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var _n;const vn={value:void 0,enumerable:!1};let yn=`captureStackTrace`in Error?Error:null;function bn(e){let t=yn;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return yn=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function F(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){vn.value=new a(r);try{Object.defineProperty(n,"_zod",vn)}finally{vn.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),on(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?bn(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 xn=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Sn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(_n=globalThis).__zod_globalConfig??(_n.__zod_globalConfig={});const Cn=globalThis.__zod_globalConfig;function wn(e){return e&&Object.assign(Cn,e),Cn}function Tn(){let e=this._zod;return e.message??=JSON.stringify(e.def,dt,2),e.message}function En(e){this._zod.message=e}const Dn={get:Tn,set:En,enumerable:!0,configurable:!0},On={value:void 0,enumerable:!1},kn=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),An=(e,t)=>{e.name=`$ZodError`,On.value=t,Object.defineProperty(e,"issues",On),On.value=void 0,Object.defineProperty(e,"message",Dn);let n=Object.getPrototypeOf(e);kn.has(n)||(kn.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})}}))},jn=F(`$ZodError`,An);F(`$ZodError`,An,void 0,{Parent:Error});function Mn(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 Nn(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Mn(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Pn(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 Fn(e,t){return{callee:t?.callee??e,Err:t?.Err}}const In=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 xn;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>$t(e,o,wn())));throw Dt(n,a?.callee??t),n}return s.value};return t},Ln=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=>$t(e,o,wn())));throw Dt(n,a?.callee??t),n}return s.value};return t},Rn=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 xn;return a.issues.length?zn(e,a.issues,i):{success:!0,data:a.value}};function zn(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>$t(e,n,wn()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const Bn=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?zn(e,a.issues,i):{success:!0,data:a.value}},Vn=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),Hn=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),Un=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Vn)return!0;if(r.definite===!0&&n===void 0)return!1}return Wn(e,t,n)});function Wn(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Hn]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new xn;return a.issues.length===0}const Gn=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},Kn=e=>{let t=In(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Fn(n,a))};return n},qn=e=>{let t=In(e),n=(e,r,i,a)=>t(e,r,i,Fn(n,a));return n},Jn=e=>{let t=Ln(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Fn(n,a))};return n},Yn=e=>{let t=Ln(e),n=async(e,r,i,a)=>await t(e,r,i,Fn(n,a));return n},Xn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Rn(e)(t,n,i)},Zn=e=>(t,n,r)=>Rn(e)(t,n,r),Qn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Bn(e)(t,n,i)},$n=e=>async(t,n,r)=>Bn(e)(t,n,r),er=/^[cC][0-9a-z]{6,}$/,tr=/^[0-9a-z]+$/,nr=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,rr=/^[0-9a-vA-V]{20}$/,ir=/^[A-Za-z0-9]{27}$/,ar=/^[a-zA-Z0-9_-]{21}$/;function or(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const sr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,cr=/^([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})$/,lr=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)$/,ur=/^(?:[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 dr(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}const fr=/^(?:(?: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])$/,pr=/^(([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}|:))$/,mr=/^((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])$/,hr=/^(([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])$/,gr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_r=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,vr=/^https?$/,yr=/^\+[1-9]\d{6,14}$/,br=`(?:(?:\\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 xr(e){return RegExp(`^${e}$`)}const Sr=/*@__PURE__*/ xr(br);function Cr(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 wr(e){return RegExp(`^${Cr(e)}$`)}function Tr(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Cr({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Cr({precision:e.precision})}`:n;return RegExp(`^${br}T(?:${r})$`)}const Er=/^[\s\S]{0,}$/,Dr=/^-?\d+(?:\.\d+)?$/,Or=/^(?:true|false)$/i,kr=/^[^A-Z]*$/,Ar=/^[^a-z]*$/,jr=/*@__PURE__*/ F(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Mr=e=>{let t=e.value;return!mt(t)&&t.length!==void 0},Nr={number:`number`,bigint:`bigint`,object:`date`},Pr=/*@__PURE__*/ F(`$ZodCheckLessThan`,(e,t)=>{jr.init(e,t);let n=Nr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Nr[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})}}),Fr=/*@__PURE__*/ F(`$ZodCheckGreaterThan`,(e,t)=>{jr.init(e,t);let n=Nr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Nr[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})}}),Ir=/*@__PURE__*/ F(`$ZodCheckMultipleOf`,(e,t)=>{jr.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):gt(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})}}),Lr=/*@__PURE__*/ F(`$ZodCheckNumberFormat`,(e,t)=>{jr.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Lt[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})}}),Rr=/*@__PURE__*/ F(`$ZodCheckMaxLength`,(e,t)=>{var n;jr.init(e,t),(n=e._zod.def).when??(n.when=Mr),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?tn(r):i)<=t.maximum)return;let a=nn(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),zr=/*@__PURE__*/ F(`$ZodCheckMinLength`,(e,t)=>{var n;jr.init(e,t),(n=e._zod.def).when??(n.when=Mr),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?tn(r):i)>=t.minimum)return;let a=nn(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Br=/*@__PURE__*/ F(`$ZodCheckLengthEquals`,(e,t)=>{var n;jr.init(e,t),(n=e._zod.def).when??(n.when=Mr),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?tn(r):i;if(a===t.length)return;let o=nn(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})}}),Vr=/*@__PURE__*/ F(`$ZodCheckStringFormat`,(e,t)=>{var n,r;jr.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=()=>{})}),Hr=/*@__PURE__*/ F(`$ZodCheckRegex`,(e,t)=>{Vr.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})}}),Ur=/*@__PURE__*/ F(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=kr,Vr.init(e,t)}),Wr=/*@__PURE__*/ F(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Ar,Vr.init(e,t)}),Gr=/*@__PURE__*/ F(`$ZodCheckIncludes`,(e,t)=>{jr.init(e,t);let n=Nt(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})}}),Kr=/*@__PURE__*/ F(`$ZodCheckStartsWith`,(e,t)=>{jr.init(e,t);let n=RegExp(`^${Nt(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})}}),qr=/*@__PURE__*/ F(`$ZodCheckEndsWith`,(e,t)=>{jr.init(e,t);let n=RegExp(`.*${Nt(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})}}),Jr=/*@__PURE__*/ F(`$ZodCheckOverwrite`,(e,t)=>{jr.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Yr=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(`
98
35
  `).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(`
99
- `)}\n};`)(...Object.values(this.closed))}};const xa={major:4,minor:6,patch:5},Sa=/*@__PURE__*/ Y(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=xa;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=Sr(t),a;for(let o of n){if(o._zod.def.when){if(Cr(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 Kr;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(K(t.issues,n,e),i||=Sr(t,n))});else{if(t.issues.length===n)continue;K(t.issues,n,e),i||=Sr(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Sr(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Kr;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 Kr;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Pr(this,`~standard`,Ta(this))},set"~standard"(e){Nr(this,`~standard`,e)}}),Ca=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Er(e,t,Yr()))}:{value:e.value};async function wa(e,t){let n={async:!0};return Ca(await e._zod.run({value:t,issues:[]},n),n)}function Ta(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Ca(r,n)}catch{}return wa(e,t)},vendor:`zod`,version:1}}const Ea=/*@__PURE__*/ Y(`$ZodString`,(e,t)=>{Sa.init(e,t),e._zod.pattern=t.pattern??Zi,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}}),X=/*@__PURE__*/ Y(`$ZodStringFormat`,(e,t)=>{fa.init(e,t),Ea.init(e,t)}),Da=/*@__PURE__*/ Y(`$ZodGUID`,(e,t)=>{t.pattern??=Ni,X.init(e,t)}),Oa=/*@__PURE__*/ Y(`$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??=Pi(e)}else t.pattern??=Pi();X.init(e,t)}),ka=/*@__PURE__*/ Y(`$ZodEmail`,(e,t)=>{t.pattern??=Fi,X.init(e,t)});function Aa(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function ja(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Aa(e)||2:Ma(e,t)}function Ma(e,t){if(!t.normalize&&t.protocol?.source===Ui.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 Na=/[\t\n\r]/g;function Pa(e){return e.replace(Na,``)}function Fa(e,t){return t.lastIndex=0,t.test(e.hostname)}function Ia(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}const La=/*@__PURE__*/ Y(`$ZodURL`,(e,t)=>{X.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=ja(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=Pa(r);return}t.hostname&&!Fa(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&&!Ia(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:Pa(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ra=/*@__PURE__*/ Y(`$ZodEmoji`,(e,t)=>{t.pattern??=Ii(),X.init(e,t)}),za=/*@__PURE__*/ Y(`$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?Ai:ji(t.length),X.init(e,t)}),Ba=/*@__PURE__*/ Y(`$ZodCUID`,(e,t)=>{t.pattern??=Ti,X.init(e,t)}),Va=/*@__PURE__*/ Y(`$ZodCUID2`,(e,t)=>{t.pattern??=Ei,X.init(e,t)}),Ha=/*@__PURE__*/ Y(`$ZodULID`,(e,t)=>{t.pattern??=Di,X.init(e,t)}),Ua=/*@__PURE__*/ Y(`$ZodXID`,(e,t)=>{t.pattern??=Oi,X.init(e,t)}),Wa=/*@__PURE__*/ Y(`$ZodKSUID`,(e,t)=>{t.pattern??=ki,X.init(e,t)}),Ga=/*@__PURE__*/ Y(`$ZodISODateTime`,(e,t)=>{t.pattern??=Xi(t),X.init(e,t)}),Ka=/*@__PURE__*/ Y(`$ZodISODate`,(e,t)=>{t.pattern??=qi,X.init(e,t)}),qa=/*@__PURE__*/ Y(`$ZodISOTime`,(e,t)=>{t.pattern??=Yi(t),X.init(e,t)}),Ja=/*@__PURE__*/ Y(`$ZodISODuration`,(e,t)=>{t.pattern??=Mi,X.init(e,t)}),Ya=/*@__PURE__*/ Y(`$ZodIPv4`,(e,t)=>{t.pattern??=Li,X.init(e,t)}),Xa=/^[0-9a-fA-F:.]+$/;function Za(e){return Xa.test(e)?Aa(`http://[${e}]`):!1}const Qa=/*@__PURE__*/ Y(`$ZodIPv6`,(e,t)=>{t.pattern??=Ri,X.init(e,t),e._zod.check=n=>{Za(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),$a=/*@__PURE__*/ Y(`$ZodCIDRv4`,(e,t)=>{t.pattern??=zi,X.init(e,t)});function eo(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:Za(n)}const to=/*@__PURE__*/ Y(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Bi,X.init(e,t),e._zod.check=n=>{eo(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function no(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const ro=/^[0-9a-zA-Z+/]*={0,2}$/,io=/*@__PURE__*/ Y(`$ZodBase64`,(e,t)=>{t.pattern??=ro,X.init(e,t),e._zod.check=n=>{no(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),ao=/^[A-Za-z0-9_-]*$/;function oo(e){if(!ao.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return no(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const so=/*@__PURE__*/ Y(`$ZodBase64URL`,(e,t)=>{t.pattern??=ao,X.init(e,t),e._zod.check=n=>{oo(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),co=/*@__PURE__*/ Y(`$ZodE164`,(e,t)=>{t.pattern??=Wi,X.init(e,t)});function lo(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 uo=/*@__PURE__*/ Y(`$ZodJWT`,(e,t)=>{X.init(e,t),e._zod.check=n=>{lo(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),fo=/*@__PURE__*/ Y(`$ZodNumber`,(e,t)=>{Sa.init(e,t),e._zod.pattern=Qi,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}}),po=/*@__PURE__*/ Y(`$ZodNumberFormat`,(e,t)=>{ca.init(e,t),fo.init(e,t)}),mo=/*@__PURE__*/ Y(`$ZodBoolean`,(e,t)=>{Sa.init(e,t),e._zod.pattern=$i,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}}),ho=/*@__PURE__*/ Y(`$ZodUnknown`,(e,t)=>{Sa.init(e,t),e._zod.parse=e=>e}),go=/*@__PURE__*/ Y(`$ZodNever`,(e,t)=>{Sa.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function _o(e,t,n){e.issues.length&&t.issues.push(...wr(n,e.issues)),t.value[n]=e.value}const vo=/*@__PURE__*/ Y(`$ZodArray`,(e,t)=>{Sa.init(e,t);let n=Jr.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=>_o(t,r,e)));else if(_o(c,r,e),s&&c.issues.length!==0&&Sr(c))break}return o.length?Promise.all(o).then(()=>r):r}});function yo(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(...wr(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}const bo=[];function xo(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:bo,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=ur(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function So(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(Sr(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=>yo(e,n,i,t,d,f))):yo(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 Co=/*@__PURE__*/ Y(`$ZodObject`,(e,t)=>{Sa.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=Vn(()=>xo(t));J(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)||Gn(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=nr,o=t.catchall,s,c=Jr.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(Sr(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=>yo(n,t,e,r,a,o))):yo(s,t,e,r,a,o)}return o?So(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),wo=/*@__PURE__*/ Y(`$ZodObjectJIT`,(e,t)=>{Co.init(e,t);let n=e._zod.parse,r=Vn(()=>xo(t)),i=Jr.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new ba([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
36
+ `)}\n};`)(...Object.values(this.closed))}};const Xr={major:4,minor:6,patch:5},I=/*@__PURE__*/ F(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Xr;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=Jt(t),a;for(let o of n){if(o._zod.def.when){if(Yt(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 xn;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Qt(t.issues,n,e),i||=Jt(t,n))});else{if(t.issues.length===n)continue;Qt(t.issues,n,e),i||=Jt(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Jt(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new xn;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 xn;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return cn(this,`~standard`,$r(this))},set"~standard"(e){sn(this,`~standard`,e)}}),Zr=(e,t)=>e.issues.length?{issues:e.issues.map(e=>$t(e,t,wn()))}:{value:e.value};async function Qr(e,t){let n={async:!0};return Zr(await e._zod.run({value:t,issues:[]},n),n)}function $r(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Zr(r,n)}catch{}return Qr(e,t)},vendor:`zod`,version:1}}const ei=/*@__PURE__*/ F(`$ZodString`,(e,t)=>{I.init(e,t),e._zod.pattern=t.pattern??Er,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}}),L=/*@__PURE__*/ F(`$ZodStringFormat`,(e,t)=>{Vr.init(e,t),ei.init(e,t)}),ti=/*@__PURE__*/ F(`$ZodGUID`,(e,t)=>{t.pattern??=cr,L.init(e,t)}),ni=/*@__PURE__*/ F(`$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??=lr(e)}else t.pattern??=lr();L.init(e,t)}),ri=/*@__PURE__*/ F(`$ZodEmail`,(e,t)=>{t.pattern??=ur,L.init(e,t)});function ii(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function ai(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?ii(e)||2:oi(e,t)}function oi(e,t){if(!t.normalize&&t.protocol?.source===vr.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 si=/[\t\n\r]/g;function ci(e){return e.replace(si,``)}function li(e,t){return t.lastIndex=0,t.test(e.hostname)}function ui(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}const di=/*@__PURE__*/ F(`$ZodURL`,(e,t)=>{L.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=ai(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=ci(r);return}t.hostname&&!li(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&&!ui(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:ci(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),fi=/*@__PURE__*/ F(`$ZodEmoji`,(e,t)=>{t.pattern??=dr(),L.init(e,t)}),pi=/*@__PURE__*/ F(`$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?ar:or(t.length),L.init(e,t)}),mi=/*@__PURE__*/ F(`$ZodCUID`,(e,t)=>{t.pattern??=er,L.init(e,t)}),hi=/*@__PURE__*/ F(`$ZodCUID2`,(e,t)=>{t.pattern??=tr,L.init(e,t)}),gi=/*@__PURE__*/ F(`$ZodULID`,(e,t)=>{t.pattern??=nr,L.init(e,t)}),_i=/*@__PURE__*/ F(`$ZodXID`,(e,t)=>{t.pattern??=rr,L.init(e,t)}),vi=/*@__PURE__*/ F(`$ZodKSUID`,(e,t)=>{t.pattern??=ir,L.init(e,t)}),yi=/*@__PURE__*/ F(`$ZodISODateTime`,(e,t)=>{t.pattern??=Tr(t),L.init(e,t)}),bi=/*@__PURE__*/ F(`$ZodISODate`,(e,t)=>{t.pattern??=Sr,L.init(e,t)}),xi=/*@__PURE__*/ F(`$ZodISOTime`,(e,t)=>{t.pattern??=wr(t),L.init(e,t)}),Si=/*@__PURE__*/ F(`$ZodISODuration`,(e,t)=>{t.pattern??=sr,L.init(e,t)}),Ci=/*@__PURE__*/ F(`$ZodIPv4`,(e,t)=>{t.pattern??=fr,L.init(e,t)}),wi=/^[0-9a-fA-F:.]+$/;function Ti(e){return wi.test(e)?ii(`http://[${e}]`):!1}const Ei=/*@__PURE__*/ F(`$ZodIPv6`,(e,t)=>{t.pattern??=pr,L.init(e,t),e._zod.check=n=>{Ti(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Di=/*@__PURE__*/ F(`$ZodCIDRv4`,(e,t)=>{t.pattern??=mr,L.init(e,t)});function Oi(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:Ti(n)}const ki=/*@__PURE__*/ F(`$ZodCIDRv6`,(e,t)=>{t.pattern??=hr,L.init(e,t),e._zod.check=n=>{Oi(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Ai(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const ji=/^[0-9a-zA-Z+/]*={0,2}$/,Mi=/*@__PURE__*/ F(`$ZodBase64`,(e,t)=>{t.pattern??=ji,L.init(e,t),e._zod.check=n=>{Ai(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Ni=/^[A-Za-z0-9_-]*$/;function Pi(e){if(!Ni.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Ai(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Fi=/*@__PURE__*/ F(`$ZodBase64URL`,(e,t)=>{t.pattern??=Ni,L.init(e,t),e._zod.check=n=>{Pi(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Ii=/*@__PURE__*/ F(`$ZodE164`,(e,t)=>{t.pattern??=yr,L.init(e,t)});function Li(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 Ri=/*@__PURE__*/ F(`$ZodJWT`,(e,t)=>{L.init(e,t),e._zod.check=n=>{Li(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),zi=/*@__PURE__*/ F(`$ZodNumber`,(e,t)=>{I.init(e,t),e._zod.pattern=Dr,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}}),Bi=/*@__PURE__*/ F(`$ZodNumberFormat`,(e,t)=>{Lr.init(e,t),zi.init(e,t)}),Vi=/*@__PURE__*/ F(`$ZodBoolean`,(e,t)=>{I.init(e,t),e._zod.pattern=Or,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}}),Hi=/*@__PURE__*/ F(`$ZodUnknown`,(e,t)=>{I.init(e,t),e._zod.parse=e=>e}),Ui=/*@__PURE__*/ F(`$ZodNever`,(e,t)=>{I.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Wi(e,t,n){e.issues.length&&t.issues.push(...Xt(n,e.issues)),t.value[n]=e.value}const Gi=/*@__PURE__*/ F(`$ZodArray`,(e,t)=>{I.init(e,t);let n=Cn.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=>Wi(t,r,e)));else if(Wi(c,r,e),s&&c.issues.length!==0&&Jt(c))break}return o.length?Promise.all(o).then(()=>r):r}});function Ki(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(...Xt(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 qi=[];function Ji(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:qi,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=It(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Yi(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(Jt(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=>Ki(e,n,i,t,d,f))):Ki(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 Xi=/*@__PURE__*/ F(`$ZodObject`,(e,t)=>{I.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=pt(()=>Ji(t));P(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)||_t(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=Ot,o=t.catchall,s,c=Cn.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(Jt(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=>Ki(n,t,e,r,a,o))):Ki(s,t,e,r,a,o)}return o?Yi(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Zi=/*@__PURE__*/ F(`$ZodObjectJIT`,(e,t)=>{Xi.init(e,t);let n=e._zod.parse,r=pt(()=>Ji(t)),i=Cn.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Yr([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
100
37
  let ${e}_ab = false;
101
38
  for (let i = 0; i < ${e}.issues.length; i++) {
102
39
  const iss = ${e}.issues[i];
@@ -107,7 +44,7 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
107
44
  if (${e}_ab && ctx && ctx.abortEarly) {
108
45
  payload.value = newResult;
109
46
  return payload;
110
- }`;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)}]`:$n(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(`
47
+ }`;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)}]`:Tt(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(`
111
48
  const ${n}_present = ${i};
112
49
  if (!${n}.issues.length || ${n}_present) {
113
50
  if (${n}.issues.length) {${c(n,r)}
@@ -146,72 +83,122 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
146
83
  newResult[${r}] = ${n}.value;
147
84
  }
148
85
 
149
- `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=nr,c=!Jr.jitless,l=c&&rr.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?So([],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 To(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=>!Sr(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=>Er(e,r,Yr())))}),t)}const Eo=/*@__PURE__*/ Y(`$ZodUnion`,(e,t)=>{Sa.init(e,t),J(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),J(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),J(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)))}),J(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=>Un(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=>To(t,r,e,i)):To(o,r,e,i)}}),Do=/*@__PURE__*/ Y(`$ZodIntersection`,(e,t)=>{Sa.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])=>ko(e,t,n)):ko(e,i,a)}});function Oo(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ir(e)&&ir(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=Oo(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=Oo(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 ko(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=Oo(t.value,n.value);if(!c.valid){if(Sr(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const Ao=/*@__PURE__*/ Y(`$ZodEnum`,(e,t)=>{Sa.init(e,t);let n=Ln(t.entries),r=new Set(n);e._zod.values=r,J(e,`pattern`,e=>{let t=Ln(e.def.entries).filter(e=>or.has(typeof e));return RegExp(t.length?`^(${t.map(e=>sr(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}}),jo=/*@__PURE__*/ Y(`$ZodTransform`,(e,t)=>{Sa.init(e,t),e._zod.optin=`optional`,Jr.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new qr(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 Kr;return n.value=i,n}});function Mo(e,t){return e.value=t.issues.length?void 0:t.value,e}const No=/*@__PURE__*/ Y(`$ZodOptional`,(e,t)=>{Sa.init(e,t),J(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,J(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),J(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Un(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=>Mo(e,t)):Mo(e,r)}return t.innerType._zod.run(e,n)}}),Po=/*@__PURE__*/ Y(`$ZodExactOptional`,(e,t)=>{No.init(e,t),J(e,`values`,e=>e.def.innerType._zod.values),J(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Fo=/*@__PURE__*/ Y(`$ZodNullable`,(e,t)=>{Sa.init(e,t),J(e,`optin`,e=>e.def.innerType._zod.optin),J(e,`optout`,e=>e.def.innerType._zod.optout),J(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Un(t.source)}|null)$`):void 0}),J(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)}),Io=/*@__PURE__*/ Y(`$ZodDefault`,(e,t)=>{Sa.init(e,t),e._zod.optin=`defaulted`,J(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=>Lo(e,t)):Lo(r,t)}});function Lo(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ro=/*@__PURE__*/ Y(`$ZodPrefault`,(e,t)=>{Sa.init(e,t),e._zod.optin=`defaulted`,J(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))}),zo=/*@__PURE__*/ Y(`$ZodNonOptional`,(e,t)=>{Sa.init(e,t),J(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=>Bo(t,e)):Bo(i,e)}});function Bo(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 Vo(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Er(e,r,Yr()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const Ho=/*@__PURE__*/ Y(`$ZodCatch`,(e,t)=>{Sa.init(e,t),J(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),J(e,`optout`,e=>e.def.innerType._zod.optout),J(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=>Vo(e,r,t,n)):Vo(e,r,t,n)}}),Uo=/*@__PURE__*/ Y(`$ZodPipe`,(e,t)=>{Sa.init(e,t),J(e,`values`,e=>e.def.in._zod.values),J(e,`optin`,e=>e.def.in._zod.optin),J(e,`optout`,e=>e.def.out._zod.optout),J(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=>Wo(e,t.in,n)):Wo(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Wo(e,t.out,n)):Wo(r,t.out,n)}});function Wo(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 Go=/*@__PURE__*/ Y(`$ZodReadonly`,(e,t)=>{Sa.init(e,t),J(e,`propValues`,e=>e.def.innerType._zod.propValues),J(e,`values`,e=>e.def.innerType._zod.values),J(e,`optin`,e=>e.def.innerType?._zod?.optin),J(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(Ko):Ko(r)}});function Ko(e){return e.memo||(e.value=Object.freeze(e.value)),e}const qo=/*@__PURE__*/ Y(`$ZodCustom`,(e,t)=>{na.init(e,t),Sa.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=>Jo(t,n,r,e));Jo(i,n,r,e)}});function Jo(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(jr(e))}}var Yo=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};const Xo=`~memo`,Zo=[];function Qo(e){return typeof e==`object`&&!!e}function $o(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const es=/*@__PURE__*/ new WeakMap;function ts(e,t,n){let r=es.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=ts(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?ts(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=Kn(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?ts(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),ns(e,i)}function ns(e,t){return t!==1&&es.set(e,t===2),t}function rs(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let is;const as=[],os={alloc(e,t,n){let r=is;if(!r)return n;is=void 0;let i={value:n,issues:null};return r.set(t.value,i),as.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`&&cs(n,e.value))throw new Yo;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=ts(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(!Qo(l))return t(s,c);let u=c[Xo];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[Xo]=u);let d;i===c?d=a:(d=rs(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(...$o(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;is=d;let p=as.length,m=t(s,c);is=void 0;let h=as.length>p?as.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?$o(e.issues):Zo),e)):(h&&(h.issues=m.issues.length?$o(m.issues):Zo),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function ss(){return os}function cs(e,t){let n=e[Xo]?.backEdges;return n!==void 0&&Qo(t)&&n.has(t)}const ls=()=>{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(Ar(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${lr(e.values[0])}`:`Invalid option: expected one of ${Rn(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`:``}: ${Rn(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 us(){return{localeError:ls()}}var ds,fs=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 ps(){return new fs}(ds=globalThis).__zod_globalRegistry??(ds.__zod_globalRegistry=ps());const ms=globalThis.__zod_globalRegistry;function hs(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
150
- function gs(e,t){return new e(hs({type:`string`,...G(t)}))}// @__NO_SIDE_EFFECTS__
151
- function _s(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
152
- function vs(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
153
- function ys(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
154
- function bs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...G(t)})}// @__NO_SIDE_EFFECTS__
155
- function xs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...G(t)})}// @__NO_SIDE_EFFECTS__
156
- function Ss(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...G(t)})}// @__NO_SIDE_EFFECTS__
157
- function Cs(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
158
- function ws(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
159
- function Ts(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
160
- function Es(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
161
- function Ds(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
162
- function Os(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
163
- function ks(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
164
- function As(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
165
- function js(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
166
- function Ms(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
167
- function Ns(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
168
- function Ps(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
169
- function Fs(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
170
- function Is(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
171
- function Ls(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
172
- function Rs(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...G(t)})}// @__NO_SIDE_EFFECTS__
173
- function zs(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...G(t)})}// @__NO_SIDE_EFFECTS__
174
- function Bs(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...G(t)})}// @__NO_SIDE_EFFECTS__
175
- function Vs(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...G(t)})}// @__NO_SIDE_EFFECTS__
176
- function Hs(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...G(t)})}// @__NO_SIDE_EFFECTS__
177
- function Us(e,t){return new e(hs({type:`number`,checks:[],...G(t)}))}// @__NO_SIDE_EFFECTS__
178
- function Ws(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...G(t)})}// @__NO_SIDE_EFFECTS__
179
- function Gs(e,t){return new e({type:`boolean`,...G(t)})}// @__NO_SIDE_EFFECTS__
180
- function Ks(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
181
- function qs(e,t){return new e({type:`never`,...G(t)})}// @__NO_SIDE_EFFECTS__
182
- function Js(e,t){return new aa({check:`less_than`,...G(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
183
- function Ys(e,t){return new aa({check:`less_than`,...G(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
184
- function Xs(e,t){return new oa({check:`greater_than`,...G(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
185
- function Zs(e,t){return new oa({check:`greater_than`,...G(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
186
- function Qs(e,t){return new sa({check:`multiple_of`,...G(t),value:e})}// @__NO_SIDE_EFFECTS__
187
- function $s(e,t){return new la({check:`max_length`,...G(t),maximum:e})}// @__NO_SIDE_EFFECTS__
188
- function ec(e,t){return new ua({check:`min_length`,...G(t),minimum:e})}// @__NO_SIDE_EFFECTS__
189
- function tc(e,t){return new da({check:`length_equals`,...G(t),length:e})}// @__NO_SIDE_EFFECTS__
190
- function nc(e,t){return new pa({check:`string_format`,format:`regex`,...G(t),pattern:e})}// @__NO_SIDE_EFFECTS__
191
- function rc(e){return new ma({check:`string_format`,format:`lowercase`,...G(e)})}// @__NO_SIDE_EFFECTS__
192
- function ic(e){return new ha({check:`string_format`,format:`uppercase`,...G(e)})}// @__NO_SIDE_EFFECTS__
193
- function ac(e,t){return new ga({check:`string_format`,format:`includes`,...G(t),includes:e})}// @__NO_SIDE_EFFECTS__
194
- function oc(e,t){return new _a({check:`string_format`,format:`starts_with`,...G(t),prefix:e})}// @__NO_SIDE_EFFECTS__
195
- function sc(e,t){return new va({check:`string_format`,format:`ends_with`,...G(t),suffix:e})}// @__NO_SIDE_EFFECTS__
196
- function cc(e){return new ya({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
197
- function lc(e){return/* @__PURE__ */ cc(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
198
- function uc(){return/* @__PURE__ */ cc(e=>e.trim())}// @__NO_SIDE_EFFECTS__
199
- function dc(){return/* @__PURE__ */ cc(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
200
- function fc(){return/* @__PURE__ */ cc(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
201
- function pc(){return/* @__PURE__ */ cc(e=>er(e))}// @__NO_SIDE_EFFECTS__
202
- function mc(e,t,n){return new e({type:`array`,element:t,...G(n)})}// @__NO_SIDE_EFFECTS__
203
- function hc(e,t,n){let r=G(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}// @__NO_SIDE_EFFECTS__
204
- function gc(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...G(n)})}// @__NO_SIDE_EFFECTS__
205
- function _c(e,t){let n=/* @__PURE__ */ vc(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(jr(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(jr(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
206
- function vc(e,t){let n=new na({check:`custom`,...G(t)});return n._zod.check=e,n}function yc(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Gn(e,t,n[t]);return e}function bc(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??ms,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 xc(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 Sc(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,Sc(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&yc(o.schema,c),t.io===`input`&&Mc(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 Cc(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function wc(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}/${Cc(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+Cc(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>
86
+ `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=Ot,c=!Cn.jitless,l=c&&kt.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?Yi([],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 Qi(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=>!Jt(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=>$t(e,r,wn())))}),t)}const $i=/*@__PURE__*/ F(`$ZodUnion`,(e,t)=>{I.init(e,t),P(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),P(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),P(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)))}),P(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=>ht(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=>Qi(t,r,e,i)):Qi(o,r,e,i)}}),ea=/*@__PURE__*/ F(`$ZodIntersection`,(e,t)=>{I.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])=>na(e,t,n)):na(e,i,a)}});function ta(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(At(e)&&At(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=ta(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=ta(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 na(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=ta(t.value,n.value);if(!c.valid){if(Jt(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const ra=/*@__PURE__*/ F(`$ZodEnum`,(e,t)=>{I.init(e,t);let n=lt(t.entries),r=new Set(n);e._zod.values=r,P(e,`pattern`,e=>{let t=lt(e.def.entries).filter(e=>Mt.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Nt(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}}),ia=/*@__PURE__*/ F(`$ZodTransform`,(e,t)=>{I.init(e,t),e._zod.optin=`optional`,Cn.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Sn(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 xn;return n.value=i,n}});function aa(e,t){return e.value=t.issues.length?void 0:t.value,e}const oa=/*@__PURE__*/ F(`$ZodOptional`,(e,t)=>{I.init(e,t),P(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,P(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),P(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ht(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=>aa(e,t)):aa(e,r)}return t.innerType._zod.run(e,n)}}),sa=/*@__PURE__*/ F(`$ZodExactOptional`,(e,t)=>{oa.init(e,t),P(e,`values`,e=>e.def.innerType._zod.values),P(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ca=/*@__PURE__*/ F(`$ZodNullable`,(e,t)=>{I.init(e,t),P(e,`optin`,e=>e.def.innerType._zod.optin),P(e,`optout`,e=>e.def.innerType._zod.optout),P(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ht(t.source)}|null)$`):void 0}),P(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)}),la=/*@__PURE__*/ F(`$ZodDefault`,(e,t)=>{I.init(e,t),e._zod.optin=`defaulted`,P(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=>ua(e,t)):ua(r,t)}});function ua(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const da=/*@__PURE__*/ F(`$ZodPrefault`,(e,t)=>{I.init(e,t),e._zod.optin=`defaulted`,P(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))}),fa=/*@__PURE__*/ F(`$ZodNonOptional`,(e,t)=>{I.init(e,t),P(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=>pa(t,e)):pa(i,e)}});function pa(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 ma(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>$t(e,r,wn()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const ha=/*@__PURE__*/ F(`$ZodCatch`,(e,t)=>{I.init(e,t),P(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),P(e,`optout`,e=>e.def.innerType._zod.optout),P(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=>ma(e,r,t,n)):ma(e,r,t,n)}}),ga=/*@__PURE__*/ F(`$ZodPipe`,(e,t)=>{I.init(e,t),P(e,`values`,e=>e.def.in._zod.values),P(e,`optin`,e=>e.def.in._zod.optin),P(e,`optout`,e=>e.def.out._zod.optout),P(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=>_a(e,t.in,n)):_a(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>_a(e,t.out,n)):_a(r,t.out,n)}});function _a(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 va=/*@__PURE__*/ F(`$ZodReadonly`,(e,t)=>{I.init(e,t),P(e,`propValues`,e=>e.def.innerType._zod.propValues),P(e,`values`,e=>e.def.innerType._zod.values),P(e,`optin`,e=>e.def.innerType?._zod?.optin),P(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(ya):ya(r)}});function ya(e){return e.memo||(e.value=Object.freeze(e.value)),e}const ba=/*@__PURE__*/ F(`$ZodCustom`,(e,t)=>{jr.init(e,t),I.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=>xa(t,n,r,e));xa(i,n,r,e)}});function xa(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(an(e))}}var Sa=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};const Ca=`~memo`,wa=[];function Ta(e){return typeof e==`object`&&!!e}function Ea(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const Da=/*@__PURE__*/ new WeakMap;function Oa(e,t,n){let r=Da.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=Oa(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?Oa(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=vt(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?Oa(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),ka(e,i)}function ka(e,t){return t!==1&&Da.set(e,t===2),t}function Aa(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let ja;const Ma=[],Na={alloc(e,t,n){let r=ja;if(!r)return n;ja=void 0;let i={value:n,issues:null};return r.set(t.value,i),Ma.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`&&Fa(n,e.value))throw new Sa;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=Oa(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(!Ta(l))return t(s,c);let u=c[Ca];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[Ca]=u);let d;i===c?d=a:(d=Aa(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(...Ea(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;ja=d;let p=Ma.length,m=t(s,c);ja=void 0;let h=Ma.length>p?Ma.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Ea(e.issues):wa),e)):(h&&(h.issues=m.issues.length?Ea(m.issues):wa),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Pa(){return Na}function Fa(e,t){let n=e[Ca]?.backEdges;return n!==void 0&&Ta(t)&&n.has(t)}const Ia=()=>{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(rn(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Ft(e.values[0])}`:`Invalid option: expected one of ${ut(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`:``}: ${ut(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 La(){return{localeError:Ia()}}var Ra,za=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 Ba(){return new za}(Ra=globalThis).__zod_globalRegistry??(Ra.__zod_globalRegistry=Ba());const Va=globalThis.__zod_globalRegistry;function Ha(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
87
+ function Ua(e,t){return new e(Ha({type:`string`,...N(t)}))}// @__NO_SIDE_EFFECTS__
88
+ function Wa(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
89
+ function Ga(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
90
+ function Ka(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
91
+ function qa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...N(t)})}// @__NO_SIDE_EFFECTS__
92
+ function Ja(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...N(t)})}// @__NO_SIDE_EFFECTS__
93
+ function Ya(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...N(t)})}// @__NO_SIDE_EFFECTS__
94
+ function Xa(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
95
+ function Za(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
96
+ function Qa(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
97
+ function $a(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
98
+ function eo(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
99
+ function to(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
100
+ function no(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
101
+ function ro(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
102
+ function io(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
103
+ function ao(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
104
+ function oo(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
105
+ function so(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
106
+ function co(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
107
+ function lo(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
108
+ function uo(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
109
+ function fo(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
110
+ function po(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...N(t)})}// @__NO_SIDE_EFFECTS__
111
+ function mo(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...N(t)})}// @__NO_SIDE_EFFECTS__
112
+ function ho(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...N(t)})}// @__NO_SIDE_EFFECTS__
113
+ function go(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...N(t)})}// @__NO_SIDE_EFFECTS__
114
+ function _o(e,t){return new e(Ha({type:`number`,checks:[],...N(t)}))}// @__NO_SIDE_EFFECTS__
115
+ function vo(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...N(t)})}// @__NO_SIDE_EFFECTS__
116
+ function yo(e,t){return new e({type:`boolean`,...N(t)})}// @__NO_SIDE_EFFECTS__
117
+ function bo(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
118
+ function xo(e,t){return new e({type:`never`,...N(t)})}// @__NO_SIDE_EFFECTS__
119
+ function So(e,t){return new Pr({check:`less_than`,...N(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
120
+ function Co(e,t){return new Pr({check:`less_than`,...N(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
121
+ function wo(e,t){return new Fr({check:`greater_than`,...N(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
122
+ function To(e,t){return new Fr({check:`greater_than`,...N(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
123
+ function Eo(e,t){return new Ir({check:`multiple_of`,...N(t),value:e})}// @__NO_SIDE_EFFECTS__
124
+ function Do(e,t){return new Rr({check:`max_length`,...N(t),maximum:e})}// @__NO_SIDE_EFFECTS__
125
+ function Oo(e,t){return new zr({check:`min_length`,...N(t),minimum:e})}// @__NO_SIDE_EFFECTS__
126
+ function ko(e,t){return new Br({check:`length_equals`,...N(t),length:e})}// @__NO_SIDE_EFFECTS__
127
+ function Ao(e,t){return new Hr({check:`string_format`,format:`regex`,...N(t),pattern:e})}// @__NO_SIDE_EFFECTS__
128
+ function jo(e){return new Ur({check:`string_format`,format:`lowercase`,...N(e)})}// @__NO_SIDE_EFFECTS__
129
+ function Mo(e){return new Wr({check:`string_format`,format:`uppercase`,...N(e)})}// @__NO_SIDE_EFFECTS__
130
+ function No(e,t){return new Gr({check:`string_format`,format:`includes`,...N(t),includes:e})}// @__NO_SIDE_EFFECTS__
131
+ function Po(e,t){return new Kr({check:`string_format`,format:`starts_with`,...N(t),prefix:e})}// @__NO_SIDE_EFFECTS__
132
+ function Fo(e,t){return new qr({check:`string_format`,format:`ends_with`,...N(t),suffix:e})}// @__NO_SIDE_EFFECTS__
133
+ function Io(e){return new Jr({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
134
+ function Lo(e){return/* @__PURE__ */ Io(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
135
+ function Ro(){return/* @__PURE__ */ Io(e=>e.trim())}// @__NO_SIDE_EFFECTS__
136
+ function zo(){return/* @__PURE__ */ Io(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
137
+ function Bo(){return/* @__PURE__ */ Io(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
138
+ function Vo(){return/* @__PURE__ */ Io(e=>Et(e))}// @__NO_SIDE_EFFECTS__
139
+ function Ho(e,t,n){return new e({type:`array`,element:t,...N(n)})}// @__NO_SIDE_EFFECTS__
140
+ function Uo(e,t,n){let r=N(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}// @__NO_SIDE_EFFECTS__
141
+ function Wo(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...N(n)})}// @__NO_SIDE_EFFECTS__
142
+ function Go(e,t){let n=/* @__PURE__ */ Ko(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(an(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(an(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
143
+ function Ko(e,t){let n=new jr({check:`custom`,...N(t)});return n._zod.check=e,n}function qo(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&_t(e,t,n[t]);return e}function Jo(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??Va,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 Yo(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 R(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,R(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&qo(o.schema,c),t.io===`input`&&z(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 Xo(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Zo(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}/${Xo(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+Xo(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>
207
144
 
208
- 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);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Tc(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;Tc(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 Ec=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Dc=[`oneOf`,`anyOf`];function Oc(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function kc(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Ec.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]??Oc(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Gn(n,r,e.length===1?e[0]:kc(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=Oc(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 Ac(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Ec)if(t in e)return;let n=t.filter(e=>Dc.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=kc(t);else{let e=n[0],i=Dc.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=>kc([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,yc(e,r))}function jc(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)):yc(i,s),yc(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())Tc(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)??[])Ac(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)}yc(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,Gn(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:Pc(t,`input`,e.processors),output:Pc(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Mc(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 Mc(r.element,n);if(r.type===`set`)return Mc(r.valueType,n);if(r.type===`lazy`)return Mc(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 Mc(r.innerType,n);if(r.type===`intersection`)return Mc(r.left,n)||Mc(r.right,n);if(r.type===`record`||r.type===`map`)return Mc(r.keyType,n)||Mc(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Mc(r.in,n)||Mc(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Mc(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Mc(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Mc(e,n))return!0;return!!(r.rest&&Mc(r.rest,n))}return!1}const Nc=(e,t={})=>n=>{let r=bc({...n,processors:t});return Sc(e,r),wc(r,e),jc(r,e)},Pc=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=bc({...i??{},target:a,io:t,processors:n});return Sc(e,o),wc(o,e),jc(o,e)},Fc=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Ic=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Lc=(e,t)=>{Fc(e,`minimum`,t),Ic(e,`maximum`,t)},Rc=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},zc=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},Bc=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Vc=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Hc=(e,t)=>Fc(e,`minimum`,t.minimum),Uc=(e,t)=>Ic(e,`maximum`,t.maximum),Wc=e=>(t,n)=>{Vc(t,n.format);let[r,i]=e[n.format];Fc(t,`minimum`,r),Ic(t,`maximum`,i)},Gc={greater_than:(e,t)=>Fc(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Ic(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Rc(e,t.value),number_format:Wc(dr),bigint_format:Wc(fr),min_length:Hc,max_length:Uc,length_equals:(e,t)=>Lc(e,t.length),min_size:Hc,max_size:Uc,size_equals:(e,t)=>Lc(e,t.size),string_format:(e,t)=>{Vc(e,t.format),t.pattern&&zc(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)=>Bc(e,t.mime)};function Kc(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Gc[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Fc(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Fc(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Ic(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Ic(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Rc(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Bc(t,i.mime);for(let e of i.patterns??[])zc(t,e);return t}const qc={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Jc=/* @__PURE__ */ new Map([[ro,Vi],[ao,Hi]]),Yc=e=>Jc.get(e)??e,Xc=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Kc(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=qc[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(Yc);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}))])}},Zc=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Kc(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)):xc(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}))])}},Qc=(e,t,n,r)=>{n.type=`boolean`},$c=(e,t,n,r)=>{n.not={}},el=(e,t,n,r)=>{let i=e._zod.def,a=Ln(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},tl=(e,t,n,r)=>{xc(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},nl=(e,t,n,r)=>{xc(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},rl=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Kc(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Sc(a.element,t,{...r,path:[...r.path,`items`]})};function il(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?il(t.out):t.type===`catch`?il(t.innerType):e._zod.optin}const al=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&xc(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Gn(i.properties,e,Sc(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`?il(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=Sc(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},ol=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Sc(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},sl=(e,t,n,r)=>{let i=e._zod.def,a=Sc(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Sc(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)},cl=(e,t,n,r)=>{let i=e._zod.def,a=Sc(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`}]},ll=(e,t,n,r)=>{let i=e._zod.def;Sc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ul=Symbol();function dl(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(xc(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),ul):JSON.parse(o)}const fl=(e,t,n,r)=>{let i=e._zod.def;Sc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=dl(i.defaultValue,e,t,n,r);o!==ul&&(n.default=o)},pl=(e,t,n,r)=>{let i=e._zod.def;Sc(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=dl(i.defaultValue,e,t,n,r);o!==ul&&(n._prefault=o)},ml=(e,t,n,r)=>{let i=e._zod.def;Sc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{xc(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},hl=(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;Sc(o,t,r);let s=t.seen.get(e);s.ref=o},gl=(e,t,n,r)=>{let i=e._zod.def;Sc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},_l=(e,t,n,r)=>{let i=e._zod.def;Sc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},vl=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function yl(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 bl=/*@__PURE__*/ Y(`ZodError`,(e,t)=>{ni.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);vl.has(n)||(vl.add(n),yl(n,`format`,e=>t=>ai(e,t)),yl(n,`flatten`,e=>t=>ii(e,t)),yl(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,zn,2)}),yl(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,zn,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),xl=/* @__PURE__ */ si(bl),Sl=/* @__PURE__ */ ci(bl),Cl=/* @__PURE__ */ li(bl),wl=/* @__PURE__ */ di(bl),Tl=/* @__PURE__ */ _i(bl),El=/* @__PURE__ */ vi(bl),Dl=/* @__PURE__ */ yi(bl),Ol=/* @__PURE__ */ bi(bl),kl=/* @__PURE__ */ xi(bl),Al=/* @__PURE__ */ Si(bl),jl=/* @__PURE__ */ Ci(bl),Ml=/* @__PURE__ */ wi(bl);function Nl(){Jr.localeError||Yr(us())}function Pl(){Jr.memoizer||Yr({memoizer:ss()})}const Fl=/*@__PURE__*/ Y(`ZodType`,(e,t)=>(Nl(),Sa.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Qn(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 cr(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Yu(e,t))},superRefine(e,t){return this.check(Xu(e,t))},overwrite(e){return this.check(/* @__PURE__ */ cc(e))},optional(){return Au(this)},exactOptional(){return Mu(this)},nullable(){return Pu(this)},nullish(){return Au(Pu(this))},nonoptional(e){return Bu(this,e)},array(){return vu(this)},or(e){return Su([this,e])},and(e){return wu(this,e)},transform(e){return Wu(this,Ou(e))},default(e){return Iu(this,e)},prefault(e){return Ru(this,e)},catch(e){return Hu(this,e)},pipe(e){return Wu(this,e)},readonly(){return Ku(this)},describe(e){let t=this.clone();return ms.add(t,{description:e}),t},meta(...e){if(e.length===0)return ms.get(this);let t=this.clone();return ms.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 Pr(this,`~standard`,{...Ta(this),jsonSchema:{input:Pc(this,`input`),output:Pc(this,`output`)}})},set"~standard"(e){Nr(this,`~standard`,e)},parse:function e(t,n){return xl(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Sl(this,t,n,{callee:e})},safeParse(e,t){return Cl(this,e,t)},async safeParseAsync(e,t){return wl(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Nr(this,`spa`,e)},validate(e,t){return mi(this,e,t)},validateAsync(e,t){return gi(this,e,t)},encode:function e(t,n){return Tl(this,t,n,{callee:e})},decode:function e(t,n){return El(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Dl(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Ol(this,t,n,{callee:e})},safeEncode(e,t){return kl(this,e,t)},safeDecode(e,t){return Al(this,e,t)},async safeEncodeAsync(e,t){return jl(this,e,t)},async safeDecodeAsync(e,t){return Ml(this,e,t)},toJSONSchema(e){return Nc(this,{})(e)},get description(){return ms.get(this)?.description},get _def(){return this._zod.def}}),Il=/*@__PURE__*/ Y(`_ZodString`,(e,t)=>{Ea.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xc(e,t,n,r)},/*@__PURE__*/ q({format:e=>Kc(e).format??null,minLength:e=>Kc(e).minimum??null,maxLength:e=>Kc(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ nc(...e))},includes(...e){return this.check(/* @__PURE__ */ ac(...e))},startsWith(...e){return this.check(/* @__PURE__ */ oc(...e))},endsWith(...e){return this.check(/* @__PURE__ */ sc(...e))},min(...e){return this.check(/* @__PURE__ */ ec(...e))},max(...e){return this.check(/* @__PURE__ */ $s(...e))},length(...e){return this.check(/* @__PURE__ */ tc(...e))},nonempty(...e){return this.check(/* @__PURE__ */ ec(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ rc(e))},uppercase(e){return this.check(/* @__PURE__ */ ic(e))},trim(){return this.check(/* @__PURE__ */ uc())},normalize(...e){return this.check(/* @__PURE__ */ lc(...e))},toLowerCase(){return this.check(/* @__PURE__ */ dc())},toUpperCase(){return this.check(/* @__PURE__ */ fc())},slugify(){return this.check(/* @__PURE__ */ pc())}})),Ll=/*@__PURE__*/ Y(`ZodString`,(e,t)=>{Ea.init(e,t),Il.init(e,t)},{email(e){return this.check(/* @__PURE__ */ _s(Hl,e))},url(e){return this.check(/* @__PURE__ */ Cs(Gl,e))},jwt(e){return this.check(/* @__PURE__ */ Rs(ou,e))},emoji(e){return this.check(/* @__PURE__ */ ws(Kl,e))},guid(e){return this.check(/* @__PURE__ */ vs(Ul,e))},uuid(e){return this.check(/* @__PURE__ */ ys(Wl,e))},uuidv4(e){return this.check(/* @__PURE__ */ bs(Wl,e))},uuidv6(e){return this.check(/* @__PURE__ */ xs(Wl,e))},uuidv7(e){return this.check(/* @__PURE__ */ Ss(Wl,e))},nanoid(e){return this.check(/* @__PURE__ */ Ts(ql,e))},cuid(e){return this.check(/* @__PURE__ */ Es(Jl,e))},cuid2(e){return this.check(/* @__PURE__ */ Ds(Yl,e))},ulid(e){return this.check(/* @__PURE__ */ Os(Xl,e))},base64(e){return this.check(/* @__PURE__ */ Fs(ru,e))},base64url(e){return this.check(/* @__PURE__ */ Is(iu,e))},xid(e){return this.check(/* @__PURE__ */ ks(Zl,e))},ksuid(e){return this.check(/* @__PURE__ */ As(Ql,e))},ipv4(e){return this.check(/* @__PURE__ */ js($l,e))},ipv6(e){return this.check(/* @__PURE__ */ Ms(eu,e))},cidrv4(e){return this.check(/* @__PURE__ */ Ns(tu,e))},cidrv6(e){return this.check(/* @__PURE__ */ Ps(nu,e))},e164(e){return this.check(/* @__PURE__ */ Ls(au,e))},datetime(e){return this.check(/* @__PURE__ */ zs(Rl,e))},date(e){return this.check(/* @__PURE__ */ Bs(zl,e))},time(e){return this.check(/* @__PURE__ */ Vs(Bl,e))},duration(e){return this.check(/* @__PURE__ */ Hs(Vl,e))}});function Z(e){return/* @__PURE__ */ gs(Ll,e)}const Q=/*@__PURE__*/ Y(`ZodStringFormat`,(e,t)=>{X.init(e,t),Il.init(e,t)}),Rl=/*@__PURE__*/ Y(`ZodISODateTime`,(e,t)=>{Ga.init(e,t),Q.init(e,t)}),zl=/*@__PURE__*/ Y(`ZodISODate`,(e,t)=>{Ka.init(e,t),Q.init(e,t)}),Bl=/*@__PURE__*/ Y(`ZodISOTime`,(e,t)=>{qa.init(e,t),Q.init(e,t)}),Vl=/*@__PURE__*/ Y(`ZodISODuration`,(e,t)=>{Ja.init(e,t),Q.init(e,t)}),Hl=/*@__PURE__*/ Y(`ZodEmail`,(e,t)=>{ka.init(e,t),Q.init(e,t)}),Ul=/*@__PURE__*/ Y(`ZodGUID`,(e,t)=>{Da.init(e,t),Q.init(e,t)}),Wl=/*@__PURE__*/ Y(`ZodUUID`,(e,t)=>{Oa.init(e,t),Q.init(e,t)}),Gl=/*@__PURE__*/ Y(`ZodURL`,(e,t)=>{La.init(e,t),Q.init(e,t)}),Kl=/*@__PURE__*/ Y(`ZodEmoji`,(e,t)=>{Ra.init(e,t),Q.init(e,t)}),ql=/*@__PURE__*/ Y(`ZodNanoID`,(e,t)=>{za.init(e,t),Q.init(e,t)}),Jl=/*@__PURE__*/ Y(`ZodCUID`,(e,t)=>{Ba.init(e,t),Q.init(e,t)}),Yl=/*@__PURE__*/ Y(`ZodCUID2`,(e,t)=>{Va.init(e,t),Q.init(e,t)}),Xl=/*@__PURE__*/ Y(`ZodULID`,(e,t)=>{Ha.init(e,t),Q.init(e,t)}),Zl=/*@__PURE__*/ Y(`ZodXID`,(e,t)=>{Ua.init(e,t),Q.init(e,t)}),Ql=/*@__PURE__*/ Y(`ZodKSUID`,(e,t)=>{Wa.init(e,t),Q.init(e,t)}),$l=/*@__PURE__*/ Y(`ZodIPv4`,(e,t)=>{Ya.init(e,t),Q.init(e,t)}),eu=/*@__PURE__*/ Y(`ZodIPv6`,(e,t)=>{Qa.init(e,t),Q.init(e,t)}),tu=/*@__PURE__*/ Y(`ZodCIDRv4`,(e,t)=>{$a.init(e,t),Q.init(e,t)}),nu=/*@__PURE__*/ Y(`ZodCIDRv6`,(e,t)=>{to.init(e,t),Q.init(e,t)}),ru=/*@__PURE__*/ Y(`ZodBase64`,(e,t)=>{io.init(e,t),Q.init(e,t)}),iu=/*@__PURE__*/ Y(`ZodBase64URL`,(e,t)=>{so.init(e,t),Q.init(e,t)}),au=/*@__PURE__*/ Y(`ZodE164`,(e,t)=>{co.init(e,t),Q.init(e,t)}),ou=/*@__PURE__*/ Y(`ZodJWT`,(e,t)=>{uo.init(e,t),Q.init(e,t)}),su=/*@__PURE__*/ Y(`ZodNumber`,(e,t)=>{fo.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zc(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ q({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Kc(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Kc(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Kc(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Kc(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ Xs(e,t))},gte(e,t){return this.check(/* @__PURE__ */ Zs(e,t))},min(e,t){return this.check(/* @__PURE__ */ Zs(e,t))},lt(e,t){return this.check(/* @__PURE__ */ Js(e,t))},lte(e,t){return this.check(/* @__PURE__ */ Ys(e,t))},max(e,t){return this.check(/* @__PURE__ */ Ys(e,t))},int(e){return this.check(uu(e))},safe(e){return this.check(uu(e))},positive(e){return this.check(/* @__PURE__ */ Xs(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ Zs(0,e))},negative(e){return this.check(/* @__PURE__ */ Js(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ Ys(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ Qs(e,t))},step(e,t){return this.check(/* @__PURE__ */ Qs(e,t))},finite(){return this}}));function cu(e){return/* @__PURE__ */ Us(su,e)}const lu=/*@__PURE__*/ Y(`ZodNumberFormat`,(e,t)=>{po.init(e,t),su.init(e,t)});function uu(e){return/* @__PURE__ */ Ws(lu,e)}const du=/*@__PURE__*/ Y(`ZodBoolean`,(e,t)=>{mo.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qc(e,t,n,r)});function fu(e){return/* @__PURE__ */ Gs(du,e)}const pu=/*@__PURE__*/ Y(`ZodUnknown`,(e,t)=>{ho.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function mu(){return/* @__PURE__ */ Ks(pu)}const hu=/*@__PURE__*/ Y(`ZodNever`,(e,t)=>{go.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$c(e,t,n,r)});function gu(e){return/* @__PURE__ */ qs(hu,e)}const _u=/*@__PURE__*/ Y(`ZodArray`,(e,t)=>{Pl(),vo.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rl(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ ec(e,t))},nonempty(e){return this.check(/* @__PURE__ */ ec(1,e))},max(e,t){return this.check(/* @__PURE__ */ $s(e,t))},length(e,t){return this.check(/* @__PURE__ */ tc(e,t))},unwrap(){return this.element}});function vu(e,t){return/* @__PURE__ */ mc(_u,e,t)}const yu=/*@__PURE__*/ Y(`ZodObject`,(e,t)=>{Pl(),wo.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>al(e,t,n,r),Br(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Eu(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Qn(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Qn(this._zod.def,{catchall:mu()}))},loose(){return this.clone(Qn(this._zod.def,{catchall:mu()}))},strict(){return this.clone(Qn(this._zod.def,{catchall:gu()}))},strip(){return this.clone(Qn(this._zod.def,{catchall:void 0}))},extend(e){return gr(this,e)},safeExtend(e){return vr(this,e)},merge(e){return yr(this,e)},pick(e){return pr(this,e)},omit(e){return hr(this,e)},partial(...e){return br(ku,this,e[0])},exactPartial(...e){return br(ju,this,e[0],`exactPartial`)},required(...e){return xr(zu,this,e[0])}});function $(e,t){let n={type:`object`,shape:e??{},...G(t)};return new yu(n)}function bu(e,t){return new yu({type:`object`,shape:e,catchall:gu(),...G(t)})}const xu=/*@__PURE__*/ Y(`ZodUnion`,(e,t)=>{Eo.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ol(e,t,n,r),e.options=t.options});function Su(e,t){return new xu({type:`union`,options:e,...G(t)})}const Cu=/*@__PURE__*/ Y(`ZodIntersection`,(e,t)=>{Do.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sl(e,t,n,r)});function wu(e,t){return new Cu({type:`intersection`,left:e,right:t})}const Tu=/*@__PURE__*/ Y(`ZodEnum`,(e,t)=>{Ao.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>el(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 Tu({...t,checks:[],...G(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 Tu({...t,checks:[],...G(r),entries:i})}});function Eu(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Tu({type:`enum`,entries:n,...G(t)})}const Du=/*@__PURE__*/ Y(`ZodTransform`,(e,t)=>{Pl(),jo.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nl(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new qr(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(jr(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(jr(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ou(e){return new Du({type:`transform`,transform:e})}const ku=/*@__PURE__*/ Y(`ZodOptional`,(e,t)=>{No.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_l(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Au(e){return new ku({type:`optional`,innerType:e})}const ju=/*@__PURE__*/ Y(`ZodExactOptional`,(e,t)=>{Po.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_l(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mu(e){return new ju({type:`optional`,innerType:e})}const Nu=/*@__PURE__*/ Y(`ZodNullable`,(e,t)=>{Fo.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pu(e){return new Nu({type:`nullable`,innerType:e})}const Fu=/*@__PURE__*/ Y(`ZodDefault`,(e,t)=>{Io.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Iu(e,t){return new Fu({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ar(t)}})}const Lu=/*@__PURE__*/ Y(`ZodPrefault`,(e,t)=>{Ro.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ru(e,t){return new Lu({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ar(t)}})}const zu=/*@__PURE__*/ Y(`ZodNonOptional`,(e,t)=>{zo.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ll(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bu(e,t){return new zu({type:`nonoptional`,innerType:e,...G(t)})}const Vu=/*@__PURE__*/ Y(`ZodCatch`,(e,t)=>{Ho.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ml(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Hu(e,t){return new Vu({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Vr(t)})}const Uu=/*@__PURE__*/ Y(`ZodPipe`,(e,t)=>{Uo.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hl(e,t,n,r),e.in=t.in,e.out=t.out});function Wu(e,t){return new Uu({type:`pipe`,in:e,out:t})}const Gu=/*@__PURE__*/ Y(`ZodReadonly`,(e,t)=>{Go.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ku(e){return new Gu({type:`readonly`,innerType:e})}const qu=/*@__PURE__*/ Y(`ZodCustom`,(e,t)=>{qo.init(e,t),Fl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tl(e,t,n,r)});function Ju(e,t){return/* @__PURE__ */ hc(qu,e??(()=>!0),t)}function Yu(e,t={}){return/* @__PURE__ */ gc(qu,e,t)}function Xu(e,t){return/* @__PURE__ */ _c(e,t)}function Zu(e){return{name:e.name,description:e.description,arguments:e.arguments,options:e.options,schema:e.schema,action:async(t,n)=>{await e.action(e.schema.parse(t),n)}}}function Qu(e){if(!/^[a-z][a-z0-9-]*$/.test(e.name))throw Error(`插件名须为 kebab-case(小写字母开头,仅小写字母/数字/连字符):${e.name}`);if(e.version.trim()===``)throw Error(`插件 ${e.name} 的 version 不得为空`);if(e.commands.length===0)throw Error(`插件 ${e.name} 须至少声明一个命令工厂`);return e}function $u(e){let t={},n=[];for(let r of e){let e=r.provides??{};for(let[i,a]of Object.entries(e)){if(i in t){n.push(`服务「${i}」被重复提供(${i} 已在册,${r.name} 重复声明)`);continue}t[i]=a}}for(let r of e){let e=r.consumes??[];for(let i of e)i in t||n.push(`插件「${r.name}」消费的服务「${i}」无提供方(在册服务:${Object.keys(t).join(`、`)||`无`})`)}return{services:t,errors:n}}function ed(e,t){let n={};for(let r of e.consumes??[])n[r]=t[r];return n}async function td(e,t){for(let n of e){let e=n[t];e!==void 0&&await e()}}var nd=class extends Error{entry;constructor(e,t){super(`外部插件「${e}」装载失败:${t}`),this.name=`PluginLoadError`,this.entry=e}};const rd=$({name:Z().regex(/^[a-z][a-z0-9-]*$/,`name 须为 kebab-case 非空字符串`),version:Z().min(1,`version 须为非空字符串`),commands:Ju(e=>Array.isArray(e)&&e.length>0&&e.every(e=>typeof e==`function`),`commands 须为非空的命令工厂函数数组`),provides:Ju(e=>typeof e==`object`&&!!e&&!Array.isArray(e),`provides 存在时须为对象(服务名 → API 对象)`).optional(),consumes:vu(Z()).optional(),hooks:Ju(e=>typeof e==`object`&&!!e&&Object.values(e).every(e=>e===void 0||typeof e==`function`),`hooks 存在时须为对象且各钩子为函数`).optional(),configSchema:Ju(e=>typeof e==`object`&&!!e&&`parse`in e,`configSchema 存在时须为具备 parse 方法的 zod schema`).optional()});function id(e,t){return e.startsWith(`./`)||e.startsWith(`../`)?c.resolve(t,e):e}function ad(e){return typeof e==`object`&&!!e&&`default`in e}async function od(e,t){let n=In(t,{interopDefault:!0}),r=id(e,t),i=await n.import(r).catch(t=>{throw new nd(e,`模块不可达(${t instanceof Error?t.message:String(t)})`)}),a=ad(i)?i.default:i,o=rd.safeParse(a);if(!o.success)throw new nd(e,o.error.issues.map(e=>e.message).join(`;`));return o.data}const sd=bu({name:Z().regex(/^[a-z][a-z0-9-]*$/,`name 须为 kebab-case 非空字符串`),status:Eu([`登记中`,`已发布`]),holdingRepo:Z().min(1,`holdingRepo 须为非空字符串(自持仓仓名)`),entryPackage:Z().min(1).optional(),version:Z().min(1).optional(),compatibleRange:Z().min(1).optional(),docs:Z().min(1).optional(),summary:Z().min(1,`summary 须为非空一句话职能`)}).refine(e=>e.status!==`已发布`||e.entryPackage!==void 0,{error:`已发布条目必须携带 entryPackage`,path:[`entryPackage`]}).refine(e=>e.status!==`已发布`||e.version!==void 0,{error:`已发布条目必须携带 version`,path:[`version`]}),cd=bu({category:Z().regex(/^[a-z][a-z0-9-]*$/,`category 须为 kebab-case 非空字符串`),names:vu(Z().regex(/^[a-z][a-z0-9-]*$/,`文档名须为 kebab-case 非空字符串`)).min(1,`names 须为非空数组`)}).refine(e=>new Set(e.names).size===e.names.length,{error:`names 不得重复`,path:[`names`]}),ld=bu({artifact:Z().min(1,`artifact 须为非空产物路径或形态描述`),mechanism:Z().min(1,`mechanism 须为非空生成机制描述`),handEdit:Eu([`禁手编`,`可手编`]),marker:Z().min(1).optional()}),ud=bu({path:Z().min(1,`path 须为非空仓内相对路径`)}),dd=bu({path:Z().min(1,`path 须为非空仓内相对路径`)}),fd=bu({path:Z().min(1,`path 须为非空仓内相对路径`),contains:Z().min(1,`contains 须为非空标记子串`)}),pd=bu({repo:Z().min(1,`repo 须为非空探针目标仓名`),requires:vu(ud).min(1).optional(),ifPresent:vu(dd).min(1).optional(),markerIn:vu(fd).min(1).optional()}).refine(e=>e.requires!==void 0||e.ifPresent!==void 0||e.markerIn!==void 0,{error:`探针至少须声明 requires / ifPresent / markerIn 之一`,path:[`requires`]}),md=bu({name:Z().regex(/^[a-z][a-z0-9-]*$/,`name 须为 kebab-case 非空字符串`),summary:Z().min(1,`summary 须为非空一句话职能`),status:Eu([`登记中`,`已确认`]),truthSource:bu({repo:Z().min(1,`repo 须为非空真源仓或仓族描述`),path:Z().min(1,`path 须为非空真源路径`)}),renders:vu(ld).min(1).optional(),distribution:Z().min(1).optional(),consumers:vu(Z().min(1)).min(1,`consumers 须为非空消费面清单`),probes:vu(pd).min(1).optional(),notes:Z().min(1).optional()}),hd=`registry`;$({id:Z(),name:Z().min(1,`分类名称不能为空`),slug:Z().min(1,`分类标识不能为空`),description:Z().nullable(),parentId:Z().nullable(),sortOrder:cu().int().min(0),createdAt:Z(),updatedAt:Z()}),$({id:Z(),docId:Z(),version:Z().min(1,`版本号不能为空`),content:Z(),createdAt:Z(),updatedAt:Z()});var gd=class extends Error{constructor(e,t){super(`glob 模式「${e}」非法:${t}`),this.name=`MiniGlobError`}};const _d=/* @__PURE__ */ new Set([`.`,`^`,`$`,`+`,`(`,`)`,`|`,`\\`,`]`]),vd=/* @__PURE__ */ new Map;function yd(e){return _d.has(e)?`\\${e}`:e}function bd(e,t){let n=``,r=0;for(;r<t.length;){let i=t[r]??``;if(i===`[`)throw new gd(e,`不支持字符类 [(与既有生态对齐,显式抛错不静默误配)`);if(i===`*`){let e=0;for(;(t[r+e]??``)===`*`;)e+=1;if(e>=2&&(t[r+e]??``)===`/`){n+=`(?:.*/)?`,r+=e+1;continue}if(e>=2){n+=`[\\s\\S]*`,r+=e;continue}n+=`[^/]*`,r+=1;continue}if(i===`?`){n+=`[^/]`,r+=1;continue}n+=yd(i),r+=1}return n}function xd(e,t){let n=t.indexOf(`{`);if(n===-1)return bd(e,t);let r=t.indexOf(`}`,n+1);if(r===-1)throw new gd(e,`大括号未闭合`);let i=t.slice(0,n),a=t.slice(n+1,r);if(a.includes(`{`))throw new gd(e,`不支持嵌套大括号`);let o=a.split(`,`),s=t.slice(r+1);return`(?:${o.map(t=>xd(e,`${i}${t}${s}`)).join(`|`)})`}function Sd(e){let t=vd.get(e);if(t!==void 0)return t;let n=RegExp(`^${xd(e,e)}$`);return vd.set(e,n),n}function Cd(e,t){return Sd(e).test(t)}function wd(e,t){return e.some(e=>Cd(e,t)||Cd(e,`${t}/`)||Cd(e,`${t}/**`))}function Td(e,t){return e.some(e=>Cd(e,t))}function Ed(e,t){return e.some(e=>e===``||t===e||t.startsWith(`${e}/`)||e.startsWith(`${t}/`))}function Dd(e,t){return e.some(e=>e===``||t.startsWith(`${e}/`))}const Od=/* @__PURE__ */ new Set([`.git`,`node_modules`,`dist`,`build`,`out`,`.turbo`,`coverage`,`.nyc_output`,`.lzi`]);function kd(e,t,n,i,o,s){if(!r(e)){if(o)throw Error(`扫描面目录缺失:${e}(严格模式防扫描面静默缩水)`);return}let c=a(e,{withFileTypes:!0}).sort((e,t)=>e.name.localeCompare(t.name));for(let r of c){let a=t===``?r.name:`${t}/${r.name}`;if(r.isDirectory()){if(Od.has(r.name)||wd(i,a)||!Ed(n,a))continue;kd(l(e,r.name),a,n,i,o,s);continue}if(r.isFile()){if(Td(i,a)||!Dd(n,a))continue;s.push(u.normalize(a))}}}function Ad(e,t,n={}){let r=[];return kd(e,``,t,n.excludeGlobs??[],!1,r),r.sort((e,t)=>e.localeCompare(t))}function jd(e,t={}){let n=[];return kd(e,``,[``],t.excludeGlobs??[],!0,n),n.sort((e,t)=>e.localeCompare(t))}function Md(e,t){if(t.kind===`numericPrefix`)return/^(\d+)(?=[-._ ]|$)/.exec(e)?.[1]??null;if(t.kind===`compositePrefix`)return RegExp(`^(\\d+(?:[-._ ]\\d+){${t.groups-1}})(?=[-._ ]|$)`).exec(e)?.[1]??null;if(t.kind===`numericSuffix`){let t=e.replace(/\.[^.]+$/,``);return/(\d+)$/.exec(t)?.[1]??null}return new RegExp(t.pattern).exec(e)?.groups?.key??null}function Nd(e){let t=/^\d+/.exec(e);return t===null?null:Number.parseInt(t[0]??``,10)}function Pd(e){let t=/* @__PURE__ */ new Set;for(let n of e.basenames){let r=Md(n,e.rule);r!==null&&t.add(r)}if(t.size===0)return{ok:!1,error:`该范围当前无编号文件,无法推断位数——请人工定号后落盘`};let n=``;for(let e of t)(Nd(e)??0)>(Nd(n)||0)&&(n=e);if(n===``)return{ok:!1,error:`该范围无数字前缀键,无法取号`};let r=n.length,i=new Set(e.reserved),a=0,o=0,s=(Nd(n)??0)+1;for(;;){let e=String(s).padStart(r,`0`);if(t.has(e)){a+=1,s+=1;continue}if(i.has(e)){o+=1,s+=1;continue}return{ok:!0,number:e,skippedOccupied:a,skippedReserved:o}}}function Fd(e){let t=/^\d+[-._ ](.+)\.[^.]+$/.exec(e);return t===null?null:t[1]??``}function Id(e,t){if(e.length!==t.length)return!1;let n=[...e].sort(),r=[...t].sort();return n.every((e,t)=>e===r[t])}function Ld(e){let t=[],n=/* @__PURE__ */ new Map;for(let t of e.basenames){let r=Md(t,e.rule);r!==null&&n.set(r,[...n.get(r)??[],t])}let r=new Map(e.reserved.map(e=>[e.number,e.reason])),i=/* @__PURE__ */ new Set;for(let[a,o]of n){if(o.length>=2){let n=e.allowlist.findIndex((t,n)=>!i.has(n)&&t.number===a&&Id(t.files,o.map(t=>e.toRepoRelative(t))));n===-1?t.push({kind:`duplicate`,scopeKey:e.scopeKey,message:`scope「${e.scopeKey}」编号 ${a} 撞号:${o.join(`、`)}——先入库者保号,后到线顺延清偿`}):i.add(n);continue}let n=r.get(a);n!==void 0&&t.push({kind:`reservedOccupied`,scopeKey:e.scopeKey,message:`scope「${e.scopeKey}」保留号 ${a} 被占用(${o.join(`、`)};保留理由:${n}——保留号不回收复用,请让号重编`})}if([...n.keys()].some(e=>e.length>1&&e.startsWith(`0`))){let r=new Set([...n.keys()].map(e=>e.length));r.size>1&&t.push({kind:`widthInconsistent`,scopeKey:e.scopeKey,message:`scope「${e.scopeKey}」零填充位数混用(族内键长 ${[...r].sort((e,t)=>e-t).join(`/`)}):${[...n.keys()].slice(0,6).join(`、`)}`})}e.allowlist.forEach((r,a)=>{if(i.has(a))return;let o=r.files.filter(e=>{let t=e.split(`/`).pop()??``;return(n.get(r.number)??[]).includes(t)});t.push({kind:`allowlistStale`,scopeKey:e.scopeKey,message:`scope「${e.scopeKey}」豁免条目(${r.number},${r.status})已无对应现行撞号组——棘轮只许缩短,须同步删除该条目(登记集:${r.files.join(`、`)};磁盘现状:${o.length>0?o.join(`、`):`无`})`})});let a=[];if(e.slugDigitPolicy!==`allow`)for(let n of e.basenames){let r=Fd(n);if(r===null||r===``||!/\d/.test(r))continue;let i=e.toRepoRelative(n);e.slugDigitAllowlist.some(e=>Cd(e,i)?(a.push(e),!0):!1)||t.push({kind:`slugContainsDigit`,scopeKey:e.scopeKey,message:`scope「${e.scopeKey}」slug 段含数字:${n}(白名单登记请到配置 slugDigitAllowlist,逐条带理由)`})}return{findings:t,slugDigitAllowlistHits:a}}function Rd(e){let t=[];for(let n of e.allowlist)e.hits.has(n)||t.push({kind:`slugDigitAllowlistStale`,scopeKey:`global`,message:`slug 白名单条目「${n}」在启用域内已匹配不到任何文件——棘轮只许缩短,须同步删除该条目`});return t}function zd(e){let t=[],n=new RegExp(e.numberishPattern),r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Set;for(let t of e.files){let a=t.split(`/`).pop()??``;if(!n.test(a)||e.registryDirs.some(e=>t===e||t.startsWith(`${e}/`))||e.pending.find(e=>Cd(e.glob,t)?(i.add(e.glob),!0):!1)!==void 0)continue;let o=t.split(`/`).slice(0,-1).join(`/`);r.set(o,[...r.get(o)??[],a])}for(let e of[...r.keys()].sort((e,t)=>e.localeCompare(t)))t.push({kind:`coverageGap`,message:`未登记编号区:目录 ${e===``?`(仓库根)`:e} 有 ${r.get(e)?.length??0} 个编号文件未被任何 scope/pending 覆盖——${(r.get(e)??[]).join(`、`)}(请在 numbering 插件配置登记 scope 或 pending 并注明理由)`});for(let n of e.pending)i.has(n.glob)||t.push({kind:`pendingStale`,message:`pending 条目「${n.glob}」已匹配不到任何编号文件——棘轮只许缩短,须同步删除该条目(登记理由:${n.reason})`});return t}const Bd={kind:`numericPrefix`};function Vd(e,t){return Ad(e,[t]).map(e=>e.split(`/`).pop()??``)}function Hd(e){let t=e.scopeKey!==void 0&&e.dirRel!==void 0,n=e.scopeKey===void 0&&e.dirRel===void 0;if(t||n)return{ok:!1,error:`取号须且仅须指定 --scope <key> 或 --dir <目录> 之一`};if(e.scopeKey!==void 0){let t=e.config.scopes.find(t=>t.key===e.scopeKey);if(t===void 0)return{ok:!1,error:`scope「${e.scopeKey}」未登记(请在 numbering 插件配置注册)`};let n=Pd({basenames:Vd(e.root,t.registryDir),rule:Bd,reserved:t.numbering.reserved.map(e=>e.number)});return n.ok?{ok:!0,number:n.number,target:t.key,skippedOccupied:n.skippedOccupied,skippedReserved:n.skippedReserved}:n}let r=e.config.scopes.filter(t=>t.registryDir===e.dirRel);if(r.length===0)return{ok:!1,error:`目录「${e.dirRel}」未登记为任何 scope 的注册表(请在 numbering 插件配置注册后再取号)`};let i=[...new Set(r.flatMap(e=>e.numbering.reserved.map(e=>e.number)))],a=Pd({basenames:Vd(e.root,e.dirRel??``),rule:Bd,reserved:i});return a.ok?{ok:!0,number:a.number,target:e.dirRel??``,skippedOccupied:a.skippedOccupied,skippedReserved:a.skippedReserved}:a}function Ud(e){let t=e.dirRel===void 0?e.config.scopes:e.config.scopes.filter(t=>t.registryDir===e.dirRel),n=[],r=0,i=e.config.slugDigitAllowlist.map(e=>e.glob),a=/* @__PURE__ */ new Set;for(let o of t){let t=Vd(e.root,o.registryDir);r+=t.length;let s=e.dirRel===void 0?e.config.numbering.allowlist.filter(e=>e.scopeKey===o.key).map(e=>({...e,files:[...e.files]})):e.config.numbering.allowlist.filter(t=>t.scopeKey===o.key&&t.files.some(t=>t.startsWith(`${e.dirRel}/`))).map(e=>({...e,files:[...e.files]})),c=Ld({scopeKey:o.key,basenames:t,rule:Bd,reserved:o.numbering.reserved,allowlist:s,slugDigitPolicy:o.slugDigitPolicy,slugDigitAllowlist:i,toRepoRelative:e=>`${o.registryDir}/${e}`});n.push(...c.findings);for(let e of c.slugDigitAllowlistHits)a.add(e)}return e.dirRel===void 0&&n.push(...Rd({allowlist:i,hits:a})),{findings:n,scopeCount:t.length,scannedFiles:r}}function Wd(e){let t=[];for(let n of e.config.numbering.audit.roots)t.push(...jd(l(e.root,n),{excludeGlobs:e.config.numbering.globalExclusions.map(e=>e.glob)}).map(e=>n===``?e:`${n}/${e}`));return{findings:zd({files:t,numberishPattern:e.config.numbering.audit.numberishPattern,registryDirs:e.config.scopes.map(e=>e.registryDir),pending:e.config.numbering.audit.pending}),scannedFiles:t.length}}const Gd=`^\\d{1,4}[-._]`,Kd=[`docs`],qd=/^[a-z][a-z0-9-]*$/,Jd=/^\d+$/,Yd=$({number:Z().regex(Jd),reason:Z().min(1)}),Xd=$({glob:Z().min(1),reason:Z().min(1)}),Zd=$({key:Z().regex(qd),title:Z().min(1),paths:vu(Z().min(1)).min(1),registryDir:Z().min(1),numbering:$({reserved:vu(Yd)}).default({reserved:[]}),slugDigitPolicy:Eu([`forbid`,`allow`]).optional()}),Qd=$({allowlist:vu($({scopeKey:Z().min(1),number:Z().regex(Jd),files:vu(Z().min(1)).min(2),status:Eu([`待清偿`,`维持现状`]),reason:Z().min(1)})).default([]),globalExclusions:vu(Xd).default([]),audit:$({roots:vu(Z().min(1)).min(1).default([...Kd]),numberishPattern:Z().min(1).default(Gd),pending:vu(Xd).default([])}).default({roots:[...Kd],numberishPattern:Gd,pending:[]})}),$d=$({scopes:vu(Zd).min(1),numbering:Qd.default({allowlist:[],globalExclusions:[],audit:{roots:[...Kd],numberishPattern:Gd,pending:[]}}),slugDigitAllowlist:vu(Xd).default([])});function ef(e){let t=$d.safeParse(e);if(!t.success)throw Error(`numbering 插件配置非法:${t.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}——${e.message}`).join(`;`)}`);return t.data}const tf=$({scope:Z().min(1),dir:Z().min(1).optional()}),nf=$({dir:Z().min(1).optional()}),rf=$({});function af(e){return ef(e)}const of=Qu({name:`numbering`,version:`0.0.1`,configSchema:$d,provides:{numbering:{next:e=>Hd(e)}},commands:[e=>sf(e),e=>cf(e),e=>lf(e)]});function sf(e){return Zu({name:`numbering-next`,description:`取号:max+1 顺延跳已占与保留,宽度随最大键`,options:[{flags:`--scope <key>`,description:`scope key`},{flags:`--dir <dir>`,description:`目录增量定向(可选)`}],schema:tf,action:async t=>{let n=af(e.pluginConfig),r=Hd({root:process.cwd(),config:n,scopeKey:t.scope});if(r.ok){process.stdout.write(`${JSON.stringify(r,null,2)}\n`);return}process.stderr.write(`错误: ${r.error}\n`),process.exit(1)}})}function cf(e){return Zu({name:`numbering-check`,description:`编号违例判定:撞号、保留号占用、零填充混用、豁免陈旧、slug 数字策略`,options:[{flags:`--dir <dir>`,description:`目录增量定向(可选)`}],schema:nf,action:async t=>{let n=af(e.pluginConfig),r=Ud({root:process.cwd(),config:n,dirRel:t.dir});for(let e of r.findings)process.stderr.write(`[numbering:${e.kind}] ${e.message}\n`);r.findings.length>0&&process.exit(1)}})}function lf(e){return Zu({name:`numbering-audit`,description:`覆盖面审计:形似编号文件必须被 scope、排除、pending 之一覆盖`,schema:rf,action:async()=>{let t=af(e.pluginConfig),n=Wd({root:process.cwd(),config:t});for(let e of n.findings)process.stderr.write(`[numbering:${e.kind}] ${e.message}\n`);n.findings.length>0&&process.exit(1)}})}async function uf(e){let t=c.join(e,`lzi-docs.config.ts`),n=await In(e,{interopDefault:!0}).import(t);return{source:n.source??`git@gitcode.com:longzai-tech/longzai-intelligence-docs.git`,namespace:n.namespace??`longzai-intelligence`,base:n.base??`docs`,docs:n.docs,packages:n.packages,plugins:n.plugins}}async function df(e){try{return await uf(e)}catch(e){if(e instanceof Error&&e.message.includes(`lzi-docs.config.ts`))return;throw e}}async function ff(e,t,n){let r=[],i=[...t],a=Object.fromEntries(Object.entries(n?.plugins??{}).filter(([,e])=>e.entry===void 0).map(([e,t])=>[e,t.options])),o=new Set(i.map(e=>e.name));for(let[t,s]of Object.entries(n?.plugins??{}))if(s.enabled!==!1){if(o.has(t)){if(s.entry===void 0)continue;r.push(`插件名「${t}」与已装载插件重名(内置或先装载者保留,如需覆盖请移除内置声明)`);continue}try{let t=await od(s.entry,e);i.push(t),o.add(t.name),a[t.name]=s.options}catch(e){let n=e instanceof Error?e.message:String(e);r.push(`插件「${t}」装载失败:${n}`)}}return{plugins:i,pluginOptions:a,errors:r}}function pf(e,t,n){let{services:r,errors:i}=$u(t);if(i.length>0)return i;let a=t.map(e=>e.hooks??{});for(let i of t){let t;if(i.configSchema!==void 0){let e=i.configSchema.safeParse(n[i.name]);e.success||(t=e.error.issues.map(e=>e.message).join(`;`))}if(t!==void 0)return[`插件「${i.name}」配置节校验失败:${t}`];let o={services:ed(i,r),pluginConfig:n[i.name],allHooks:a};for(let t of i.commands)ut(e,t(o))}return[]}function mf(e,t){let n=[],r=new Map(t.map(e=>[e.category,new Set(e.names)]));for(let[t,i]of Object.entries(e??{})){let e=r.get(t);if(e===void 0){n.push(`${t}/*(目录中无此分类)`);continue}for(let r of Object.keys(i))e.has(r)||n.push(`${t}/${r}`)}return n}function hf(e,t){let r=[];for(let i of t){let t;try{t=new Set(n.readdirSync(c.join(e,`library`,i.category),{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name))}catch{r.push(`${i.category}/*(library 下无此分类目录)`);continue}for(let e of i.names)t.has(e)||r.push(`${i.category}/${e}(library 缺此目录)`);for(let e of t)i.names.includes(e)||r.push(`${i.category}/${e}(library 有而目录未登记)`)}return r}const gf=/^([a-z][a-z0-9-]*)\.plugin\.ts$/,_f=/^([a-z][a-z0-9-]*)\.docs\.ts$/,vf=/^([a-z][a-z0-9-]*)\.source\.ts$/;function yf(e){let t=c.join(e,hd);try{return a(t),t}catch{return null}}function bf(e){let t=process.env.LZI_DOCS_REGISTRY_ROOT;if(t!==void 0&&t.trim()!==``&&yf(t)!==null)return t;let n=e;for(;;){let e=c.join(n,`longzai-intelligence-docs-registry`);if(yf(e)!==null)return e;let t=c.dirname(n);if(t===n)return null;n=t}}function xf(e,t,n){try{return a(c.join(e,hd,t)).filter(e=>n.test(e)).sort()}catch{return[]}}async function Sf(e){let t=xf(e,`plugins`,gf),n=xf(e,`docs`,_f),r=xf(e,`sources`,vf);if(t.length===0&&n.length===0&&r.length===0)throw Error(`docs-registry 声明域为空(${e})——至少须有一个插件登记档、目录档或真源档`);let i=[];for(let n of t){let t=gf.exec(n)?.[1]??``,r=await wf(c.join(e,hd,`plugins`,n)),a=sd.safeParse(r);if(!a.success)throw Error(`插件登记档 ${n} 非法:${a.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}——${e.message}`).join(`;`)}`);if(a.data.name!==t)throw Error(`插件登记档 ${n} 的 name「${a.data.name}」与文件名不符`);i.push(a.data)}let a=[];for(let t of n){let n=_f.exec(t)?.[1]??``,r=await wf(c.join(e,hd,`docs`,t)),i=cd.safeParse(r);if(!i.success)throw Error(`文档目录档 ${t} 非法:${i.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}——${e.message}`).join(`;`)}`);if(i.data.category!==n)throw Error(`文档目录档 ${t} 的 category「${i.data.category}」与文件名不符`);a.push(i.data)}let o=[];for(let t of r){let n=vf.exec(t)?.[1]??``,r=await wf(c.join(e,hd,`sources`,t)),i=md.safeParse(r);if(!i.success)throw Error(`真源登记档 ${t} 非法:${i.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}——${e.message}`).join(`;`)}`);if(i.data.name!==n)throw Error(`真源登记档 ${t} 的 name「${i.data.name}」与文件名不符`);o.push(i.data)}if(new Set(i.map(e=>e.name)).size!==i.length)throw Error(`docs-registry 插件登记名重复`);if(new Set(a.map(e=>e.category)).size!==a.length)throw Error(`docs-registry 文档分类名重复`);if(new Set(o.map(e=>e.name)).size!==o.length)throw Error(`docs-registry 真源登记名重复`);return{root:e,plugins:i,docCategories:a,sources:o}}async function Cf(e){let t=bf(e);return t===null?null:Sf(t)}async function wf(e){let t=await import(d(o(e)).href);return Tf(t)?t.default:t}function Tf(e){return typeof e==`object`&&!!e&&`default`in e}const Ef=`lzi-docs.lock`;function Df(e){let t=c.join(e,Ef);if(!n.existsSync(t))return null;let r=n.readFileSync(t,`utf-8`),i=JSON.parse(r);if(!Of(i))throw Error(`lzi-docs.lock 内容非法(期望:包路径 -> 文档类型/名称 -> 版本字符串)`);return i}function Of(e){return typeof e!=`object`||!e?!1:Object.values(e).every(e=>typeof e!=`object`||!e?!1:Object.values(e).every(e=>typeof e==`string`))}function kf(e,t){let r=c.join(e,Ef),i=Af(t);n.writeFileSync(r,JSON.stringify(i,null,2)+`
209
- `,`utf-8`)}function Af(e){let t={};for(let n of e){let e=Mf(n.dest),r=`${n.category}/${n.name}`;t[e]||(t[e]={}),t[e][r]=n.version}return t}function jf(e,t){if(!t)return{added:e,removed:[],changed:[]};let n=[],r=[],i=[],a=/* @__PURE__ */ new Map;for(let t of e){let e=`${Mf(t.dest)}::${t.category}/${t.name}`;a.set(e,t)}let o=/* @__PURE__ */ new Map;for(let[e,n]of Object.entries(t))for(let[t,r]of Object.entries(n)){let n=`${e}::${t}`,[i=``,a=``]=t.split(`/`);o.set(n,{packagePath:e,category:i,name:a,version:r})}for(let[e,t]of a){let r=o.get(e);r?r.version!==t.version&&i.push(t):n.push(t)}for(let[e,t]of o)a.has(e)||r.push({category:t.category,name:t.name,version:t.version,dest:``});return{added:n,removed:r,changed:i}}function Mf(e){let t=e.split(c.sep),[n=``,r=``]=t;return t.length>=2&&n===`packages`?c.join(n,r):`.`}const Nf={docs:{standards:{nextjs:`1.1.0`,tsconfig:`1.0.0`}}},Pf={docs:{standards:{react:`2.0.0`,tsconfig:`1.0.0`}}},Ff={docs:{standards:{tsconfig:`1.0.0`},guides:{"code-review":`1.0.0`}}};var If=/* @__PURE__ */ D({nextjs:()=>Nf,node:()=>Ff,react:()=>Pf});function Lf(e){return typeof e==`object`&&!!e&&`docs`in e&&typeof e.docs==`object`}const Rf=Object.fromEntries(Object.entries(If).filter(([,e])=>Lf(e)));function zf(e,t){let n={...e};for(let r of Object.keys(t)){let i=t[r];i&&(n[r]={...e[r],...i})}return n}function Bf(e){return e.packages||e.docs,e}function Vf(e){let t={};for(let n of e){let e=Rf[n];e?.docs&&(t=zf(t,e.docs))}return t}async function Hf(e){if(!e)throw Error(`未配置 source`);let r=c.isAbsolute(e)?e:c.resolve(e);if(n.existsSync(r))return r;let i=c.join(t.tmpdir(),`lzi-docs-cache`);n.existsSync(i)||n.mkdirSync(i,{recursive:!0});let a=Uf(e),o=c.join(i,a);if(n.existsSync(o)){let{execSync:e}=await import(`node:child_process`);e(`git pull`,{cwd:o,stdio:`pipe`})}else{let{execSync:t}=await import(`node:child_process`);t(`git clone ${e} ${o}`,{stdio:`pipe`})}return o}function Uf(e){return`lzi-docs-${c.basename(e,`.git`)}`}var Wf=/* @__PURE__ */ E(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||
210
- /* istanbul ignore next */9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),Gf=/* @__PURE__ */ E(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),Kf=/* @__PURE__ */ E(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Wf(),a=Gf();e=t.exports={};let o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),qf=/* @__PURE__ */ E(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),Jf=/* @__PURE__ */ E(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),Yf=/* @__PURE__ */ E(((e,t)=>{let n=Gf(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=Wf(),{safeRe:a,t:o}=Kf(),s=qf(),{compareIdentifiers:c}=Jf(),l=(e,t)=>{let n=t.split(`.`);if(n.length>e.length)return!1;for(let t=0;t<n.length;t++)if(c(e[t],n[t])!==0)return!1;return!0};t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=l[4]?l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):[],this.build=l[5]?l[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}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),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(t){if(t instanceof e||(t=new e(t,this.options)),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 r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,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 r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];if(n===!1&&(r=[t]),l(this.prerelease,t)){let e=this.prerelease[t.split(`.`).length];isNaN(e)&&(this.prerelease=r)}else this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),Xf=/* @__PURE__ */ E(((e,t)=>{let n=Yf();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),Zf=/* @__PURE__ */ E(((e,t)=>{let n=Xf();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),Qf=/* @__PURE__ */ E(((e,t)=>{let n=Xf();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),$f=/* @__PURE__ */ E(((e,t)=>{let n=Yf();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),ep=/* @__PURE__ */ E(((e,t)=>{let n=Xf();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),tp=/* @__PURE__ */ E(((e,t)=>{let n=Yf();t.exports=(e,t)=>new n(e,t).major})),np=/* @__PURE__ */ E(((e,t)=>{let n=Yf();t.exports=(e,t)=>new n(e,t).minor})),rp=/* @__PURE__ */ E(((e,t)=>{let n=Yf();t.exports=(e,t)=>new n(e,t).patch})),ip=/* @__PURE__ */ E(((e,t)=>{let n=Xf();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),ap=/* @__PURE__ */ E(((e,t)=>{let n=Yf();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),op=/* @__PURE__ */ E(((e,t)=>{let n=ap();t.exports=(e,t,r)=>n(t,e,r)})),sp=/* @__PURE__ */ E(((e,t)=>{let n=ap();t.exports=(e,t)=>n(e,t,!0)})),cp=/* @__PURE__ */ E(((e,t)=>{let n=Yf();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),lp=/* @__PURE__ */ E(((e,t)=>{let n=cp();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),up=/* @__PURE__ */ E(((e,t)=>{let n=cp();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),dp=/* @__PURE__ */ E(((e,t)=>{let n=ap();t.exports=(e,t,r)=>n(e,t,r)>0})),fp=/* @__PURE__ */ E(((e,t)=>{let n=ap();t.exports=(e,t,r)=>n(e,t,r)<0})),pp=/* @__PURE__ */ E(((e,t)=>{let n=ap();t.exports=(e,t,r)=>n(e,t,r)===0})),mp=/* @__PURE__ */ E(((e,t)=>{let n=ap();t.exports=(e,t,r)=>n(e,t,r)!==0})),hp=/* @__PURE__ */ E(((e,t)=>{let n=ap();t.exports=(e,t,r)=>n(e,t,r)>=0})),gp=/* @__PURE__ */ E(((e,t)=>{let n=ap();t.exports=(e,t,r)=>n(e,t,r)<=0})),_p=/* @__PURE__ */ E(((e,t)=>{let n=pp(),r=mp(),i=dp(),a=hp(),o=fp(),s=gp();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),vp=/* @__PURE__ */ E(((e,t)=>{let n=Yf(),r=Xf(),{safeRe:i,t:a}=Kf();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2],c=o[3]||`0`,l=o[4]||`0`,u=t.includePrerelease&&o[5]?`-${o[5]}`:``,d=t.includePrerelease&&o[6]?`+${o[6]}`:``;return r(`${s}.${c}.${l}${u}${d}`,t)}})),yp=/* @__PURE__ */ E(((e,t)=>{let n=Xf(),r=Wf(),i=Yf(),a=(e,t,n)=>{if(!r.RELEASE_TYPES.includes(t))return null;let i=o(e,n);return i&&s(i,t)},o=(e,t)=>{let r=e instanceof i?e.version:e;return n(r,t)},s=(e,t)=>{if(c(t))return e.version;switch(e.prerelease=[],t){case`major`:e.minor=0,e.patch=0;break;case`minor`:e.patch=0}return e.format()},c=e=>e.startsWith(`pre`);t.exports=a})),bp=/* @__PURE__ */ E(((e,t)=>{t.exports=class{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;this.delete(e)}this.map.set(e,t)}return this}}})),xp=/* @__PURE__ */ E(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)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=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!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=>!_(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&&v(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}parseRange(e){e=e.replace(g,``);let t=((this.options.includePrerelease&&m)|(this.options.loose&&h))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(s,A(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[u.COMPARATORTRIM],d),o(`comparator trim`,e),e=e.replace(c[u.TILDETRIM],f),o(`tilde trim`,e),e=e.replace(c[u.CARETTRIM],p),o(`caret trim`,e);let l=e.split(` `).map(e=>b(e,this.options)).join(` `).split(/\s+/).map(e=>k(e,this.options));i&&(l=l.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[u.COMPARATORLOOSE])))),o(`range list`,l);let v=/* @__PURE__ */ new Map,y=l.map(e=>new a(e,this.options));for(let e of y){if(_(e))return[e];v.set(e.value,e)}v.size>1&&v.has(``)&&v.delete(``);let x=[...v.values()];return r.set(t,x),x}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>y(e,n)&&t.set.some(t=>y(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(j(this.set[t],e,this.options))return!0;return!1}};let r=new(bp()),i=qf(),a=Sp(),o=Gf(),s=Yf(),{safeRe:c,src:l,t:u,comparatorTrimReplace:d,tildeTrimReplace:f,caretTrimReplace:p}=Kf(),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:h}=Wf(),g=new RegExp(l[u.BUILD],`g`),_=e=>e.value===`<0.0.0-0`,v=e=>e.value===``,y=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},b=(e,t)=>(e=e.replace(c[u.BUILD],``),o(`comp`,e,t),e=T(e,t),o(`caret`,e),e=C(e,t),o(`tildes`,e),e=D(e,t),o(`xrange`,e),e=O(e,t),o(`stars`,e),e),x=e=>!e||e.toLowerCase()===`x`||e===`*`,S=(e,t,n)=>x(e)&&!x(t)||x(t)&&n&&!x(n),C=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(` `),w=(e,t)=>{let n=t.loose?c[u.TILDELOOSE]:c[u.TILDE],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`tilde`,e,t,n,i,a,s);let c;return x(n)?c=``:x(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:x(a)?c=`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:s?(o(`replaceTilde pr`,s),c=`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`):c=`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`,o(`tilde return`,c),c})},T=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(` `),E=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[u.CARETLOOSE]:c[u.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return x(n)?c=``:x(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:x(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},D=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>ee(e,t)).join(` `)),ee=(e,t)=>{e=e.trim();let n=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{if(o(`xRange`,e,n,r,i,a,s,c),S(i,a,s))return e;let l=x(i),u=l||x(a),d=u||x(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},O=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[u.STAR],``)),k=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],``)),A=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=x(r)?``:x(i)?`>=${r}.0.0${e?`-0`:``}`:x(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=x(l)?``:x(u)?`<${+l+1}.0.0-0`:x(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),j=(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++)if(o(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),Sp=/* @__PURE__ */ E(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.value=this.semver===n?``:this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),this.semver=r[2]?new c(r[2],this.options.loose):n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new l(t.value,n).test(this.value):t.operator===``?t.value===``||new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.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.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=qf(),{safeRe:i,t:a}=Kf(),o=_p(),s=Gf(),c=Yf(),l=xp()})),Cp=/* @__PURE__ */ E(((e,t)=>{let n=xp();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),wp=/* @__PURE__ */ E(((e,t)=>{let n=xp();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),Tp=/* @__PURE__ */ E(((e,t)=>{let n=Yf(),r=xp();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),Ep=/* @__PURE__ */ E(((e,t)=>{let n=Yf(),r=xp();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),Dp=/* @__PURE__ */ E(((e,t)=>{let n=Yf(),r=xp(),i=dp();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;
145
+ 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 Qo(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;Qo(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`]),es=[`oneOf`,`anyOf`];function ts(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function ns(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]??ts(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}_t(n,r,e.length===1?e[0]:ns(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=ts(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 rs(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=>es.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=ns(t);else{let e=n[0],i=es.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=>ns([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,qo(e,r))}function is(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)):qo(i,s),qo(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())Qo(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)??[])rs(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)}qo(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,_t(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:os(t,`input`,e.processors),output:os(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function z(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 z(r.element,n);if(r.type===`set`)return z(r.valueType,n);if(r.type===`lazy`)return z(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 z(r.innerType,n);if(r.type===`intersection`)return z(r.left,n)||z(r.right,n);if(r.type===`record`||r.type===`map`)return z(r.keyType,n)||z(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:z(r.in,n)||z(r.out,n);if(r.type===`object`){for(let e in r.shape)if(z(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(z(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(z(e,n))return!0;return!!(r.rest&&z(r.rest,n))}return!1}const as=(e,t={})=>n=>{let r=Jo({...n,processors:t});return R(e,r),Zo(r,e),is(r,e)},os=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Jo({...i??{},target:a,io:t,processors:n});return R(e,o),Zo(o,e),is(o,e)},ss=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},cs=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},ls=(e,t)=>{ss(e,`minimum`,t),cs(e,`maximum`,t)},us=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},ds=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},fs=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},ps=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},ms=(e,t)=>ss(e,`minimum`,t.minimum),hs=(e,t)=>cs(e,`maximum`,t.maximum),gs=e=>(t,n)=>{ps(t,n.format);let[r,i]=e[n.format];ss(t,`minimum`,r),cs(t,`maximum`,i)},_s={greater_than:(e,t)=>ss(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>cs(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>us(e,t.value),number_format:gs(Lt),bigint_format:gs(Rt),min_length:ms,max_length:hs,length_equals:(e,t)=>ls(e,t.length),min_size:ms,max_size:hs,size_equals:(e,t)=>ls(e,t.size),string_format:(e,t)=>{ps(e,t.format),t.pattern&&ds(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)=>fs(e,t.mime)};function vs(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)_s[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&ss(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&ss(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&cs(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&cs(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&us(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&fs(t,i.mime);for(let e of i.patterns??[])ds(t,e);return t}const ys={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},bs=/* @__PURE__ */ new Map([[ji,gr],[Ni,_r]]),xs=e=>bs.get(e)??e,Ss=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=vs(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ys[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(xs);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}))])}},Cs=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=vs(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)):Yo(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}))])}},ws=(e,t,n,r)=>{n.type=`boolean`},Ts=(e,t,n,r)=>{n.not={}},Es=(e,t,n,r)=>{let i=e._zod.def,a=lt(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)},Ds=(e,t,n,r)=>{Yo(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Os=(e,t,n,r)=>{Yo(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},ks=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=vs(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=R(a.element,t,{...r,path:[...r.path,`items`]})};function As(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?As(t.out):t.type===`catch`?As(t.innerType):e._zod.optin}const js=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Yo(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)_t(i.properties,e,R(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`?As(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=R(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ms=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>R(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ns=(e,t,n,r)=>{let i=e._zod.def,a=R(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=R(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)},Ps=(e,t,n,r)=>{let i=e._zod.def,a=R(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`}]},Fs=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Is=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?(Yo(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Is):JSON.parse(o)}const Rs=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Ls(i.defaultValue,e,t,n,r);o!==Is&&(n.default=o)},zs=(e,t,n,r)=>{let i=e._zod.def;R(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!==Is&&(n._prefault=o)},Bs=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Yo(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Vs=(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;R(o,t,r);let s=t.seen.get(e);s.ref=o},Hs=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Us=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ws=/* @__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 Ks=/*@__PURE__*/ F(`ZodError`,(e,t)=>{jn.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Ws.has(n)||(Ws.add(n),Gs(n,`format`,e=>t=>Pn(e,t)),Gs(n,`flatten`,e=>t=>Nn(e,t)),Gs(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,dt,2)}),Gs(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,dt,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),qs=/* @__PURE__ */ In(Ks),Js=/* @__PURE__ */ Ln(Ks),Ys=/* @__PURE__ */ Rn(Ks),Xs=/* @__PURE__ */ Bn(Ks),Zs=/* @__PURE__ */ Kn(Ks),Qs=/* @__PURE__ */ qn(Ks),$s=/* @__PURE__ */ Jn(Ks),ec=/* @__PURE__ */ Yn(Ks),tc=/* @__PURE__ */ Xn(Ks),nc=/* @__PURE__ */ Zn(Ks),rc=/* @__PURE__ */ Qn(Ks),ic=/* @__PURE__ */ $n(Ks);function ac(){Cn.localeError||wn(La())}function oc(){Cn.memoizer||wn({memoizer:Pa()})}const B=/*@__PURE__*/ F(`ZodType`,(e,t)=>(ac(),I.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(wt(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 Pt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(yl(e,t))},superRefine(e,t){return this.check(bl(e,t))},overwrite(e){return this.check(/* @__PURE__ */ Io(e))},optional(){return el(this)},exactOptional(){return nl(this)},nullable(){return il(this)},nullish(){return el(il(this))},nonoptional(e){return ul(this,e)},array(){return U(this)},or(e){return Kc([this,e])},and(e){return Jc(this,e)},transform(e){return ml(this,Qc(e))},default(e){return ol(this,e)},prefault(e){return cl(this,e)},catch(e){return fl(this,e)},pipe(e){return ml(this,e)},readonly(){return gl(this)},describe(e){let t=this.clone();return Va.add(t,{description:e}),t},meta(...e){if(e.length===0)return Va.get(this);let t=this.clone();return Va.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 cn(this,`~standard`,{...$r(this),jsonSchema:{input:os(this,`input`),output:os(this,`output`)}})},set"~standard"(e){sn(this,`~standard`,e)},parse:function e(t,n){return qs(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Js(this,t,n,{callee:e})},safeParse(e,t){return Ys(this,e,t)},async safeParseAsync(e,t){return Xs(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){sn(this,`spa`,e)},validate(e,t){return Un(this,e,t)},validateAsync(e,t){return Gn(this,e,t)},encode:function e(t,n){return Zs(this,t,n,{callee:e})},decode:function e(t,n){return Qs(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await $s(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await ec(this,t,n,{callee:e})},safeEncode(e,t){return tc(this,e,t)},safeDecode(e,t){return nc(this,e,t)},async safeEncodeAsync(e,t){return rc(this,e,t)},async safeDecodeAsync(e,t){return ic(this,e,t)},toJSONSchema(e){return as(this,{})(e)},get description(){return Va.get(this)?.description},get _def(){return this._zod.def}}),sc=/*@__PURE__*/ F(`_ZodString`,(e,t)=>{ei.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ss(e,t,n,r)},/*@__PURE__*/ ln({format:e=>vs(e).format??null,minLength:e=>vs(e).minimum??null,maxLength:e=>vs(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ Ao(...e))},includes(...e){return this.check(/* @__PURE__ */ No(...e))},startsWith(...e){return this.check(/* @__PURE__ */ Po(...e))},endsWith(...e){return this.check(/* @__PURE__ */ Fo(...e))},min(...e){return this.check(/* @__PURE__ */ Oo(...e))},max(...e){return this.check(/* @__PURE__ */ Do(...e))},length(...e){return this.check(/* @__PURE__ */ ko(...e))},nonempty(...e){return this.check(/* @__PURE__ */ Oo(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ jo(e))},uppercase(e){return this.check(/* @__PURE__ */ Mo(e))},trim(){return this.check(/* @__PURE__ */ Ro())},normalize(...e){return this.check(/* @__PURE__ */ Lo(...e))},toLowerCase(){return this.check(/* @__PURE__ */ zo())},toUpperCase(){return this.check(/* @__PURE__ */ Bo())},slugify(){return this.check(/* @__PURE__ */ Vo())}})),cc=/*@__PURE__*/ F(`ZodString`,(e,t)=>{ei.init(e,t),sc.init(e,t)},{email(e){return this.check(/* @__PURE__ */ Wa(pc,e))},url(e){return this.check(/* @__PURE__ */ Xa(gc,e))},jwt(e){return this.check(/* @__PURE__ */ fo(jc,e))},emoji(e){return this.check(/* @__PURE__ */ Za(_c,e))},guid(e){return this.check(/* @__PURE__ */ Ga(mc,e))},uuid(e){return this.check(/* @__PURE__ */ Ka(hc,e))},uuidv4(e){return this.check(/* @__PURE__ */ qa(hc,e))},uuidv6(e){return this.check(/* @__PURE__ */ Ja(hc,e))},uuidv7(e){return this.check(/* @__PURE__ */ Ya(hc,e))},nanoid(e){return this.check(/* @__PURE__ */ Qa(vc,e))},cuid(e){return this.check(/* @__PURE__ */ $a(yc,e))},cuid2(e){return this.check(/* @__PURE__ */ eo(bc,e))},ulid(e){return this.check(/* @__PURE__ */ to(xc,e))},base64(e){return this.check(/* @__PURE__ */ co(Oc,e))},base64url(e){return this.check(/* @__PURE__ */ lo(kc,e))},xid(e){return this.check(/* @__PURE__ */ no(Sc,e))},ksuid(e){return this.check(/* @__PURE__ */ ro(Cc,e))},ipv4(e){return this.check(/* @__PURE__ */ io(wc,e))},ipv6(e){return this.check(/* @__PURE__ */ ao(Tc,e))},cidrv4(e){return this.check(/* @__PURE__ */ oo(Ec,e))},cidrv6(e){return this.check(/* @__PURE__ */ so(Dc,e))},e164(e){return this.check(/* @__PURE__ */ uo(Ac,e))},datetime(e){return this.check(/* @__PURE__ */ po(lc,e))},date(e){return this.check(/* @__PURE__ */ mo(uc,e))},time(e){return this.check(/* @__PURE__ */ ho(dc,e))},duration(e){return this.check(/* @__PURE__ */ go(fc,e))}});function V(e){return/* @__PURE__ */ Ua(cc,e)}const H=/*@__PURE__*/ F(`ZodStringFormat`,(e,t)=>{L.init(e,t),sc.init(e,t)}),lc=/*@__PURE__*/ F(`ZodISODateTime`,(e,t)=>{yi.init(e,t),H.init(e,t)}),uc=/*@__PURE__*/ F(`ZodISODate`,(e,t)=>{bi.init(e,t),H.init(e,t)}),dc=/*@__PURE__*/ F(`ZodISOTime`,(e,t)=>{xi.init(e,t),H.init(e,t)}),fc=/*@__PURE__*/ F(`ZodISODuration`,(e,t)=>{Si.init(e,t),H.init(e,t)}),pc=/*@__PURE__*/ F(`ZodEmail`,(e,t)=>{ri.init(e,t),H.init(e,t)}),mc=/*@__PURE__*/ F(`ZodGUID`,(e,t)=>{ti.init(e,t),H.init(e,t)}),hc=/*@__PURE__*/ F(`ZodUUID`,(e,t)=>{ni.init(e,t),H.init(e,t)}),gc=/*@__PURE__*/ F(`ZodURL`,(e,t)=>{di.init(e,t),H.init(e,t)}),_c=/*@__PURE__*/ F(`ZodEmoji`,(e,t)=>{fi.init(e,t),H.init(e,t)}),vc=/*@__PURE__*/ F(`ZodNanoID`,(e,t)=>{pi.init(e,t),H.init(e,t)}),yc=/*@__PURE__*/ F(`ZodCUID`,(e,t)=>{mi.init(e,t),H.init(e,t)}),bc=/*@__PURE__*/ F(`ZodCUID2`,(e,t)=>{hi.init(e,t),H.init(e,t)}),xc=/*@__PURE__*/ F(`ZodULID`,(e,t)=>{gi.init(e,t),H.init(e,t)}),Sc=/*@__PURE__*/ F(`ZodXID`,(e,t)=>{_i.init(e,t),H.init(e,t)}),Cc=/*@__PURE__*/ F(`ZodKSUID`,(e,t)=>{vi.init(e,t),H.init(e,t)}),wc=/*@__PURE__*/ F(`ZodIPv4`,(e,t)=>{Ci.init(e,t),H.init(e,t)}),Tc=/*@__PURE__*/ F(`ZodIPv6`,(e,t)=>{Ei.init(e,t),H.init(e,t)}),Ec=/*@__PURE__*/ F(`ZodCIDRv4`,(e,t)=>{Di.init(e,t),H.init(e,t)}),Dc=/*@__PURE__*/ F(`ZodCIDRv6`,(e,t)=>{ki.init(e,t),H.init(e,t)}),Oc=/*@__PURE__*/ F(`ZodBase64`,(e,t)=>{Mi.init(e,t),H.init(e,t)}),kc=/*@__PURE__*/ F(`ZodBase64URL`,(e,t)=>{Fi.init(e,t),H.init(e,t)}),Ac=/*@__PURE__*/ F(`ZodE164`,(e,t)=>{Ii.init(e,t),H.init(e,t)}),jc=/*@__PURE__*/ F(`ZodJWT`,(e,t)=>{Ri.init(e,t),H.init(e,t)}),Mc=/*@__PURE__*/ F(`ZodNumber`,(e,t)=>{zi.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cs(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ ln({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=vs(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=vs(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=vs(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>vs(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ wo(e,t))},gte(e,t){return this.check(/* @__PURE__ */ To(e,t))},min(e,t){return this.check(/* @__PURE__ */ To(e,t))},lt(e,t){return this.check(/* @__PURE__ */ So(e,t))},lte(e,t){return this.check(/* @__PURE__ */ Co(e,t))},max(e,t){return this.check(/* @__PURE__ */ Co(e,t))},int(e){return this.check(Fc(e))},safe(e){return this.check(Fc(e))},positive(e){return this.check(/* @__PURE__ */ wo(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ To(0,e))},negative(e){return this.check(/* @__PURE__ */ So(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ Co(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ Eo(e,t))},step(e,t){return this.check(/* @__PURE__ */ Eo(e,t))},finite(){return this}}));function Nc(e){return/* @__PURE__ */ _o(Mc,e)}const Pc=/*@__PURE__*/ F(`ZodNumberFormat`,(e,t)=>{Bi.init(e,t),Mc.init(e,t)});function Fc(e){return/* @__PURE__ */ vo(Pc,e)}const Ic=/*@__PURE__*/ F(`ZodBoolean`,(e,t)=>{Vi.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ws(e,t,n,r)});function Lc(e){return/* @__PURE__ */ yo(Ic,e)}const Rc=/*@__PURE__*/ F(`ZodUnknown`,(e,t)=>{Hi.init(e,t),B.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function zc(){return/* @__PURE__ */ bo(Rc)}const Bc=/*@__PURE__*/ F(`ZodNever`,(e,t)=>{Ui.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ts(e,t,n,r)});function Vc(e){return/* @__PURE__ */ xo(Bc,e)}const Hc=/*@__PURE__*/ F(`ZodArray`,(e,t)=>{oc(),Gi.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ks(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ Oo(e,t))},nonempty(e){return this.check(/* @__PURE__ */ Oo(1,e))},max(e,t){return this.check(/* @__PURE__ */ Do(e,t))},length(e,t){return this.check(/* @__PURE__ */ ko(e,t))},unwrap(){return this.element}});function U(e,t){return/* @__PURE__ */ Ho(Hc,e,t)}const Uc=/*@__PURE__*/ F(`ZodObject`,(e,t)=>{oc(),Zi.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>js(e,t,n,r),hn(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Xc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(wt(this._zod.def,{catchall:e}))},passthrough(){return this.clone(wt(this._zod.def,{catchall:zc()}))},loose(){return this.clone(wt(this._zod.def,{catchall:zc()}))},strict(){return this.clone(wt(this._zod.def,{catchall:Vc()}))},strip(){return this.clone(wt(this._zod.def,{catchall:void 0}))},extend(e){return Ht(this,e)},safeExtend(e){return Wt(this,e)},merge(e){return Gt(this,e)},pick(e){return zt(this,e)},omit(e){return Vt(this,e)},partial(...e){return Kt($c,this,e[0])},exactPartial(...e){return Kt(tl,this,e[0],`exactPartial`)},required(...e){return qt(ll,this,e[0])}});function W(e,t){let n={type:`object`,shape:e??{},...N(t)};return new Uc(n)}function Wc(e,t){return new Uc({type:`object`,shape:e,catchall:Vc(),...N(t)})}const Gc=/*@__PURE__*/ F(`ZodUnion`,(e,t)=>{$i.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ms(e,t,n,r),e.options=t.options});function Kc(e,t){return new Gc({type:`union`,options:e,...N(t)})}const qc=/*@__PURE__*/ F(`ZodIntersection`,(e,t)=>{ea.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ns(e,t,n,r)});function Jc(e,t){return new qc({type:`intersection`,left:e,right:t})}const Yc=/*@__PURE__*/ F(`ZodEnum`,(e,t)=>{ra.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Es(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 Yc({...t,checks:[],...N(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 Yc({...t,checks:[],...N(r),entries:i})}});function Xc(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Yc({type:`enum`,entries:n,...N(t)})}const Zc=/*@__PURE__*/ F(`ZodTransform`,(e,t)=>{oc(),ia.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Os(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Sn(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(an(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(an(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Qc(e){return new Zc({type:`transform`,transform:e})}const $c=/*@__PURE__*/ F(`ZodOptional`,(e,t)=>{oa.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Us(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function el(e){return new $c({type:`optional`,innerType:e})}const tl=/*@__PURE__*/ F(`ZodExactOptional`,(e,t)=>{sa.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Us(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function nl(e){return new tl({type:`optional`,innerType:e})}const rl=/*@__PURE__*/ F(`ZodNullable`,(e,t)=>{ca.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ps(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function il(e){return new rl({type:`nullable`,innerType:e})}const al=/*@__PURE__*/ F(`ZodDefault`,(e,t)=>{la.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ol(e,t){return new al({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():jt(t)}})}const sl=/*@__PURE__*/ F(`ZodPrefault`,(e,t)=>{da.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cl(e,t){return new sl({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():jt(t)}})}const ll=/*@__PURE__*/ F(`ZodNonOptional`,(e,t)=>{fa.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ul(e,t){return new ll({type:`nonoptional`,innerType:e,...N(t)})}const dl=/*@__PURE__*/ F(`ZodCatch`,(e,t)=>{ha.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function fl(e,t){return new dl({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:gn(t)})}const pl=/*@__PURE__*/ F(`ZodPipe`,(e,t)=>{ga.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vs(e,t,n,r),e.in=t.in,e.out=t.out});function ml(e,t){return new pl({type:`pipe`,in:e,out:t})}const hl=/*@__PURE__*/ F(`ZodReadonly`,(e,t)=>{va.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gl(e){return new hl({type:`readonly`,innerType:e})}const _l=/*@__PURE__*/ F(`ZodCustom`,(e,t)=>{ba.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ds(e,t,n,r)});function vl(e,t){return/* @__PURE__ */ Uo(_l,e??(()=>!0),t)}function yl(e,t={}){return/* @__PURE__ */ Wo(_l,e,t)}function bl(e,t){return/* @__PURE__ */ Go(e,t)}const xl=Ge(`@longzai-intelligence-cli/core/provider`),Sl={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 Cl={select:async(e,t)=>t[0]?.value??``,textInput:async(e,t)=>t?.defaultValue??``,confirm:async(e,t)=>t?.defaultValue??!1,spinner:()=>({start:e=>xl.info(e),stop:e=>xl.info(e)}),note:(e,t)=>{t?xl.info(`${t}: ${e}`):xl.info(e)},log:{info:e=>xl.info(e),success:e=>xl.info(e),warn:e=>xl.warn(e),error:e=>xl.error(e),step:e=>xl.info(e)}},wl=Sl;function Tl(e){Cl=e}function El(e){wl=e}function Dl(){return Cl}function Ol(){return wl}const kl=()=>`0.0.12`;function Al(e){let t=e.version??kl();e.interaction&&Tl(e.interaction),e.color&&El(e.color);let n=new at;return n.name(e.name).version(t,`-v, --version`,`输出 ${e.name} 的版本号`),e.description&&n.description(e.description),n}Ge(`@longzai-intelligence-cli/core/output`),Ge(`@longzai-intelligence-cli/core/progress`);const jl=Ge(`@longzai-intelligence-cli/core/define-command`);function Ml(e,t){let n=e.commands.find(e=>e.name()===t);return n===void 0?e.command(t):n}function Nl(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=Ml(e,n);for(let e of r)a=Ml(a,e);return a.command(i)}function Pl(e,t){let n=Nl(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 at))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(`, `);jl.error(Ol().red(`参数校验失败: ${e}`)),Dl().log.error(`参数校验失败: ${e}`),process.exit(1)}await t.action(a.data,i)})}var Fl=/* @__PURE__ */ O(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}})),Il=/* @__PURE__ */ O(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})),G=Fl(),K=/* @__PURE__ */ te(Il(),1);function Ll({onlyFirst:e=!1}={}){let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))`].join(`|`);return new RegExp(t,e?void 0:`g`)}const Rl=Ll();function zl(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Rl,``)}function Bl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var Vl={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(e){var t=e.charCodeAt(0),n=e.length==2?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t&=1023,n&=1023,r=t<<10|n,r+=65536),r==12288||65281<=r&&r<=65376||65504<=r&&r<=65510?`F`:r==8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?`H`:4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?`W`:32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r==172||r==175||10214<=r&&r<=10221||10629<=r&&r<=10630?`Na`:r==161||r==164||167<=r&&r<=168||r==170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r==198||r==208||215<=r&&r<=216||222<=r&&r<=225||r==230||232<=r&&r<=234||236<=r&&r<=237||r==240||242<=r&&r<=243||247<=r&&r<=250||r==252||r==254||r==257||r==273||r==275||r==283||294<=r&&r<=295||r==299||305<=r&&r<=307||r==312||319<=r&&r<=322||r==324||328<=r&&r<=331||r==333||338<=r&&r<=339||358<=r&&r<=359||r==363||r==462||r==464||r==466||r==468||r==470||r==472||r==474||r==476||r==593||r==609||r==708||r==711||713<=r&&r<=715||r==717||r==720||728<=r&&r<=731||r==733||r==735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r==1025||1040<=r&&r<=1103||r==1105||r==8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r==8240||8242<=r&&r<=8243||r==8245||r==8251||r==8254||r==8308||r==8319||8321<=r&&r<=8324||r==8364||r==8451||r==8453||r==8457||r==8467||r==8470||8481<=r&&r<=8482||r==8486||r==8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r==8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r==8658||r==8660||r==8679||r==8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r==8715||r==8719||r==8721||r==8725||r==8730||8733<=r&&r<=8736||r==8739||r==8741||8743<=r&&r<=8748||r==8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r==8776||r==8780||r==8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r==8853||r==8857||r==8869||r==8895||r==8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r==9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r==9711||9733<=r&&r<=9734||r==9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r==9756||r==9758||r==9792||r==9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r==9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r==9955||9960<=r&&r<=9983||r==10045||r==10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r==65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?`A`:`N`},t.characterLength=function(e){var t=this.eastAsianWidth(e);return t==`F`||t==`W`||t==`A`?2:1};function n(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(e){for(var t=n(e),r=0,i=0;i<t.length;i++)r+=this.characterLength(t[i]);return r},t.slice=function(e,r,i){textLen=t.length(e),r||=0,i||=1,r<0&&(r=textLen+r),i<0&&(i=textLen+i);for(var a=``,o=0,s=n(e),c=0;c<s.length;c++){var l=s[c],u=t.length(l);if(o>=r-+(u==2)){if(o+u<=i)a+=l;else break}o+=u}return a}})(Vl);var Hl=Vl.exports;const Ul=Bl(Hl),Wl=Bl(function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g});function Gl(e,t={}){if(typeof e!=`string`||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=zl(e),e.length===0))return 0;e=e.replace(Wl(),` `);let n=t.ambiguousIsNarrow?1:2,r=0;for(let t of e){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159||e>=768&&e<=879))switch(Ul.eastAsianWidth(t)){case`F`:case`W`:r+=2;break;case`A`:r+=n;break;default:r+=1}}return r}const Kl=(e=0)=>t=>`\x1B[${t+e}m`,ql=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Jl=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,q={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(q.modifier);const Yl=Object.keys(q.color),Xl=Object.keys(q.bgColor);[...Yl,...Xl];function Zl(){let e=/* @__PURE__ */ new Map;for(let[t,n]of Object.entries(q)){for(let[t,r]of Object.entries(n))q[t]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[t]=q[t],e.set(r[0],r[1]);Object.defineProperty(q,t,{value:n,enumerable:!1})}return Object.defineProperty(q,"codes",{value:e,enumerable:!1}),q.color.close=`\x1B[39m`,q.bgColor.close=`\x1B[49m`,q.color.ansi=Kl(),q.color.ansi256=ql(),q.color.ansi16m=Jl(),q.bgColor.ansi=Kl(10),q.bgColor.ansi256=ql(10),q.bgColor.ansi16m=Jl(10),Object.defineProperties(q,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>q.rgbToAnsi256(...q.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>q.ansi256ToAnsi(q.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>q.ansi256ToAnsi(q.hexToAnsi256(e)),enumerable:!1}}),q}const Ql=Zl(),$l=/* @__PURE__ */ new Set([`\x1B`,`›`]),eu=`]8;;`,tu=e=>`${$l.values().next().value}[${e}m`,nu=e=>`${$l.values().next().value}${eu}${e}`,ru=e=>e.split(` `).map(e=>Gl(e)),iu=(e,t,n)=>{let r=[...t],i=!1,a=!1,o=Gl(zl(e[e.length-1]));for(let[t,s]of r.entries()){let c=Gl(s);o+c<=n?e[e.length-1]+=s:(e.push(s),o=0),$l.has(s)&&(i=!0,a=r.slice(t+1).join(``).startsWith(eu)),i?a?s===`\x07`&&(i=!1,a=!1):s===`m`&&(i=!1):(o+=c,o===n&&t<r.length-1&&(e.push(``),o=0))}!o&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},au=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(Gl(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},ou=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=ru(e),s=[``];for(let[r,i]of e.split(` `).entries()){n.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let e=Gl(s[s.length-1]);if(r!==0&&(e>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),e=0),(e>0||n.trim===!1)&&(s[s.length-1]+=` `,e++)),n.hard&&o[r]>t){let n=t-e,a=1+Math.floor((o[r]-n-1)/t);Math.floor((o[r]-1)/t)<a&&s.push(``),iu(s,i,t)}else{if(e+o[r]>t&&e>0&&o[r]>0){if(n.wordWrap===!1&&e<t){iu(s,i,t);continue}s.push(``)}e+o[r]>t&&n.wordWrap===!1?iu(s,i,t):s[s.length-1]+=i}}n.trim!==!1&&(s=s.map(e=>au(e)));let c=[...s.join(`
146
+ `)];for(let[e,t]of c.entries()){if(r+=t,$l.has(t)){let{groups:t}=RegExp(`(?:\\[(?<code>\\d+)m|\\${eu}(?<uri>.*))`).exec(c.slice(e).join(``))||{groups:{}};if(t.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}let n=Ql.codes.get(Number(i));c[e+1]===`
147
+ `?(a&&(r+=nu(``)),i&&n&&(r+=tu(n))):t===`
148
+ `&&(i&&n&&(r+=tu(i)),a&&(r+=nu(a)))}return r};function su(e,t,n){return String(e).normalize().replace(/\r\n/g,`
149
+ `).split(`
150
+ `).map(e=>ou(e,t,n)).join(`
151
+ `)}const cu={actions:/* @__PURE__ */ new Set([`up`,`down`,`left`,`right`,`space`,`enter`,`cancel`]),aliases:/* @__PURE__ */ new Map([[`k`,`up`],[`j`,`down`],[`h`,`left`],[`l`,`right`],[``,`cancel`],[`escape`,`cancel`]])};function lu(e,t){if(typeof e==`string`)return cu.aliases.get(e)===t;for(let n of e)if(n!==void 0&&lu(n,t))return!0;return!1}function uu(e,t){if(e===t)return;let n=e.split(`
152
+ `),r=t.split(`
153
+ `),i=[];for(let e=0;e<Math.max(n.length,r.length);e++)n[e]!==r[e]&&i.push(e);return i}const du=globalThis.process.platform.startsWith(`win`),fu=Symbol(`clack:cancel`);function pu(e){return e===fu}function mu(e,t){let n=e;n.isTTY&&n.setRawMode(t)}function hu({input:e=_,output:t=v,overwrite:n=!0,hideCursor:r=!0}={}){let i=b.createInterface({input:e,output:t,prompt:``,tabSize:1});b.emitKeypressEvents(e,i),e.isTTY&&e.setRawMode(!0);let a=(i,{name:o,sequence:s})=>{if(lu([String(i),o,s],`cancel`)){r&&t.write(G.cursor.show),process.exit(0);return}if(!n)return;let c=o===`return`?0:-1,l=o===`return`?-1:0;b.moveCursor(t,c,l,()=>{b.clearLine(t,1,()=>{e.once(`keypress`,a)})})};return r&&t.write(G.cursor.hide),e.once(`keypress`,a),()=>{e.off(`keypress`,a),r&&t.write(G.cursor.show),e.isTTY&&!du&&e.setRawMode(!1),i.terminal=!1,i.close()}}var gu=Object.defineProperty,_u=(e,t,n)=>t in e?gu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vu=(e,t,n)=>(_u(e,typeof t==`symbol`?t:t+``,n),n),yu=class{constructor(e,t=!0){vu(this,`input`),vu(this,`output`),vu(this,`_abortSignal`),vu(this,`rl`),vu(this,`opts`),vu(this,`_render`),vu(this,`_track`,!1),vu(this,`_prevFrame`,``),vu(this,`_subscribers`,/* @__PURE__ */ new Map),vu(this,`_cursor`,0),vu(this,`state`,`initial`),vu(this,`error`,``),vu(this,`value`);let{input:n=_,output:r=v,render:i,signal:a,...o}=e;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=t,this._abortSignal=a,this.input=n,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let n=this._subscribers.get(e)??[];n.push(t),this._subscribers.set(e,n)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let n=this._subscribers.get(e)??[],r=[];for(let e of n)e.cb(...t),e.once&&r.push(()=>n.splice(n.indexOf(e),1));for(let e of r)e()}prompt(){return new Promise((e,t)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state=`cancel`,this.close(),e(fu);this._abortSignal.addEventListener(`abort`,()=>{this.state=`cancel`,this.close()},{once:!0})}let n=new x;n._write=(e,t,n)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,``),this._cursor=this.rl?.cursor??0,this.emit(`value`,this.value)),n()},this.input.pipe(n),this.rl=y.createInterface({input:this.input,output:n,tabSize:2,prompt:``,escapeCodeTimeout:50,terminal:!0}),y.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on(`keypress`,this.onKeypress),mu(this.input,!0),this.output.on(`resize`,this.render),this.render(),this.once(`submit`,()=>{this.output.write(G.cursor.show),this.output.off(`resize`,this.render),mu(this.input,!1),e(this.value)}),this.once(`cancel`,()=>{this.output.write(G.cursor.show),this.output.off(`resize`,this.render),mu(this.input,!1),e(fu)})})}onKeypress(e,t){if(this.state===`error`&&(this.state=`active`),t?.name&&(!this._track&&cu.aliases.has(t.name)&&this.emit(`cursor`,cu.aliases.get(t.name)),cu.actions.has(t.name)&&this.emit(`cursor`,t.name)),e&&(e.toLowerCase()===`y`||e.toLowerCase()===`n`)&&this.emit(`confirm`,e.toLowerCase()===`y`),e===` `&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit(`value`,this.opts.placeholder))),e&&this.emit(`key`,e.toLowerCase()),t?.name===`return`){if(this.opts.validate){let e=this.opts.validate(this.value);e&&(this.error=e instanceof Error?e.message:e,this.state=`error`,this.rl?.write(this.value))}this.state!==`error`&&(this.state=`submit`)}lu([e,t?.name,t?.sequence],`cancel`)&&(this.state=`cancel`),(this.state===`submit`||this.state===`cancel`)&&this.emit(`finalize`),this.render(),(this.state===`submit`||this.state===`cancel`)&&this.close()}close(){this.input.unpipe(),this.input.removeListener(`keypress`,this.onKeypress),this.output.write(`
154
+ `),mu(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=su(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
155
+ `).length-1;this.output.write(G.cursor.move(-999,e*-1))}render(){let e=su(this._render(this)??``,process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state===`initial`)this.output.write(G.cursor.hide);else{let t=uu(this._prevFrame,e);if(this.restoreCursor(),t&&t?.length===1){let n=t[0];this.output.write(G.cursor.move(0,n)),this.output.write(G.erase.lines(1));let r=e.split(`
156
+ `);this.output.write(r[n]),this._prevFrame=e,this.output.write(G.cursor.move(0,r.length-n-1));return}if(t&&t?.length>1){let n=t[0];this.output.write(G.cursor.move(0,n)),this.output.write(G.erase.down());let r=e.split(`
157
+ `).slice(n);this.output.write(r.join(`
158
+ `)),this._prevFrame=e;return}this.output.write(G.erase.down())}this.output.write(e),this.state===`initial`&&(this.state=`active`),this._prevFrame=e}}},bu=class extends yu{get cursor(){return+!this.value}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on(`value`,()=>{this.value=this._value}),this.on(`confirm`,e=>{this.output.write(G.cursor.move(0,-1)),this.value=e,this.state=`submit`,this.close()}),this.on(`cursor`,()=>{this.value=!this.value})}},xu=Object.defineProperty,Su=(e,t,n)=>t in e?xu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cu=(e,t,n)=>(Su(e,typeof t==`symbol`?t:t+``,n),n),wu=class extends yu{constructor(e){super(e,!1),Cu(this,`options`),Cu(this,`cursor`,0),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case`down`:case`right`:this.cursor=this.cursor===this.options.length-1?0:this.cursor+1}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}},Tu=class extends yu{get valueWithCursor(){if(this.state===`submit`)return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[t,...n]=this.value.slice(this.cursor);return`${e}${K.default.inverse(t)}${n.join(``)}`}get cursor(){return this._cursor}constructor(e){super(e),this.on(`finalize`,()=>{this.value||=e.defaultValue})}};function Eu(){return g.platform===`win32`?!!g.env.CI||!!g.env.WT_SESSION||!!g.env.TERMINUS_SUBLIME||g.env.ConEmuTask===`{cmd::Cmder}`||g.env.TERM_PROGRAM===`Terminus-Sublime`||g.env.TERM_PROGRAM===`vscode`||g.env.TERM===`xterm-256color`||g.env.TERM===`alacritty`||g.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:g.env.TERM!==`linux`}const Du=Eu(),J=(e,t)=>Du?e:t,Ou=J(`◆`,`*`),ku=J(`■`,`x`),Au=J(`▲`,`x`),ju=J(`◇`,`o`),Y=J(`│`,`|`),Mu=J(`└`,`—`),Nu=J(`●`,`>`),Pu=J(`○`,` `),Fu=J(`─`,`-`),Iu=J(`╮`,`+`),Lu=J(`├`,`+`),Ru=J(`╯`,`+`),zu=J(`●`,`•`),Bu=J(`◆`,`*`),Vu=J(`▲`,`!`),Hu=J(`■`,`x`),Uu=e=>{switch(e){case`initial`:case`active`:return K.default.cyan(Ou);case`cancel`:return K.default.red(ku);case`error`:return K.default.yellow(Au);case`submit`:return K.default.green(ju)}},Wu=e=>{let{cursor:t,options:n,style:r}=e,i=e.maxItems??1/0,a=Math.max(process.stdout.rows-4,0),o=Math.min(a,Math.max(i,5)),s=0;t>=s+o-3?s=Math.max(Math.min(t-o+3,n.length-o),0):t<s+2&&(s=Math.max(t-2,0));let c=o<n.length&&s>0,l=o<n.length&&s+o<n.length;return n.slice(s,s+o).map((e,n,i)=>{let a=n===0&&c,o=n===i.length-1&&l;return a||o?K.default.dim(`...`):r(e,n+s===t)})},Gu=e=>new Tu({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,render(){let t=`${K.default.gray(Y)}
159
+ ${Uu(this.state)} ${e.message}
160
+ `,n=e.placeholder?K.default.inverse(e.placeholder[0])+K.default.dim(e.placeholder.slice(1)):K.default.inverse(K.default.hidden(`_`)),r=this.value?this.valueWithCursor:n;switch(this.state){case`error`:return`${t.trim()}
161
+ ${K.default.yellow(Y)} ${r}
162
+ ${K.default.yellow(Mu)} ${K.default.yellow(this.error)}
163
+ `;case`submit`:return`${t}${K.default.gray(Y)} ${K.default.dim(this.value||e.placeholder)}`;case`cancel`:return`${t}${K.default.gray(Y)} ${K.default.strikethrough(K.default.dim(this.value??``))}${this.value?.trim()?`
164
+ ${K.default.gray(Y)}`:``}`;default:return`${t}${K.default.cyan(Y)} ${r}
165
+ ${K.default.cyan(Mu)}
166
+ `}}}).prompt(),Ku=e=>{let t=e.active??`Yes`,n=e.inactive??`No`;return new bu({active:t,inactive:n,initialValue:e.initialValue??!0,render(){let r=`${K.default.gray(Y)}
167
+ ${Uu(this.state)} ${e.message}
168
+ `,i=this.value?t:n;switch(this.state){case`submit`:return`${r}${K.default.gray(Y)} ${K.default.dim(i)}`;case`cancel`:return`${r}${K.default.gray(Y)} ${K.default.strikethrough(K.default.dim(i))}
169
+ ${K.default.gray(Y)}`;default:return`${r}${K.default.cyan(Y)} ${this.value?`${K.default.green(Nu)} ${t}`:`${K.default.dim(Pu)} ${K.default.dim(t)}`} ${K.default.dim(`/`)} ${this.value?`${K.default.dim(Pu)} ${K.default.dim(n)}`:`${K.default.green(Nu)} ${n}`}
170
+ ${K.default.cyan(Mu)}
171
+ `}}}).prompt()},qu=e=>{let t=(e,t)=>{let n=e.label??String(e.value);switch(t){case`selected`:return`${K.default.dim(n)}`;case`active`:return`${K.default.green(Nu)} ${n} ${e.hint?K.default.dim(`(${e.hint})`):``}`;case`cancelled`:return`${K.default.strikethrough(K.default.dim(n))}`;default:return`${K.default.dim(Pu)} ${K.default.dim(n)}`}};return new wu({options:e.options,initialValue:e.initialValue,render(){let n=`${K.default.gray(Y)}
172
+ ${Uu(this.state)} ${e.message}
173
+ `;switch(this.state){case`submit`:return`${n}${K.default.gray(Y)} ${t(this.options[this.cursor],`selected`)}`;case`cancel`:return`${n}${K.default.gray(Y)} ${t(this.options[this.cursor],`cancelled`)}
174
+ ${K.default.gray(Y)}`;default:return`${n}${K.default.cyan(Y)} ${Wu({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(e,n)=>t(e,n?`active`:`inactive`)}).join(`
175
+ ${K.default.cyan(Y)} `)}
176
+ ${K.default.cyan(Mu)}
177
+ `}}}).prompt()},Ju=(e=``,t=``)=>{let r=`
178
+ ${e}
179
+ `.split(`
180
+ `),i=n(t).length,a=Math.max(r.reduce((e,t)=>{let r=n(t);return r.length>e?r.length:e},0),i)+2,o=r.map(e=>`${K.default.gray(Y)} ${K.default.dim(e)}${` `.repeat(a-n(e).length)}${K.default.gray(Y)}`).join(`
181
+ `);process.stdout.write(`${K.default.gray(Y)}
182
+ ${K.default.green(ju)} ${K.default.reset(t)} ${K.default.gray(Fu.repeat(Math.max(a-i-1,1))+Iu)}
183
+ ${o}
184
+ ${K.default.gray(Lu+Fu.repeat(a+2)+Ru)}
185
+ `)},Yu=(e=``)=>{process.stdout.write(`${K.default.gray(Mu)} ${K.default.red(e)}
186
+
187
+ `)},Xu={message:(e=``,{symbol:t=K.default.gray(Y)}={})=>{let n=[`${K.default.gray(Y)}`];if(e){let[r,...i]=e.split(`
188
+ `);n.push(`${t} ${r}`,...i.map(e=>`${K.default.gray(Y)} ${e}`))}process.stdout.write(`${n.join(`
189
+ `)}
190
+ `)},info:e=>{Xu.message(e,{symbol:K.default.blue(zu)})},success:e=>{Xu.message(e,{symbol:K.default.green(Bu)})},step:e=>{Xu.message(e,{symbol:K.default.green(ju)})},warn:e=>{Xu.message(e,{symbol:K.default.yellow(Vu)})},warning:e=>{Xu.warn(e)},error:e=>{Xu.message(e,{symbol:K.default.red(Hu)})}};`${K.default.gray(Y)}`;const Zu=({indicator:e=`dots`}={})=>{let t=Du?[`◒`,`◐`,`◓`,`◑`]:[`•`,`o`,`O`,`0`],n=Du?80:120,r=process.env.CI===`true`,i,a,o=!1,s=``,c,l=performance.now(),u=e=>{o&&y(e>1?`Something went wrong`:`Canceled`,e)},d=()=>u(2),f=()=>u(1),p=()=>{process.on(`uncaughtExceptionMonitor`,d),process.on(`unhandledRejection`,d),process.on(`SIGINT`,f),process.on(`SIGTERM`,f),process.on(`exit`,u)},m=()=>{process.removeListener(`uncaughtExceptionMonitor`,d),process.removeListener(`unhandledRejection`,d),process.removeListener(`SIGINT`,f),process.removeListener(`SIGTERM`,f),process.removeListener(`exit`,u)},h=()=>{if(c===void 0)return;r&&process.stdout.write(`
191
+ `);let e=c.split(`
192
+ `);process.stdout.write(G.cursor.move(-999,e.length-1)),process.stdout.write(G.erase.down(e.length))},g=e=>e.replace(/\.+$/,``),_=e=>{let t=(performance.now()-e)/1e3,n=Math.floor(t/60),r=Math.floor(t%60);return n>0?`[${n}m ${r}s]`:`[${r}s]`},v=(u=``)=>{o=!0,i=hu(),s=g(u),l=performance.now(),process.stdout.write(`${K.default.gray(Y)}
193
+ `);let d=0,f=0;p(),a=setInterval(()=>{if(r&&s===c)return;h(),c=s;let n=K.default.magenta(t[d]);if(r)process.stdout.write(`${n} ${s}...`);else if(e===`timer`)process.stdout.write(`${n} ${s} ${_(l)}`);else{let e=`.`.repeat(Math.floor(f)).slice(0,3);process.stdout.write(`${n} ${s}${e}`)}d=d+1<t.length?d+1:0,f=f<t.length?f+.125:0},n)},y=(t=``,n=0)=>{o=!1,clearInterval(a),h();let r=n===0?K.default.green(ju):n===1?K.default.red(ku):K.default.red(Au);s=g(t??s),e===`timer`?process.stdout.write(`${r} ${s} ${_(l)}
194
+ `):process.stdout.write(`${r} ${s}
195
+ `),m(),i()};return{start:v,stop:y,message:(e=``)=>{s=g(e??s)}}},Qu={red:e=>K.default.red(e),green:e=>K.default.green(e),yellow:e=>K.default.yellow(e),blue:e=>K.default.blue(e),cyan:e=>K.default.cyan(e),magenta:e=>K.default.magenta(e),gray:e=>K.default.gray(e),bold:e=>K.default.bold(e),dim:e=>K.default.dim(e)},$u={async select(e,t){let n=await qu({message:e,options:t.map(e=>({value:e.value,label:e.label,hint:e.hint}))});return pu(n)&&(Yu(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async textInput(e,t){let n=await Gu({message:e,placeholder:t?.placeholder,defaultValue:t?.defaultValue});return pu(n)&&(Yu(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async confirm(e,t){let n=await Ku({message:e,initialValue:t?.defaultValue??!1});return pu(n)&&(Yu(`操作已取消`),process.exit(0)),typeof n==`boolean`?n:!!n},spinner(){let e=Zu();return{start(t){e.start(t)},stop(t){e.stop(t)}}},note(e,t){Ju(e,t)},log:{info(e){Xu.info(K.default.blue(e))},success(e){Xu.success(K.default.green(e))},warn(e){Xu.warn(K.default.yellow(e))},error(e){Xu.error(K.default.red(e))},step(e){Xu.step(e)}}},ed=`[a-z][a-z0-9-]*`,td=/^[a-z][a-z0-9-]*$/,nd=[`forbid`,`allow`];function rd(e){return{name:e.name,description:e.description,arguments:e.arguments,options:e.options,schema:e.schema,action:async(t,n)=>{await e.action(e.schema.parse(t),n)}}}function id(e){if(!td.test(e.name))throw Error(`插件名须为 kebab-case(小写字母开头,仅小写字母/数字/连字符):${e.name}`);if(e.version.trim()===``)throw Error(`插件 ${e.name} 的 version 不得为空`);if(e.commands.length===0)throw Error(`插件 ${e.name} 须至少声明一个命令工厂`);return e}function ad(e){let t={},n=[];for(let r of e){let e=r.provides??{};for(let[i,a]of Object.entries(e))i in t?n.push(`服务「${i}」被重复提供(${i} 已在册,${r.name} 重复声明)`):t[i]=a}for(let r of e){let e=r.consumes??[];for(let i of e)i in t||n.push(`插件「${r.name}」消费的服务「${i}」无提供方(在册服务:${Object.keys(t).join(`、`)||`无`})`)}return{services:t,errors:n}}function od(e,t){let n={};for(let r of e.consumes??[])n[r]=t[r];return n}async function sd(e,t){for(let n of e){let e=n[t];e!==void 0&&await e()}}function cd(e){return/\d/.test(e)}function ld(e){let t=/^\d+[-._ ](.+)\.[^.]+$/.exec(e);return t===null?null:t[1]??``}var ud=class extends Error{entry;constructor(e,t){super(`外部插件「${e}」装载失败:${t}`),this.name=`PluginLoadError`,this.entry=e}};const dd=W({name:V().regex(td,`name 须为 kebab-case 非空字符串`),version:V().min(1,`version 须为非空字符串`),commands:vl(e=>Array.isArray(e)&&e.length>0&&e.every(e=>typeof e==`function`),`commands 须为非空的命令工厂函数数组`),provides:vl(e=>typeof e==`object`&&!!e&&!Array.isArray(e),`provides 存在时须为对象(服务名 → API 对象)`).optional(),consumes:U(V()).optional(),hooks:vl(e=>typeof e==`object`&&!!e&&Object.values(e).every(e=>e===void 0||typeof e==`function`),`hooks 存在时须为对象且各钩子为函数`).optional(),configSchema:vl(e=>typeof e==`object`&&!!e&&`parse`in e,`configSchema 存在时须为具备 parse 方法的 zod schema`).optional()});function fd(t,n){let r=e(l.join(n,`package.json`));return t.startsWith(`./`)||t.startsWith(`../`)?m(l.resolve(n,t)).href:m(r.resolve(t)).href}function pd(e){return typeof e==`object`&&!!e&&`default`in e}async function md(e,t){let n=await import(fd(e,t)).catch(t=>{throw new ud(e,`模块不可达(${t instanceof Error?t.message:String(t)})`)}),r=pd(n)?n.default:n,i=dd.safeParse(r);if(!i.success)throw new ud(e,i.error.issues.map(e=>e.message).join(`;`));return i.data}const hd=Wc({name:V().regex(td,`name 须为 kebab-case 非空字符串`),status:Xc([`登记中`,`已发布`]),holdingRepo:V().min(1,`holdingRepo 须为非空字符串(自持仓仓名)`),entryPackage:V().min(1).optional(),version:V().min(1).optional(),compatibleRange:V().min(1).optional(),docs:V().min(1).optional(),summary:V().min(1,`summary 须为非空一句话职能`)}).refine(e=>e.status!==`已发布`||e.entryPackage!==void 0,{error:`已发布条目必须携带 entryPackage`,path:[`entryPackage`]}).refine(e=>e.status!==`已发布`||e.version!==void 0,{error:`已发布条目必须携带 version`,path:[`version`]}),gd=Wc({category:V().regex(td,`category 须为 kebab-case 非空字符串`),names:U(V().regex(td,`文档名须为 kebab-case 非空字符串`)).min(1,`names 须为非空数组`)}).refine(e=>new Set(e.names).size===e.names.length,{error:`names 不得重复`,path:[`names`]}),_d=Wc({artifact:V().min(1,`artifact 须为非空产物路径或形态描述`),mechanism:V().min(1,`mechanism 须为非空生成机制描述`),handEdit:Xc([`禁手编`,`可手编`]),marker:V().min(1).optional()}),vd=Wc({path:V().min(1,`path 须为非空仓内相对路径`)}),yd=Wc({path:V().min(1,`path 须为非空仓内相对路径`)}),bd=Wc({path:V().min(1,`path 须为非空仓内相对路径`),contains:V().min(1,`contains 须为非空标记子串`)}),xd=Wc({repo:V().min(1,`repo 须为非空探针目标仓名`),requires:U(vd).min(1).optional(),ifPresent:U(yd).min(1).optional(),markerIn:U(bd).min(1).optional()}).refine(e=>e.requires!==void 0||e.ifPresent!==void 0||e.markerIn!==void 0,{error:`探针至少须声明 requires / ifPresent / markerIn 之一`,path:[`requires`]}),Sd=Wc({name:V().regex(td,`name 须为 kebab-case 非空字符串`),summary:V().min(1,`summary 须为非空一句话职能`),status:Xc([`登记中`,`已确认`]),truthSource:Wc({repo:V().min(1,`repo 须为非空真源仓或仓族描述`),path:V().min(1,`path 须为非空真源路径`)}),renders:U(_d).min(1).optional(),distribution:V().min(1).optional(),consumers:U(V().min(1)).min(1,`consumers 须为非空消费面清单`),probes:U(xd).min(1).optional(),notes:V().min(1).optional()}),Cd=`registry`;W({id:V(),name:V().min(1,`分类名称不能为空`),slug:V().min(1,`分类标识不能为空`),description:V().nullable(),parentId:V().nullable(),sortOrder:Nc().int().min(0),createdAt:V(),updatedAt:V()}),W({id:V(),docId:V(),version:V().min(1,`版本号不能为空`),content:V(),createdAt:V(),updatedAt:V()});const wd=`^\\d{1,4}[-._]`,Td=[`docs`],Ed=/^\d+$/,Dd=W({number:V().regex(Ed),reason:V().min(1)}),Od=W({glob:V().min(1),reason:V().min(1)}),kd=W({key:V().regex(td),title:V().min(1),paths:U(V().min(1)).min(1),registryDir:V().min(1),numbering:W({reserved:U(Dd)}).default({reserved:[]}),slugDigitPolicy:Xc(nd).optional()}),Ad=W({allowlist:U(W({scopeKey:V().min(1),number:V().regex(Ed),files:U(V().min(1)).min(2),status:Xc([`待清偿`,`维持现状`]),reason:V().min(1)})).default([]),globalExclusions:U(Od).default([]),audit:W({roots:U(V().min(1)).min(1).default([...Td]),numberishPattern:V().min(1).default(wd),pending:U(Od).default([])}).default({roots:[...Td],numberishPattern:wd,pending:[]})}),jd=W({scopes:U(kd).min(1),numbering:Ad.default({allowlist:[],globalExclusions:[],audit:{roots:[...Td],numberishPattern:wd,pending:[]}})});function Md(e){let t=jd.safeParse(e);if(!t.success)throw Error(`numbering 插件配置非法:${t.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}——${e.message}`).join(`;`)}`);return t.data}var Nd=class extends Error{constructor(e,t){super(`glob 模式「${e}」非法:${t}`),this.name=`MiniGlobError`}};const Pd=/* @__PURE__ */ new Set([`.`,`^`,`$`,`+`,`(`,`)`,`|`,`\\`,`]`]),Fd=/* @__PURE__ */ new Map;function Id(e){return Pd.has(e)?`\\${e}`:e}function Ld(e,t){let n=``,r=0;for(;r<t.length;){let i=t[r]??``;if(i===`[`)throw new Nd(e,`不支持字符类 [(与既有生态对齐,显式抛错不静默误配)`);if(i===`*`){let e=0;for(;(t[r+e]??``)===`*`;)e+=1;if(e>=2&&(t[r+e]??``)===`/`){n+=`(?:.*/)?`,r+=e+1;continue}if(e>=2){n+=`[\\s\\S]*`,r+=e;continue}n+=`[^/]*`,r+=1}else i===`?`?(n+=`[^/]`,r+=1):(n+=Id(i),r+=1)}return n}function Rd(e,t){let n=t.indexOf(`{`);if(n===-1)return Ld(e,t);let r=t.indexOf(`}`,n+1);if(r===-1)throw new Nd(e,`大括号未闭合`);let i=t.slice(0,n),a=t.slice(n+1,r);if(a.includes(`{`))throw new Nd(e,`不支持嵌套大括号`);let o=a.split(`,`),s=t.slice(r+1);return`(?:${o.map(t=>Rd(e,`${i}${t}${s}`)).join(`|`)})`}function zd(e){let t=Fd.get(e);if(t!==void 0)return t;let n=RegExp(`^${Rd(e,e)}$`);return Fd.set(e,n),n}function Bd(e,t){return zd(e).test(t)}function Vd(e,t){if(t.kind===`numericPrefix`)return/^(\d+)(?=[-._ ]|$)/.exec(e)?.[1]??null;if(t.kind===`compositePrefix`)return RegExp(`^(\\d+(?:[-._ ]\\d+){${t.groups-1}})(?=[-._ ]|$)`).exec(e)?.[1]??null;if(t.kind===`numericSuffix`){let t=e.replace(/\.[^.]+$/,``);return/(\d+)$/.exec(t)?.[1]??null}return new RegExp(t.pattern).exec(e)?.groups?.key??null}function Hd(e){let t=/^\d+/.exec(e);return t===null?null:Number.parseInt(t[0]??``,10)}function Ud(e){let t=/* @__PURE__ */ new Set;for(let n of e.basenames){let r=Vd(n,e.rule);r!==null&&t.add(r)}if(t.size===0)return{ok:!1,error:`该范围当前无编号文件,无法推断位数——请人工定号后落盘`};let n=``;for(let e of t)(Hd(e)??0)>(Hd(n)||0)&&(n=e);if(n===``)return{ok:!1,error:`该范围无数字前缀键,无法取号`};let r=n.length,i=new Set(e.reserved),a=0,o=0,s=(Hd(n)??0)+1;for(;;){let e=String(s).padStart(r,`0`);if(t.has(e))a+=1,s+=1;else if(i.has(e))o+=1,s+=1;else return{ok:!0,number:e,skippedOccupied:a,skippedReserved:o}}}function Wd(e,t){if(e.length!==t.length)return!1;let n=[...e].sort(),r=[...t].sort();return n.every((e,t)=>e===r[t])}function Gd(e){let t=[],n=/* @__PURE__ */ new Map;for(let t of e.basenames){let r=Vd(t,e.rule);r!==null&&n.set(r,[...n.get(r)??[],t])}let r=new Map(e.reserved.map(e=>[e.number,e.reason])),i=/* @__PURE__ */ new Set;for(let[a,o]of n){if(o.length>=2){let n=e.allowlist.findIndex((t,n)=>!i.has(n)&&t.number===a&&Wd(t.files,o.map(t=>e.toRepoRelative(t))));n===-1?t.push({kind:`duplicate`,scopeKey:e.scopeKey,message:`scope「${e.scopeKey}」编号 ${a} 撞号:${o.join(`、`)}——先入库者保号,后到线顺延清偿`}):i.add(n);continue}let n=r.get(a);n!==void 0&&t.push({kind:`reservedOccupied`,scopeKey:e.scopeKey,message:`scope「${e.scopeKey}」保留号 ${a} 被占用(${o.join(`、`)};保留理由:${n}——保留号不回收复用,请让号重编`})}if([...n.keys()].some(e=>e.length>1&&e.startsWith(`0`))){let r=new Set([...n.keys()].map(e=>e.length));r.size>1&&t.push({kind:`widthInconsistent`,scopeKey:e.scopeKey,message:`scope「${e.scopeKey}」零填充位数混用(族内键长 ${[...r].sort((e,t)=>e-t).join(`/`)}):${[...n.keys()].slice(0,6).join(`、`)}`})}if(e.allowlist.forEach((r,a)=>{if(i.has(a))return;let o=r.files.filter(e=>{let t=e.split(`/`).pop()??``;return(n.get(r.number)??[]).includes(t)});t.push({kind:`allowlistStale`,scopeKey:e.scopeKey,message:`scope「${e.scopeKey}」豁免条目(${r.number},${r.status})已无对应现行撞号组——棘轮只许缩短,须同步删除该条目(登记集:${r.files.join(`、`)};磁盘现状:${o.length>0?o.join(`、`):`无`})`})}),e.slugDigitPolicy!==`allow`)for(let n of e.basenames){let r=ld(n);r!==null&&r!==``&&cd(r)&&t.push({kind:`slugContainsDigit`,scopeKey:e.scopeKey,message:`scope「${e.scopeKey}」slug 段含数字:${n}——禁数字域无逐条豁免,处置为改名或该域声明政策 allow`})}return{findings:t}}function Kd(e){let t=[],n=new RegExp(e.numberishPattern),r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Set;for(let t of e.files){let a=t.split(`/`).pop()??``;if(!n.test(a)||e.registryDirs.some(e=>t===e||t.startsWith(`${e}/`))||e.pending.find(e=>Bd(e.glob,t)?(i.add(e.glob),!0):!1)!==void 0)continue;let o=t.split(`/`).slice(0,-1).join(`/`);r.set(o,[...r.get(o)??[],a])}for(let e of[...r.keys()].sort((e,t)=>e.localeCompare(t)))t.push({kind:`coverageGap`,message:`未登记编号区:目录 ${e===``?`(仓库根)`:e} 有 ${r.get(e)?.length??0} 个编号文件未被任何 scope/pending 覆盖——${(r.get(e)??[]).join(`、`)}(请在 numbering 插件配置登记 scope 或 pending 并注明理由)`});for(let n of e.pending)i.has(n.glob)||t.push({kind:`pendingStale`,message:`pending 条目「${n.glob}」已匹配不到任何编号文件——棘轮只许缩短,须同步删除该条目(登记理由:${n.reason})`});return t}function qd(e,t){return e.some(e=>Bd(e,t)||Bd(e,`${t}/`)||Bd(e,`${t}/**`))}function Jd(e,t){return e.some(e=>Bd(e,t))}function Yd(e,t){return e.some(e=>e===``||t===e||t.startsWith(`${e}/`)||e.startsWith(`${t}/`))}function Xd(e,t){return e.some(e=>e===``||t.startsWith(`${e}/`))}const Zd=/* @__PURE__ */ new Set([`.git`,`node_modules`,`dist`,`build`,`out`,`.turbo`,`coverage`,`.nyc_output`,`.lzi`]);function Qd(e,t,n,r,a,s){if(!i(e)){if(a)throw Error(`扫描面目录缺失:${e}(严格模式防扫描面静默缩水)`);return}let c=o(e,{withFileTypes:!0}).sort((e,t)=>e.name.localeCompare(t.name));for(let i of c){let o=t===``?i.name:`${t}/${i.name}`;if(i.isDirectory()){if(Zd.has(i.name)||qd(r,o)||!Yd(n,o))continue;Qd(d(e,i.name),o,n,r,a,s)}else if(i.isFile()){if(Jd(r,o)||!Xd(n,o))continue;s.push(f.normalize(o))}}}function $d(e,t,n={}){let r=[];return Qd(e,``,t,n.excludeGlobs??[],!1,r),r.sort((e,t)=>e.localeCompare(t))}function ef(e,t={}){let n=[];return Qd(e,``,[``],t.excludeGlobs??[],!0,n),n.sort((e,t)=>e.localeCompare(t))}const tf={kind:`numericPrefix`};function nf(e,t){return $d(e,[t]).map(e=>e.split(`/`).pop()??``)}function rf(e){let t=e.scopeKey!==void 0&&e.dirRel!==void 0,n=e.scopeKey===void 0&&e.dirRel===void 0;if(t||n)return{ok:!1,error:`取号须且仅须指定 --scope <key> 或 --dir <目录> 之一`};if(e.scopeKey!==void 0){let t=e.config.scopes.find(t=>t.key===e.scopeKey);if(t===void 0)return{ok:!1,error:`scope「${e.scopeKey}」未登记(请在 numbering 插件配置注册)`};let n=Ud({basenames:nf(e.root,t.registryDir),rule:tf,reserved:t.numbering.reserved.map(e=>e.number)});return n.ok?{ok:!0,number:n.number,target:t.key,skippedOccupied:n.skippedOccupied,skippedReserved:n.skippedReserved}:n}let r=e.config.scopes.filter(t=>t.registryDir===e.dirRel);if(r.length===0)return{ok:!1,error:`目录「${e.dirRel}」未登记为任何 scope 的注册表(请在 numbering 插件配置注册后再取号)`};let i=[...new Set(r.flatMap(e=>e.numbering.reserved.map(e=>e.number)))],a=Ud({basenames:nf(e.root,e.dirRel??``),rule:tf,reserved:i});return a.ok?{ok:!0,number:a.number,target:e.dirRel??``,skippedOccupied:a.skippedOccupied,skippedReserved:a.skippedReserved}:a}function af(e){let t=e.dirRel===void 0?e.config.scopes:e.config.scopes.filter(t=>t.registryDir===e.dirRel),n=[],r=0;for(let i of t){let t=nf(e.root,i.registryDir);r+=t.length;let a=e.dirRel===void 0?e.config.numbering.allowlist.filter(e=>e.scopeKey===i.key).map(e=>({...e,files:[...e.files]})):e.config.numbering.allowlist.filter(t=>t.scopeKey===i.key&&t.files.some(t=>t.startsWith(`${e.dirRel}/`))).map(e=>({...e,files:[...e.files]})),o=Gd({scopeKey:i.key,basenames:t,rule:tf,reserved:i.numbering.reserved,allowlist:a,slugDigitPolicy:i.slugDigitPolicy,toRepoRelative:e=>`${i.registryDir}/${e}`});n.push(...o.findings)}return{findings:n,scopeCount:t.length,scannedFiles:r}}function of(e){let t=[];for(let n of e.config.numbering.audit.roots)t.push(...ef(d(e.root,n),{excludeGlobs:e.config.numbering.globalExclusions.map(e=>e.glob)}).map(e=>n===``?e:`${n}/${e}`));return{findings:Kd({files:t,numberishPattern:e.config.numbering.audit.numberishPattern,registryDirs:e.config.scopes.map(e=>e.registryDir),pending:e.config.numbering.audit.pending}),scannedFiles:t.length}}const sf=W({scope:V().min(1),dir:V().min(1).optional()}),cf=W({dir:V().min(1).optional()}),lf=W({});function uf(e){return Md(e)}const df=id({name:`numbering`,version:`0.0.1`,configSchema:jd,provides:{numbering:{next:e=>rf(e)}},commands:[e=>ff(e),e=>pf(e),e=>mf(e)]});function ff(e){return rd({name:`numbering-next`,description:`取号:max+1 顺延跳已占与保留,宽度随最大键`,options:[{flags:`--scope <key>`,description:`scope key`},{flags:`--dir <dir>`,description:`目录增量定向(可选)`}],schema:sf,action:async t=>{let n=uf(e.pluginConfig),r=rf({root:process.cwd(),config:n,scopeKey:t.scope});r.ok?process.stdout.write(`${JSON.stringify(r,null,2)}\n`):(process.stderr.write(`错误: ${r.error}\n`),process.exit(1))}})}function pf(e){return rd({name:`numbering-check`,description:`编号违例判定:撞号、保留号占用、零填充混用、豁免陈旧、slug 数字策略`,options:[{flags:`--dir <dir>`,description:`目录增量定向(可选)`}],schema:cf,action:async t=>{let n=uf(e.pluginConfig),r=af({root:process.cwd(),config:n,dirRel:t.dir});for(let e of r.findings)process.stderr.write(`[numbering:${e.kind}] ${e.message}\n`);r.findings.length>0&&process.exit(1)}})}function mf(e){return rd({name:`numbering-audit`,description:`覆盖面审计:形似编号文件必须被 scope、排除、pending 之一覆盖`,schema:lf,action:async()=>{let t=uf(e.pluginConfig),n=of({root:process.cwd(),config:t});for(let e of n.findings)process.stderr.write(`[numbering:${e.kind}] ${e.message}\n`);n.findings.length>0&&process.exit(1)}})}var hf=class extends Error{configPath;constructor(e,t){super(e),this.name=`SharedConfigError`,this.configPath=t}},gf=class extends hf{searchFrom;constructor(e){super(`未在 ${e} 找到配置文件`,e),this.name=`SharedConfigNotFoundError`,this.searchFrom=e}},_f=class extends hf{issues;constructor(e,t){super(`配置校验失败,共 ${e.length} 个问题`,t),this.name=`SharedConfigValidationError`,this.issues=e}};function vf(e,t,n,r){let i=e;if(r.schema!==void 0){let e=r.schema.safeParse(i);if(!e.success)throw new _f(e.error.issues,t);i=e.data}return r.transform!==void 0&&(i=r.transform(i,n)),i}var yf=class extends hf{cause;constructor(e,t){super(`加载配置文件 ${e} 失败`,e),this.name=`SharedConfigLoadError`,this.cause=t}};function bf(e){return typeof e==`object`&&!!e}function xf(e){return typeof e==`object`&&!!e}async function Sf(e,t={}){let n=p(e);if(!i(n))throw new gf(n);let r;try{let e=await import(n);r=bf(e)?e.default:void 0}catch(e){throw new yf(n,e)}if(r===void 0)throw new yf(n,TypeError(`配置文件缺少默认导出`));if(!xf(r))throw new yf(n,TypeError(`配置文件的默认导出必须是对象`));return{config:vf(r,n,u(n),t),configFilePath:n}}function Cf(e=process.cwd()){let t=p(e);for(;;){let e=d(t,`lzi.config.ts`);if(i(e))return e;let n=u(t);if(n===t)return null;t=n}}async function wf(e={}){let t=e.cwd??process.cwd(),n=Cf(t);if(n===null)throw new gf(t);let r=p(n,`..`),{config:i}=await Sf(n);return{config:i,configPath:r,configFilePath:n}}function Tf(e){return typeof e==`object`&&!!e}async function Ef(e){let t;try{t=await S(e)}catch(t){throw new yf(e,t)}let n=t.filter(e=>e.endsWith(`.config.ts`)).sort();if(n.length===0)throw new yf(e,Error(`配置目录内没有 .config.ts 分片文件`));let r={};for(let t of n){let n=await Sf(d(e,t));r={...r,...n.config}}let i=r;if(!Tf(i))throw new yf(e,Error(`配置目录合并结果不是对象形态`));return i}function Df(e,t=process.cwd()){let n=Array.isArray(e)?e:[e],r=p(t);for(;;){for(let e of n){let t=d(r,e);if(Of(t))return t}let e=u(r);if(e===r)return null;r=e}}function Of(e){try{return c(e).isDirectory()}catch{return!1}}function kf(e,t=process.cwd()){let n=Array.isArray(e)?e:[e],r=p(t);for(;;){for(let e of n){let t=d(r,e);if(i(t))return t}let e=u(r);if(e===r)return null;r=e}}function Af(e){return typeof e==`object`&&!!e}function jf(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function Mf(e={}){let t=e.cwd??p(process.cwd());if(e.explicitPath!==void 0){let t=await Sf(e.explicitPath,{schema:e.schema,transform:e.transform});return{success:!0,config:t.config,source:`explicit`,configFilePath:t.configFilePath}}if(e.standaloneFile!==void 0){let n=kf(e.standaloneFile,t);if(n!==null){let{config:t}=await Sf(n);return{success:!0,config:vf(t,n,u(n),e),source:`standalone`,configFilePath:n}}}if(e.standaloneDir!==void 0){let n=Df(e.standaloneDir,t);if(n!==null)return{success:!0,config:vf(await Ef(n),n,n,e),source:`standalone`,configFilePath:n}}if(e.unifiedField!==void 0){let n,r;try{let{config:i,configFilePath:a}=await wf({cwd:t}),o=i;n=jf(o)?o[e.unifiedField]:void 0,r=a}catch{}if(r!==void 0&&n!==void 0&&Af(n))return{success:!0,config:vf(n,r,u(r),e),source:`unified`,configFilePath:r}}return{success:!1,configFilePath:null}}async function Nf(e){let t=await Mf({standaloneFile:`lzi-docs.config.ts`,unifiedField:`docs`,cwd:e});if(!t.success)throw Error(`未在 ${e} 及其上级目录找到 lzi-docs.config.ts 或 lzi.config.ts 的 docs 字段,请先创建工具专属配置`);let n=t.config;return{source:n.source??`git@gitcode.com:longzai-tech/longzai-intelligence-docs.git`,namespace:n.namespace??`longzai-intelligence`,base:n.base??`docs`,docs:n.docs,packages:n.packages,plugins:n.plugins}}async function Pf(e){try{return await Nf(e)}catch(e){if(e instanceof Error&&e.message.includes(`lzi-docs.config.ts`))return;throw e}}async function Ff(e,t,n){let r=[],i=[...t],a=Object.fromEntries(Object.entries(n?.plugins??{}).filter(([,e])=>e.entry===void 0).map(([e,t])=>[e,t.options])),o=new Set(i.map(e=>e.name));for(let[t,s]of Object.entries(n?.plugins??{}))if(s.enabled!==!1){if(o.has(t)){if(s.entry===void 0)continue;r.push(`插件名「${t}」与已装载插件重名(内置或先装载者保留,如需覆盖请移除内置声明)`)}else try{let t=await md(s.entry,e);i.push(t),o.add(t.name),a[t.name]=s.options}catch(e){let n=e instanceof Error?e.message:String(e);r.push(`插件「${t}」装载失败:${n}`)}}return{plugins:i,pluginOptions:a,errors:r}}function If(e,t,n){let{services:r,errors:i}=ad(t);if(i.length>0)return i;let a=t.map(e=>e.hooks??{});for(let i of t){let t;if(i.configSchema!==void 0){let e=i.configSchema.safeParse(n[i.name]);e.success||(t=e.error.issues.map(e=>e.message).join(`;`))}if(t!==void 0)return[`插件「${i.name}」配置节校验失败:${t}`];let o={services:od(i,r),pluginConfig:n[i.name],allHooks:a};for(let t of i.commands)Pl(e,t(o))}return[]}function Lf(e,t){let n=[],r=new Map(t.map(e=>[e.category,new Set(e.names)]));for(let[t,i]of Object.entries(e??{})){let e=r.get(t);if(e===void 0)n.push(`${t}/*(目录中无此分类)`);else for(let r of Object.keys(i))e.has(r)||n.push(`${t}/${r}`)}return n}function Rf(e,t){let n=[];for(let i of t){let t;try{t=new Set(r.readdirSync(l.join(e,`library`,i.category),{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name))}catch{n.push(`${i.category}/*(library 下无此分类目录)`);continue}for(let e of i.names)t.has(e)||n.push(`${i.category}/${e}(library 缺此目录)`);for(let e of t)i.names.includes(e)||n.push(`${i.category}/${e}(library 有而目录未登记)`)}return n}const zf=RegExp(`^(${ed})\\.plugin\\.ts$`),Bf=RegExp(`^(${ed})\\.docs\\.ts$`),Vf=RegExp(`^(${ed})\\.source\\.ts$`);function Hf(e){let t=l.join(e,Cd);try{return o(t),t}catch{return null}}function Uf(e){let t=process.env.LZI_DOCS_REGISTRY_ROOT;if(t!==void 0&&t.trim()!==``&&Hf(t)!==null)return t;let n=e;for(;;){let e=l.join(n,`longzai-intelligence-docs-registry`);if(Hf(e)!==null)return e;let t=l.dirname(n);if(t===n)return null;n=t}}function Wf(e,t,n){try{return o(l.join(e,Cd,t)).filter(e=>n.test(e)).sort()}catch{return[]}}async function Gf(e){let t=Wf(e,`plugins`,zf),n=Wf(e,`docs`,Bf),r=Wf(e,`sources`,Vf);if(t.length===0&&n.length===0&&r.length===0)throw Error(`docs-registry 声明域为空(${e})——至少须有一个插件登记档、目录档或真源档`);let i=[];for(let n of t){let t=zf.exec(n)?.[1]??``,r=await qf(l.join(e,Cd,`plugins`,n)),a=hd.safeParse(r);if(!a.success)throw Error(`插件登记档 ${n} 非法:${a.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}——${e.message}`).join(`;`)}`);if(a.data.name!==t)throw Error(`插件登记档 ${n} 的 name「${a.data.name}」与文件名不符`);i.push(a.data)}let a=[];for(let t of n){let n=Bf.exec(t)?.[1]??``,r=await qf(l.join(e,Cd,`docs`,t)),i=gd.safeParse(r);if(!i.success)throw Error(`文档目录档 ${t} 非法:${i.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}——${e.message}`).join(`;`)}`);if(i.data.category!==n)throw Error(`文档目录档 ${t} 的 category「${i.data.category}」与文件名不符`);a.push(i.data)}let o=[];for(let t of r){let n=Vf.exec(t)?.[1]??``,r=await qf(l.join(e,Cd,`sources`,t)),i=Sd.safeParse(r);if(!i.success)throw Error(`真源登记档 ${t} 非法:${i.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}——${e.message}`).join(`;`)}`);if(i.data.name!==n)throw Error(`真源登记档 ${t} 的 name「${i.data.name}」与文件名不符`);o.push(i.data)}if(new Set(i.map(e=>e.name)).size!==i.length)throw Error(`docs-registry 插件登记名重复`);if(new Set(a.map(e=>e.category)).size!==a.length)throw Error(`docs-registry 文档分类名重复`);if(new Set(o.map(e=>e.name)).size!==o.length)throw Error(`docs-registry 真源登记名重复`);return{root:e,plugins:i,docCategories:a,sources:o}}async function Kf(e){let t=Uf(e);return t===null?null:Gf(t)}async function qf(e){let t=await import(m(s(e)).href);return Jf(t)?t.default:t}function Jf(e){return typeof e==`object`&&!!e&&`default`in e}const Yf=`lzi-docs.lock`;function Xf(e){let t=l.join(e,Yf);if(!r.existsSync(t))return null;let n=r.readFileSync(t,`utf-8`),i=JSON.parse(n);if(!Zf(i))throw Error(`lzi-docs.lock 内容非法(期望:包路径 -> 文档类型/名称 -> 版本字符串)`);return i}function Zf(e){return typeof e!=`object`||!e?!1:Object.values(e).every(e=>typeof e!=`object`||!e?!1:Object.values(e).every(e=>typeof e==`string`))}function Qf(e,t){let n=l.join(e,Yf),i=$f(t);r.writeFileSync(n,JSON.stringify(i,null,2)+`
196
+ `,`utf-8`)}function $f(e){let t={};for(let n of e){let e=tp(n.dest),r=`${n.category}/${n.name}`;t[e]||(t[e]={}),t[e][r]=n.version}return t}function ep(e,t){if(!t)return{added:e,removed:[],changed:[]};let n=[],r=[],i=[],a=/* @__PURE__ */ new Map;for(let t of e){let e=`${tp(t.dest)}::${t.category}/${t.name}`;a.set(e,t)}let o=/* @__PURE__ */ new Map;for(let[e,n]of Object.entries(t))for(let[t,r]of Object.entries(n)){let n=`${e}::${t}`,[i=``,a=``]=t.split(`/`);o.set(n,{packagePath:e,category:i,name:a,version:r})}for(let[e,t]of a){let r=o.get(e);r?r.version!==t.version&&i.push(t):n.push(t)}for(let[e,t]of o)a.has(e)||r.push({category:t.category,name:t.name,version:t.version,dest:``});return{added:n,removed:r,changed:i}}function tp(e){let t=e.split(l.sep),[n=``,r=``]=t;return t.length>=2&&n===`packages`?l.join(n,r):`.`}const np={docs:{standards:{nextjs:`1.1.0`,tsconfig:`1.0.0`}}},rp={docs:{standards:{react:`2.0.0`,tsconfig:`1.0.0`}}},ip={docs:{standards:{tsconfig:`1.0.0`},guides:{"code-review":`1.0.0`}}};var ap=/* @__PURE__ */ k({nextjs:()=>np,node:()=>ip,react:()=>rp});function op(e){return typeof e==`object`&&!!e&&`docs`in e&&typeof e.docs==`object`}const sp=Object.fromEntries(Object.entries(ap).filter(([,e])=>op(e)));function cp(e,t){let n={...e};for(let r of Object.keys(t)){let i=t[r];i&&(n[r]={...e[r],...i})}return n}function lp(e){return e.packages||e.docs,e}function up(e){let t={};for(let n of e){let e=sp[n];e?.docs&&(t=cp(t,e.docs))}return t}async function dp(e){if(!e)throw Error(`未配置 source`);let n=l.isAbsolute(e)?e:l.resolve(e);if(r.existsSync(n))return n;let i=l.join(t.tmpdir(),`lzi-docs-cache`);r.existsSync(i)||r.mkdirSync(i,{recursive:!0});let a=fp(e),o=l.join(i,a);if(r.existsSync(o)){let{execSync:e}=await import(`node:child_process`);e(`git pull`,{cwd:o,stdio:`pipe`})}else{let{execSync:t}=await import(`node:child_process`);t(`git clone ${e} ${o}`,{stdio:`pipe`})}return o}function fp(e){return`lzi-docs-${l.basename(e,`.git`)}`}var pp=/* @__PURE__ */ O(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||
197
+ /* istanbul ignore next */9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),mp=/* @__PURE__ */ O(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),hp=/* @__PURE__ */ O(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=pp(),a=mp();e=t.exports={};let o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),gp=/* @__PURE__ */ O(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),_p=/* @__PURE__ */ O(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),X=/* @__PURE__ */ O(((e,t)=>{let n=mp(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=pp(),{safeRe:a,t:o}=hp(),s=gp(),{compareIdentifiers:c}=_p(),l=(e,t)=>{let n=t.split(`.`);if(n.length>e.length)return!1;for(let t=0;t<n.length;t++)if(c(e[t],n[t])!==0)return!1;return!0};t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=l[4]?l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):[],this.build=l[5]?l[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}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),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(t){if(t instanceof e||(t=new e(t,this.options)),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 r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,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 r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];if(n===!1&&(r=[t]),l(this.prerelease,t)){let e=this.prerelease[t.split(`.`).length];isNaN(e)&&(this.prerelease=r)}else this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),vp=/* @__PURE__ */ O(((e,t)=>{let n=X();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),yp=/* @__PURE__ */ O(((e,t)=>{let n=vp();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),bp=/* @__PURE__ */ O(((e,t)=>{let n=vp();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),xp=/* @__PURE__ */ O(((e,t)=>{let n=X();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),Sp=/* @__PURE__ */ O(((e,t)=>{let n=vp();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),Cp=/* @__PURE__ */ O(((e,t)=>{let n=X();t.exports=(e,t)=>new n(e,t).major})),wp=/* @__PURE__ */ O(((e,t)=>{let n=X();t.exports=(e,t)=>new n(e,t).minor})),Tp=/* @__PURE__ */ O(((e,t)=>{let n=X();t.exports=(e,t)=>new n(e,t).patch})),Ep=/* @__PURE__ */ O(((e,t)=>{let n=vp();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),Dp=/* @__PURE__ */ O(((e,t)=>{let n=X();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),Op=/* @__PURE__ */ O(((e,t)=>{let n=Dp();t.exports=(e,t,r)=>n(t,e,r)})),kp=/* @__PURE__ */ O(((e,t)=>{let n=Dp();t.exports=(e,t)=>n(e,t,!0)})),Ap=/* @__PURE__ */ O(((e,t)=>{let n=X();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),jp=/* @__PURE__ */ O(((e,t)=>{let n=Ap();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),Mp=/* @__PURE__ */ O(((e,t)=>{let n=Ap();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),Np=/* @__PURE__ */ O(((e,t)=>{let n=Dp();t.exports=(e,t,r)=>n(e,t,r)>0})),Pp=/* @__PURE__ */ O(((e,t)=>{let n=Dp();t.exports=(e,t,r)=>n(e,t,r)<0})),Fp=/* @__PURE__ */ O(((e,t)=>{let n=Dp();t.exports=(e,t,r)=>n(e,t,r)===0})),Ip=/* @__PURE__ */ O(((e,t)=>{let n=Dp();t.exports=(e,t,r)=>n(e,t,r)!==0})),Lp=/* @__PURE__ */ O(((e,t)=>{let n=Dp();t.exports=(e,t,r)=>n(e,t,r)>=0})),Rp=/* @__PURE__ */ O(((e,t)=>{let n=Dp();t.exports=(e,t,r)=>n(e,t,r)<=0})),zp=/* @__PURE__ */ O(((e,t)=>{let n=Fp(),r=Ip(),i=Np(),a=Lp(),o=Pp(),s=Rp();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),Bp=/* @__PURE__ */ O(((e,t)=>{let n=X(),r=vp(),{safeRe:i,t:a}=hp();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2],c=o[3]||`0`,l=o[4]||`0`,u=t.includePrerelease&&o[5]?`-${o[5]}`:``,d=t.includePrerelease&&o[6]?`+${o[6]}`:``;return r(`${s}.${c}.${l}${u}${d}`,t)}})),Vp=/* @__PURE__ */ O(((e,t)=>{let n=vp(),r=pp(),i=X(),a=(e,t,n)=>{if(!r.RELEASE_TYPES.includes(t))return null;let i=o(e,n);return i&&s(i,t)},o=(e,t)=>{let r=e instanceof i?e.version:e;return n(r,t)},s=(e,t)=>{if(c(t))return e.version;switch(e.prerelease=[],t){case`major`:e.minor=0,e.patch=0;break;case`minor`:e.patch=0}return e.format()},c=e=>e.startsWith(`pre`);t.exports=a})),Hp=/* @__PURE__ */ O(((e,t)=>{t.exports=class{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;this.delete(e)}this.map.set(e,t)}return this}}})),Up=/* @__PURE__ */ O(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)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=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!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=>!_(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&&v(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}parseRange(e){e=e.replace(g,``);let t=((this.options.includePrerelease&&m)|(this.options.loose&&h))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(s,A(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[u.COMPARATORTRIM],d),o(`comparator trim`,e),e=e.replace(c[u.TILDETRIM],f),o(`tilde trim`,e),e=e.replace(c[u.CARETTRIM],p),o(`caret trim`,e);let l=e.split(` `).map(e=>b(e,this.options)).join(` `).split(/\s+/).map(e=>k(e,this.options));i&&(l=l.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[u.COMPARATORLOOSE])))),o(`range list`,l);let v=/* @__PURE__ */ new Map,y=l.map(e=>new a(e,this.options));for(let e of y){if(_(e))return[e];v.set(e.value,e)}v.size>1&&v.has(``)&&v.delete(``);let x=[...v.values()];return r.set(t,x),x}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>y(e,n)&&t.set.some(t=>y(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(te(this.set[t],e,this.options))return!0;return!1}};let r=new(Hp()),i=gp(),a=Wp(),o=mp(),s=X(),{safeRe:c,src:l,t:u,comparatorTrimReplace:d,tildeTrimReplace:f,caretTrimReplace:p}=hp(),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:h}=pp(),g=new RegExp(l[u.BUILD],`g`),_=e=>e.value===`<0.0.0-0`,v=e=>e.value===``,y=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},b=(e,t)=>(e=e.replace(c[u.BUILD],``),o(`comp`,e,t),e=T(e,t),o(`caret`,e),e=C(e,t),o(`tildes`,e),e=E(e,t),o(`xrange`,e),e=O(e,t),o(`stars`,e),e),x=e=>!e||e.toLowerCase()===`x`||e===`*`,S=(e,t,n)=>x(e)&&!x(t)||x(t)&&n&&!x(n),C=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(` `),w=(e,t)=>{let n=t.loose?c[u.TILDELOOSE]:c[u.TILDE],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`tilde`,e,t,n,i,a,s);let c;return x(n)?c=``:x(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:x(a)?c=`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:s?(o(`replaceTilde pr`,s),c=`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`):c=`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`,o(`tilde return`,c),c})},T=(e,t)=>e.trim().split(/\s+/).map(e=>ee(e,t)).join(` `),ee=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[u.CARETLOOSE]:c[u.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return x(n)?c=``:x(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:x(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},E=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>D(e,t)).join(` `)),D=(e,t)=>{e=e.trim();let n=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{if(o(`xRange`,e,n,r,i,a,s,c),S(i,a,s))return e;let l=x(i),u=l||x(a),d=u||x(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},O=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[u.STAR],``)),k=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],``)),A=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=x(r)?``:x(i)?`>=${r}.0.0${e?`-0`:``}`:x(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=x(l)?``:x(u)?`<${+l+1}.0.0-0`:x(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),te=(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++)if(o(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),Wp=/* @__PURE__ */ O(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.value=this.semver===n?``:this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),this.semver=r[2]?new c(r[2],this.options.loose):n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new l(t.value,n).test(this.value):t.operator===``?t.value===``||new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.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.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=gp(),{safeRe:i,t:a}=hp(),o=zp(),s=mp(),c=X(),l=Up()})),Gp=/* @__PURE__ */ O(((e,t)=>{let n=Up();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),Kp=/* @__PURE__ */ O(((e,t)=>{let n=Up();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),qp=/* @__PURE__ */ O(((e,t)=>{let n=X(),r=Up();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),Jp=/* @__PURE__ */ O(((e,t)=>{let n=X(),r=Up();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),Yp=/* @__PURE__ */ O(((e,t)=>{let n=X(),r=Up(),i=Np();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;
211
198
  /* istanbul ignore next */
212
- default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),Op=/* @__PURE__ */ E(((e,t)=>{let n=xp();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),kp=/* @__PURE__ */ E(((e,t)=>{let n=Yf(),r=Sp(),{ANY:i}=r,a=xp(),o=Cp(),s=dp(),c=fp(),l=gp(),u=hp();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(d){case`>`:p=s,m=l,h=c,g=`>`,_=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),Ap=/* @__PURE__ */ E(((e,t)=>{let n=kp();t.exports=(e,t,r)=>n(e,t,`>`,r)})),jp=/* @__PURE__ */ E(((e,t)=>{let n=kp();t.exports=(e,t,r)=>n(e,t,`<`,r)})),Mp=/* @__PURE__ */ E(((e,t)=>{let n=xp();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),Np=/* @__PURE__ */ E(((e,t)=>{let n=Cp(),r=ap();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),Pp=/* @__PURE__ */ E(((e,t)=>{let n=xp(),r=Sp(),{ANY:i}=r,a=Cp(),o=ap(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=/* @__PURE__ */ new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!e.test(s.semver))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!e.test(u.semver))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),Fp=(/* @__PURE__ */ E(((e,t)=>{let n=Kf(),r=Wf(),i=Yf(),a=Jf();t.exports={parse:Xf(),valid:Zf(),clean:Qf(),inc:$f(),diff:ep(),major:tp(),minor:np(),patch:rp(),prerelease:ip(),compare:ap(),rcompare:op(),compareLoose:sp(),compareBuild:cp(),sort:lp(),rsort:up(),gt:dp(),lt:fp(),eq:pp(),neq:mp(),gte:hp(),lte:gp(),cmp:_p(),coerce:vp(),truncate:yp(),Comparator:Sp(),Range:xp(),satisfies:Cp(),toComparators:wp(),maxSatisfying:Tp(),minSatisfying:Ep(),minVersion:Dp(),validRange:Op(),outside:kp(),gtr:Ap(),ltr:jp(),intersects:Mp(),simplifyRange:Np(),subset:Pp(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}})))();function Ip(e,t,r,i){let a=c.join(e,`library`,t,r);if(!n.existsSync(a))return null;let o=n.readdirSync(a,{withFileTypes:!0}).filter(e=>e.isDirectory()&&Vp(e.name)).map(e=>e.name);return o.length===0?null:(0,Fp.maxSatisfying)(o,i===`latest`?`*`:i)??null}function Lp(e,t){let n=[];if(t.docs){let r=Rp(e,t.docs,t);n.push(...r)}if(t.packages)for(let[r,i]of Object.entries(t.packages)){let a=i.docs??{};if(i.presets&&i.presets.length>0&&(a=zf(Vf(i.presets),a)),Object.keys(a).length>0){let i=Rp(e,a,t,r);n.push(...i)}}return n}function Rp(e,t,n,r){let i=[];for(let a of Object.keys(t)){let o=t[a];if(o)for(let[t,s]of Object.entries(o)){if(s===void 0)continue;let{version:o,dest:l}=zp(s),u=Ip(e,a,t,o);if(!u)continue;let d=l??Bp(n.base??`docs`,a,n.namespace??`longzai-intelligence`,t);i.push({category:a,name:t,version:u,dest:r?c.join(r,d):d})}}return i}function zp(e){return typeof e==`string`?{version:e}:{version:e.version,dest:e.dest}}function Bp(e,t,n,r){return c.join(e,t,n,r)}function Vp(e){return/^\d+\.\d+\.\d+/.test(e)}const Hp=Le(`src/plugins/check.plugin`),Up=st(),Wp=$({}),Gp=Qu({name:`check`,version:ct(),commands:[e=>Zu({name:`check`,description:`检查本地文档版本与配置的差异`,schema:Wp,action:async()=>{await td(e.allHooks,`beforeCheck`);let t=process.cwd();try{let n=Bf(await uf(t)),r=await Hf(n.source),i=Lp(r,n),a=Df(t),o=await Cf(t),s=[];o===null?Hp.info(Up.yellow(`未定位 docs-registry 声明仓——跳过文档名称目录校验与漂移校验`)):(s.push(...mf(n.docs,o.docCategories),...Object.values(n.packages??{}).flatMap(e=>mf(e.docs,o.docCategories))),s.push(...hf(r,o.docCategories)));let{added:c,removed:l,changed:u}=jf(i,a);if(s.length>0){Hp.error(Up.red(`目录校验未过:`));for(let e of s)Hp.error(Up.red(` ! ${e}`))}if(c.length===0&&l.length===0&&u.length===0&&s.length===0)Hp.info(Up.green(`所有文档版本已同步`));else{if(c.length>0){Hp.info(Up.green(`新增:`));for(let e of c)Hp.info(Up.green(` + ${e.category}/${e.name}@${e.version}`))}if(l.length>0){Hp.info(Up.red(`移除:`));for(let e of l)Hp.info(Up.red(` - ${e.category}/${e.name}@${e.version}`))}if(u.length>0){Hp.info(Up.yellow(`变更:`));for(let e of u)Hp.info(Up.yellow(` ~ ${e.category}/${e.name}@${e.version}`))}}s.length>0&&process.exit(1),await td(e.allHooks,`afterCheck`)}catch(e){let t=e instanceof Error?e.message:String(e);Hp.error(Up.red(`检查失败: ${t}`)),process.exit(1)}}})]});function Kp(e){return typeof e==`string`?`'${e}'`:typeof e==`object`&&e?`dest`in e&&e.dest?`{ version: '${e.version}', dest: '${e.dest}' }`:`{ version: '${e.version}' }`:`'latest'`}function qp(e){return e.reduce((e,t)=>e+t.names.length,0)}function Jp(e,t){let n=/* @__PURE__ */ new Map;for(let r of t){let t=e?.[r.category],i=new Set(t===void 0?[]:Object.keys(t)),a=r.names.filter(e=>!i.has(e));a.length>0&&n.set(r.category,[...a])}return n}function Yp(e,t){let n={};for(let r of t){let t=/* @__PURE__ */ new Map;for(let[n,i]of Object.entries(e?.[r.category]??{}))i!==void 0&&t.set(n,i);let i={};for(let e of r.names)i[e]=t.get(e)??`latest`;n[r.category]=i}return n}function Xp(e){return Object.keys(e).filter(t=>Object.keys(e[t]??{}).length>0).map(t=>Zp(t,e[t]??{})).join(`
213
- `)}function Zp(e,t){return` ${e}: {\n${Object.entries(t).map(([e,t])=>` ${e}: ${Kp(t??`latest`)},`).join(`
214
- `)}\n },`}function Qp(e,t){let n=Yp(e.docs,t),r=[];if(e.source&&r.push(` source: '${e.source}',`),e.namespace&&r.push(` namespace: '${e.namespace}',`),e.base&&r.push(` base: '${e.base}',`),r.push(` docs: {\n${Xp(n)}\n },`),e.packages&&Object.keys(e.packages).length>0){let n=Object.entries(e.packages).map(([e,n])=>{let r=[];if(n.presets&&n.presets.length>0){let e=n.presets.map(e=>`'${e}'`).join(`, `);r.push(` presets: [${e}],`)}if(n.docs){let e=Yp(n.docs,t);r.push(` docs: {\n${Xp(e)}\n },`)}return` '${e}': {\n${r.join(`
199
+ default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),Xp=/* @__PURE__ */ O(((e,t)=>{let n=Up();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),Zp=/* @__PURE__ */ O(((e,t)=>{let n=X(),r=Wp(),{ANY:i}=r,a=Up(),o=Gp(),s=Np(),c=Pp(),l=Rp(),u=Lp();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(d){case`>`:p=s,m=l,h=c,g=`>`,_=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),Qp=/* @__PURE__ */ O(((e,t)=>{let n=Zp();t.exports=(e,t,r)=>n(e,t,`>`,r)})),$p=/* @__PURE__ */ O(((e,t)=>{let n=Zp();t.exports=(e,t,r)=>n(e,t,`<`,r)})),em=/* @__PURE__ */ O(((e,t)=>{let n=Up();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),tm=/* @__PURE__ */ O(((e,t)=>{let n=Gp(),r=Dp();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),nm=/* @__PURE__ */ O(((e,t)=>{let n=Up(),r=Wp(),{ANY:i}=r,a=Gp(),o=Dp(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=/* @__PURE__ */ new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!e.test(s.semver))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!e.test(u.semver))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),rm=(/* @__PURE__ */ O(((e,t)=>{let n=hp(),r=pp(),i=X(),a=_p();t.exports={parse:vp(),valid:yp(),clean:bp(),inc:xp(),diff:Sp(),major:Cp(),minor:wp(),patch:Tp(),prerelease:Ep(),compare:Dp(),rcompare:Op(),compareLoose:kp(),compareBuild:Ap(),sort:jp(),rsort:Mp(),gt:Np(),lt:Pp(),eq:Fp(),neq:Ip(),gte:Lp(),lte:Rp(),cmp:zp(),coerce:Bp(),truncate:Vp(),Comparator:Wp(),Range:Up(),satisfies:Gp(),toComparators:Kp(),maxSatisfying:qp(),minSatisfying:Jp(),minVersion:Yp(),validRange:Xp(),outside:Zp(),gtr:Qp(),ltr:$p(),intersects:em(),simplifyRange:tm(),subset:nm(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}})))();function im(e,t,n,i){let a=l.join(e,`library`,t,n);if(!r.existsSync(a))return null;let o=r.readdirSync(a,{withFileTypes:!0}).filter(e=>e.isDirectory()&&lm(e.name)).map(e=>e.name);return o.length===0?null:(0,rm.maxSatisfying)(o,i===`latest`?`*`:i)??null}function am(e,t){let n=[];if(t.docs){let r=om(e,t.docs,t);n.push(...r)}if(t.packages)for(let[r,i]of Object.entries(t.packages)){let a=i.docs??{};if(i.presets&&i.presets.length>0&&(a=cp(up(i.presets),a)),Object.keys(a).length>0){let i=om(e,a,t,r);n.push(...i)}}return n}function om(e,t,n,r){let i=[];for(let a of Object.keys(t)){let o=t[a];if(o)for(let[t,s]of Object.entries(o)){if(s===void 0)continue;let{version:o,dest:c}=sm(s),u=im(e,a,t,o);if(!u)continue;let d=c??cm(n.base??`docs`,a,n.namespace??`longzai-intelligence`,t);i.push({category:a,name:t,version:u,dest:r?l.join(r,d):d})}}return i}function sm(e){return typeof e==`string`?{version:e}:{version:e.version,dest:e.dest}}function cm(e,t,n,r){return l.join(e,t,n,r)}function lm(e){return/^\d+\.\d+\.\d+/.test(e)}const um=Ge(`src/plugins/check.plugin`),dm=Ol(),fm=W({}),pm=id({name:`check`,version:kl(),commands:[e=>rd({name:`check`,description:`检查本地文档版本与配置的差异`,schema:fm,action:async()=>{await sd(e.allHooks,`beforeCheck`);let t=process.cwd();try{let n=lp(await Nf(t)),r=await dp(n.source),i=am(r,n),a=Xf(t),o=await Kf(t),s=[];o===null?um.info(dm.yellow(`未定位 docs-registry 声明仓——跳过文档名称目录校验与漂移校验`)):(s.push(...Lf(n.docs,o.docCategories),...Object.values(n.packages??{}).flatMap(e=>Lf(e.docs,o.docCategories))),s.push(...Rf(r,o.docCategories)));let{added:c,removed:l,changed:u}=ep(i,a);if(s.length>0){um.error(dm.red(`目录校验未过:`));for(let e of s)um.error(dm.red(` ! ${e}`))}if(c.length===0&&l.length===0&&u.length===0&&s.length===0)um.info(dm.green(`所有文档版本已同步`));else{if(c.length>0){um.info(dm.green(`新增:`));for(let e of c)um.info(dm.green(` + ${e.category}/${e.name}@${e.version}`))}if(l.length>0){um.info(dm.red(`移除:`));for(let e of l)um.info(dm.red(` - ${e.category}/${e.name}@${e.version}`))}if(u.length>0){um.info(dm.yellow(`变更:`));for(let e of u)um.info(dm.yellow(` ~ ${e.category}/${e.name}@${e.version}`))}}s.length>0&&process.exit(1),await sd(e.allHooks,`afterCheck`)}catch(e){let t=e instanceof Error?e.message:String(e);um.error(dm.red(`检查失败: ${t}`)),process.exit(1)}}})]});function mm(e){return typeof e==`string`?`'${e}'`:typeof e==`object`&&e?`dest`in e&&e.dest?`{ version: '${e.version}', dest: '${e.dest}' }`:`{ version: '${e.version}' }`:`'latest'`}function hm(e){return e.reduce((e,t)=>e+t.names.length,0)}function gm(e,t){let n=/* @__PURE__ */ new Map;for(let r of t){let t=e?.[r.category],i=new Set(t===void 0?[]:Object.keys(t)),a=r.names.filter(e=>!i.has(e));a.length>0&&n.set(r.category,[...a])}return n}function _m(e,t){let n={};for(let r of t){let t=/* @__PURE__ */ new Map;for(let[n,i]of Object.entries(e?.[r.category]??{}))i!==void 0&&t.set(n,i);let i={};for(let e of r.names)i[e]=t.get(e)??`latest`;n[r.category]=i}return n}function vm(e){return Object.keys(e).filter(t=>Object.keys(e[t]??{}).length>0).map(t=>ym(t,e[t]??{})).join(`
200
+ `)}function ym(e,t){return` ${e}: {\n${Object.entries(t).map(([e,t])=>` ${e}: ${mm(t??`latest`)},`).join(`
201
+ `)}\n },`}function bm(e,t){let n=_m(e.docs,t),r=[];if(e.source&&r.push(` source: '${e.source}',`),e.namespace&&r.push(` namespace: '${e.namespace}',`),e.base&&r.push(` base: '${e.base}',`),r.push(` docs: {\n${vm(n)}\n },`),e.packages&&Object.keys(e.packages).length>0){let n=Object.entries(e.packages).map(([e,n])=>{let r=[];if(n.presets&&n.presets.length>0){let e=n.presets.map(e=>`'${e}'`).join(`, `);r.push(` presets: [${e}],`)}if(n.docs){let e=_m(n.docs,t);r.push(` docs: {\n${vm(e)}\n },`)}return` '${e}': {\n${r.join(`
215
202
  `)}\n },`}).join(`
216
203
  `);r.push(` packages: {\n${n}\n },`)}return`import { defineConfig } from '@longzai-intelligence-docs/config';
217
204
 
@@ -219,15 +206,15 @@ export default defineConfig({
219
206
  ${r.join(`
220
207
  `)}
221
208
  });
222
- `}function $p(e,t){let n=[];for(let[r,i]of e)for(let e of i)n.push(` ${t} ${r}/${e}`);return n.join(`
223
- `)}const em=Le(`src/plugins/complete.plugin`),tm=st(),nm=$({dryRun:fu().optional()}),rm=Qu({name:`complete`,version:ct(),commands:[()=>Zu({name:`complete`,description:`补全 lzi-docs.config.ts 中缺失的文档 key`,options:[{flags:`--dry-run`,description:`仅预览变更,不修改配置文件`}],schema:nm,action:async e=>{let t=process.cwd(),r=c.join(t,`lzi-docs.config.ts`);n.existsSync(r)||(em.error(tm.red(`错误: 未找到 lzi-docs.config.ts`)),em.error(tm.dim(`请先运行 lzi-docs init 创建配置文件`)),process.exit(1));let i=await Cf(t);i===null&&(em.error(tm.red(`未定位 docs-registry 声明仓——complete 依赖目录补全`)),em.info(tm.dim(`定位链:env LZI_DOCS_REGISTRY_ROOT > 工作区兄弟仓名探测(longzai-intelligence-docs-registry/registry)`)),process.exit(1));try{let a=await uf(t),o=i.docCategories,s=Jp(a.docs,o),c=qp(o),l=/* @__PURE__ */ new Map;if(a.packages)for(let[e,t]of Object.entries(a.packages)){let n=Jp(t.docs,o);n.size>0&&l.set(e,n)}if(!(s.size>0||l.size>0)){em.info(tm.green(`所有文档 key 已完整 (${c}/${c}),无需补全`));return}let u=0;for(let e of s.values())u+=e.length;for(let e of l.values())for(let t of e.values())u+=t.length;if(e.dryRun){em.info(tm.cyan(`[dry-run] 将补全 ${u} 个缺失的文档 key:`)),s.size>0&&em.info($p(s,tm.green(`+`)));for(let[e,t]of l)em.info(tm.dim(` packages/${e}:`)),em.info($p(t,tm.green(`+`)));em.info(tm.dim(`使用 lzi-docs complete 以应用变更`));return}let d=Qp(a,o);n.writeFileSync(r,d,`utf-8`),em.info(tm.green(`已补全 ${u} 个缺失的文档 key:`)),s.size>0&&em.info($p(s,tm.green(`+`)));for(let[e,t]of l)em.info(tm.dim(` packages/${e}:`)),em.info($p(t,tm.green(`+`)))}catch(e){let t=e instanceof Error?e.message:String(e);em.error(tm.red(`补全失败: ${t}`)),process.exit(1)}}})]}),im=Le(`src/plugins/init.plugin`),am=st(),om=$({}),sm=Qu({name:`init`,version:ct(),commands:[()=>Zu({name:`init`,description:`交互式生成 lzi-docs.config.ts 配置文件`,schema:om,action:async()=>{let e=process.cwd(),t=c.join(e,`lzi-docs.config.ts`);if(n.existsSync(t)){im.info(am.yellow(`lzi-docs.config.ts 已存在`));return}let r=await Cf(e);r===null&&(im.error(am.red(`未定位 docs-registry 声明仓——init 需要目录生成模板`)),im.info(am.dim(`定位链:env LZI_DOCS_REGISTRY_ROOT > 工作区兄弟仓名探测(longzai-intelligence-docs-registry/registry)`)),process.exit(1));let i=`import { defineConfig } from '@longzai-intelligence-docs/config';
209
+ `}function xm(e,t){let n=[];for(let[r,i]of e)for(let e of i)n.push(` ${t} ${r}/${e}`);return n.join(`
210
+ `)}const Z=Ge(`src/plugins/complete.plugin`),Q=Ol(),Sm=W({dryRun:Lc().optional()}),Cm=id({name:`complete`,version:kl(),commands:[()=>rd({name:`complete`,description:`补全 lzi-docs.config.ts 中缺失的文档 key`,options:[{flags:`--dry-run`,description:`仅预览变更,不修改配置文件`}],schema:Sm,action:async e=>{let t=process.cwd(),n=l.join(t,`lzi-docs.config.ts`);r.existsSync(n)||(Z.error(Q.red(`错误: 未找到 lzi-docs.config.ts`)),Z.error(Q.dim(`请先运行 lzi-docs init 创建配置文件`)),process.exit(1));let i=await Kf(t);i===null&&(Z.error(Q.red(`未定位 docs-registry 声明仓——complete 依赖目录补全`)),Z.info(Q.dim(`定位链:env LZI_DOCS_REGISTRY_ROOT > 工作区兄弟仓名探测(longzai-intelligence-docs-registry/registry)`)),process.exit(1));try{let a=await Nf(t),o=i.docCategories,s=gm(a.docs,o),c=hm(o),l=/* @__PURE__ */ new Map;if(a.packages)for(let[e,t]of Object.entries(a.packages)){let n=gm(t.docs,o);n.size>0&&l.set(e,n)}if(!(s.size>0||l.size>0)){Z.info(Q.green(`所有文档 key 已完整 (${c}/${c}),无需补全`));return}let u=0;for(let e of s.values())u+=e.length;for(let e of l.values())for(let t of e.values())u+=t.length;if(e.dryRun){Z.info(Q.cyan(`[dry-run] 将补全 ${u} 个缺失的文档 key:`)),s.size>0&&Z.info(xm(s,Q.green(`+`)));for(let[e,t]of l)Z.info(Q.dim(` packages/${e}:`)),Z.info(xm(t,Q.green(`+`)));Z.info(Q.dim(`使用 lzi-docs complete 以应用变更`));return}let d=bm(a,o);r.writeFileSync(n,d,`utf-8`),Z.info(Q.green(`已补全 ${u} 个缺失的文档 key:`)),s.size>0&&Z.info(xm(s,Q.green(`+`)));for(let[e,t]of l)Z.info(Q.dim(` packages/${e}:`)),Z.info(xm(t,Q.green(`+`)))}catch(e){let t=e instanceof Error?e.message:String(e);Z.error(Q.red(`补全失败: ${t}`)),process.exit(1)}}})]}),wm=Ge(`src/plugins/init.plugin`),Tm=Ol(),Em=W({}),Dm=id({name:`init`,version:kl(),commands:[()=>rd({name:`init`,description:`交互式生成 lzi-docs.config.ts 配置文件`,schema:Em,action:async()=>{let e=process.cwd(),t=l.join(e,`lzi-docs.config.ts`);if(r.existsSync(t)){wm.info(Tm.yellow(`lzi-docs.config.ts 已存在`));return}let n=await Kf(e);n===null&&(wm.error(Tm.red(`未定位 docs-registry 声明仓——init 需要目录生成模板`)),wm.info(Tm.dim(`定位链:env LZI_DOCS_REGISTRY_ROOT > 工作区兄弟仓名探测(longzai-intelligence-docs-registry/registry)`)),process.exit(1));let i=`import { defineConfig } from '@longzai-intelligence-docs/config';
224
211
 
225
212
  export default defineConfig({
226
213
  // source: '../longzai-intelligence-docs',
227
214
  docs: {
228
- ${r.docCategories.map(e=>{let t=e.names.map(e=>` ${e}: 'latest',`).join(`
215
+ ${n.docCategories.map(e=>{let t=e.names.map(e=>` ${e}: 'latest',`).join(`
229
216
  `);return` ${e.category}: {\n${t}\n },`}).join(`
230
217
  `)}
231
218
  },
232
219
  });
233
- `;n.writeFileSync(t,i,`utf-8`),im.info(am.green(`已生成 lzi-docs.config.ts`))}})]}),cm=Le(`src/plugins/plugins.plugin`),lm=st(),um=$({json:fu().optional()}),dm=Qu({name:`plugins`,version:ct(),commands:[()=>Zu({name:`plugins`,description:`列出 docs-registry 已登记插件与文档资产目录`,options:[{flags:`--json`,description:`以 JSON 输出(机器可读)`}],schema:um,action:async e=>{let t=await Cf(process.cwd());if(t===null&&(cm.error(lm.red(`未定位 docs-registry 声明仓`)),cm.info(lm.dim(`定位链:env LZI_DOCS_REGISTRY_ROOT > 工作区兄弟仓名探测(longzai-intelligence-docs-registry/registry)`)),process.exit(1)),e.json){process.stdout.write(`${JSON.stringify({plugins:t.plugins,docs:t.docCategories},null,2)}\n`);return}cm.info(lm.bold(`插件清单`));for(let e of t.plugins){let t=e.status===`已发布`?`${e.entryPackage}@${e.version}`:lm.dim(`登记中——entry 待插件首发回填`);cm.info(`- ${e.name} [${e.status}] ${t} 自持仓 ${e.holdingRepo}——${e.summary}`)}cm.info(``),cm.info(lm.bold(`文档资产目录`));for(let e of t.docCategories)cm.info(`- ${e.category}: ${e.names.join(`、`)}`)}})]});function fm(e){try{return s(e).isDirectory()}catch{return!1}}function pm(e){try{return a(e)}catch{return[]}}function mm(e,t){let n=t;for(;;){let t=c.join(n,e);if(fm(t))return t;for(let t of pm(n))if(t.endsWith(`-edition`)){let r=c.join(n,t,e);if(fm(r))return r}let r=c.dirname(n);if(r===n)return null;n=r}}function hm(e,t){let n=mm(e.repo,t);if(n===null)return{repo:e.repo,repoPath:null,verdict:`fail`,reasons:[`无法定位探针仓 ${e.repo}(工作区内单层枚举未命中)`]};if(!(e.ifPresent===void 0||e.ifPresent.some(e=>r(c.join(n,e.path)))))return{repo:e.repo,repoPath:n,verdict:`skip`,reasons:[]};let a=[];for(let t of e.requires??[])r(c.join(n,t.path))||a.push(`必查路径缺失:${t.path}`);for(let t of e.markerIn??[]){let e=c.join(n,t.path);if(!r(e)){a.push(`标记目标不存在:${t.path}`);continue}i(e,`utf-8`).includes(t.contains)||a.push(`${t.path} 未携带定位标记「${t.contains}」`)}return{repo:e.repo,repoPath:n,verdict:a.length>0?`fail`:`pass`,reasons:a}}function gm(e,t,n){let r=(n===void 0?e:e.filter(e=>e.name===n)).map(e=>{let n=(e.probes??[]).map(e=>hm(e,t));return{entry:e,probes:n,verdict:n.length===0?`not-probed`:n.some(e=>e.verdict===`fail`)?`fail`:`pass`}});return{entries:r,violationCount:r.filter(e=>e.verdict===`fail`).length}}const _m=Le(`src/plugins/sources.plugin`),vm=st(),ym=$({json:fu().optional()}),bm=$({name:Z().optional()});function xm(e){return e===null&&(_m.error(vm.red(`未定位 docs-registry 声明仓`)),_m.info(vm.dim(`定位链:env LZI_DOCS_REGISTRY_ROOT > 工作区兄弟仓名探测(longzai-intelligence-docs-registry/registry)`)),process.exit(1)),e.sources.length===0&&(_m.error(vm.red(`sources 声明域为空——尚未登记真源条目`)),_m.info(vm.dim(`真源登记:docs-registry 仓 registry/sources/<name>.source.ts(defineTruthSourceEntry 工厂导出)`)),process.exit(1)),e.sources}const Sm=Qu({name:`sources`,version:ct(),commands:[()=>Zu({name:`sources-list`,description:`列出 docs-registry 已登记真源条目(内容类级真源与数据流)`,options:[{flags:`--json`,description:`以 JSON 输出(机器可读)`}],schema:ym,action:async e=>{let t=xm(await Cf(process.cwd()));if(e.json){process.stdout.write(`${JSON.stringify({sources:t},null,2)}\n`);return}_m.info(vm.bold(`真源登记清单`));for(let e of t){let t=e.renders?.map(e=>`${e.artifact}(${e.mechanism},${e.handEdit})`).join(`;`)??vm.dim(`无渲染产物`);_m.info(`- ${e.name} [${e.status}]——${e.summary}`),_m.info(` 真源:${e.truthSource.repo} ${e.truthSource.path}`),_m.info(` 渲染:${t}`),e.distribution!==void 0&&_m.info(` 分发:${e.distribution}`),_m.info(` 消费:${e.consumers.join(`、`)}`)}}}),()=>Zu({name:`sources-check`,description:`真源门禁判定:以 registry sources 登记为据逐探针判定,违例即拦截`,options:[{flags:`--name <name>`,description:`仅判定指定内容类(可选)`}],schema:bm,action:async e=>{let t=xm(await Cf(process.cwd()));e.name!==void 0&&!t.some(t=>t.name===e.name)&&(_m.error(vm.red(`未登记内容类「${e.name}」——sources-check 以登记为据,未登记者不可判`)),process.exit(1));let n=gm(t,process.cwd(),e.name);for(let e of n.entries){let t=e.verdict===`pass`?vm.green(`PASS`):e.verdict===`fail`?vm.red(`FAIL`):vm.dim(`NOT-PROBED(仅登记)`);_m.info(`${e.entry.name}:${t}`);for(let t of e.probes){let n=t.repoPath===null?``:vm.dim(`(${t.repoPath})`);if(t.verdict===`fail`){for(let n of t.reasons)process.stderr.write(`[sources:violation] ${e.entry.name} ${t.repo}——${n}\n`);_m.info(` 探针 ${t.repo}:${vm.red(`FAIL`)} ${n}`)}else _m.info(` 探针 ${t.repo}:${t.verdict===`pass`?vm.green(`PASS`):vm.dim(`SKIP`)} ${n}`)}}_m.info(`汇总:${n.entries.length} 条目、${n.violationCount} 违例${e.name===void 0?``:`(过滤:${e.name})`}`),n.violationCount>0&&process.exit(1)}})]}),Cm=/\[([^\]]*)\]\(([^)]+)\)/g;async function wm(e,t,r){let i=c.join(e,`library`,t.category,t.name,t.version),a=t.dest;if(!n.existsSync(i))throw Error(`源目录不存在: ${i}`);n.mkdirSync(a,{recursive:!0}),Tm(i,a,e,r)}function Tm(e,t,r,i){let a=n.readdirSync(e,{withFileTypes:!0});for(let o of a){let a=c.join(e,o.name),s=c.join(t,o.name);if(o.isDirectory())n.mkdirSync(s,{recursive:!0}),Tm(a,s,r,i);else if(o.name.endsWith(`.md`)){let e=Em(n.readFileSync(a,`utf-8`),a,r,i,s);n.writeFileSync(s,e,`utf-8`)}else n.copyFileSync(a,s)}}function Em(e,t,n,r,i){return Cm.lastIndex=0,e.replace(Cm,(e,a,o)=>{let s=Dm(o,t,n,r,i);return s?`[${a}](${s})`:e})}function Dm(e,t,r,i,a){let{filePath:o,fragment:s}=Om(e);if(!o||!o.includes(`../`))return null;let l=c.resolve(c.dirname(t),o),u=c.join(r,`library`),d=c.relative(u,l);if(d.startsWith(`..`)||c.isAbsolute(d)||!n.existsSync(l)&&!n.existsSync(l+`.md`))return null;let f=d.split(`/`);if(f.length<3)return null;let p=f[0],m=f[1],h=f.slice(3).join(`/`),g=i.find(e=>e.category===p&&e.name===m);if(!g)return null;let _=c.join(g.dest,h),v=c.relative(c.dirname(a),_);return s?`${v}${s}`:v}function Om(e){let t=e.indexOf(`#`);return t===-1?{filePath:e,fragment:``}:{filePath:e.slice(0,t),fragment:e.slice(t)}}const km=Le(`src/plugins/sync.plugin`),Am=st(),jm=$({dryRun:fu().optional()}),Mm=Qu({name:`sync`,version:ct(),commands:[e=>Zu({name:`sync`,description:`同步文档到本地项目`,options:[{flags:`--dry-run`,description:`仅输出将要执行的操作,不实际同步`}],schema:jm,action:async t=>{await td(e.allHooks,`beforeSync`);let n=process.cwd();try{let r=Bf(await uf(n)),i=await Cf(n);if(i===null)km.info(Am.yellow(`未定位 docs-registry 声明仓——跳过文档名称目录校验`));else{let e=[...mf(r.docs,i.docCategories),...Object.values(r.packages??{}).flatMap(e=>mf(e.docs,i.docCategories))];e.length>0&&(km.error(Am.red(`文档名称未命中目录:${e.join(`、`)}`)),process.exit(1))}let a=await Hf(r.source),o=Lp(a,r);if(o.length===0){km.info(Am.yellow(`没有找到需要同步的文档`));return}let s=[];for(let e of o){if(t.dryRun){km.info(Am.dim(`[dry-run] ${e.category}/${e.name}@${e.version} -> ${e.dest}`)),s.push(e);continue}await wm(a,e,o),km.info(Am.green(`synced ${e.category}/${e.name}@${e.version} -> ${e.dest}`)),s.push(e)}t.dryRun||(kf(n,s),km.info(Am.dim(`lzi-docs.lock 已更新`))),await td(e.allHooks,`afterSync`)}catch(e){let t=e instanceof Error?e.message:String(e);km.error(Am.red(`同步失败: ${t}`)),process.exit(1)}}})]}),Nm=lt({name:`lzi-docs`,description:`longzai-intelligence 文档域基础平台(插件机制宿主,ADR 0099)`,interaction:An,color:kn}),Pm=[Mm,Gp,sm,dm,of,rm,Sm];async function Fm(){let e=process.cwd(),t=await df(e),{plugins:n,pluginOptions:r,errors:i}=await ff(e,Pm,t);if(i.length>0){for(let e of i)process.stderr.write(`装配错误: ${e}\n`);process.exit(2)}let a=pf(Nm,n,r);if(a.length>0){for(let e of a)process.stderr.write(`装配错误: ${e}\n`);process.exit(2)}await Nm.parseAsync(process.argv)}Fm().catch(e=>{process.stderr.write(`致命错误: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)});export{};
220
+ `;r.writeFileSync(t,i,`utf-8`),wm.info(Tm.green(`已生成 lzi-docs.config.ts`))}})]}),Om=Ge(`src/plugins/plugins.plugin`),km=Ol(),Am=W({json:Lc().optional()}),jm=id({name:`plugins`,version:kl(),commands:[()=>rd({name:`plugins`,description:`列出 docs-registry 已登记插件与文档资产目录`,options:[{flags:`--json`,description:`以 JSON 输出(机器可读)`}],schema:Am,action:async e=>{let t=await Kf(process.cwd());if(t===null&&(Om.error(km.red(`未定位 docs-registry 声明仓`)),Om.info(km.dim(`定位链:env LZI_DOCS_REGISTRY_ROOT > 工作区兄弟仓名探测(longzai-intelligence-docs-registry/registry)`)),process.exit(1)),e.json)process.stdout.write(`${JSON.stringify({plugins:t.plugins,docs:t.docCategories},null,2)}\n`);else{Om.info(km.bold(`插件清单`));for(let e of t.plugins){let t=e.status===`已发布`?`${e.entryPackage}@${e.version}`:km.dim(`登记中——entry 待插件首发回填`);Om.info(`- ${e.name} [${e.status}] ${t} 自持仓 ${e.holdingRepo}——${e.summary}`)}Om.info(``),Om.info(km.bold(`文档资产目录`));for(let e of t.docCategories)Om.info(`- ${e.category}: ${e.names.join(`、`)}`)}}})]});function Mm(e){try{return c(e).isDirectory()}catch{return!1}}function Nm(e){try{return o(e)}catch{return[]}}function Pm(e,t){let n=t;for(;;){let t=l.join(n,e);if(Mm(t))return t;for(let t of Nm(n))if(t.endsWith(`-edition`)){let r=l.join(n,t,e);if(Mm(r))return r}let r=l.dirname(n);if(r===n)return null;n=r}}function Fm(e,t){let n=Pm(e.repo,t);if(n===null)return{repo:e.repo,repoPath:null,verdict:`fail`,reasons:[`无法定位探针仓 ${e.repo}(工作区内单层枚举未命中)`]};if(!(e.ifPresent===void 0||e.ifPresent.some(e=>i(l.join(n,e.path)))))return{repo:e.repo,repoPath:n,verdict:`skip`,reasons:[]};let r=[];for(let t of e.requires??[])i(l.join(n,t.path))||r.push(`必查路径缺失:${t.path}`);for(let t of e.markerIn??[]){let e=l.join(n,t.path);i(e)?a(e,`utf-8`).includes(t.contains)||r.push(`${t.path} 未携带定位标记「${t.contains}」`):r.push(`标记目标不存在:${t.path}`)}return{repo:e.repo,repoPath:n,verdict:r.length>0?`fail`:`pass`,reasons:r}}function Im(e,t,n){let r=(n===void 0?e:e.filter(e=>e.name===n)).map(e=>{let n=(e.probes??[]).map(e=>Fm(e,t));return{entry:e,probes:n,verdict:n.length===0?`not-probed`:n.some(e=>e.verdict===`fail`)?`fail`:`pass`}});return{entries:r,violationCount:r.filter(e=>e.verdict===`fail`).length}}const $=Ge(`src/plugins/sources.plugin`),Lm=Ol(),Rm=W({json:Lc().optional()}),zm=W({name:V().optional()});function Bm(e){return e===null&&($.error(Lm.red(`未定位 docs-registry 声明仓`)),$.info(Lm.dim(`定位链:env LZI_DOCS_REGISTRY_ROOT > 工作区兄弟仓名探测(longzai-intelligence-docs-registry/registry)`)),process.exit(1)),e.sources.length===0&&($.error(Lm.red(`sources 声明域为空——尚未登记真源条目`)),$.info(Lm.dim(`真源登记:docs-registry 仓 registry/sources/<name>.source.ts(defineTruthSourceEntry 工厂导出)`)),process.exit(1)),e.sources}const Vm=id({name:`sources`,version:kl(),commands:[()=>rd({name:`sources-list`,description:`列出 docs-registry 已登记真源条目(内容类级真源与数据流)`,options:[{flags:`--json`,description:`以 JSON 输出(机器可读)`}],schema:Rm,action:async e=>{let t=Bm(await Kf(process.cwd()));if(e.json)process.stdout.write(`${JSON.stringify({sources:t},null,2)}\n`);else{$.info(Lm.bold(`真源登记清单`));for(let e of t){let t=e.renders?.map(e=>`${e.artifact}(${e.mechanism},${e.handEdit})`).join(`;`)??Lm.dim(`无渲染产物`);$.info(`- ${e.name} [${e.status}]——${e.summary}`),$.info(` 真源:${e.truthSource.repo} ${e.truthSource.path}`),$.info(` 渲染:${t}`),e.distribution!==void 0&&$.info(` 分发:${e.distribution}`),$.info(` 消费:${e.consumers.join(`、`)}`)}}}}),()=>rd({name:`sources-check`,description:`真源门禁判定:以 registry sources 登记为据逐探针判定,违例即拦截`,options:[{flags:`--name <name>`,description:`仅判定指定内容类(可选)`}],schema:zm,action:async e=>{let t=Bm(await Kf(process.cwd()));e.name!==void 0&&!t.some(t=>t.name===e.name)&&($.error(Lm.red(`未登记内容类「${e.name}」——sources-check 以登记为据,未登记者不可判`)),process.exit(1));let n=Im(t,process.cwd(),e.name);for(let e of n.entries){let t=e.verdict===`pass`?Lm.green(`PASS`):e.verdict===`fail`?Lm.red(`FAIL`):Lm.dim(`NOT-PROBED(仅登记)`);$.info(`${e.entry.name}:${t}`);for(let t of e.probes){let n=t.repoPath===null?``:Lm.dim(`(${t.repoPath})`);if(t.verdict===`fail`){for(let n of t.reasons)process.stderr.write(`[sources:violation] ${e.entry.name} ${t.repo}——${n}\n`);$.info(` 探针 ${t.repo}:${Lm.red(`FAIL`)} ${n}`)}else $.info(` 探针 ${t.repo}:${t.verdict===`pass`?Lm.green(`PASS`):Lm.dim(`SKIP`)} ${n}`)}}$.info(`汇总:${n.entries.length} 条目、${n.violationCount} 违例${e.name===void 0?``:`(过滤:${e.name})`}`),n.violationCount>0&&process.exit(1)}})]}),Hm=/\[([^\]]*)\]\(([^)]+)\)/g;async function Um(e,t,n){let i=l.join(e,`library`,t.category,t.name,t.version),a=t.dest;if(!r.existsSync(i))throw Error(`源目录不存在: ${i}`);r.mkdirSync(a,{recursive:!0}),Wm(i,a,e,n)}function Wm(e,t,n,i){let a=r.readdirSync(e,{withFileTypes:!0});for(let o of a){let a=l.join(e,o.name),s=l.join(t,o.name);if(o.isDirectory())r.mkdirSync(s,{recursive:!0}),Wm(a,s,n,i);else if(o.name.endsWith(`.md`)){let e=Gm(r.readFileSync(a,`utf-8`),a,n,i,s);r.writeFileSync(s,e,`utf-8`)}else r.copyFileSync(a,s)}}function Gm(e,t,n,r,i){return Hm.lastIndex=0,e.replace(Hm,(e,a,o)=>{let s=Km(o,t,n,r,i);return s?`[${a}](${s})`:e})}function Km(e,t,n,i,a){let{filePath:o,fragment:s}=qm(e);if(!o||!o.includes(`../`))return null;let c=l.resolve(l.dirname(t),o),u=l.join(n,`library`),d=l.relative(u,c);if(d.startsWith(`..`)||l.isAbsolute(d)||!r.existsSync(c)&&!r.existsSync(c+`.md`))return null;let f=d.split(`/`);if(f.length<3)return null;let p=f[0],m=f[1],h=f.slice(3).join(`/`),g=i.find(e=>e.category===p&&e.name===m);if(!g)return null;let _=l.join(g.dest,h),v=l.relative(l.dirname(a),_);return s?`${v}${s}`:v}function qm(e){let t=e.indexOf(`#`);return t===-1?{filePath:e,fragment:``}:{filePath:e.slice(0,t),fragment:e.slice(t)}}const Jm=Ge(`src/plugins/sync.plugin`),Ym=Ol(),Xm=W({dryRun:Lc().optional()}),Zm=id({name:`sync`,version:kl(),commands:[e=>rd({name:`sync`,description:`同步文档到本地项目`,options:[{flags:`--dry-run`,description:`仅输出将要执行的操作,不实际同步`}],schema:Xm,action:async t=>{await sd(e.allHooks,`beforeSync`);let n=process.cwd();try{let r=lp(await Nf(n)),i=await Kf(n);if(i===null)Jm.info(Ym.yellow(`未定位 docs-registry 声明仓——跳过文档名称目录校验`));else{let e=[...Lf(r.docs,i.docCategories),...Object.values(r.packages??{}).flatMap(e=>Lf(e.docs,i.docCategories))];e.length>0&&(Jm.error(Ym.red(`文档名称未命中目录:${e.join(`、`)}`)),process.exit(1))}let a=await dp(r.source),o=am(a,r);if(o.length===0){Jm.info(Ym.yellow(`没有找到需要同步的文档`));return}let s=[];for(let e of o)t.dryRun?(Jm.info(Ym.dim(`[dry-run] ${e.category}/${e.name}@${e.version} -> ${e.dest}`)),s.push(e)):(await Um(a,e,o),Jm.info(Ym.green(`synced ${e.category}/${e.name}@${e.version} -> ${e.dest}`)),s.push(e));t.dryRun||(Qf(n,s),Jm.info(Ym.dim(`lzi-docs.lock 已更新`))),await sd(e.allHooks,`afterSync`)}catch(e){let t=e instanceof Error?e.message:String(e);Jm.error(Ym.red(`同步失败: ${t}`)),process.exit(1)}}})]}),Qm=Al({name:`lzi-docs`,description:`longzai-intelligence 文档域基础平台(插件机制宿主,ADR 0099)`,interaction:$u,color:Qu}),$m=[Zm,pm,Dm,jm,df,Cm,Vm];async function eh(){let e=process.cwd(),t=await Pf(e),{plugins:n,pluginOptions:r,errors:i}=await Ff(e,$m,t);if(i.length>0){for(let e of i)process.stderr.write(`装配错误: ${e}\n`);process.exit(2)}let a=If(Qm,n,r);if(a.length>0){for(let e of a)process.stderr.write(`装配错误: ${e}\n`);process.exit(2)}await Qm.parseAsync(process.argv)}eh().catch(e=>{process.stderr.write(`致命错误: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)});export{};