@visulima/pail 4.0.0-alpha.20 → 4.0.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/LICENSE.md +841 -6
- package/README.md +53 -24
- package/dist/error.js +2 -2
- package/dist/index.browser.d.ts +16 -5
- package/dist/index.browser.js +19 -19
- package/dist/index.server.d.ts +30 -5
- package/dist/index.server.js +28 -27
- package/dist/middleware/elysia.d.ts +5 -4
- package/dist/middleware/elysia.js +1 -1
- package/dist/middleware/express.d.ts +5 -4
- package/dist/middleware/express.js +1 -1
- package/dist/middleware/fastify.d.ts +5 -4
- package/dist/middleware/fastify.js +1 -1
- package/dist/middleware/hono.d.ts +5 -4
- package/dist/middleware/hono.js +1 -1
- package/dist/middleware/next/handler.d.ts +5 -4
- package/dist/middleware/next/handler.js +1 -1
- package/dist/middleware/sveltekit.d.ts +5 -4
- package/dist/middleware/sveltekit.js +1 -1
- package/dist/object-tree.js +2 -2
- package/dist/packem_shared/AbstractJsonReporter-Bp_JCrMQ.js +1 -0
- package/dist/packem_shared/AbstractJsonReporter-C6iu_u9-.js +1 -0
- package/dist/packem_shared/JsonReporter-BXktpC__.js +2 -0
- package/dist/packem_shared/JsonReporter-bmem9lcg.js +1 -0
- package/dist/packem_shared/PailError-CbU1Ogfa.js +5 -0
- package/dist/packem_shared/PrettyReporter-DNNseeLK.js +44 -0
- package/dist/packem_shared/PrettyReporter-DsHfKOU7.js +5 -0
- package/dist/packem_shared/{abstract-json-reporter.d-BAgznjyU.d.ts → abstract-json-reporter.d-wfESoEa-.d.ts} +3 -2
- package/dist/packem_shared/abstract-pretty-reporter-Bczvp2Zh.js +57 -0
- package/dist/packem_shared/addKnownErrorConstructor-C1OJTj2D-f9no2VNI.js +25 -0
- package/dist/packem_shared/{create-middleware-logger.d-CR3o6VDh.d.ts → create-middleware-logger.d-B-JmQ1Sl.d.ts} +2 -2
- package/dist/packem_shared/headers-DH0H2s8W.js +1 -0
- package/dist/packem_shared/index-Q1764hvO.js +1 -0
- package/dist/packem_shared/index.d-T71KjNAr.d.ts +16 -0
- package/dist/packem_shared/pailMiddleware-B5DJoBYl.js +1 -0
- package/dist/packem_shared/serializeError-C-NFvZ8_-D0CA_Qlx.js +1 -0
- package/dist/packem_shared/storage-DaXAlpiO.js +1 -0
- package/dist/packem_shared/{types.d-BeLumqgD.d.ts → types.d-bWnqHJKL.d.ts} +2 -37
- package/dist/packem_shared/useLogger-DB34CuU5.js +1 -0
- package/dist/packem_shared/{wide-event.d-gb2-ks5w.d.ts → wide-event.d-D3ATYpoK.d.ts} +17 -5
- package/dist/packem_shared/write-console-log-based-on-level-BqjxV016.js +1 -0
- package/dist/packem_shared/write-stream-C7jxLxIT.js +1 -0
- package/dist/processor/caller/caller-processor.d.ts +2 -1
- package/dist/processor/caller/caller-processor.js +1 -1
- package/dist/processor/environment-processor.d.ts +2 -1
- package/dist/processor/environment-processor.js +1 -1
- package/dist/processor/message-formatter-processor.d.ts +9 -1
- package/dist/processor/message-formatter-processor.js +1 -1
- package/dist/processor/opentelemetry-processor.d.ts +2 -1
- package/dist/processor/opentelemetry-processor.js +1 -1
- package/dist/processor/redact-processor.d.ts +41 -2
- package/dist/processor/redact-processor.js +1 -1
- package/dist/processor/sampling-processor.d.ts +2 -1
- package/dist/processor/sampling-processor.js +1 -1
- package/dist/reporter/file/json-file-reporter.d.ts +21 -3
- package/dist/reporter/file/json-file-reporter.js +2 -2
- package/dist/reporter/http/abstract-http-reporter.d.ts +46 -3
- package/dist/reporter/http/abstract-http-reporter.js +2 -2
- package/dist/reporter/http/http-reporter.d.ts +4 -3
- package/dist/reporter/http/http-reporter.edge-light.d.ts +57 -1
- package/dist/reporter/http/http-reporter.edge-light.js +2 -2
- package/dist/reporter/http/http-reporter.js +1 -1
- package/dist/reporter/json/index.browser.d.ts +1 -1
- package/dist/reporter/json/index.browser.js +1 -1
- package/dist/reporter/json/index.d.ts +6 -4
- package/dist/reporter/json/index.js +1 -1
- package/dist/reporter/pretty/index.browser.js +1 -1
- package/dist/reporter/pretty/index.d.ts +125 -5
- package/dist/reporter/pretty/index.js +1 -1
- package/dist/reporter/simple/simple-reporter.server.d.ts +87 -5
- package/dist/reporter/simple/simple-reporter.server.js +8 -8
- package/dist/wide-event.d.ts +4 -3
- package/dist/wide-event.js +1 -1
- package/package.json +4 -4
- package/dist/packem_shared/AbstractJsonReporter-D_Pb6kpB.js +0 -1
- package/dist/packem_shared/AbstractJsonReporter-PVC4ONf2.js +0 -1
- package/dist/packem_shared/JsonReporter-BEEmb0W4.js +0 -2
- package/dist/packem_shared/JsonReporter-CE-lw7R0.js +0 -1
- package/dist/packem_shared/PrettyReporter-CDv9n1Fy.js +0 -5
- package/dist/packem_shared/PrettyReporter-CuFxJm_o.js +0 -44
- package/dist/packem_shared/abstract-pretty-reporter-BpyhtAoN.js +0 -33
- package/dist/packem_shared/createPailError-53jAfQ-T.js +0 -5
- package/dist/packem_shared/headers-S8WyX-2m.js +0 -1
- package/dist/packem_shared/index-Dwp5v97D.js +0 -1
- package/dist/packem_shared/pailMiddleware-CWOJRmJq.js +0 -1
- package/dist/packem_shared/storage-DHM1EP2P.js +0 -1
- package/dist/packem_shared/useLogger-qyZrjy4D.js +0 -1
- package/dist/packem_shared/write-console-log-based-on-level-DfD64owL.js +0 -1
- package/dist/packem_shared/write-stream-Dd4_PTcm.js +0 -1
|
@@ -17,7 +17,40 @@ type CodeFrameOptions = {
|
|
|
17
17
|
showLineNumbers?: boolean;
|
|
18
18
|
tabWidth?: number | false;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* The compiled position of a stack frame handed to a {@link SourceMapResolver}.
|
|
22
|
+
*/
|
|
23
|
+
interface SourceMapLocation {
|
|
24
|
+
column?: number;
|
|
25
|
+
file: string;
|
|
26
|
+
line: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The resolved original position returned by a {@link SourceMapResolver}. Any omitted field falls
|
|
30
|
+
* back to the compiled value. `source`, when provided, is used directly as the code-frame content
|
|
31
|
+
* (e.g. from an inlined `sourcesContent`) instead of reading the resolved file from disk.
|
|
32
|
+
*/
|
|
33
|
+
interface ResolvedSourceLocation {
|
|
34
|
+
column?: number;
|
|
35
|
+
file?: string;
|
|
36
|
+
line?: number;
|
|
37
|
+
source?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Pluggable hook that maps a compiled `*.js:line:col` position back to its original source position
|
|
41
|
+
* (e.g. TS/JSX). Return `undefined` (or throw) to leave the frame untouched. Synchronous so it can
|
|
42
|
+
* be used by the synchronous `renderError`; resolve/inline your maps ahead of time.
|
|
43
|
+
*/
|
|
44
|
+
type SourceMapResolver = (location: SourceMapLocation) => ResolvedSourceLocation | undefined;
|
|
45
|
+
type Options$1 = {
|
|
46
|
+
/**
|
|
47
|
+
* Read source files for code frames from anywhere on disk, including absolute paths outside
|
|
48
|
+
* `cwd`. Defaults to `false`, in which case only files resolving inside `cwd` are read — this
|
|
49
|
+
* prevents local file disclosure when rendering errors whose stack came from untrusted input
|
|
50
|
+
* (e.g. a deserialized error). Enable only for trusted, locally-thrown errors.
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
allowAllFilePaths: boolean;
|
|
21
54
|
color: CodeFrameOptions["color"] & {
|
|
22
55
|
fileLine: ColorizeMethod;
|
|
23
56
|
hint: ColorizeMethod;
|
|
@@ -34,19 +67,67 @@ type Options$1 = Omit<CodeFrameOptions, "message | prefix"> & {
|
|
|
34
67
|
hideErrorTitle: boolean;
|
|
35
68
|
hideMessage: boolean;
|
|
36
69
|
indentation: number | " ";
|
|
37
|
-
prefix: string;
|
|
38
|
-
|
|
70
|
+
prefix: string; /** Optional source-map resolver to map compiled frame positions back to original source. */
|
|
71
|
+
sourceMap?: SourceMapResolver;
|
|
72
|
+
} & Omit<CodeFrameOptions, "message | prefix">;
|
|
39
73
|
interface Options {
|
|
40
|
-
|
|
74
|
+
/**
|
|
75
|
+
* When `true`, honour custom inspectors: a value's
|
|
76
|
+
* `Symbol.for("nodejs.util.inspect.custom")` method (Node only),
|
|
77
|
+
* `Symbol.for("chai/inspect")` method, an `.inspect()` method, or a handler
|
|
78
|
+
* registered via `registerConstructor` / `registerStringTag`.
|
|
79
|
+
* @default true
|
|
80
|
+
*/
|
|
41
81
|
customInspect: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* The maximum nesting depth to traverse before collapsing a nested value to
|
|
84
|
+
* `[Object]` / `[Array]`. A value `<= 0` disables the limit.
|
|
85
|
+
* @default 5
|
|
86
|
+
*/
|
|
42
87
|
depth: number;
|
|
88
|
+
/**
|
|
89
|
+
* Pretty-print with indentation. `"\t"` indents with tabs, a positive integer
|
|
90
|
+
* indents with that many spaces, and `undefined` keeps everything on one line.
|
|
91
|
+
* @default undefined
|
|
92
|
+
*/
|
|
43
93
|
indent: number | " " | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* The maximum number of array / typed-array / iterable elements to render
|
|
96
|
+
* before the remainder is replaced with an `… (N more)` marker. Use
|
|
97
|
+
* `Number.POSITIVE_INFINITY` to show every element.
|
|
98
|
+
* @default Number.POSITIVE_INFINITY
|
|
99
|
+
*/
|
|
44
100
|
maxArrayLength: number;
|
|
101
|
+
/**
|
|
102
|
+
* When `true`, render large numbers and bigints with `_` digit-group
|
|
103
|
+
* separators (e.g. `1_000_000`).
|
|
104
|
+
* @default true
|
|
105
|
+
*/
|
|
45
106
|
numericSeparator: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* The quote character used when rendering string values and complex object
|
|
109
|
+
* keys.
|
|
110
|
+
* @default "single"
|
|
111
|
+
*/
|
|
46
112
|
quoteStyle: "double" | "single";
|
|
113
|
+
/**
|
|
114
|
+
* When `true`, also render non-enumerable own properties of plain objects
|
|
115
|
+
* (mirrors `util.inspect`'s `showHidden`).
|
|
116
|
+
* @default false
|
|
117
|
+
*/
|
|
47
118
|
showHidden: boolean;
|
|
48
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Colourize / decorate a rendered fragment. Receives the raw fragment and a
|
|
121
|
+
* style hint and must return the (optionally wrapped) string. Defaults to the
|
|
122
|
+
* identity function.
|
|
123
|
+
*/
|
|
49
124
|
stylize: (value: string, styleType: LiteralUnion<"bigint" | "boolean" | "date" | "null" | "number" | "regexp" | "special" | "string" | "symbol" | "undefined", string>) => string;
|
|
125
|
+
/**
|
|
126
|
+
* The maximum length (in characters) of a single rendered value before it is
|
|
127
|
+
* truncated with an ellipsis. Use `Number.POSITIVE_INFINITY` to disable
|
|
128
|
+
* truncation.
|
|
129
|
+
* @default Number.POSITIVE_INFINITY
|
|
130
|
+
*/
|
|
50
131
|
truncate: number;
|
|
51
132
|
}
|
|
52
133
|
/**
|
|
@@ -125,6 +206,7 @@ type SimpleReporterOptions = PrettyStyleOptions & {
|
|
|
125
206
|
declare class SimpleReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> implements InteractiveStreamReporter<L> {
|
|
126
207
|
#private;
|
|
127
208
|
constructor(options?: Partial<SimpleReporterOptions>);
|
|
209
|
+
override setLoggerTypes(types: LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>): void;
|
|
128
210
|
setStdout(stdout_: NodeJS.WriteStream): void;
|
|
129
211
|
setStderr(stderr_: NodeJS.WriteStream): void;
|
|
130
212
|
setInteractiveManager(manager?: InteractiveManager): void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
`),0):
|
|
3
|
-
`,
|
|
1
|
+
import{createRequire as P}from"node:module";import L from"@visulima/colorize";import{A as z,c as B,r as D,b as O,d as F,g as G,e as H,f as c,h as K,a as Q,j as C,V as U,U as $,i as X}from"../../packem_shared/abstract-pretty-reporter-Bczvp2Zh.js";const ie=P(import.meta.url),V=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:W,stderr:Y}=V,{bgGrey:Z,bold:E,cyan:J,green:N,greenBright:ee,grey:h,red:b,underline:I,white:te}=L,se=/[\\/]pail[\\/]dist/,x=T=>!se.test(T);class he extends z{#e;#r;#i;#h=!1;#o;#s;#t;#a=!1;#n="";#p="";constructor(t={}){const{error:o,inspect:n,...i}=t;super({uppercase:{label:!0,...i.uppercase},...i}),this.#o={...B,indent:void 0,...n},this.#s={...o,color:{fileLine:N,hint:J,marker:b,message:b,method:ee,title:b}},this.#e=W,this.#r=Y,this.#l()}setLoggerTypes(t){super.setLoggerTypes(t),this.#l()}setStdout(t){this.#e=t,this.#t=void 0,this.#a=!1}setStderr(t){this.#r=t}setInteractiveManager(t){this.#i=t}setIsInteractive(t){this.#h=t}log(t){const o=this.formatMessage(t),n=t.type.level,i=D(n)?"stderr":"stdout",a=i==="stderr"?this.#r:this.#e;this.#h&&this.#i!==void 0&&a.isTTY?this.#i.update(i,o.split(`
|
|
2
|
+
`),0):O(`${o}
|
|
3
|
+
`,a)}#l(){this.#n=F(this.loggerTypes),this.#p=G(this.loggerTypes)}#u(){return!this.#a&&typeof this.#e.on=="function"&&(this.#a=!0,this.#e.on("resize",()=>{this.#t=void 0})),this.#t===void 0&&(this.#t=H().columns),this.#t}formatMessage(t){let o=this.#u();typeof this.styles.messageLength=="number"&&(o=this.styles.messageLength);const{badge:n,context:i,date:a,error:S,file:l,groups:f,label:g,message:u,prefix:d,repeated:j,scope:m,suffix:y,traceError:_,type:R}=t,{color:M}=this.loggerTypes[R.name],v=M?L[M]:te,p=f.map(()=>" ").join(""),e=[];if(f.length>0&&e.push(`${p+h(`[${f.at(-1)??""}]`)} `),a&&e.push(`${h(this.styles.dateFormatter(typeof a=="string"?new Date(a):a))} `),n)e.push(E(v(n)));else{const s=this.#n;s.length>0&&e.push(h(" ".repeat(s.length)))}const A=this.#p,w=c(A);if(g){const s=c(g),r=Math.max(0,w-s);e.push(`${E(v(K(g,this.styles)))} `," ".repeat(r))}else e.push(" ".repeat(w+1));j&&e.push(`${Z.white(`[${String(j)}x]`)} `),Array.isArray(m)&&m.length>0&&e.push(`${h(`[${m.join(" > ")}]`)} `),d&&e.push(`${h(`[${this.styles.underline.prefix?I(d):d}]`)} `);const k=c(e.join(""));if(u!==Q){const s=typeof u=="string"?u:C(u,this.#o);e.push(p+U(s,{trim:!1,width:o-3,wrapMode:X.STRICT_WIDTH}))}if(i){let s=!1;e.push(...i.map(r=>{if(r instanceof Error)return s=!0,`
|
|
4
4
|
|
|
5
|
-
${
|
|
5
|
+
${$(r,{...this.#s,filterStacktrace:x,prefix:p})}`;if(typeof r=="object")return` ${C(r,this.#o)}`;const q=(s?`
|
|
6
6
|
|
|
7
|
-
`:" ")+String(r);return s=!1,q}))}if(
|
|
7
|
+
`:" ")+String(r);return s=!1,q}))}if(S&&e.push($(S,{...this.#s,filterStacktrace:x,prefix:p})),_&&e.push(`
|
|
8
8
|
|
|
9
|
-
${
|
|
10
|
-
`,
|
|
11
|
-
`)}return
|
|
9
|
+
${$(_,{...this.#s,filterStacktrace:x,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:p})}`),y&&e.push(` ${p}${h(this.styles.underline.suffix?I(y):y)}`),l){const s=(l.name??"")+(l.line?`:${String(l.line)}`:""),r=Math.max(0,k-c("Caller: "));e.push(`
|
|
10
|
+
`,h("Caller: ")," ".repeat(r),s,`
|
|
11
|
+
`)}return e.join("")}}export{he as SimpleReporter};
|
package/dist/wide-event.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { R as RequestLogEntry, S as SerializedError, W as WideEvent, a as WideEventFinishOptions, b as WideEventLevel, c as WideEventOptions, d as createWideEvent } from "./packem_shared/wide-event.d-
|
|
2
|
-
import "./packem_shared/types.d-
|
|
3
|
-
import
|
|
1
|
+
export { R as RequestLogEntry, S as SerializedError, W as WideEvent, a as WideEventFinishOptions, b as WideEventLevel, c as WideEventOptions, d as createWideEvent } from "./packem_shared/wide-event.d-D3ATYpoK.js";
|
|
2
|
+
import "./packem_shared/types.d-bWnqHJKL.js";
|
|
3
|
+
import "./packem_shared/index.d-T71KjNAr.js";
|
|
4
|
+
import 'type-fest';
|
|
4
5
|
import '@visulima/colorize';
|
|
5
6
|
import '@visulima/interactive-manager';
|
package/dist/wide-event.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import"./packem_shared/addKnownErrorConstructor-C1OJTj2D-f9no2VNI.js";import{O as c}from"./packem_shared/serializeError-C-NFvZ8_-D0CA_Qlx.js";const m=8,h={debug:0,error:3,info:1,warn:2},l={debug:"debug",error:"error",info:"info",warn:"warn"},u=(s,t)=>{const e={...s},r=Object.keys(t);for(let i=0;i<r.length;i+=1){const a=r[i],o=t[a],n=e[a];o!==null&&typeof o=="object"&&!Array.isArray(o)&&n!==null&&typeof n=="object"&&!Array.isArray(n)?e[a]=u(n,o):e[a]=o}return e},g=s=>s<1e3?`${String(s)}ms`:`${(s/1e3).toFixed(2)}s`,d=(s,t)=>{const e={message:typeof s.message=="string"?s.message:"",name:typeof s.name=="string"?s.name:"Error"};if(s.stack&&(e.stack=s.stack),s.status!==void 0?e.status=s.status:s.statusCode!==void 0&&(e.status=s.statusCode),s.data!==void 0&&(e.data=s.data),t.cause instanceof Error){const{cause:r}=s;r==="[Circular]"?e.cause="[Circular]":r!==null&&typeof r=="object"&&(e.cause=d(r,t.cause))}return e},p=s=>d(c(s,{maxDepth:m}),s);class v{name;autoEmit;data;emitted;attachedError;level;pail;requestLogs;service;startTime;status;timestamp;_type;constructor(t){this.name=t.name,this.pail=t.pail,this.data={},this.startTime=performance.now(),this.timestamp=new Date().toISOString(),this.emitted=!1,this.autoEmit=t.autoEmit??!0,this._type=t.type??"info",this.level="info",this.requestLogs=[],this.service=t.service}debug(t,e){return this.addLogEntry("debug",t,e)}emit(t){if(this.emitted)return;this.emitted=!0;const e=Math.round(performance.now()-this.startTime),r=this.attachedError?"error":this.level,i=t??l[r],a={duration:g(e),duration_ms:e,event:this.name,timestamp:this.timestamp,...this.data};this.service&&(a.service=this.service),this.status!==void 0&&(a.status=this.status),this.attachedError&&(a.error=p(this.attachedError)),this.requestLogs.length>0&&(a.requestLogs=this.requestLogs);const o=this.pail[i];o({message:a})}error(t,e,r){return e&&(this.attachedError=e),this.addLogEntry("error",t,r)}finish(t){t?.status!==void 0&&(this.status=t.status),t?.error&&(this.attachedError=t.error),this.emit()}getData(){return this.data}getLevel(){return this.attachedError?"error":this.level}getRequestLogs(){return this.requestLogs}info(t,e){return this.addLogEntry("info",t,e)}set(t){return this.data=u(this.data,t),this}setError(t){return this.attachedError=t,this}setStatus(t){return this.status=t,this}warn(t,e){return this.addLogEntry("warn",t,e)}[Symbol.dispose](){this.autoEmit&&!this.emitted&&this.emit()}addLogEntry(t,e,r){const i={level:t,message:e,timestamp:new Date().toISOString()};return r&&(i.context=r),this.requestLogs.push(i),this.escalateLevel(t),this}escalateLevel(t){(h[t]??0)>(h[this.level]??0)&&(this.level=t)}}const y=s=>new v(s);export{v as WideEvent,y as createWideEvent};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/pail",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.22",
|
|
4
4
|
"description": "Highly configurable Logger for Node.js, Edge and Browser.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -229,13 +229,13 @@
|
|
|
229
229
|
"LICENSE.md"
|
|
230
230
|
],
|
|
231
231
|
"dependencies": {
|
|
232
|
-
"@visulima/colorize": "2.0.0-alpha.
|
|
233
|
-
"@visulima/interactive-manager": "1.0.0-alpha.
|
|
232
|
+
"@visulima/colorize": "2.0.0-alpha.14",
|
|
233
|
+
"@visulima/interactive-manager": "1.0.0-alpha.5"
|
|
234
234
|
},
|
|
235
235
|
"peerDependencies": {
|
|
236
236
|
"@opentelemetry/api": "^1.9.1",
|
|
237
237
|
"@sveltejs/kit": ">=2.0",
|
|
238
|
-
"@visulima/redact": "3.0.0-alpha.
|
|
238
|
+
"@visulima/redact": "3.0.0-alpha.14",
|
|
239
239
|
"elysia": ">=1.0",
|
|
240
240
|
"express": ">=4.0",
|
|
241
241
|
"fastify": ">=4.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var d=Object.defineProperty;var f=(e,r)=>d(e,"name",{value:r,configurable:!0});import{E as y}from"./constants-DKfCaSUR.js";var j=Object.defineProperty,h=f((e,r)=>j(e,"name",{value:r,configurable:!0}),"f$1"),P=Object.defineProperty,S=h((e,r)=>P(e,"name",{value:r,configurable:!0}),"b");const w=Object.create({},{cause:{enumerable:!1,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},errors:{enumerable:!1,value:void 0,writable:!0},message:{enumerable:!1,value:void 0,writable:!0},name:{enumerable:!1,value:void 0,writable:!0},stack:{enumerable:!1,value:void 0,writable:!0}});var N=Object.defineProperty,l=S((e,r)=>N(e,"name",{value:r,configurable:!0}),"i");const x=l(e=>{if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return r===null||r===Object.prototype||Object.getPrototypeOf(r)===null},"isPlainObject"),m=new WeakSet,g=l(e=>{const r=Object.getOwnPropertyNames(e);for(const a of r){const t=Object.getOwnPropertyDescriptor(e,a);t&&(t.enumerable||Object.defineProperty(e,a,{...t,enumerable:!0}),t.value&&typeof t.value=="object"&&!Array.isArray(t.value)&&(Object.getPrototypeOf(t.value)===Object.prototype||Object.getPrototypeOf(t.value)===null)&&g(t.value))}},"makePropertiesEnumerable"),E=l(e=>{m.add(e);const r=e.toJSON();return m.delete(e),Object.isExtensible(r)&&g(r),r},"toJSON"),O=l((e,r,a,t)=>{if(e&&e instanceof Uint8Array&&e.constructor.name==="Buffer")return"[object Buffer]";if(e!==null&&typeof e=="object"&&"pipe"in e&&typeof e.pipe=="function")return"[object Stream]";if(e instanceof Error)return r.has(e)?"[Circular]":(a+=1,b(e,t,r,a));if(t.useToJSON&&e!==null&&typeof e=="object"&&"toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();if(e instanceof Date)return e.toISOString();if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="bigint")return`${String(e)}n`;if(x(e)){if(t.maxDepth!==void 0&&t.maxDepth!==Number.POSITIVE_INFINITY&&a+1>=t.maxDepth)return{};a+=1;const o={};for(const i in e)o[i]=O(e[i],r,a,t);return o}try{return e}catch{return"[Not Available]"}},"serializeValue"),b=l((e,r,a,t)=>{if(a.add(e),r.maxDepth===0)return{};if(r.useToJSON&&typeof e.toJSON=="function"&&!m.has(e))return E(e);const o=Object.create(w);if(Object.defineProperty(o,"name",{configurable:!0,enumerable:!0,value:Object.prototype.toString.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,writable:!0}),Object.defineProperty(o,"message",{configurable:!0,enumerable:!0,value:e.message,writable:!0}),Object.defineProperty(o,"stack",{configurable:!0,enumerable:!0,value:e.stack,writable:!0}),Array.isArray(e.errors)){const n=[];for(const u of e.errors){if(!(u instanceof Error))throw new TypeError("All errors in the 'errors' property must be instances of Error");if(a.has(u))return Object.defineProperty(o,"errors",{configurable:!0,enumerable:!0,value:[],writable:!0}),o;n.push(b(u,r,a,t))}Object.defineProperty(o,"errors",{configurable:!0,enumerable:!0,value:n,writable:!0})}const i=e.cause;if(i!=null)if(i instanceof Error)a.has(i)?Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:"[Circular]",writable:!0}):Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:b(i,r,a,t),writable:!0});else{const n=O(i,a,t,r);Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:n,writable:!0})}for(const n in e){if(n==="name"||n==="message"||n==="stack"||n==="cause"||n==="errors")continue;const u=e[n],c=O(u,a,t,r);Object.defineProperty(o,n,{configurable:!0,enumerable:!0,value:c,writable:!0})}if(Array.isArray(r.exclude)&&r.exclude.length>0)for(const n of r.exclude)try{delete o[n]}catch{}return o},"_serialize"),v=l((e,r={})=>b(e,{exclude:r.exclude??[],maxDepth:r.maxDepth??Number.POSITIVE_INFINITY,useToJSON:r.useToJSON??!1},new Set,0),"serialize");var J=Object.defineProperty,A=f((e,r)=>J(e,"name",{value:r,configurable:!0}),"f");class D{static{f(this,"AbstractJsonReporter")}static{A(this,"AbstractJsonReporter")}stringify;errorOptions;constructor(r={}){this.errorOptions=r.error??{}}setStringify(r){this.stringify=r}log(r){const{context:a,error:t,file:o,message:i,type:n,...u}=r;if(u.label&&(u.label=u.label.trim()),o&&(u.file=`${o.name??""}:${String(o.line)}${o.column?`:${String(o.column)}`:""}`),u.message=i===y?void 0:i,t&&(u.error=v(t,this.errorOptions)),a){const c=[];for(let p=0;p<a.length;p+=1){const s=a[p];s!==y&&(s instanceof Error?c.push(v(s,this.errorOptions)):c.push(s))}u.context=c}this._log(this.stringify(u),n.level)}}export{D as AbstractJsonReporter};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var d=Object.defineProperty;var f=(e,r)=>d(e,"name",{value:r,configurable:!0});import{E as y}from"./constants-ep2nsfdy.js";var j=Object.defineProperty,h=f((e,r)=>j(e,"name",{value:r,configurable:!0}),"f$1"),P=Object.defineProperty,S=h((e,r)=>P(e,"name",{value:r,configurable:!0}),"b");const w=Object.create({},{cause:{enumerable:!1,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},errors:{enumerable:!1,value:void 0,writable:!0},message:{enumerable:!1,value:void 0,writable:!0},name:{enumerable:!1,value:void 0,writable:!0},stack:{enumerable:!1,value:void 0,writable:!0}});var N=Object.defineProperty,l=S((e,r)=>N(e,"name",{value:r,configurable:!0}),"i");const x=l(e=>{if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return r===null||r===Object.prototype||Object.getPrototypeOf(r)===null},"isPlainObject"),m=new WeakSet,g=l(e=>{const r=Object.getOwnPropertyNames(e);for(const a of r){const t=Object.getOwnPropertyDescriptor(e,a);t&&(t.enumerable||Object.defineProperty(e,a,{...t,enumerable:!0}),t.value&&typeof t.value=="object"&&!Array.isArray(t.value)&&(Object.getPrototypeOf(t.value)===Object.prototype||Object.getPrototypeOf(t.value)===null)&&g(t.value))}},"makePropertiesEnumerable"),E=l(e=>{m.add(e);const r=e.toJSON();return m.delete(e),Object.isExtensible(r)&&g(r),r},"toJSON"),O=l((e,r,a,t)=>{if(e&&e instanceof Uint8Array&&e.constructor.name==="Buffer")return"[object Buffer]";if(e!==null&&typeof e=="object"&&"pipe"in e&&typeof e.pipe=="function")return"[object Stream]";if(e instanceof Error)return r.has(e)?"[Circular]":(a+=1,b(e,t,r,a));if(t.useToJSON&&e!==null&&typeof e=="object"&&"toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();if(e instanceof Date)return e.toISOString();if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="bigint")return`${String(e)}n`;if(x(e)){if(t.maxDepth!==void 0&&t.maxDepth!==Number.POSITIVE_INFINITY&&a+1>=t.maxDepth)return{};a+=1;const o={};for(const i in e)o[i]=O(e[i],r,a,t);return o}try{return e}catch{return"[Not Available]"}},"serializeValue"),b=l((e,r,a,t)=>{if(a.add(e),r.maxDepth===0)return{};if(r.useToJSON&&typeof e.toJSON=="function"&&!m.has(e))return E(e);const o=Object.create(w);if(Object.defineProperty(o,"name",{configurable:!0,enumerable:!0,value:Object.prototype.toString.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,writable:!0}),Object.defineProperty(o,"message",{configurable:!0,enumerable:!0,value:e.message,writable:!0}),Object.defineProperty(o,"stack",{configurable:!0,enumerable:!0,value:e.stack,writable:!0}),Array.isArray(e.errors)){const n=[];for(const u of e.errors){if(!(u instanceof Error))throw new TypeError("All errors in the 'errors' property must be instances of Error");if(a.has(u))return Object.defineProperty(o,"errors",{configurable:!0,enumerable:!0,value:[],writable:!0}),o;n.push(b(u,r,a,t))}Object.defineProperty(o,"errors",{configurable:!0,enumerable:!0,value:n,writable:!0})}const i=e.cause;if(i!=null)if(i instanceof Error)a.has(i)?Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:"[Circular]",writable:!0}):Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:b(i,r,a,t),writable:!0});else{const n=O(i,a,t,r);Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:n,writable:!0})}for(const n in e){if(n==="name"||n==="message"||n==="stack"||n==="cause"||n==="errors")continue;const u=e[n],c=O(u,a,t,r);Object.defineProperty(o,n,{configurable:!0,enumerable:!0,value:c,writable:!0})}if(Array.isArray(r.exclude)&&r.exclude.length>0)for(const n of r.exclude)try{delete o[n]}catch{}return o},"_serialize"),v=l((e,r={})=>b(e,{exclude:r.exclude??[],maxDepth:r.maxDepth??Number.POSITIVE_INFINITY,useToJSON:r.useToJSON??!1},new Set,0),"serialize");var J=Object.defineProperty,A=f((e,r)=>J(e,"name",{value:r,configurable:!0}),"f");class D{static{f(this,"AbstractJsonReporter")}static{A(this,"AbstractJsonReporter")}stringify;errorOptions;constructor(r={}){this.errorOptions=r.error??{}}setStringify(r){this.stringify=r}log(r){const{context:a,error:t,file:o,message:i,type:n,...u}=r;if(u.label&&(u.label=u.label.trim()),o&&(u.file=`${o.name??""}:${String(o.line)}${o.column?`:${String(o.column)}`:""}`),u.message=i===y?void 0:i,t&&(u.error=v(t,this.errorOptions)),a){const c=[];for(let p=0;p<a.length;p+=1){const s=a[p];s!==y&&(s instanceof Error?c.push(v(s,this.errorOptions)):c.push(s))}u.context=c}this._log(this.stringify(u),n.level)}}export{D as AbstractJsonReporter};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var i=Object.defineProperty;var s=(t,e)=>i(t,"name",{value:e,configurable:!0});import{createRequire as c}from"node:module";import{i as p}from"./write-stream-Dd4_PTcm.js";import{AbstractJsonReporter as l}from"./AbstractJsonReporter-PVC4ONf2.js";const _=c(import.meta.url),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:n,stderr:u}=a;var d=Object.defineProperty,f=s((t,e)=>d(t,"name",{value:e,configurable:!0}),"r");class j extends l{static{s(this,"m")}static{f(this,"JsonReporter")}#e;#t;constructor(e={}){super(e),this.#e=n,this.#t=u}setStdout(e){this.#e=e}setStderr(e){this.#t=e}_log(e,r){const o=["error","warn"].includes(r)?this.#t:this.#e;p(`${e}
|
|
2
|
-
`,o)}}export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s=Object.defineProperty;var t=(e,r)=>s(e,"name",{value:r,configurable:!0});import{AbstractJsonReporter as a}from"./AbstractJsonReporter-D_Pb6kpB.js";import{t as p}from"./write-console-log-based-on-level-DfD64owL.js";var c=Object.defineProperty,n=t((e,r)=>c(e,"name",{value:r,configurable:!0}),"e");class l extends a{static{t(this,"p")}static{n(this,"JsonReporter")}constructor(r={}){super(r)}_log(r,o){p(o)(r)}}export{l as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var E=Object.defineProperty;var c=(r,t)=>E(r,"name",{value:t,configurable:!0});import F,{grey as o,white as w,underline as T,bold as M}from"@visulima/colorize/browser";import{v as a,s as Y}from"./index-Dwp5v97D.js";import{L as _,E as k}from"./constants-DKfCaSUR.js";import{t as C}from"./write-console-log-based-on-level-DfD64owL.js";var D=Object.defineProperty,G=c((r,t)=>D(r,"name",{value:t,configurable:!0}),"r$1");const H=G(r=>{const t=Object.keys(r).map(l=>r[l].badge??"");return t.length===0?"":t.reduce((l,u)=>l.length>u.length?l:u,"")},"getLongestBadge");var U=Object.defineProperty,R=c((r,t)=>U(r,"name",{value:t,configurable:!0}),"o");const q=R(r=>[r.getHours(),r.getMinutes(),r.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":"),"dateFormatter");class z{static{c(this,"AbstractPrettyReporter")}static{R(this,"AbstractPrettyReporter")}styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:q,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=_}setLoggerTypes(t){this.loggerTypes=t}}var I=Object.defineProperty,J=c((r,t)=>I(r,"name",{value:t,configurable:!0}),"B");class X extends z{static{c(this,"_")}static{J(this,"PrettyReporter")}constructor(t={}){super({uppercase:{label:!0,...t.uppercase},...t})}log(t){const l=typeof globalThis.window<"u"&&typeof globalThis.document<"u",u=C(t.type.level),{badge:x,context:A,date:g,error:P,groups:y,label:d,message:S,prefix:b,repeated:f,scope:h,suffix:m,type:B}=t,{color:j}=this.loggerTypes[B.name],O=j?F[j]:w,s=[];if(l&&y.length>0){const e=y.map(()=>" ").join(""),i=o(`[${y.at(-1)}]`);s.push(a(e+i[0],i.slice(1)))}if(g){const e=o(this.styles.dateFormatter(typeof g=="string"?new Date(g):g));l?s.push(a(e[0],e.slice(1))):s.push([`${e[0]} `,...e.slice(1)])}if(x){const e=O(x);l?s.push(a(e[0],e.slice(1))):s.push([`${e[0]} `,...e.slice(1)])}else{const e=H(this.loggerTypes);if(e.length>0){const i=o(".".repeat(e.length));l?s.push(a(`${i[0]} `,i.slice(1))):s.push([`${i[0]} `,...i.slice(1)])}}const L=Y(this.loggerTypes);let $;if(f){const e=w(`[${f}x]`);$=l?a(e[0],e.slice(1)):[e[0],...e.slice(1)]}if(d){const e=O(this.#e(d));l?s.push(a(e[0],e.slice(1))):s.push([e[0],...e.slice(1)]),$&&s.push($);let i=L.length-d.length;if(f?i-=String(f).length+3:i+=1,i>0){const n=o(".".repeat(i));l?s.push(a(n[0],n.slice(1))):s.push([` ${n[0]}`,...n.slice(1)])}}else{const e=o(".".repeat(L.length+1));l?s.push(a(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(Array.isArray(h)&&h.length>0){const e=o(`[${h.join(" > ")}]`);l?s.push(a(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(b){const e=o(`${Array.isArray(h)&&h.length>0?". ":" "}[${this.styles.underline.prefix?T(b):b}] `);l?s.push(a(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(S!==k&&s.push(S),A&&s.push(...A),P&&s.push(P,`
|
|
2
|
-
|
|
3
|
-
`),m){const e=o(this.styles.underline.suffix?T(m):m);l?s.push(a(`
|
|
4
|
-
${e[0]}`,e.slice(1))):s.push([`
|
|
5
|
-
${e[0]}`,...e.slice(1)])}if(l)u(...s);else{let e="";const i=[],n=[];for(let v=0;v<s.length;v+=1){const p=s[v];Array.isArray(p)&&p.length>1&&p[0].includes("%c")?(e+=String(p[0]),i.push(...p.slice(1))):n.push(p)}u(`${e}%c`,...i,"",...n)}}#e(t){let l=this.styles.uppercase.label?t.toUpperCase():t;return l=this.styles.underline.label?T(l):l,this.styles.bold.label&&(l=M(l)),l}}export{X as default};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
var qt=Object.defineProperty;var $=(e,t)=>qt(e,"name",{value:t,configurable:!0});import{createRequire as Yt}from"node:module";import de from"@visulima/colorize";import{L as er,E as tr}from"./constants-ep2nsfdy.js";import{i as rr}from"./write-stream-Dd4_PTcm.js";const Ut=Yt(import.meta.url),D=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,fe=$(e=>{if(typeof D<"u"&&D.versions&&D.versions.node){const[t,r]=D.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return D.getBuiltinModule(e)}return Ut(e)},"__cjs_getBuiltinModule"),B=D,{stdout:Jt,stderr:Kt}=B,{createRequire:Qt}=fe("node:module"),{execFileSync:Zt}=fe("node:child_process"),J=fe("node:fs"),Xt=fe("node:tty");var nr=Object.defineProperty,ir=$((e,t)=>nr(e,"name",{value:t,configurable:!0}),"A$4"),sr=Object.defineProperty,We=ir((e,t)=>sr(e,"name",{value:t,configurable:!0}),"$"),ar=Object.defineProperty,or=We((e,t)=>ar(e,"name",{value:t,configurable:!0}),"r$1");const lr=or(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
2
|
-
`),"normalizeLF"),ur=globalThis.process??Object.create(null),Le={versions:{}},ze=new Proxy(ur,{get(e,t){if(t in e)return e[t];if(t in Le)return Le[t]}});var cr=Object.defineProperty,fr=We((e,t)=>cr(e,"name",{value:t,configurable:!0}),"b");const dr=fr((e,t,r,n)=>{const i={column:0,line:-1,...e.start},s={...i,...e.end},a=i.line,o=i.column,l=s.line,u=s.column;let c=Math.max(a-(r+1),0),f=Math.min(t.length,l+n);a===-1&&(c=0),l===-1&&(f=t.length);const g=l-a,p={};if(g)for(let d=0;d<=g;d++){const h=d+a;if(!o)p[h]=!0;else if(d===0){const m=t[h-1]?.length;p[h]=[o,(m??0)-o+1]}else if(d===g)p[h]=[0,u];else{const m=t[h-d]?.length;p[h]=[0,m]}}else o===u?p[a]=o?[o,0]:!0:p[a]=[o,(u??0)-(o??0)];return{end:f,markerLines:p,start:c}},"getMarkerLines");var pr=Object.defineProperty,ne=We((e,t)=>pr(e,"name",{value:t,configurable:!0}),"t");const gr=ze.platform==="win32"&&!ze.env?.WT_SESSION?">":"❯",hr=ne((e,t,r)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:ne(d=>d,"gutter"),marker:ne(d=>d,"marker"),message:ne(d=>d,"message"),...r?.color}},i=typeof t.start.column=="number";let s=lr(e).split(`
|
|
3
|
-
`);typeof n.tabWidth=="number"&&(s=s.map(d=>d.replaceAll(" "," ".repeat(n.tabWidth))));const{end:a,markerLines:o,start:l}=dr(t,s,n.linesAbove,n.linesBelow),u=String(a).length,{gutter:c,marker:f,message:g}=n.color;let p=s.slice(l,a).map((d,h)=>{const m=l+1+h,y=o[m],A=` ${String(m)}`.slice(-u),I=!o[m+1],x=` ${A}${n.showGutter?" |":""}`;if(y){let b="";if(Array.isArray(y)){const C=d.replaceAll(/[^\t]/g," ").slice(0,Math.max(y[0]-1,0)),k=y[1]||1;b=[`
|
|
4
|
-
`,n.prefix+c(x.replaceAll(/\d/g," "))," ",C,f("^").repeat(k)].join(""),I&&n.message&&(b+=` ${g(n.message)}`)}return[n.prefix+f(gr),c(x),d.length>0?` ${d}`:"",b].join("")}return`${n.prefix} ${c(x)}${d.length>0?` ${d}`:""}`}).join(`
|
|
5
|
-
`);return n.message&&!i&&(p=`${n.prefix+" ".repeat(u+1)+n.message}
|
|
6
|
-
${p}`),p},"codeFrame");var mr=Object.defineProperty,$r=$((e,t)=>mr(e,"name",{value:t,configurable:!0}),"x$5"),br=Object.defineProperty,vr=$r((e,t)=>br(e,"name",{value:t,configurable:!0}),"x"),yr=Object.defineProperty,W=vr((e,t)=>yr(e,"name",{value:t,configurable:!0}),"u");const L=W((e,...t)=>{process.env.DEBUG&&process.env.DEBUG==="true"&&console.debug(`error:parse-stacktrace: ${e}`,...t)},"debugLog"),z="<unknown>",wr=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Sr=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,Or=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,xr=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,jr=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,Ar=/in\s(.*)\s\(at\s(.+)\)\sat/,Er=/^(?:.*@)?(.*):(\d+):(\d+)$/,Nr=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ir=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Pr=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,Ve=/\(error: (.*)\)/,kr=/at\s/,Tr=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,Wr=/\S*(?:Error: |AggregateError:)/,st=/^Anonymous function$/,Br=/^\s*in\s.*/,Fr=/^.*?\s*at\s.*/,Mr=/^.*?\s*@.*|\[native code\]/,at=W((e,t)=>{const r=e.includes("safari-extension"),n=e.includes("safari-web-extension");return r||n?[e.includes("@")?e.split("@")[0]:z,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},"extractSafariExtensionDetails"),ot=W((e,t)=>{const r=Or.exec(t);r&&(e.file=r[1],e.line=+r[2],e.column=+r[3])},"parseMapped"),_r=W(e=>{const t=Ar.exec(e);if(t){L(`parse nested node error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const n=t[2].split(":");return{column:n[2]?+n[2]:void 0,file:n[0],line:n[1]?+n[1]:void 0,methodName:t[1]??z,raw:e,type:void 0}}const r=jr.exec(e);if(r){L(`parse node error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n={column:r[4]?+r[4]:void 0,file:r[2]?r[2].replace(kr,""):void 0,line:r[3]?+r[3]:void 0,methodName:r[1]??z,raw:e,type:e.startsWith("internal")?"internal":void 0};return ot(n,`${r[2]}:${r[3]}:${r[4]}`),n}},"parseNode"),Cr=W(e=>{const t=wr.exec(e);if(t){L(`parse chrome error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const r=t[2]?.startsWith("native"),n=t[2]?.startsWith("eval")||t[1]?.startsWith("eval");let i,s;if(n){const u=Sr.exec(e);if(u){const c=Tr.exec(u[1]);c?(t[2]=c[4]??c[1],t[3]=c[5]??c[2],t[4]=c[3]):u[2]&&(t[2]=u[1]),u[2]&&(i={column:u[4]?+u[4]:void 0,file:u[2],line:u[3]?+u[3]:void 0,methodName:"eval",raw:e,type:"eval"})}else{const c=xr.exec(e);c&&(s={column:c[4]?+c[4]:void 0,file:c[2],line:c[3]?+c[3]:void 0},i={column:c[6]?+c[6]:void 0,file:c[1],line:c[5]?+c[5]:void 0,methodName:"eval",raw:c[0],type:"eval"})}}const[a,o]=at(t[1]?t[1].replace(st,"<anonymous>"):z,t[2]),l={column:t[4]?+t[4]:void 0,evalOrigin:i,file:o,line:t[3]?+t[3]:void 0,methodName:a,raw:e,type:n?"eval":r?"native":void 0};return s?(l.column=s.column,l.file=s.file,l.line=s.line):ot(l,`${o}:${t[3]}:${t[4]}`),l}},"parseChromium"),Rr=W((e,t)=>{const r=Nr.exec(e);if(r){L(`parse gecko error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n=r[3]?.includes(" > eval"),i=n&&r[3]&&Ir.exec(r[3]);let s;n&&i&&(r[3]=i[1],s={column:r[5]?+r[5]:void 0,file:r[3],line:r[4]?+r[4]:void 0,methodName:"eval",raw:e,type:"eval"},r[4]=i[2]);const[a,o]=at(r[1]?r[1].replace(st,"<anonymous>"):z,r[3]);let l;(t?.type==="safari"||!n&&t?.type==="firefox")&&t.column?l=t.column:!n&&r[5]&&(l=+r[5]);let u;return(t?.type==="safari"||!n&&t?.type==="firefox")&&t.line?u=t.line:r[4]&&(u=+r[4]),{column:l,evalOrigin:s,file:o,line:u,methodName:a,raw:e,type:n?"eval":o.includes("[native code]")?"native":void 0}}},"parseGecko"),Lr=W((e,t)=>{const r=Pr.exec(e);if(!(r&&r[2].includes(" > eval"))&&r)return L(`parse firefox error stack line: "${e}"`,`found: ${JSON.stringify(r)}`),{column:r[4]?+r[4]:t?.column??void 0,file:r[2],line:r[3]?+r[3]:t?.line??void 0,methodName:r[1]||z,raw:e,type:void 0}},"parseFirefox"),zr=W(e=>{const t=Er.exec(e);if(t)return L(`parse react android native error stack line: "${e}"`,`found: ${JSON.stringify(t)}`),{column:t[3]?+t[3]:void 0,file:t[1],line:t[2]?+t[2]:void 0,methodName:z,raw:e,type:void 0}},"parseReactAndroidNative"),lt=W((e,{filter:t,frameLimit:r=50}={})=>{const n=e;let i=(typeof n.stacktrace=="string"?n.stacktrace:e.stack??"").split(`
|
|
7
|
-
`).map(s=>(Ve.test(s)?s.replace(Ve,"$1"):s).trim()).filter(s=>!Wr.test(s)&&s!=="eval code");return t&&(i=i.filter(s=>t(s))),i=i.slice(0,r),i.reduce((s,a,o)=>{if(!a||a.length>1024)return s;let l;if(Br.test(a))l=_r(a);else if(Fr.test(a))l=Cr(a);else if(Mr.test(a)){let u;if(o===0){const c=e,f=c.columnNumber,g=c.lineNumber,p=c.line,d=c.column;f||g?u={column:f,line:g,type:"firefox"}:(p||d)&&(u={column:d,line:p,type:"safari"})}l=Lr(a,u)??Rr(a,u)}else l=zr(a);return l?s.push(l):L(`parse error stack line: "${a}"`,"not parser found"),s},[])},"parseStacktrace");var Vr=Object.defineProperty,Hr=$((e,t)=>Vr(e,"name",{value:t,configurable:!0}),"p$6"),Dr=Object.defineProperty,ut=Hr((e,t)=>Dr(e,"name",{value:t,configurable:!0}),"m");const Gr=Qt(import.meta.url),G=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Be=ut(e=>{if(typeof G<"u"&&G.versions&&G.versions.node){const[t,r]=G.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return G.getBuiltinModule(e)}return Gr(e)},"__cjs_getBuiltinModule"),{existsSync:qr,readFileSync:Yr}=Be("node:fs"),{relative:Ur}=Be("node:path"),{cwd:Jr}=G,{fileURLToPath:Kr}=Be("node:url");var Qr=Object.defineProperty,w=ut((e,t)=>Qr(e,"name",{value:t,configurable:!0}),"o");const q=w((e,t,r)=>r===0?e:t===" "?e+" ".repeat(r):e+" ".repeat(t*r),"getPrefix"),Zr=w((e,t)=>{const r=e.replace("async file:","file:");return Ur(t,r.startsWith("file:")?Kr(r):r)},"getRelativePath"),Xr=w((e,t,r)=>{if(t)return r.title(e.message);const n=e.message?`: ${e.message}`:"";return r.title(e.name+n)},"getTitleText"),ct=w((e,{color:t,hideErrorTitle:r,indentation:n,prefix:i},s)=>`${q(i,n,s)}${Xr(e,r,t)}
|
|
8
|
-
`,"getMessage"),ft=w((e,{color:t,indentation:r,prefix:n},i)=>{if(e.hint===void 0)return;const s=q(n,r,i);let a="";if(Array.isArray(e.hint))for(const o of e.hint)a+=`${s+o}
|
|
9
|
-
`;else a+=s+e.hint;return t.hint(a)},"getHint"),Fe=w((e,{color:t,cwd:r,displayShortPath:n,indentation:i,prefix:s},a=0)=>{const o=n?Zr(e.file,r):e.file,{fileLine:l,method:u}=t;return`${q(s,i,a)}at ${e.methodName?`${u(e.methodName)} `:""}${l(o)}:${l(e.line?.toString()??"")}`},"getMainFrame"),dt=w((e,{color:t,indentation:r,linesAbove:n,linesBelow:i,prefix:s,showGutter:a,showLineNumbers:o,tabWidth:l},u)=>{if(e.file===void 0)return;const c=e.file.replace("file://","");if(!qr(c))return;const f=Yr(c,"utf8");return hr(f,{start:{column:e.column,line:e.line}},{color:t,linesAbove:n,linesBelow:i,prefix:q(s,r,u),showGutter:a,showLineNumbers:o,tabWidth:l})},"getCode"),pt=w((e,t,r)=>{if(e.errors.length===0)return;let n=`${q(t.prefix,t.indentation,r)}Errors:
|
|
10
|
-
|
|
11
|
-
`,i=!0;for(const s of e.errors)i?i=!1:n+=`
|
|
12
|
-
|
|
13
|
-
`,n+=ht(s,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},r+1);return`
|
|
14
|
-
${n}`},"getErrors"),gt=w((e,t,r)=>{let n=`${q(t.prefix,t.indentation,r)}Caused by:
|
|
15
|
-
|
|
16
|
-
`;const i=e.cause;n+=ct(i,t,r);const s=lt(i).shift(),a=ft(i,t,r);if(a&&(n+=`${a}
|
|
17
|
-
`),s&&(n+=Fe(s,t,r),!t.hideErrorCauseCodeView)){const o=dt(s,t,r);o!==void 0&&(n+=`
|
|
18
|
-
${o}`)}if(i.cause)n+=`
|
|
19
|
-
${gt(i,t,r+1)}`;else if(i instanceof AggregateError){const o=pt(i,t,r);o!==void 0&&(n+=`
|
|
20
|
-
${o}`)}return`
|
|
21
|
-
${n}`},"getCause"),en=w((e,t)=>(e.length>0?`
|
|
22
|
-
`:"")+e.map(r=>Fe(r,t)).join(`
|
|
23
|
-
`),"getStacktrace"),ht=w((e,t,r)=>{const n={cwd:Jr(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...t,color:{fileLine:w(a=>a,"fileLine"),gutter:w(a=>a,"gutter"),hint:w(a=>a,"hint"),marker:w(a=>a,"marker"),message:w(a=>a,"message"),method:w(a=>a,"method"),title:w(a=>a,"title"),...t.color}},i=lt(e,{filter:t.filterStacktrace,frameLimit:n.framesMaxLimit}),s=i.shift();return[t.hideMessage?void 0:ct(e,n,r),ft(e,n,r),s?Fe(s,n,r):void 0,s&&!n.hideErrorCodeView?dt(s,n,r):void 0,e instanceof AggregateError?pt(e,n,r):void 0,e.cause===void 0?void 0:gt(e,n,r),i.length>0?en(i,n):void 0].filter(Boolean).join(`
|
|
24
|
-
`).replaceAll("\\","/")},"internalRenderError"),Oe=w((e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return ht(e,t,0)},"renderError");var tn=Object.defineProperty,mt=$((e,t)=>tn(e,"name",{value:t,configurable:!0}),"w$3"),rn=Object.defineProperty,v=mt((e,t)=>rn(e,"name",{value:t,configurable:!0}),"c"),nn=Object.defineProperty,sn=v((e,t)=>nn(e,"name",{value:t,configurable:!0}),"L");const N=sn((e,t,r,n,i,s=", ")=>{const a=e.length;if(a===0)return"";let o=n;i!==void 0&&(o=i);const l=r.truncate;let u="",c="",f="";for(let g=0;g<a;g+=1){const p=g+1===e.length,d=g+2===e.length;f=`…(${String(e.length-g)})`;let h=e[g];r.truncate=l-u.length-(p?0:s.length);const m=c||o(h,t,r,n)+(p?"":s),y=u.length+m.length,A=y+f.length;if(p&&y>l&&u.length+f.length<=l||!p&&!d&&A>l)break;h=e[g+1];const I=d?"":s;if(p?c="":c=o(h,t,r,n)+I,!p&&d&&A>l&&y+c.length>l)break;if(u+=m,!p&&!d&&y+c.length>=l){f=`…(${String(e.length-g-1)})`;break}f=""}return`${u}${f}`},"inspectList");var an=Object.defineProperty,pe=v((e,t)=>an(e,"name",{value:t,configurable:!0}),"s$7");const on=pe(([e,t],r,n)=>(n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:n.stylize(String(e),"yellow")),"inspectAttribute"),ln=pe((e,t,r)=>{switch(e.nodeType){case 1:return $t(e,e,r,t);case 3:return t(e.data,t,r);default:return t(e,t,r)}},"inspectNode"),Ie=pe((e,t,r,n)=>N(e,e,t,r,ln,`
|
|
25
|
-
`),"inspectNodeCollection"),$t=pe((e,t,r,n)=>{const i=e.getAttributeNames(),s=e.tagName.toLowerCase(),a=r.stylize(`<${s}`,"special"),o=r.stylize(">","special"),l=r.stylize(`</${s}>`,"special");r.truncate-=s.length*2+5;let u="";i.length>0&&(u+=" ",u+=N(i.map(g=>[g,e.getAttribute(g)]),t,r,n,on," ")),r.truncate-=u.length;const{truncate:c}=r;let f=Ie(e.children,r,n,void 0);return f&&f.length>c&&(f=`…(${String(e.children.length)})`),`${a}${u}${o}${f}${l}`},"inspectHTMLElement");var un=Object.defineProperty,cn=v((e,t)=>un(e,"name",{value:t,configurable:!0}),"n$4");const fn=cn((e,t,r)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${N(e,e,t,r)} ]`),"inspectArguments");var dn=Object.defineProperty,bt=v((e,t)=>dn(e,"name",{value:t,configurable:!0}),"r$3");const pn=bt((e,t)=>{let r;if(e===" ")r=" ";else if(typeof e=="number"&&e>0)r=Array.from({length:e+1}).join(" ");else return;return{base:r,prev:`
|
|
26
|
-
${Array.from({length:t+1}).join(r)}`}},"getIndent"),ge=bt((e,t)=>{if(e.length===0)return"";const r=t.prev+t.base;return r+e.split("\0\0").join(`,${r}`)+t.prev},"indentedJoin");var gn=Object.defineProperty,vt=v((e,t)=>gn(e,"name",{value:t,configurable:!0}),"i$6");const hn=/^[a-z_]\w*$/i,mn=/^"|"$/g,$n=vt((e,t)=>{if(hn.test(e))return e;const r=JSON.stringify(e);return t.quoteStyle==="double"?r.replaceAll('"',String.raw`\"`):r.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(mn,"'")},"quoteComplexKey"),Q=vt(([e,t],r,n,i)=>{n.truncate-=2;let s;typeof e=="string"?s=$n(e,n):typeof e=="number"?s=String(e):s=`[${i(e,r,n)}]`,n.truncate-=s.length;const a=i(t,r,n);return`${s}: ${a}`},"inspectProperty");var bn=Object.defineProperty,yt=v((e,t)=>bn(e,"name",{value:t,configurable:!0}),"i$5");const vn=yt(e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},"multiLineValues"),yn=yt((e,t,r,n)=>{const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return"[]";t.truncate-=4;const s=!!n&&vn(e);let a=N(e,e,t,r,void 0,s?"\0\0":", ");t.truncate-=a.length;let o="";return i.length>0&&(o=N(i.map(l=>[l,e[l]]),e,t,r,Q)),s&&n&&(a=ge(a,n)),`[${s?"":" "}${a}${o?`, ${o}`:""}${s?"":" "}]`},"inspectArray");var wn=Object.defineProperty,Sn=v((e,t)=>wn(e,"name",{value:t,configurable:!0}),"o$6");const He=/\d(?=(?:\d{3})+(?!\d))/g,On=/\d{3}/g,xn=/_$/,wt=Sn((e,t)=>{if(e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY||t.includes("e"))return t;if(typeof e=="number"){const r=e<0?-Math.floor(-e):Math.floor(e);if(r!==e){const n=String(r),i=t.slice(n.length+1);return`${n.replace(He,"$&_")}.${i.replace(On,"$&_").replace(xn,"")}`}}return t.replace(He,"$&_")},"addNumericSeparator");var jn=Object.defineProperty,St=v((e,t)=>jn(e,"name",{value:t,configurable:!0}),"i$4");const An=St(e=>e>="\uD800"&&e<="\uDBFF","isHighSurrogate"),M=St((e,t,r="…")=>{e=String(e);const n=r.length,i=e.length;if(n>t&&i>n)return r;if(i>t&&i>n){let s=t-n;return s>0&&An(e[s-1])&&(s-=1),`${e.slice(0,s)}${r}`}return e},"truncate");var En=Object.defineProperty,Nn=v((e,t)=>En(e,"name",{value:t,configurable:!0}),"e$4");const De=Nn((e,t)=>{let r=M(e.toString(),t.truncate-1);return r!=="…"&&(r+="n"),t.stylize(t.numericSeparator?wt(e,r):r,"bigint")},"inspectBigInt");var In=Object.defineProperty,Pn=v((e,t)=>In(e,"name",{value:t,configurable:!0}),"m$1");const kn=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),ae=Pn((e,t,r,n)=>{if("window"in globalThis&&e===globalThis)return"{ [object Window] }";if(e===globalThis)return"{ [object globalThis] }";const i=Object.getOwnPropertyNames(e),s=Object.getOwnPropertySymbols(e),a=kn(e)===Object.prototype||e.constructor===Object,o=e instanceof Object?"":"null prototype";let l;!a&&Symbol.toStringTag in e?l=e[Symbol.toStringTag]:l=o?"Object":"";const u=l||o?`[${[l,o].filter(Boolean).join(": ")}] `:"";if(i.length===0&&s.length===0)return`${u}{}`;t.truncate-=4;const c=n?"\0\0":", ",f=N(i.map(d=>[d,e[d]]),e,t,r,Q,c),g=N(s.map(d=>[d,e[d]]),e,t,r,Q,c);let p="";return f&&g&&(p=c),n?`${u}{${ge(f+p+g,n)}}`:`${u}{ ${f}${p}${g} }`},"inspectObject");var Tn=Object.defineProperty,Wn=v((e,t)=>Tn(e,"name",{value:t,configurable:!0}),"s$4");const Bn=Wn((e,t,r,n)=>{let i="";return i=i||e.constructor.name,(!i||i==="_class")&&(i="<Anonymous Class>"),t.truncate-=i.length,`${i} ${ae(e,t,r,n)}`},"inspectClass");var Fn=Object.defineProperty,Mn=v((e,t)=>Fn(e,"name",{value:t,configurable:!0}),"i$3");const _n=Mn((e,t)=>{const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),i=n[0];return t.stylize(`${i}T${M(n[1],t.truncate-i.length-1)}`,"date")},"inspectDate");var Cn=Object.defineProperty,Rn=v((e,t)=>Cn(e,"name",{value:t,configurable:!0}),"c$4");const Ln=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),zn=Rn((e,t,r)=>{const n=Object.getOwnPropertyNames(e).filter(o=>!Ln.has(o)),{name:i}=e;t.truncate-=i.length;let s="";typeof e.message=="string"?s=M(e.message,t.truncate):n.unshift("message"),s=s?`: ${s}`:"",t.truncate-=s.length+5;const a=N(n.map(o=>[o,e[o]]),e,t,r,Q);return`${i}${s}${a?` { ${a} }`:""}`},"inspectObject");var Vn=Object.defineProperty,Hn=v((e,t)=>Vn(e,"name",{value:t,configurable:!0}),"c$3");const Ge=Hn((e,t)=>{const r=e[Symbol.toStringTag]||"Function",n=e.toString();if(n.length<t.truncate-12)return t.stylize(`[${r}: ${n}]`,"special");const{name:i}=e;return i?t.stylize(`[${r} ${M(i,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")},"inspectFunction");var Dn=Object.defineProperty,Ot=v((e,t)=>Dn(e,"name",{value:t,configurable:!0}),"p$3");const Gn=Ot(([e,t],r,n,i)=>(n.truncate-=4,e=i(e,r,n),n.truncate-=e.length,`${e} => ${i(t,r,n)}`),"inspectMapEntry"),qn=Ot((e,t,r,n)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let i=N([...e.entries()],e,t,r,Gn,n?"\0\0":", ");return n&&(i=ge(i,n)),`Map (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectMap");var Yn=Object.defineProperty,Un=v((e,t)=>Yn(e,"name",{value:t,configurable:!0}),"e$3");function Z(e,t){return Number.isNaN(e)?t.stylize("NaN","number"):e===Number.POSITIVE_INFINITY?t.stylize("Infinity","number"):e===Number.NEGATIVE_INFINITY?t.stylize("-Infinity","number"):e===0?t.stylize(1/e===Number.POSITIVE_INFINITY?"+0":"-0","number"):t.stylize(M(t.numericSeparator?wt(e,e.toString()):e.toString(),t.truncate),"number")}$(Z,"j$2");mt(Z,"P");v(Z,"u$3");Un(Z,"inspectNumber");var Jn=Object.defineProperty,Kn=v((e,t)=>Jn(e,"name",{value:t,configurable:!0}),"e$2");const Qn=Kn(()=>"Promise{…}","getPromiseValue");var Zn=Object.defineProperty,Xn=v((e,t)=>Zn(e,"name",{value:t,configurable:!0}),"p$1");const ei=Xn((e,t)=>{const r=t.truncate-(2+e.flags.length);return t.stylize(`/${M(e.source,r)}/${e.flags}`,"regexp")},"inspectRegExp");var ti=Object.defineProperty,ri=v((e,t)=>ti(e,"name",{value:t,configurable:!0}),"i$1");const ni=ri((e,t,r,n)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let i=N([...e],e,t,r,void 0,n?"\0\0":", ");return n&&(i=ge(i,n)),`Set (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectSet");var ii=Object.defineProperty,si=v((e,t)=>ii(e,"name",{value:t,configurable:!0}),"l");const ai=si((e,t)=>{const r=t.quoteStyle==="double"?'"':"'";return t.quoteStyle==="double"&&(e=e.replaceAll('"','"')),r+e+r},"wrapQuotes");var oi=Object.defineProperty,xt=v((e,t)=>oi(e,"name",{value:t,configurable:!0}),"e$1");const qe=new RegExp(String.raw`['\0-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5`+String.raw`\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]`,"g"),li={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},ui=16,ci=xt(e=>li[e]||String.raw`\u${`0000${e.codePointAt(0).toString(ui)}`.slice(-4)}`,"escape"),Ye=xt((e,t)=>(qe.test(e)&&(e=e.replaceAll(qe,ci)),t.stylize(ai(M(e,t.truncate-2),t),"string")),"inspectString");var fi=Object.defineProperty,di=v((e,t)=>fi(e,"name",{value:t,configurable:!0}),"o");const Ue=di(e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),"inspectSymbol");var pi=Object.defineProperty,jt=v((e,t)=>pi(e,"name",{value:t,configurable:!0}),"f");const gi=jt(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],"getArrayName"),T=jt((e,t,r)=>{const n=gi(e);t.truncate-=n.length+4;const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return`${n}[]`;let s="";for(let o=0;o<e.length;o++){const l=`${t.stylize(M(e[o],t.truncate),"number")}${o===e.length-1?"":", "}`;if(t.truncate-=l.length,o!==e.length-1&&t.truncate<=3){s+=`…(${String(e.length-o)})`;break}s+=l}let a="";return i.length>0&&(a=N(i.map(o=>[o,e[o]]),e,t,r,Q)),`${n}[ ${s}${a?`, ${a}`:""} ]`},"inspectTypedArray");var hi=Object.defineProperty,S=v((e,t)=>hi(e,"name",{value:t,configurable:!0}),"r");const ce=new WeakMap,Pe={},mi={Arguments:fn,Array:yn,ArrayBuffer:S(()=>"","ArrayBuffer"),BigInt:De,bigint:De,Boolean:S((e,t)=>t.stylize(String(e),"boolean"),"Boolean"),boolean:S((e,t)=>t.stylize(String(e),"boolean"),"boolean"),DataView:S(()=>"","DataView"),Date:_n,Error:zn,Float32Array:T,Float64Array:T,Function:Ge,function:Ge,Generator:S(()=>"","Generator"),HTMLCollection:Ie,Int8Array:T,Int16Array:T,Int32Array:T,Map:qn,NodeList:Ie,null:S((e,t)=>t.stylize("null","null"),"null"),Number:Z,number:Z,Promise:Qn,RegExp:ei,Set:ni,String:Ye,string:Ye,Symbol:Ue,symbol:Ue,Uint8Array:T,Uint8ClampedArray:T,Uint16Array:T,Uint32Array:T,undefined:S((e,t)=>t.stylize("undefined","undefined"),"undefined"),WeakMap:S((e,t)=>t.stylize("WeakMap{…}","special"),"WeakMap"),WeakSet:S((e,t)=>t.stylize("WeakSet{…}","special"),"WeakSet")},Je=Symbol.for("nodejs.util.inspect.custom"),$i=S((e,t,r,n)=>{if(!("window"in globalThis)&&typeof e[Je]=="function")return e[Je](n,t);if("inspect"in e&&typeof e.inspect=="function")return e.inspect(n,t);if("constructor"in e&&ce.has(e.constructor))return ce.get(e.constructor)?.(e,t)??"unknown";const i=Pe[r];return i?i(e,t):""},"inspectCustom"),At=S((e,t,r,n)=>{if(n.includes(e))return"[Circular]";if(r>=t.depth&&t.depth>0&&typeof e=="object")return Array.isArray(e)?"[Array]":"[Object]";const i=S((u,c,f)=>(c&&(n=[...n,c]),At(u,f,r+1,n)),"inspect"),s=t.indent?pn(t.indent,r):void 0;let a=e===null?"null":typeof e;a==="object"&&(a=Object.prototype.toString.call(e).slice(8,-1));const o=mi[a];if(o!==void 0)return o(e,t,i,s);if(t.customInspect&&e){const u=$i(e,t,a,t.depth-r);if(u)return typeof u=="string"?u:i(u,e,t)}const l=e?Object.getPrototypeOf(e):!1;return l===Object.prototype||l===null?ae(e,t,i,s):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?$t(e,e,t,i):"constructor"in e?e.constructor!==Object?Bn(e,t,i,s):ae(e,t,i,s):e===Object(e)?ae(e,t,i,s):t.stylize(String(e),a)},"internalInspect"),Ke=S((e,t={})=>{const r={breakLength:Number.POSITIVE_INFINITY,customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,showProxy:!1,stylize:S(n=>n,"stylize"),truncate:Number.POSITIVE_INFINITY,...t};if(r.indent!==void 0&&r.indent!==" "&&!(Number.parseInt(r.indent,10)===r.indent&&r.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');return At(e,r,0,[])},"inspect");S((e,t)=>ce.has(e)?!1:(ce.set(e,t),!0),"registerConstructor");S((e,t)=>e in Pe?!1:(Pe[e]=t,!0),"registerStringTag");var bi=Object.defineProperty,Me=$((e,t)=>bi(e,"name",{value:t,configurable:!0}),"u$3"),vi=Object.defineProperty,he=Me((e,t)=>vi(e,"name",{value:t,configurable:!0}),"l");const yi=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],wi=12288,Si=65510,Oi=[12288,12288,65281,65376,65504,65510],xi=8361,ji=65518,Ai=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Ei=32,Ni=10630,Ii=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Pi=4352,ki=262141,Et=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var Ti=Object.defineProperty,Wi=he((e,t)=>Ti(e,"name",{value:t,configurable:!0}),"r$1");const ee=Wi((e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){const i=Math.floor((r+n)/2),s=i*2;if(t<e[s])n=i-1;else if(t>e[s+1])r=i+1;else return!0}return!1},"isInRange");var Bi=Object.defineProperty,V=he((e,t)=>Bi(e,"name",{value:t,configurable:!0}),"r");const Qe=19968,[Fi,Mi]=me(Et);function me(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){const i=e[n],s=e[n+1];if(Qe>=i&&Qe<=s)return[i,s];s-i>r-t&&(t=i,r=s)}return[t,r]}$(me,"c$2");Me(me,"f");he(me,"k");V(me,"findWideFastPathRange");const Nt=V(e=>e<161||e>1114109?!1:ee(yi,e),"isAmbiguous"),It=V(e=>e<wi||e>Si?!1:ee(Oi,e),"isFullWidth"),_i=V(e=>e<xi||e>ji?!1:ee(Ai,e),"isHalfWidth"),Ci=V(e=>e<Ei||e>Ni?!1:ee(Ii,e),"isNarrow"),Pt=V(e=>e>=Fi&&e<=Mi?!0:e<Pi||e>ki?!1:ee(Et,e),"isWide");function $e(e){return Nt(e)?"ambiguous":It(e)?"fullwidth":_i(e)?"halfwidth":Ci(e)?"narrow":Pt(e)?"wide":"neutral"}$($e,"g$5");Me($e,"S");he($e,"getCategory");V($e,"getCategory");var Ri=Object.defineProperty,be=$((e,t)=>Ri(e,"name",{value:t,configurable:!0}),"i$4"),Li=Object.defineProperty,ve=be((e,t)=>Li(e,"name",{value:t,configurable:!0}),"a"),zi=Object.defineProperty,_e=ve((e,t)=>zi(e,"name",{value:t,configurable:!0}),"e");function te(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}$(te,"s$3");be(te,"s");ve(te,"r");_e(te,"validate");function re(e){return te(e),$e(e)}$(re,"r$5");be(re,"p");ve(re,"eastAsianWidthType");_e(re,"eastAsianWidthType");function Ce(e,{ambiguousAsWide:t=!1}={}){return te(e),It(e)||Pt(e)||t&&Nt(e)?2:1}$(Ce,"o$6");be(Ce,"W");ve(Ce,"eastAsianWidth");_e(Ce,"eastAsianWidth");var Vi=Object.defineProperty,Hi=$((e,t)=>Vi(e,"name",{value:t,configurable:!0}),"p$3"),Di=Object.defineProperty,kt=Hi((e,t)=>Di(e,"name",{value:t,configurable:!0}),"e"),Gi=Object.defineProperty,qi=kt((e,t)=>Gi(e,"name",{value:t,configurable:!0}),"E");const Tt=String.raw,Ze=Tt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Yi=qi(()=>new RegExp(Tt`\p{RI}{2}|(?)${Ze}(?:\u200D${Ze})*`,"gu"),"default");var Ui=Object.defineProperty,Ji=kt((e,t)=>Ui(e,"name",{value:t,configurable:!0}),"p");const Y=new Set(["\x1B",""]),ye="\x07",Wt="[",Re="m",X="]8;;",Ki=39,Qi=/[\u200B\uFEFF\u2060-\u2064]/g,Zi=new RegExp(`(?:\\${Wt}(?<code>\\d+)m|\\${X}(?<uri>.*)${ye})`),Xi=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),U=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,ie=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,oe=Yi();Ji(e=>e.replace(oe,""),"stripEmoji");var es=Object.defineProperty,ts=$((e,t)=>es(e,"name",{value:t,configurable:!0}),"E"),rs=Object.defineProperty,ns=ts((e,t)=>rs(e,"name",{value:t,configurable:!0}),"A"),is=Object.defineProperty,we=ns((e,t)=>is(e,"name",{value:t,configurable:!0}),"d");const Xe=new Map,se=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,le=we(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),ss=we((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=Xe.get(r);if(i||(i=new Map,Xe.set(r,i)),i.has(n))return i.get(n);let s;if(le(e)==="latin")s=t.width.regular;else if(le(e)==="control")s=t.width.control;else if(le(e)==="wide")s=t.width.wide;else switch(re(e)){case"ambiguous":{s=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{s=t.width.fullWidth;break}case"wide":{s=t.width.wide;break}default:s=t.width.regular}return i.set(n,s),s},"getCachedCharWidth"),as=we(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),ke=we((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?ke(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},n=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=e,s=i>1e4;let a=0,o=0,l=i,u=!1;const c=e.includes("\x1B")||e.includes("");for(;a<i;){if(c&&(e[a]==="\x1B"||e[a]==="")){if(e.startsWith("\x1B]8;;",a)){const m="\x1B]8;;\x07",y=m.length,A=e.indexOf("\x07",a+5);if(A!==-1){const I=e.indexOf(m,A+1);if(I!==-1){const x=I+y,b=e.slice(A+1,I).replace(U,""),C=ke(b,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,n-o),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),k=C.width;if(C.truncated)u=!0,l=Math.min(l,a);else if(o+k>n&&(l=Math.min(l,a),u=!0,o+k>r.truncation.limit))break;if(o+=k,a=x,u&&o>=r.truncation.limit)break;continue}}}if(U.lastIndex=a,U.test(e)){const m=U.lastIndex-a,y=r.truncation.countAnsiEscapeCodes?m:r.width.ansi;if(o+y>n&&(l=Math.min(l,a),o+y>r.truncation.limit)){u=!0;break}o+=y,a=U.lastIndex;continue}}const p=e.codePointAt(a);if(p===8203||p===65279||p>=8288&&p<=8292){a+=1;continue}if(p===9){if(o+r.width.tab>n&&(l=Math.min(l,a),o+r.width.tab>r.truncation.limit)){u=!0;break}o+=r.width.tab,a+=1;continue}if(se.lastIndex=a,se.test(e)){const m=(se.lastIndex-a)*r.width.regular;if(o+m>n){const y=Math.floor((n-o)/r.width.regular);if(l=Math.min(l,a+y),o+m>r.truncation.limit){u=!0;break}}o+=m,a=se.lastIndex;continue}if((p<=31||p>=127&&p<=159)&&(ie.lastIndex=a,ie.test(e))){const m=(ie.lastIndex-a)*r.width.control;if(o+m>n&&(l=Math.min(l,a+Math.floor((n-o)/r.width.control)),o+m>r.truncation.limit)){u=!0;break}o+=m,a=ie.lastIndex;continue}if(oe.lastIndex=a,oe.test(e)){if(o+r.width.emoji>n&&(l=Math.min(l,a),o+r.width.emoji>r.truncation.limit)){u=!0;break}o+=r.width.emoji,a=oe.lastIndex;continue}const d=e.codePointAt(a)??0;if(as(d)){a+=d>65535?2:1;continue}let h;if(s)h=ss(d,r);else switch(le(d)){case"control":{h=r.width.control;break}case"latin":{h=r.width.regular;break}case"wide":{h=r.width.wide;break}case"zero":{h=0;break}default:switch(re(d)){case"ambiguous":{h=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{h=r.width.fullWidth;break}case"wide":{h=r.width.wide;break}default:h=r.width.regular}}if(o+h>n&&(l=Math.min(l,a),o+h>r.truncation.limit)){u=!0;break}o+=h,a+=d>65535?2:1}let f=o,g=!1;return u&&r.truncation.limit>=r.truncation.ellipsisWidth&&(f=r.truncation.limit,g=!0),{ellipsed:g,index:u?l:i,truncated:u,width:f}},"getStringTruncatedWidth");var os=Object.defineProperty,ls=$((e,t)=>os(e,"name",{value:t,configurable:!0}),"i$2"),us=Object.defineProperty,cs=ls((e,t)=>us(e,"name",{value:t,configurable:!0}),"e"),fs=Object.defineProperty,ds=cs((e,t)=>fs(e,"name",{value:t,configurable:!0}),"r");const j=ds((e,t={})=>ke(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var ps=Object.defineProperty,Bt=$((e,t)=>ps(e,"name",{value:t,configurable:!0}),"k"),gs=Object.defineProperty,H=Bt((e,t)=>gs(e,"name",{value:t,configurable:!0}),"d"),hs=Object.defineProperty,ms=H((e,t)=>hs(e,"name",{value:t,configurable:!0}),"a");const $s=/\x1B\[(\d+)m/;let Ft=class{static{$(this,"T")}static{Bt(this,"T")}static{H(this,"d")}static{ms(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(e){const t=$s.exec(e);if(!t)return;const r=Number.parseInt(t[1],10);switch(r){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(r>=30&&r<=37||r>=90&&r<=97)this.activeForeground=e;else if(r>=40&&r<=47||r>=100&&r<=107)this.activeBackground=e;else if([1,2,3,4,7,8,9].includes(r))this.activeFormatting.push(e);else if([22,23,24,27,28,29].includes(r)){const n={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[r];n&&(this.activeFormatting=this.activeFormatting.filter(i=>!i.includes(n)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const e=[];if(this.activeFormatting.length>0){const t={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(r=>{const n=t[r];n&&e.push(n)})}return this.activeForeground&&e.push("\x1B[39m"),this.activeBackground&&e.push("\x1B[49m"),e.join("")}};var bs=Object.defineProperty,Mt=H((e,t)=>bs(e,"name",{value:t,configurable:!0}),"o");const vs=Mt((e,t)=>{if(!Y.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+X.length).join("")===X;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),ys=Mt((e,t={})=>{const r=new Ft;let n="",i=!1,s="",a="",o=!1;const l=[...e];for(let u=0;u<l.length;u++){const c=l[u];if(c&&Y.has(c)){if(n){const h=t.getWidth?.(n)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:n,width:h};if(o&&(m.isHyperlink=!0,m.hyperlinkUrl=a),t.onSegment?.(m,r)===!1)return;n=""}i=!0,s=c;const p=vs(l,u),{isInsideLinkEscape:d}=p;if(d){let h=u+1;for(a="";h<l.length;){const y=l[h];if(y===ye)break;a+=y,h+=1}a=a.slice(4);const m={hyperlinkUrl:a,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(m,r)===!1)return;u=h,o=!0,i=!1,s="";continue}if(u+1<l.length&&l[u+1]==="\\"&&o){const h={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(h,r)===!1)return;o=!1,a="",u+=1,i=!1,s="";continue}}if(i){if(s!==c&&(s+=c),c===Re){i=!1,r.processEscape(s);const p={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};if(t.onSegment?.(p,r)===!1)return;s=""}continue}n+=c;const f=t.getWidth?.(n)??0,g={isEscapeSequence:!1,isGrapheme:!0,text:n,width:f};if(o&&(g.isHyperlink=!0,g.hyperlinkUrl=a),t.onSegment?.(g,r)===!1)return;n=""}if(n){const u=t.getWidth?.(n)??0,c={isEscapeSequence:!1,isGrapheme:!0,text:n,width:u};o&&(c.isHyperlink=!0,c.hyperlinkUrl=a),t.onSegment?.(c,r)}if(s){const u={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};t.onSegment?.(u,r)}},"processAnsiString");var ws=Object.defineProperty,Ss=H((e,t)=>ws(e,"name",{value:t,configurable:!0}),"t$1");const et=Ss(e=>`${Y.values().next().value}${Wt}${String(e)}${Re}`,"wrapAnsiCode");var Os=Object.defineProperty,xs=H((e,t)=>Os(e,"name",{value:t,configurable:!0}),"s");const tt=xs(e=>`${Y.values().next().value}${X}${e}${ye}`,"wrapAnsiHyperlink");var js=Object.defineProperty,As=H((e,t)=>js(e,"name",{value:t,configurable:!0}),"l");const Es=As(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const i=e.join(`
|
|
27
|
-
`),s=[...i];let a=0;for(const[o,l]of s.entries()){if(t+=l,Y.has(l)){const c=Zi.exec(i.slice(a))?.groups??{};if(c.code!==void 0){const f=Number.parseFloat(c.code);r=f===Ki?void 0:f}else c.uri!==void 0&&(n=c.uri.length===0?void 0:c.uri)}const u=Xi.get(Number(r));s[o+1]===`
|
|
28
|
-
`?(n&&(t+=tt("")),r&&u&&(t+=et(u))):l===`
|
|
29
|
-
`&&(r&&u&&(t+=et(r)),n&&(t+=tt(n))),a+=l.length}return t},"preserveAnsi");var Ns=Object.defineProperty,F=H((e,t)=>Ns(e,"name",{value:t,configurable:!0}),"h");const _t=/(?=\s)|(?<=\s)/,Ct=/^\s+$/,xe=F(e=>{if(!e.includes("\x1B"))return e;let t=e;return e.includes("\x1B[30m")&&(t+="\x1B[39m"),e.includes("\x1B[42m")&&(t+="\x1B[49m"),t},"resetAnsiAtLineBreak"),R=F(e=>{const t=e.split(" ");let r=t.length;for(;r>0&&j(t[r-1])===0;)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},"stringVisibleTrimSpacesRight"),Rt=F((e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],i=new Ft;let s="",a=0,o=!1,l=!1,u="",c=0;for(;c<e.length;){const f=e[c];if(Y.has(f)){o=!0,u=f,s+=f,l=e.startsWith(X,c+1),c+=1;continue}if(o){u+=f,s+=f,l?f===ye&&(o=l=!1):f===Re&&(o=!1,i.processEscape(u)),c+=1;continue}const g=j(f),p=f===" ";if(g===0){s+=f,c+=1;continue}if(a+g>t&&(s&&n.push(s+i.getEndEscapesForAllActiveAttributes()),s=i.getStartEscapesForAllActiveAttributes(),a=j(s),p&&r)){for(;c<e.length&&e[c]===" ";)c+=1;continue}if(s+=f,a+=g,a===t&&c<e.length-1&&(n.push(s+i.getEndEscapesForAllActiveAttributes()),s=i.getStartEscapesForAllActiveAttributes(),a=j(s),c+1<e.length&&e[c+1]===" "&&r)){for(c+=1;c<e.length&&e[c]===" ";)c+=1;continue}c+=1}return s&&n.push(s+i.getEndEscapesForAllActiveAttributes()),r?n.map(f=>R(f)):n},"wrapWithBreakAtWidth"),Is=F((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=[];let s="",a=0;return ys(n,{getWidth:j,onSegment:F((o,l)=>{const u=o.text??"";if(o.isEscapeSequence)s+=u;else{const c=u===" ";if(o.width===0)return s+=u,!0;if(a+o.width>t&&(s&&i.push(s),s=l.getStartEscapesForAllActiveAttributes(),a=0,c))return r||i.push(l.getStartEscapesForAllActiveAttributes()+u),!0;s+=u,a+=o.width}return!0},"onSegment")}),s&&i.push(s),r?i.map(o=>R(o)):i},"wrapCharByChar"),Ps=F((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(_t),s=[];let a="",o=0,l=0;for(;l<i.length;){const u=i[l],c=Ct.test(u),f=j(u);if(u.length===0){l+=1;continue}if(r&&c&&o===0){l+=1;continue}if(o+f>t&&o>0){r?s.push(R(a)):s.push(a),a="",o=0;continue}a+=u,o+=f,l+=1}return a&&(r?s.push(R(a)):s.push(a)),s},"wrapWithWordBoundaries"),ks=F((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(_t),s=[];let a="",o=0,l=0;for(;l<i.length;){const u=i[l],c=Ct.test(u),f=j(u);if(u.length===0){l+=1;continue}if(r&&c&&o===0){l+=1;continue}if(f>t){a&&s.push(xe(r?R(a):a));const g=Rt(u,t,r);if(g.length>0){for(let p=0;p<g.length-1;p+=1)s.push(g[p]);a=g.at(-1),o=j(a)}else a="",o=0;l+=1;continue}if(o+f>t&&o>0&&(s.push(xe(r?R(a):a)),a="",o=0,r&&c)){l+=1;continue}a+=u,o+=f,l+=1}return a&&s.push(xe(r?R(a):a)),s},"wrapAndBreakWords"),K={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},Ts=F((e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:i=80,wrapMode:s=K.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let a=e.normalize("NFC").replaceAll(`\r
|
|
30
|
-
`,`
|
|
31
|
-
`);return r&&(a=a.replaceAll(Qi,"")),a.split(`
|
|
32
|
-
`).map(o=>{if(n&&o.trim()==="")return"";let l;switch(s){case K.BREAK_AT_CHARACTERS:{l=Is(o,i,n);break}case K.BREAK_WORDS:{l=ks(o,i,n);break}case K.STRICT_WIDTH:{l=Rt(o,i,n);break}default:l=Ps(o,i,n)}return Es(l)}).join(`
|
|
33
|
-
`)},"wordWrap");var Ws=Object.defineProperty,_=$((e,t)=>Ws(e,"name",{value:t,configurable:!0}),"n$2");const Lt=80,zt=24,Te=_((e,t,{shell:r,env:n}={})=>Zt(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),ue=_((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),Vt=_((e,t)=>{const{columns:r,rows:n}=ue(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===Lt&&n===zt))return{columns:r,rows:n}},"createIfNotDefault"),Bs=_(()=>{if(B.platform!=="linux")return!0;try{const e=J.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const r=e.slice(t+2).trim().split(/\s+/),n=Number.parseInt(r[2],10),i=Number.parseInt(r[5],10);return Number.isNaN(n)||Number.isNaN(i)||i<=0?!1:n===i}catch{return!1}},"isForegroundProcess");function Ht(){const{env:e,stdout:t,stderr:r}=B;if(t?.columns&&t?.rows)return ue(t.columns,t.rows);if(r?.columns&&r?.rows)return ue(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return ue(e.COLUMNS,e.LINES);const n={columns:Lt,rows:zt};return B.platform==="win32"?je()??n:B.platform==="darwin"?rt()??je()??n:rt()??je()??Fs()??n}$(Ht,"O$1");_(Ht,"terminalSize");const rt=_(()=>{try{const e=B.platform==="darwin"?J.constants.O_EVTONLY|J.constants.O_NONBLOCK:J.constants.O_NONBLOCK,{columns:t,rows:r}=Xt.WriteStream(J.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),je=_(()=>{try{const e=Te("tput",["cols"],{env:{TERM:"dumb",...B.env}}),t=Te("tput",["lines"],{env:{TERM:"dumb",...B.env}});if(e&&t)return Vt(e,t)}catch{}},"tput"),Fs=_(()=>{try{if(!Bs())return;const e=Te("resize",["-u"]).match(/\d+/g);if(e.length===2)return Vt(e[0],e[1])}catch{}},"resize");var Ms=Object.defineProperty,_s=$((e,t)=>Ms(e,"name",{value:t,configurable:!0}),"r$2");const Cs=_s(e=>{const t=Object.keys(e).map(r=>e[r].badge??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},"getLongestBadge");var Rs=Object.defineProperty,Ls=$((e,t)=>Rs(e,"name",{value:t,configurable:!0}),"g$1");const zs=Ls(e=>{const t=Object.keys(e).map(r=>e[r].label??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},"getLongestLabel");var Vs=Object.defineProperty,Hs=$((e,t)=>Vs(e,"name",{value:t,configurable:!0}),"r$1");const{bold:Ds,cyan:Gs,green:nt,grey:qs,magenta:Ys,red:Us,yellow:Ae}=de,Js={indent:2,quoteStyle:"single",stylize:Hs((e,t)=>{const r={bigint:Ae,boolean:Ae,date:Ys,null:Ds,number:Ae,regexp:Us,special:Gs,string:nt,symbol:nt,undefined:qs};return Object.hasOwn(r,t)?r[t](e):e},"stylize")};var Ks=Object.defineProperty,Qs=$((e,t)=>Ks(e,"name",{value:t,configurable:!0}),"o$1");const{bold:Zs,underline:Xs}=de,ea=Qs((e,t)=>{let r=t.uppercase.label?e.toUpperCase():e;return r=t.underline.label?Xs(r):r,t.bold.label&&(r=Zs(r)),r},"formatLabel");var ta=Object.defineProperty,Dt=$((e,t)=>ta(e,"name",{value:t,configurable:!0}),"o");const ra=Dt(e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":"),"dateFormatter");class na{static{$(this,"AbstractPrettyReporter")}static{Dt(this,"AbstractPrettyReporter")}styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:ra,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=er}setLoggerTypes(t){this.loggerTypes=t}}var ia=Object.defineProperty,Gt=$((e,t)=>ia(e,"name",{value:t,configurable:!0}),"M");const{bgGrey:sa,cyan:aa,green:oa,greenBright:la,grey:E,red:Ee,underline:it,white:ua}=de,ca=/[\\/]pail[\\/]dist/,Ne=Gt(e=>!ca.test(e),"pailFileFilter");class ma extends na{static{$(this,"PrettyReporter")}static{Gt(this,"PrettyReporter")}#t;#r;#n;#s=!1;#i;#e;constructor(t={}){const{error:r,inspect:n,...i}=t;super({uppercase:{label:!0,...i.uppercase},...i}),this.#i={...Js,...n},this.#e={...r,color:{fileLine:oa,hint:aa,marker:Ee,message:Ee,method:la,title:Ee}},this.#t=Jt,this.#r=Kt}setStdout(t){this.#t=t}setStderr(t){this.#r=t}setInteractiveManager(t){this.#n=t}setIsInteractive(t){this.#s=t}log(t){this._log(this._formatMessage(t),t.type.level)}_formatMessage(t){const{columns:r}=Ht();let n=r;typeof this.styles.messageLength=="number"&&(n=this.styles.messageLength);const{badge:i,context:s,date:a,error:o,file:l,groups:u,label:c,message:f,prefix:g,repeated:p,scope:d,suffix:h,traceError:m,type:y}=t,{color:A}=this.loggerTypes[y.name],I=A?de[A]:ua,x=u.map(()=>" ").join(""),b=[];if(u.length>0&&b.push(`${x+E(`[${u.at(-1)??""}]`)} `),a&&b.push(`${E(this.styles.dateFormatter(typeof a=="string"?new Date(a):a))} `),i)b.push(I(i));else{const O=Cs(this.loggerTypes);O.length>0&&b.push(`${E(".".repeat(O.length))} `)}const C=zs(this.loggerTypes);if(c){const O=j(C),P=j(c);b.push(`${I(ea(c,this.styles))} `,E(".".repeat(Math.max(0,O-P))))}else b.push(E(".".repeat(C.length+2)));p&&b.push(`${sa.white(`[${String(p)}x]`)} `),Array.isArray(d)&&d.length>0&&b.push(` ${E(`[${d.join(" > ")}]`)} `),g&&b.push(`${E(`${Array.isArray(d)&&d.length>0?". ":" "}[${this.styles.underline.prefix?it(g):g}]`)} `);const k=j(b.join(" "));if(l){const O=(l.name??"")+(l.line?`:${String(l.line)}`:""),P=j(O);if(P+k+2>n)b.push(E(` ${O}`));else{const Se=Math.max(0,n-k-P-2);b.push(E(`${".".repeat(Se)} ${O}`))}}else b.push(E(".".repeat(Math.max(0,n-k-1))));if(b.length>0&&b.push(`
|
|
34
|
-
|
|
35
|
-
`),f!==tr){const O=typeof f=="string"?f:Ke(f,this.#i);b.push(x+Ts(O,{trim:!1,width:n-3,wrapMode:K.STRICT_WIDTH}))}if(s){let O=!1;b.push(...s.map(P=>{if(P instanceof Error)return O=!0,`
|
|
36
|
-
|
|
37
|
-
${Oe(P,{...this.#e,filterStacktrace:Ne,prefix:x})}`;if(typeof P=="object")return` ${Ke(P,this.#i)}`;const Se=(O?`
|
|
38
|
-
|
|
39
|
-
`:" ")+String(P);return O=!1,Se}))}return o&&b.push(Oe(o,{...this.#e,filterStacktrace:Ne,prefix:x})),m&&b.push(`
|
|
40
|
-
|
|
41
|
-
${Oe(m,{...this.#e,filterStacktrace:Ne,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:x})}`),h&&b.push(`
|
|
42
|
-
`,x+E(this.styles.underline.suffix?it(h):h)),b.join("")}_log(t,r){const n=["error","trace","warn"].includes(r)?"stderr":"stdout",i=n==="stderr"?this.#r:this.#t;this.#s&&this.#n!==void 0&&i.isTTY?this.#n.update(n,t.split(`
|
|
43
|
-
`),0):rr(`${t}
|
|
44
|
-
`,i)}}export{ma as PrettyReporter};
|