@visulima/pail 5.0.1 → 6.0.1

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 CHANGED
@@ -1,3 +1,129 @@
1
+ ## @visulima/pail [6.0.1](https://github.com/visulima/visulima/compare/@visulima/pail@6.0.0...@visulima/pail@6.0.1) (2026-11-11)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **deps:** hold safe-stable-stringify at 2.x ([d97ba6f](https://github.com/visulima/visulima/commit/d97ba6f039396ca584736e2c18a446156f67ca3d))
6
+ * **pail:** pass bench options as second argument ([fe84756](https://github.com/visulima/visulima/commit/fe8475672855793e0a997158b93958b1d775cebf))
7
+ * **pail:** type stringify as configure() result ([8764c53](https://github.com/visulima/visulima/commit/8764c5362d538839b8729d547b1865427902f514))
8
+
9
+ ### Tests
10
+
11
+ * **bench:** use vitest 5 test-context bench ([424a875](https://github.com/visulima/visulima/commit/424a87567a935ae96d1b7d5c8af9f16e2b854fdc))
12
+
13
+
14
+ ### Dependencies
15
+
16
+ * **@visulima/error:** upgraded to 6.1.1
17
+ * **@visulima/string:** upgraded to 3.1.3
18
+
19
+ ## @visulima/pail [6.0.0](https://github.com/visulima/visulima/compare/@visulima/pail@5.0.1...@visulima/pail@6.0.0) (2026-10-15)
20
+
21
+ ### ⚠ BREAKING CHANGES
22
+
23
+ * Deno is no longer a supported runtime or package manager.
24
+ vis targets node/bun runtimes and aube/npm/pnpm/yarn package managers; the
25
+ deno-lint/deno-fmt adapters and deno inference targets are removed.
26
+
27
+ * fix: resolve eslint errors after deno removal
28
+
29
+ - vis: use a block body for applyIgnoreScripts (arrow-body-style)
30
+ - is-ansi-color-supported: drop stale eslint-disable directives and
31
+ replace the raw-release if/else with a ternary (unicorn/prefer-ternary)
32
+
33
+ * docs(cron-parser): remove remaining deno runtime mentions
34
+
35
+ These doc/config files arrived with main's dialect-gating commit after this
36
+ branch's base, so they still listed Deno as a supported runtime.
37
+
38
+ * feat!: remove deno runtime and tooling support
39
+
40
+ Deno is being wound down: Cloudflare is acquiring the Deno team, the runtime
41
+ gets one more year of monthly maintenance before development ends, and Deno
42
+ Deploy shuts down. Drop Deno as a supported runtime, package manager, and
43
+ lint/fmt/inference target across the monorepo.
44
+
45
+ - vis: remove the deno runtime path, deno-lint/deno-fmt adapters, the
46
+ deno.json inference detector, Deno PM handling (TypeScript + Rust native
47
+ resolver), and the devcontainer deno mount; regenerate the JSON schemas.
48
+ - libraries: drop Deno runtime detection from cerebro, ono,
49
+ is-ansi-color-supported, and task-runner command parsing; remove Deno
50
+ wording from package docs and READMEs.
51
+ - delete the examples/deno directories (ono, pail, storage) and Deno docs.
52
+ - keep JSR publishing (registry usable from Node), license/attribution
53
+ comments, the secret-scanner Deno-token rule, and the historical RFCs.
54
+ * Deno is no longer a supported runtime or package manager.
55
+ vis targets node/bun runtimes and aube/npm/pnpm/yarn package managers; the
56
+ deno-lint/deno-fmt adapters and deno inference targets are removed.
57
+
58
+ * fix: resolve eslint errors after deno removal
59
+
60
+ - vis: use a block body for applyIgnoreScripts (arrow-body-style)
61
+ - is-ansi-color-supported: drop stale eslint-disable directives and
62
+ replace the raw-release if/else with a ternary (unicorn/prefer-ternary)
63
+
64
+ * chore(vis): tidy deno-removal leftovers from review
65
+
66
+ * fix(vis): drop unused logger from x handler, restore bun typing
67
+
68
+ Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
69
+
70
+ * docs: add migration notes for removed deno exports
71
+
72
+ Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
73
+
74
+ * feat(vis): warn on stale adapter ids and deno-only projects
75
+
76
+ Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
77
+
78
+ * refactor(vis): derive runtime ids and reuse bun detection
79
+
80
+ Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
81
+
82
+ * refactor(vis): drop jsr deno option and deno auth reference
83
+
84
+ Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
85
+
86
+ * fix(vis): restore runtime id schema description
87
+
88
+ Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
89
+
90
+ * refactor(vis): remove jsr publishing support
91
+
92
+ Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
93
+
94
+ * feat(bytes): port @std/bytes helpers back in
95
+
96
+ Carries the Uint8Array helpers from @std/bytes@1.0.6 (MIT, Copyright the Deno authors)
97
+ into src/std-bytes.ts and re-exports them from the package entry. Keeps the public API that
98
+ the Deno-removal commit dropped, without the jsr: devDependency. Docs and AGENTS notes are
99
+ restored to describe the ported functions.
100
+
101
+ Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
102
+
103
+ * docs(bytes): attribute ported @std/bytes source
104
+
105
+ The license file still listed @jsr/std__bytes as a bundled dependency.
106
+ Replace it with the MIT notice for the ported src/std-bytes.ts, placed outside
107
+ the generated dependency blocks.
108
+
109
+ Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
110
+
111
+ * fix(cron-parser): keep reviewed docs and 1.1.0 version
112
+
113
+ The rebase onto the remote branch dropped the reviewed dialect sentence in the README and
114
+ the installation table row, and the release commit's 1.1.0 version bump.
115
+
116
+ ### Features
117
+
118
+ * remove deno runtime and tooling support ([#973](https://github.com/visulima/visulima/issues/973)) ([26fada1](https://github.com/visulima/visulima/commit/26fada1ac04731cba9db8f74fe20849c0a15db74))
119
+
120
+
121
+ ### Dependencies
122
+
123
+ * **@visulima/colorize:** upgraded to 3.0.0
124
+ * **@visulima/ansi:** upgraded to 5.0.0
125
+ * **@visulima/fmt:** upgraded to 4.0.0
126
+
1
127
  ## @visulima/pail [5.0.1](https://github.com/visulima/visulima/compare/@visulima/pail@5.0.0...@visulima/pail@5.0.1) (2026-10-13)
2
128
 
3
129
  ### Miscellaneous Chores
package/README.md CHANGED
@@ -186,7 +186,7 @@ The `.` entry point picks a build from the export conditions your runtime or bun
186
186
 
187
187
  | Runtime | Condition matched | Build | Default reporter |
188
188
  | ------------------------------------------- | ------------------------ | ----------------------- | ---------------------- |
189
- | Node.js, Bun, Deno (Node compat) | `import` | `dist/index.server.js` | Pretty (stdout/stderr) |
189
+ | Node.js, Bun (Node compat) | `import` | `dist/index.server.js` | Pretty (stdout/stderr) |
190
190
  | Browsers and bundlers targeting the browser | `browser` | `dist/index.browser.js` | JSON (console) |
191
191
  | Cloudflare Workers, Vercel Edge | `workerd` / `edge-light` | `dist/index.browser.js` | JSON (console) |
192
192
 
@@ -1,4 +1,4 @@
1
- import{createRequire as _t}from"node:module";import{InteractiveManager as Ne,InteractiveStreamHook as ye}from"@visulima/interactive-manager";import{L as Pe,g as fe,E as _e,a as ue,Y as re,i as Ee,w as ve,A as Ce,d as De,b as Ie,t as Fe,c as ee,f as Ve,Z as qe,z as ie,v as ze}from"./packem_shared/abstract-pretty-reporter-CZoTcUjq.js";import Ae from"@visulima/colorize";import{PailError as Jt,createPailError as Gt}from"./packem_shared/PailError-BgUh0gyX.js";const Re=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:he,stderr:de,env:K}=Re,Je="\x1B",J="\x1B[",Ge=";",Oe=typeof globalThis<"u"&&typeof globalThis.window=="object"&&globalThis.window.document!==void 0,We=/^(?:msys|cygwin)$/,ke=process,ce=ke?.env??{};!Oe&&ce.TERM_PROGRAM;const Ye=!Oe&&(ke?.platform==="win32"||ce.OSTYPE!==void 0&&We.test(ce.OSTYPE)),He=(r,e)=>`${J}${String(e+1)}${Ge}${String(r+1)}H`;var Ke=(r=>(r[r.Default=0]="Default",r[r.BlinkingBlock=1]="BlinkingBlock",r[r.SteadyBlock=2]="SteadyBlock",r[r.BlinkingUnderline=3]="BlinkingUnderline",r[r.SteadyUnderline=4]="SteadyUnderline",r[r.BlinkingBar=5]="BlinkingBar",r[r.SteadyBar=6]="SteadyBar",r))(Ke||{}),W=(r=>(r[r.ToEnd=0]="ToEnd",r[r.ToBeginning=1]="ToBeginning",r[r.EntireScreen=2]="EntireScreen",r[r.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",r))(W||{});const U=r=>{const e=r>=0&&r<=3?r:0;return`${J}${e===0?"":String(e)}J`};var Be=(r=>(r[r.ToEnd=0]="ToEnd",r[r.ToBeginning=1]="ToBeginning",r[r.EntireLine=2]="EntireLine",r))(Be||{});const Ue=r=>{const e=r>=0&&r<=2?r:0;return`${J}${e===0?"":String(e)}K`};He(0,0)+U(W.ToEnd);`${Ue(Be.EntireLine)}${J}`;`${J}${U(W.EntireScreen)}`;const be=Ye?`${U(W.EntireScreen)}${J}0f`:`${U(W.EntireScreen)}${U(W.EntireScreenAndScrollback)}${J}H${Je}c`;var te={exports:{}},Se;function Qe(){return Se||(Se=1,(function(r,e){const{hasOwnProperty:t}=Object.prototype,s=C();s.configure=C,s.stringify=s,s.default=s,e.stringify=s,e.configure=C,r.exports=s;const n=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function l(c){return c.length<5e3&&!n.test(c)?`"${c}"`:JSON.stringify(c)}function a(c,g){if(c.length>200||g)return c.sort(g);for(let h=1;h<c.length;h++){const N=c[h];let B=h;for(;B!==0&&c[B-1]>N;)c[B]=c[B-1],B--;c[B]=N}return c}const o=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function d(c){return o.call(c)!==void 0&&c.length!==0}function m(c,g,h){c.length<h&&(h=c.length);const N=g===","?"":" ";let B=`"0":${N}${c[0]}`;for(let A=1;A<h;A++)B+=`${g}"${A}":${N}${c[A]}`;return B}function b(c){if(t.call(c,"circularValue")){const g=c.circularValue;if(typeof g=="string")return`"${g}"`;if(g==null)return g;if(g===Error||g===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function f(c){let g;if(t.call(c,"deterministic")&&(g=c.deterministic,typeof g!="boolean"&&typeof g!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return g===void 0?!0:g}function $(c,g){let h;if(t.call(c,g)&&(h=c[g],typeof h!="boolean"))throw new TypeError(`The "${g}" argument must be of type boolean`);return h===void 0?!0:h}function u(c,g){let h;if(t.call(c,g)){if(h=c[g],typeof h!="number")throw new TypeError(`The "${g}" argument must be of type number`);if(!Number.isInteger(h))throw new TypeError(`The "${g}" argument must be an integer`);if(h<1)throw new RangeError(`The "${g}" argument must be >= 1`)}return h===void 0?1/0:h}function L(c){return c===1?"1 item":`${c} items`}function I(c){const g=new Set;for(const h of c)(typeof h=="string"||typeof h=="number")&&g.add(String(h));return g}function G(c){if(t.call(c,"strict")){const g=c.strict;if(typeof g!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(g)return h=>{let N=`Object can not safely be stringified. Received type ${typeof h}`;throw typeof h!="function"&&(N+=` (${h.toString()})`),new Error(N)}}}function C(c){c={...c};const g=G(c);g&&(c.bigint===void 0&&(c.bigint=!1),"circularValue"in c||(c.circularValue=Error));const h=b(c),N=$(c,"bigint"),B=f(c),A=typeof B=="function"?B:void 0,R=u(c,"maximumDepth"),E=u(c,"maximumBreadth");function Q(P,i,p,x,S,T){let y=i[P];switch(typeof y=="object"&&y!==null&&typeof y.toJSON=="function"&&(y=y.toJSON(P)),y=x.call(i,P,y),typeof y){case"string":return l(y);case"object":{if(y===null)return"null";if(p.indexOf(y)!==-1)return h;let w="",O=",";const k=T;if(Array.isArray(y)){if(y.length===0)return"[]";if(R<p.length+1)return'"[Array]"';p.push(y),S!==""&&(T+=S,w+=`
1
+ import{createRequire as _t}from"node:module";import{InteractiveManager as Ne,InteractiveStreamHook as ye}from"@visulima/interactive-manager";import{L as Pe,g as fe,E as _e,a as ue,Y as re,i as Ee,w as ve,A as Ce,d as De,b as Ie,t as Fe,c as ee,f as Ve,X as qe,z as ie,R as ze}from"./packem_shared/abstract-pretty-reporter-BJn6mWP0.js";import Ae from"@visulima/colorize";import{PailError as Jt,createPailError as Gt}from"./packem_shared/PailError-BgUh0gyX.js";const Re=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:he,stderr:de,env:K}=Re,Je="\x1B",J="\x1B[",Ge=";",Oe=typeof globalThis<"u"&&typeof globalThis.window=="object"&&globalThis.window.document!==void 0,We=/^(?:msys|cygwin)$/,ke=process,ce=ke?.env??{};!Oe&&ce.TERM_PROGRAM;const Ye=!Oe&&(ke?.platform==="win32"||ce.OSTYPE!==void 0&&We.test(ce.OSTYPE)),He=(r,e)=>`${J}${String(e+1)}${Ge}${String(r+1)}H`;var Ke=(r=>(r[r.Default=0]="Default",r[r.BlinkingBlock=1]="BlinkingBlock",r[r.SteadyBlock=2]="SteadyBlock",r[r.BlinkingUnderline=3]="BlinkingUnderline",r[r.SteadyUnderline=4]="SteadyUnderline",r[r.BlinkingBar=5]="BlinkingBar",r[r.SteadyBar=6]="SteadyBar",r))(Ke||{}),W=(r=>(r[r.ToEnd=0]="ToEnd",r[r.ToBeginning=1]="ToBeginning",r[r.EntireScreen=2]="EntireScreen",r[r.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",r))(W||{});const U=r=>{const e=r>=0&&r<=3?r:0;return`${J}${e===0?"":String(e)}J`};var Be=(r=>(r[r.ToEnd=0]="ToEnd",r[r.ToBeginning=1]="ToBeginning",r[r.EntireLine=2]="EntireLine",r))(Be||{});const Ue=r=>{const e=r>=0&&r<=2?r:0;return`${J}${e===0?"":String(e)}K`};He(0,0)+U(W.ToEnd);`${Ue(Be.EntireLine)}${J}`;`${J}${U(W.EntireScreen)}`;const be=Ye?`${U(W.EntireScreen)}${J}0f`:`${U(W.EntireScreen)}${U(W.EntireScreenAndScrollback)}${J}H${Je}c`;var te={exports:{}},Se;function Qe(){return Se||(Se=1,(function(r,e){const{hasOwnProperty:t}=Object.prototype,s=C();s.configure=C,s.stringify=s,s.default=s,e.stringify=s,e.configure=C,r.exports=s;const n=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function l(c){return c.length<5e3&&!n.test(c)?`"${c}"`:JSON.stringify(c)}function a(c,g){if(c.length>200||g)return c.sort(g);for(let h=1;h<c.length;h++){const N=c[h];let B=h;for(;B!==0&&c[B-1]>N;)c[B]=c[B-1],B--;c[B]=N}return c}const o=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function d(c){return o.call(c)!==void 0&&c.length!==0}function m(c,g,h){c.length<h&&(h=c.length);const N=g===","?"":" ";let B=`"0":${N}${c[0]}`;for(let A=1;A<h;A++)B+=`${g}"${A}":${N}${c[A]}`;return B}function b(c){if(t.call(c,"circularValue")){const g=c.circularValue;if(typeof g=="string")return`"${g}"`;if(g==null)return g;if(g===Error||g===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function f(c){let g;if(t.call(c,"deterministic")&&(g=c.deterministic,typeof g!="boolean"&&typeof g!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return g===void 0?!0:g}function $(c,g){let h;if(t.call(c,g)&&(h=c[g],typeof h!="boolean"))throw new TypeError(`The "${g}" argument must be of type boolean`);return h===void 0?!0:h}function u(c,g){let h;if(t.call(c,g)){if(h=c[g],typeof h!="number")throw new TypeError(`The "${g}" argument must be of type number`);if(!Number.isInteger(h))throw new TypeError(`The "${g}" argument must be an integer`);if(h<1)throw new RangeError(`The "${g}" argument must be >= 1`)}return h===void 0?1/0:h}function L(c){return c===1?"1 item":`${c} items`}function I(c){const g=new Set;for(const h of c)(typeof h=="string"||typeof h=="number")&&g.add(String(h));return g}function G(c){if(t.call(c,"strict")){const g=c.strict;if(typeof g!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(g)return h=>{let N=`Object can not safely be stringified. Received type ${typeof h}`;throw typeof h!="function"&&(N+=` (${h.toString()})`),new Error(N)}}}function C(c){c={...c};const g=G(c);g&&(c.bigint===void 0&&(c.bigint=!1),"circularValue"in c||(c.circularValue=Error));const h=b(c),N=$(c,"bigint"),B=f(c),A=typeof B=="function"?B:void 0,R=u(c,"maximumDepth"),E=u(c,"maximumBreadth");function Q(P,i,p,x,S,T){let y=i[P];switch(typeof y=="object"&&y!==null&&typeof y.toJSON=="function"&&(y=y.toJSON(P)),y=x.call(i,P,y),typeof y){case"string":return l(y);case"object":{if(y===null)return"null";if(p.indexOf(y)!==-1)return h;let w="",O=",";const k=T;if(Array.isArray(y)){if(y.length===0)return"[]";if(R<p.length+1)return'"[Array]"';p.push(y),S!==""&&(T+=S,w+=`
2
2
  ${T}`,O=`,
3
3
  ${T}`);const D=Math.min(y.length,E);let q=0;for(;q<D-1;q++){const Z=Q(String(q),y,p,x,S,T);w+=Z!==void 0?Z:"null",w+=O}const z=Q(String(q),y,p,x,S,T);if(w+=z!==void 0?z:"null",y.length-1>E){const Z=y.length-E-1;w+=`${O}"... ${L(Z)} not stringified"`}return S!==""&&(w+=`
4
4
  ${k}`),p.pop(),`[${w}]`}let v=Object.keys(y);const j=v.length;if(j===0)return"{}";if(R<p.length+1)return'"[Object]"';let M="",_="";S!==""&&(T+=S,O=`,
@@ -0,0 +1,45 @@
1
+ import{createRequire as It}from"node:module";import te from"@visulima/colorize";import{L as jt,E as Wt}from"./constants-ep2nsfdy.js";import{i as Bt,w as Lt}from"./write-stream-D2XwCKdN.js";let xt;const Nt=e=>(xt??=It(import.meta.url))(e),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:T,ye=e=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[t,n]=P.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return P.getBuiltinModule(e)}return Nt(e)},T=P,{stdout:Ot,stderr:kt}=T,{execFileSync:Tt}=ye("node:child_process"),D=ye("node:fs"),Mt=ye("node:tty"),_t=globalThis.process??Object.create(null),ve={versions:{}},G=new Proxy(_t,{get(e,t){if(t in e)return e[t];if(t in ve)return ve[t]}}),ne=e=>{let t;return()=>{if(t===void 0){if(typeof G.getBuiltinModule!="function")throw new TypeError(`[@visulima/error] Cannot load ${e}: this runtime implements no process.getBuiltinModule(). Requires Node ^22.14.0 || >=24.10.0, or another runtime providing process.getBuiltinModule().`);t=G.getBuiltinModule(e)}return t}},Ft=e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
2
+ `),zt=(e,t,n,r)=>{const i={column:0,line:-1,...e.start},o={...i,...e.end},s=i.line,c=i.column,l=o.line,a=o.column;let u=Math.max(s-(n+1),0),h=Math.min(t.length,l+r);s===-1&&(u=0),l===-1&&(h=t.length);const g=l-s,f={};if(g)for(let d=0;d<=g;d++){const p=d+s;if(!c)f[p]=!0;else if(d===0){const m=t[p-1]?.length;f[p]=[c,(m??0)-c+1]}else if(d===g)f[p]=[0,a];else{const m=t[p-d]?.length;f[p]=[0,m]}}else c===a?f[s]=c?[c,0]:!0:f[s]=[c,(a??0)-(c??0)];return{end:h,markerLines:f,start:u}},Ct=G.platform==="win32"&&!G.env?.WT_SESSION?">":"❯",Rt=(e,t,n)=>{const r={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...n,color:{gutter:d=>d,marker:d=>d,message:d=>d,...n?.color}},i=typeof t.start.column=="number";let o=(e.includes("\r")?Ft(e):e).split(`
3
+ `);typeof r.tabWidth=="number"&&e.includes(" ")&&(o=o.map(d=>d.replaceAll(" "," ".repeat(r.tabWidth))));const{end:s,markerLines:c,start:l}=zt(t,o,r.linesAbove,r.linesBelow),a=String(s).length,{gutter:u,marker:h,message:g}=r.color;let f=o.slice(l,s).map((d,p)=>{const m=l+1+p,y=c[m],w=String(m).padStart(a),S=!c[m+1],$=` ${w}${r.showGutter?" |":""}`;if(y){let v="";if(Array.isArray(y)){const A=d.replaceAll(/[^\t]/g," ").slice(0,Math.max(y[0]-1,0)),b=y[1]||1;v=[`
4
+ `,r.prefix+u($.replaceAll(/\d/g," "))," ",A,h("^").repeat(b)].join(""),S&&r.message&&(v+=` ${g(r.message)}`)}return[r.prefix+h(Ct),u($),d.length>0?` ${d}`:"",v].join("")}return`${r.prefix} ${u($)}${d.length>0?` ${d}`:""}`}).join(`
5
+ `);return r.message&&!i&&(f=`${r.prefix+" ".repeat(a+1)+r.message}
6
+ ${f}`),f},Pt=()=>G.env?.DEBUG==="true",C=(e,...t)=>{if(Pt()){const n=t.map(r=>typeof r=="function"?r():r);console.debug(`error:parse-stacktrace: ${e}`,...n)}},R="<unknown>",Vt=/^(?:node:internal\/|node:|internal\/)/,Dt=e=>e!==void 0&&Vt.test(e),Ut=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Gt=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,Ht=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,Yt=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,qt=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,Jt=/in\s(.*)\s\(at\s(.+)\)\sat/,Kt=/^(?:.*@)?(.*):(\d+):(\d+)$/,Xt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Qt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Zt=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,Ae=/\(error: ([^)]*)\)/,en=/at\s/,tn=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,nn=/Error: |AggregateError:/,Xe=/^Anonymous function$/,rn=/^\s*in\s.*/,sn=/^.*?\s*at\s.*/,on=/^.*?\s*@.*|\[native code\]/,Qe=(e,t)=>{const n=e.includes("safari-extension"),r=e.includes("safari-web-extension");return n||r?[e.includes("@")?e.split("@")[0]:R,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Ze=(e,t)=>{const n=Ht.exec(t);n&&(e.file=n[1],e.line=+n[2],e.column=+n[3])},cn=e=>{const t=Jt.exec(e);if(t){C(`parse nested node error stack line: "${e}"`,()=>`found: ${JSON.stringify(t)}`);const r=t[2].split(":");return{column:r[2]?+r[2]:void 0,file:r[0],line:r[1]?+r[1]:void 0,methodName:t[1]??R,raw:e,type:void 0}}const n=qt.exec(e);if(n){C(`parse node error stack line: "${e}"`,()=>`found: ${JSON.stringify(n)}`);const r={column:n[4]?+n[4]:void 0,file:n[2]?n[2].replace(en,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]??R,raw:e,type:e.startsWith("internal")?"internal":void 0};return Ze(r,`${n[2]}:${n[3]}:${n[4]}`),r}},ln=e=>{const t=Ut.exec(e);if(t){C(`parse chrome error stack line: "${e}"`,()=>`found: ${JSON.stringify(t)}`);const n=t[2]?.startsWith("native"),r=t[2]?.startsWith("eval")||t[1]?.startsWith("eval");let i,o;if(r){const a=Gt.exec(e);if(a){const u=tn.exec(a[1]);u?(t[2]=u[4]??u[1],t[3]=u[5]??u[2],t[4]=u[3]):a[2]&&(t[2]=a[1]),a[2]&&(i={column:a[4]?+a[4]:void 0,file:a[2],line:a[3]?+a[3]:void 0,methodName:"eval",raw:e,type:"eval"})}else{const u=Yt.exec(e);u&&(o={column:u[4]?+u[4]:void 0,file:u[2],line:u[3]?+u[3]:void 0},i={column:u[6]?+u[6]:void 0,file:u[1],line:u[5]?+u[5]:void 0,methodName:"eval",raw:u[0],type:"eval"})}}const[s,c]=Qe(t[1]?t[1].replace(Xe,"<anonymous>"):R,t[2]),l={column:t[4]?+t[4]:void 0,evalOrigin:i,file:c,line:t[3]?+t[3]:void 0,methodName:s,raw:e,type:r?"eval":n?"native":Dt(c)?"internal":void 0};return o?(l.column=o.column,l.file=o.file,l.line=o.line):Ze(l,`${c}:${t[3]}:${t[4]}`),l}},an=(e,t)=>{const n=Xt.exec(e);if(n){C(`parse gecko error stack line: "${e}"`,()=>`found: ${JSON.stringify(n)}`);const r=n[3]?.includes(" > eval"),i=r&&n[3]&&Qt.exec(n[3]);let o;r&&i&&(n[3]=i[1],o={column:n[5]?+n[5]:void 0,file:n[3],line:n[4]?+n[4]:void 0,methodName:"eval",raw:e,type:"eval"},n[4]=i[2]);const[s,c]=Qe(n[1]?n[1].replace(Xe,"<anonymous>"):R,n[3]);let l;(t?.type==="safari"||!r&&t?.type==="firefox")&&t.column?l=t.column:!r&&n[5]&&(l=+n[5]);let a;return(t?.type==="safari"||!r&&t?.type==="firefox")&&t.line?a=t.line:n[4]&&(a=+n[4]),{column:l,evalOrigin:o,file:c,line:a,methodName:s,raw:e,type:r?"eval":c.includes("[native code]")?"native":void 0}}},un=(e,t)=>{const n=Zt.exec(e);if(!(n&&n[2].includes(" > eval"))&&n)return C(`parse firefox error stack line: "${e}"`,()=>`found: ${JSON.stringify(n)}`),{column:n[4]?+n[4]:t?.column??void 0,file:n[2],line:n[3]?+n[3]:t?.line??void 0,methodName:n[1]||R,raw:e,type:void 0}},fn=e=>{const t=Kt.exec(e);if(t)return C(`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:R,raw:e,type:void 0}},et=(e,{filter:t,frameLimit:n=50}={})=>{const r=e;let i=(typeof r.stacktrace=="string"?r.stacktrace:e.stack??"").split(`
7
+ `).map(o=>(Ae.test(o)?o.replace(Ae,"$1"):o).trim()).filter(o=>!nn.test(o)&&o!=="eval code");return t&&(i=i.filter(o=>t(o))),i=i.slice(0,n),i.reduce((o,s,c)=>{if(!s||s.length>1024)return o;let l;if(rn.test(s))l=cn(s);else if(sn.test(s))l=ln(s);else if(on.test(s)){let a;if(c===0){const u=e,h=u.columnNumber,g=u.lineNumber,f=u.line,d=u.column;h||g?a={column:h,line:g,type:"firefox"}:(f||d)&&(a={column:d,line:f,type:"safari"})}l=un(s,a)??an(s,a)}else l=fn(s);return l?o.push(l):C(`parse error stack line: "${s}"`,"not parser found"),o},[])},Ee=ne("node:fs"),Q=ne("node:path"),hn=ne("node:process"),dn=ne("node:url"),B=(e,t,n)=>n===0?e:t===" "?e+" ".repeat(n):e+" ".repeat(t*n),tt=e=>e.replaceAll("\\","/"),pn=e=>{if(!e.startsWith("file:"))return e;try{return dn().fileURLToPath(e)}catch{return e}},gn=(e,t)=>{const n=e.replace("async file:","file:");return tt(Q().relative(t,pn(n)))},mn=(e,t,n)=>{if(t)return n.title(e.message);const r=e.message?`: ${e.message}`:"";return n.title(e.name+r)},nt=(e,{color:t,hideErrorTitle:n,indentation:r,prefix:i},o)=>`${B(i,r,o)}${mn(e,n,t)}
8
+ `,rt=(e,{color:t,indentation:n,prefix:r},i)=>{if(e.hint===void 0)return;const o=B(r,n,i);let s="";if(Array.isArray(e.hint))for(const c of e.hint)s+=`${o+c}
9
+ `;else s+=o+e.hint;return t.hint(s)},$e=(e,t)=>{if(!t||e.file===void 0||e.line===void 0)return{trace:e};try{const n=t({column:e.column,file:e.file,line:e.line});return n?{source:n.source,trace:{...e,column:n.column??e.column,file:n.file??e.file,line:n.line??e.line}}:{trace:e}}catch{return{trace:e}}},be=(e,t,n=0)=>{const{color:r,cwd:i,displayShortPath:o,indentation:s,prefix:c}=t,{trace:l}=e;let a;l.file===void 0?a="<unknown>":a=o?gn(l.file,i):tt(l.file);const{fileLine:u,method:h}=r;return`${B(c,s,n)}at ${l.methodName?`${h(l.methodName)} `:""}${u(a)}:${u(l.line?.toString()??"")}`},yn=(e,t)=>{if(t.allowAllFilePaths)return!0;const n=Q().resolve(t.cwd),r=Q().resolve(n,e);return r===n||r.startsWith(n+Q().sep)},$n=e=>{try{return Ee().existsSync(e)?Ee().readFileSync(e,"utf8"):void 0}catch{return}},it=(e,t,n)=>{const{color:r,indentation:i,linesAbove:o,linesBelow:s,prefix:c,showGutter:l,showLineNumbers:a,tabWidth:u}=t,{source:h,trace:g}=e;if(g.file===void 0)return;let f;if(h===void 0){const d=g.file.replace("file://","");if(!yn(d,t))return;const p=$n(d);if(p===void 0)return;f=p}else f=h;return Rt(f,{start:{column:g.column,line:g.line}},{color:r,linesAbove:o,linesBelow:s,prefix:B(c,i,n),showGutter:l,showLineNumbers:a,tabWidth:u})},st=(e,t,n)=>{if(e.errors.length===0)return;let r=`${B(t.prefix,t.indentation,n)}Errors:
10
+
11
+ `,i=!0;for(const o of e.errors)i?i=!1:r+=`
12
+
13
+ `,r+=ct(o,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},n+1);return`
14
+ ${r}`},bn=e=>{if(typeof e=="object"&&e!==null)try{return JSON.stringify(e)}catch{return Object.prototype.toString.call(e)}return String(e)},ot=(e,t,n,r=new Set)=>{r.add(e);let i=`${B(t.prefix,t.indentation,n)}Caused by:
15
+
16
+ `;const{cause:o}=e;if(!(o instanceof Error)){const l=bn(o);return i+=`${B(t.prefix,t.indentation,n)}${t.color.title(l)}
17
+ `,`
18
+ ${i}`}i+=nt(o,t,n);const s=et(o).shift(),c=rt(o,t,n);if(c&&(i+=`${c}
19
+ `),s){const l=$e(s,t.sourceMap);if(i+=be(l,t,n),!t.hideErrorCauseCodeView){const a=it(l,t,n);a!==void 0&&(i+=`
20
+ ${a}`)}}if(o instanceof AggregateError){const l=st(o,t,n);l!==void 0&&(i+=`
21
+ ${l}`)}return o.cause&&(i+=r.has(o)?`
22
+ ${B(t.prefix,t.indentation,n+1)}Caused by: [Circular]`:`
23
+ ${ot(o,t,n+1,r)}`),`
24
+ ${i}`},wn=(e,t)=>(e.length>0?`
25
+ `:"")+e.map(n=>be($e(n,t.sourceMap),t)).join(`
26
+ `),ct=(e,t,n)=>{const r={allowAllFilePaths:!1,cwd:hn().cwd(),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:c=>c,gutter:c=>c,hint:c=>c,marker:c=>c,message:c=>c,method:c=>c,title:c=>c,...t.color}},i=et(e,{filter:t.filterStacktrace,frameLimit:r.framesMaxLimit}),o=i.shift(),s=o?$e(o,r.sourceMap):void 0;return[t.hideMessage?void 0:nt(e,r,n),rt(e,r,n),s?be(s,r,n):void 0,s&&!r.hideErrorCodeView?it(s,r,n):void 0,e instanceof AggregateError?st(e,r,n):void 0,e.cause===void 0||e.cause===null?void 0:ot(e,r,n),i.length>0?wn(i,r):void 0].filter(Boolean).join(`
27
+ `)},oe=(e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return ct(e,t,0)},M="[Inspection threw]",x=(e,t,n,r,i,o=", ",s=Number.POSITIVE_INFINITY)=>{const c=e.length;if(c===0)return"";const l=Number.isFinite(s)&&c>s,a=l?Math.max(0,Math.floor(s)):c;if(a===0)return`…(${String(c)})`;let u=r;i!==void 0&&(u=i);const h=n.truncate,g=Number.isFinite(h);let f="",d="",p="";for(let m=0;m<a;m+=1){const y=m+1===a,w=m+2===a;g&&(p=`…(${String(a-m)})`);let S=e[m];n.truncate=h-f.length-(y?0:o.length);const $=d||u(S,t,n,r)+(y?"":o),v=f.length+$.length,A=v+p.length;if(y&&v>h&&f.length+p.length<=h||!y&&!w&&A>h)break;S=e[m+1];const b=w?"":o;if(y?d="":d=u(S,t,n,r)+b,!y&&w&&A>h&&v+d.length>h)break;if(f+=$,!y&&!w&&v+d.length>=h){p=`…(${String(a-m-1)})`;break}p=""}return l&&p===""&&(p=`${o}… ${String(c-a)} more`),`${f}${p}`},Sn=([e,t],n,r)=>(r.truncate-=3,t?`${r.stylize(String(e),"yellow")}=${r.stylize(`"${t}"`,"string")}`:r.stylize(String(e),"yellow")),lt=e=>{try{return Object.create(e,{length:{value:e.length}})}catch{return}},vn=(e,t,n,r)=>{let i;try{i=e.nodeType}catch{return M}if(i===1)return at(e,e,n,r);if(i===3){let o;try{o=e.data}catch{return M}return r(o,void 0,n)}return r(e,void 0,n)},pe=(e,t,n,r)=>{const i=lt(e);return i===void 0?M:x(i,e,t,n,vn,`
28
+ `)},at=(e,t,n,r)=>{let i,o;try{i=e.getAttributeNames().map(f=>[f,e.getAttribute(f)]),o=e.tagName.toLowerCase()}catch{return M}const s=n.stylize(`<${o}`,"special"),c=n.stylize(">","special"),l=n.stylize(`</${o}>`,"special");n.truncate-=o.length*2+5;let a="";i.length>0&&(a+=" ",a+=x(i,t,n,r,Sn," ")),n.truncate-=a.length;const{truncate:u}=n;let h;try{h=lt(e.children)}catch{h=void 0}let g;return h===void 0?g=M:(g=pe(h,n,r),g&&g.length>u&&(g=`…(${String(h.length)})`)),`${s}${a}${c}${g}${l}`},An=(e,t,n)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${x(e,e,t,n,void 0,", ",t.maxArrayLength)} ]`),En=(e,t)=>{let n;if(e===" ")n=" ";else if(typeof e=="number"&&e>0)n=Array.from({length:e+1}).join(" ");else return;return{base:n,prev:`
29
+ ${Array.from({length:t+1}).join(n)}`}},re=(e,t)=>{if(e.length===0)return"";const n=t.prev+t.base;return n+e.split("\0\0").join(`,${n}`)+t.prev},In=/^[a-z_]\w*$/i,xn=/^"|"$/g,Nn=(e,t)=>{if(In.test(e))return e;const n=JSON.stringify(e);return t.quoteStyle==="double"?n.replaceAll('"',String.raw`\"`):n.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(xn,"'")},H=([e,t],n,r,i)=>{r.truncate-=2;let o;typeof e=="string"?o=Nn(e,r):typeof e=="number"?o=String(e):o=`[${i(e,n,r)}]`,r.truncate-=o.length;const s=i(t,n,r);return`${o}: ${s}`},On=Symbol.for("chai/inspect"),ce=e=>({[On]:()=>e}),Y=(e,t)=>{let n;try{n=Object.getOwnPropertyDescriptor(e,t)}catch{n=void 0}if(n===void 0||"value"in n)try{return e[t]}catch{return ce(M)}if(n.get===void 0)return ce("[Setter]");try{return e[t]}catch{return ce(M)}},kn=e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},Tn=e=>{const t=[];for(const n of Object.keys(e)){const r=Number(n);Number.isInteger(r)&&r>=0&&String(r)===n&&r<4294967295||t.push(n)}return t},Mn=(e,t,n,r)=>{const i=Tn(e);if(e.length===0&&i.length===0)return"[]";t.truncate-=4;const o=!!r&&kn(e);let s=x(e,e,t,n,void 0,o?"\0\0":", ",t.maxArrayLength);t.truncate-=s.length;let c="";return i.length>0&&(c=x(i.map(l=>[l,Y(e,l)]),e,t,n,H)),o&&r&&(s=re(s,r)),`[${o?"":" "}${s}${c?`, ${c}`:""}${o?"":" "}]`},jn=50,Ie=(e,t)=>{const n=new Uint8Array(e),r=Math.min(n.length,jn);let i="",o=!1;for(let a=0;a<r;a+=1){const u=n[a];u!==0&&(o=!0),i+=(a===0?"":" ")+u.toString(16).padStart(2,"0")}n.length>r&&(i+=` ... ${String(n.length-r)} more byte${n.length-r===1?"":"s"}`);const s=e instanceof ArrayBuffer?"ArrayBuffer":"SharedArrayBuffer",c=o||n.length>r,l=i!==""&&c?`[Uint8Contents]: <${i}>, `:"";return`${t.stylize(s,"special")} { ${l}byteLength: ${t.stylize(String(e.byteLength),"number")} }`},xe=/\d(?=(?:\d{3})+(?!\d))/g,Wn=/\d{3}/g,Bn=/_$/,ut=(e,t)=>{if(t.length<4||t.length===4&&t.codePointAt(0)===45||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY||t.includes("e"))return t;if(typeof e=="number"){const n=e<0?-Math.floor(-e):Math.floor(e);if(n!==e){const r=String(n),i=t.slice(r.length+1);return`${r.replace(xe,"$&_")}.${i.replace(Wn,"$&_").replace(Bn,"")}`}}return t.replace(xe,"$&_")},Ln=e=>e>="\uD800"&&e<="\uDBFF",L=(e,t,n="…")=>{e=String(e);const r=n.length,i=e.length;if(r>t&&i>r)return n;if(i>t&&i>r){let o=t-r;return o>0&&Ln(e[o-1])&&(o-=1),`${e.slice(0,o)}${n}`}return e},Ne=(e,t)=>{let n=L(e.toString(),t.truncate-1);return n!=="…"&&(n+="n"),t.stylize(t.numericSeparator?ut(e,n):n,"bigint")},ft=e=>{try{return Array.isArray(e)}catch{return!1}},F=(e,t)=>{try{return e[t]}catch{return}},_n=(e,t)=>{try{return e instanceof t}catch{return!1}},Oe=(e,t)=>{try{return Object.getOwnPropertyDescriptor(e,t)?.enumerable??!1}catch{return!0}},Fn=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),Z=(e,t,n,r)=>{if("window"in globalThis&&e===globalThis)return"{ [object Window] }";if(e===globalThis)return"{ [object globalThis] }";let i,o;try{i=Object.getOwnPropertyNames(e),o=Object.getOwnPropertySymbols(e)}catch{return M}let s,c;try{s=t.showHidden?i:i.filter(f=>Object.getOwnPropertyDescriptor(e,f)?.enumerable)}catch{s=i.filter(f=>Oe(e,f))}try{c=o.filter(f=>t.showHidden||Object.getOwnPropertyDescriptor(e,f)?.enumerable)}catch{c=o.filter(f=>Oe(e,f))}let l;try{const f=Fn(e)===Object.prototype||e.constructor===Object,d=e instanceof Object?"":"null prototype";let p;!f&&Symbol.toStringTag in e?p=e[Symbol.toStringTag]:p=d?"Object":"",l=p||d?`[${[p,d].filter(Boolean).join(": ")}] `:""}catch{l=""}if(s.length===0&&c.length===0)return`${l}{}`;t.truncate-=4;const a=r?"\0\0":", ",u=x(s.map(f=>[f,Y(e,f)]),e,t,n,H,a),h=x(c.map(f=>[f,Y(e,f)]),e,t,n,H,a);let g="";return u&&h&&(g=a),r?`${l}{${re(u+g+h,r)}}`:`${l}{ ${u}${g}${h} }`},zn=(e,t,n,r)=>{let i;try{i=typeof e.constructor=="function"?e.constructor.name:""}catch{i=""}return(!i||i==="_class")&&(i="<Anonymous Class>"),t.truncate-=i.length,`${i} ${Z(e,t,n,r)}`},Cn=(e,t)=>{const n=t.stylize(String(e.byteLength),"number"),r=t.stylize(String(e.byteOffset),"number"),i=t.stylize(String(e.buffer.byteLength),"number");return`${t.stylize("DataView","special")} { byteLength: ${n}, byteOffset: ${r}, buffer: ArrayBuffer { byteLength: ${i} } }`},Rn=(e,t)=>{const n=e.toJSON();if(n===null)return"Invalid Date";const r=n.split("T"),i=r[0];return t.stylize(`${i}T${L(r[1],t.truncate-i.length-1)}`,"date")},Pn=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),Vn=(e,t,n)=>{const r=Object.getOwnPropertyNames(e).filter(c=>!Pn.has(c)),{name:i}=e;t.truncate-=i.length;let o="";typeof e.message=="string"?o=L(e.message,t.truncate):r.unshift("message"),o=o?`: ${o}`:"",t.truncate-=o.length+5;const s=x(r.map(c=>[c,Y(e,c)]),e,t,n,H);return`${i}${o}${s?` { ${s} }`:""}`},ke=(e,t)=>{let n,r,i;try{n=e[Symbol.toStringTag]||"Function",r=e.toString(),{name:i}=e}catch{return t.stylize(M,"special")}return r.length<t.truncate-12?t.stylize(`[${n}: ${r}]`,"special"):i?t.stylize(`[${n} ${L(i,t.truncate-11)}]`,"special"):t.stylize(`[${n}]`,"special")},Te=(e,t)=>{const n=F(e,Symbol.toStringTag),r=typeof n=="string"?n:"Generator";return`${t.stylize(`Object [${r}]`,"special")} {}`},Dn=([e,t],n,r,i)=>(r.truncate-=4,e=i(e,n,r),r.truncate-=e.length,`${e} => ${i(t,n,r)}`),Un=(e,t,n,r)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let i=x([...e.entries()],e,t,n,Dn,r?"\0\0":", ",t.maxArrayLength);return r&&(i=re(i,r)),`Map (${String(e.size)}) {${r?"":" "}${i}${r?"":" "}}`};function Me(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(L(t.numericSeparator?ut(e,e.toString()):e.toString(),t.truncate),"number")}const Gn=()=>"Promise{…}",Hn=(e,t)=>{const n=t.truncate-(2+e.flags.length);return t.stylize(`/${L(e.source,n)}/${e.flags}`,"regexp")},Yn=(e,t,n,r)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let i=x([...e],e,t,n,void 0,r?"\0\0":", ",t.maxArrayLength);return r&&(i=re(i,r)),`Set (${String(e.size)}) {${r?"":" "}${i}${r?"":" "}}`},qn=(e,t)=>{const n=t.quoteStyle==="double"?'"':"'";return n+e+n},je=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"),Jn={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},Kn=16,Xn=e=>Jn[e]||String.raw`\u${`0000${e.codePointAt(0).toString(Kn)}`.slice(-4)}`,We=(e,t)=>(je.test(e)&&(e=e.replaceAll(je,Xn)),t.stylize(qn(L(e,t.truncate-2),t),"string")),Be=e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),Qn=e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],O=(e,t,n)=>{const r=Qn(e);t.truncate-=r.length+4;const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return`${r}[]`;let o="";const s=Number.isFinite(t.maxArrayLength)?Math.min(e.length,Math.max(0,Math.floor(t.maxArrayLength))):e.length;for(let l=0;l<s;l++){const a=`${t.stylize(L(e[l],t.truncate),"number")}${l===s-1?"":", "}`;if(t.truncate-=a.length,l!==s-1&&t.truncate<=3){o+=`…(${String(e.length-l)})`;break}o+=a}s<e.length&&(o+=`${o?", ":""}… ${String(e.length-s)} more`);let c="";return i.length>0&&(c=x(i.map(l=>[l,Y(e,l)]),e,t,n,H)),`${r}[ ${o}${c?`, ${c}`:""} ]`},Le=e=>typeof F(e,Symbol.toStringTag)!="string",Zn=e=>typeof e=="function",ht=(e,t,n)=>{if(e==null)return;const r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0)return;const i=n==="get"?r.get:r.value;return typeof i=="function"?i:void 0},dt=(e,t)=>{if(e!==void 0)return n=>{try{return e.call(n,t),!0}catch{return!1}}},_=(e,t)=>dt(ht(e,t,"get")),W=(e,t,n)=>dt(ht(e,t,"value"),n),_e=Object.freeze({}),k=_(Reflect.getPrototypeOf(Int8Array.prototype),"length"),er=typeof SharedArrayBuffer=="function"?SharedArrayBuffer.prototype:void 0,tr=Object.assign(Object.create(null),{Arguments:Le,Array:ft,ArrayBuffer:_(ArrayBuffer.prototype,"byteLength"),BigInt:W(BigInt.prototype,"valueOf"),Boolean:W(Boolean.prototype,"valueOf"),DataView:_(DataView.prototype,"byteLength"),Date:W(Date.prototype,"valueOf"),Error:Le,Float32Array:k,Float64Array:k,Function:Zn,Int8Array:k,Int16Array:k,Int32Array:k,Map:_(Map.prototype,"size"),Number:W(Number.prototype,"valueOf"),RegExp:_(RegExp.prototype,"source"),Set:_(Set.prototype,"size"),SharedArrayBuffer:_(er,"byteLength"),String:W(String.prototype,"valueOf"),Symbol:W(Symbol.prototype,"valueOf"),Uint8Array:k,Uint8ClampedArray:k,Uint16Array:k,Uint32Array:k,WeakMap:W(WeakMap.prototype,"has",_e),WeakSet:W(WeakSet.prototype,"has",_e)}),nr=(e,t)=>{const n=tr[t];return n===void 0||n(e)},Fe=new WeakMap,ze=Object.create(null),rr=Object.assign(Object.create(null),{Arguments:An,Array:Mn,ArrayBuffer:Ie,AsyncGenerator:Te,BigInt:Ne,bigint:Ne,Boolean:(e,t)=>t.stylize(String(e),"boolean"),boolean:(e,t)=>t.stylize(String(e),"boolean"),DataView:Cn,Date:Rn,Error:Vn,Float32Array:O,Float64Array:O,Function:ke,function:ke,Generator:Te,HTMLCollection:pe,Int8Array:O,Int16Array:O,Int32Array:O,Map:Un,NodeList:pe,null:(e,t)=>t.stylize("null","null"),Number:Me,number:Me,Promise:Gn,RegExp:Hn,Set:Yn,SharedArrayBuffer:Ie,String:We,string:We,Symbol:Be,symbol:Be,Uint8Array:O,Uint8ClampedArray:O,Uint16Array:O,Uint32Array:O,undefined:(e,t)=>t.stylize("undefined","undefined"),WeakMap:(e,t)=>t.stylize("WeakMap{…}","special"),WeakSet:(e,t)=>t.stylize("WeakSet{…}","special")}),ir=Symbol.for("nodejs.util.inspect.custom"),sr=Symbol.for("chai/inspect"),or=(e,t,n,r)=>{const i=F(e,sr);if(typeof i=="function")return i.call(e,t);if(!("window"in globalThis)){const l=F(e,ir);if(typeof l=="function")return l.call(e,r,t)}const o=F(e,"inspect");if(typeof o=="function")return o.call(e,r,t);const s=F(e,"constructor");if(typeof s=="function"&&Fe.has(s))return Fe.get(s)?.(e,t)??"unknown";const c=Object.hasOwn(ze,n)?ze[n]:void 0;return c?c(e,t):""},le=(e,t,n)=>{const{depth:r,inspect:i,seen:o}=n;if(o.includes(e))return"[Circular]";if(r>=t.depth&&t.depth>0&&typeof e=="object"&&e!==null)return ft(e)?"[Array]":"[Object]";const s=t.indent?En(t.indent,r):void 0;let c=e===null?"null":typeof e;if(c==="object")try{c=Object.prototype.toString.call(e).slice(8,-1)}catch{c="Object"}let l=rr[c];if(l!==void 0&&typeof e=="object"&&e!==null&&!nr(e,c)&&(l=void 0),l!==void 0)return l(e,t,i,s);if(t.customInspect&&e){const h=or(e,t,c,t.depth-r);if(h)return typeof h=="string"?h:i(h,e,t)}let a=!1;if(e)try{a=Object.getPrototypeOf(e)}catch{a=Object.prototype}if(a===Object.prototype||a===null)return Z(e,t,i,s);if(e&&typeof HTMLElement=="function"&&_n(e,HTMLElement))return at(e,e,t,i);const u=F(e,"constructor");return u!==void 0?u!==Object?zn(e,t,i,s):Z(e,t,i,s):e===Object(e)?Z(e,t,i,s):t.stylize(String(e),c)},Ce=(e,t={})=>{const n={customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,stylize:i=>i,truncate:Number.POSITIVE_INFINITY,...t};if(n.indent!==void 0&&n.indent!==" "&&!(Number.parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');const r={depth:0,inspect:void 0,seen:[]};return r.inspect=(i,o,s)=>{if(o==null){r.depth+=1;const l=le(i,s,r);return r.depth-=1,l}r.seen.push(o),r.depth+=1;const c=le(i,s,r);return r.depth-=1,r.seen.pop(),c},le(e,n,r)},cr=[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],lr=12288,ar=65510,ur=[12288,12288,65281,65376,65504,65510],fr=8361,hr=65518,dr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],pr=32,gr=10630,mr=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],yr=4352,$r=262141,pt=[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],q=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){const i=Math.floor((n+r)/2),o=i*2;if(t<e[o])r=i-1;else if(t>e[o+1])n=i+1;else return!0}return!1},Re=19968,[br,wr]=Sr(pt);function Sr(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){const i=e[r],o=e[r+1];if(Re>=i&&Re<=o)return[i,o];o-i>n-t&&(t=i,n=o)}return[t,n]}const vr=e=>e<161||e>1114109?!1:q(cr,e),Ar=e=>e<lr||e>ar?!1:q(ur,e),Er=e=>e<fr||e>hr?!1:q(dr,e),Ir=e=>e<pr||e>gr?!1:q(mr,e),xr=e=>e>=br&&e<=wr?!0:e<yr||e>$r?!1:q(pt,e);function Nr(e){return vr(e)?"ambiguous":Ar(e)?"fullwidth":Er(e)?"halfwidth":Ir(e)?"narrow":xr(e)?"wide":"neutral"}function Or(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function gt(e){return Or(e),Nr(e)}const mt=String.raw,Pe=mt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,kr=()=>new RegExp(mt`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${Pe}(?:\u200D${Pe})*`,"gu"),j=new Set(["\x1B","›"]),we="\x07",V="]8;;",Tr=/[\u200B\uFEFF\u2060-\u2064]/g,yt=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\)|\][^\u0007\u001B]{0,1000}(?:\u0007|\u001B\\))/g,J=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Mr=kr(),Ve=new Map,jr=e=>[e.ambiguousIsNarrow?1:0,e.control,e.fullWidth,e.regular,e.wide].join("|"),Wr=e=>{const t=jr(e.width);let n=Ve.get(t);return n||(n=new Map,Ve.set(t,n)),n},K=new RegExp(yt.source,"y"),ae=new RegExp(Mr.source,"uy"),X=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,$t=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",Br=(e,t)=>{const n=Wr(t),r=Math.floor(e/65536),i=e%65536;let o=n.get(r);if(o||(o=new Map,n.set(r,o)),o.has(i))return o.get(i);let s;switch($t(e)){case"control":{s=t.width.control;break}case"latin":{s=t.width.regular;break}case"wide":{s=t.width.wide;break}case"zero":{s=0;break}default:switch(gt(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 o.set(i,s),s},Lr=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,ge=(e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const n={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?ge(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}},r=Math.max(0,n.truncation.limit-n.truncation.ellipsisWidth),{length:i}=e,o=i>1e4;let s=0,c=0,l=i,a=!1;const u=e.includes("\x1B")||e.includes("›");for(;s<i;){if(u&&(e[s]==="\x1B"||e[s]==="›")){if(e.startsWith("\x1B]8;;",s)){const m="\x1B]8;;\x07",y=m.length,w=e.indexOf("\x07",s+5);if(w!==-1){const S=e.indexOf(m,w+1);if(S!==-1){const $=S+y,v=e.slice(w+1,S).replace(yt,""),A=ge(v,{ambiguousIsNarrow:n.width.ambiguousIsNarrow,ansiWidth:n.width.ansi,controlWidth:n.width.control,countAnsiEscapeCodes:!1,ellipsis:n.truncation.ellipsis,ellipsisWidth:n.truncation.ellipsisWidth,emojiWidth:n.width.emoji,fullWidth:n.width.fullWidth,halfWidth:n.width.halfWidth,limit:Math.max(0,r-c),regularWidth:n.width.regular,tabWidth:n.width.tab,wideWidth:n.width.wide}),b=A.width;if(A.truncated)a=!0,l=Math.min(l,s);else if(c+b>r&&(l=Math.min(l,s),a=!0,c+b>n.truncation.limit))break;if(c+=b,s=$,a&&c>=n.truncation.limit)break;continue}}}if(K.lastIndex=s,K.test(e)){const m=K.lastIndex-s,y=n.truncation.countAnsiEscapeCodes?m:n.width.ansi;if(c+y>r&&(l=Math.min(l,s),c+y>n.truncation.limit)){a=!0;break}c+=y,s=K.lastIndex;continue}}const f=e.codePointAt(s);if(f===8203||f===65279||f>=8288&&f<=8292){s+=1;continue}if(f===9){if(c+n.width.tab>r&&(l=Math.min(l,s),c+n.width.tab>n.truncation.limit)){a=!0;break}c+=n.width.tab,s+=1;continue}if(X.lastIndex=s,X.test(e)){const m=(X.lastIndex-s)*n.width.regular;if(c+m>r){const y=n.width.regular>0?Math.floor((r-c)/n.width.regular):0;if(l=Math.min(l,s+y),c+m>n.truncation.limit){a=!0;break}}c+=m,s=X.lastIndex;continue}if((f<=31||f>=127&&f<=159)&&(J.lastIndex=s,J.test(e))){const m=(J.lastIndex-s)*n.width.control;if(c+m>r){const y=n.width.control>0?Math.floor((r-c)/n.width.control):0;if(l=Math.min(l,s+y),c+m>n.truncation.limit){a=!0;break}}c+=m,s=J.lastIndex;continue}if(ae.lastIndex=s,ae.test(e)){if(c+n.width.emoji>r&&(l=Math.min(l,s),c+n.width.emoji>n.truncation.limit)){a=!0;break}c+=n.width.emoji,s=ae.lastIndex;continue}const d=e.codePointAt(s)??0;if(Lr(d)){s+=d>65535?2:1;continue}let p;if(o)p=Br(d,n);else switch($t(d)){case"control":{p=n.width.control;break}case"latin":{p=n.width.regular;break}case"wide":{p=n.width.wide;break}case"zero":{p=0;break}default:switch(gt(d)){case"ambiguous":{p=n.width.ambiguousIsNarrow?n.width.regular:n.width.wide;break}case"fullwidth":{p=n.width.fullWidth;break}case"wide":{p=n.width.wide;break}default:p=n.width.regular}}if(c+p>r&&(l=Math.min(l,s),c+p>n.truncation.limit)){a=!0;break}c+=p,s+=d>65535?2:1}let h=c,g=!1;return a&&n.truncation.limit>=n.truncation.ellipsisWidth&&(h=n.truncation.limit,g=!0),{ellipsed:g,index:a?l:i,truncated:a,width:h}},I=(e,t={})=>ge(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,_r=/^(?:\u001B\[|\u009B)([\d:;]*)m$/,bt=new Map([[1,22],[2,22],[3,23],[4,24],[5,25],[6,25],[7,27],[8,28],[9,29],[21,24],[53,55]]),Fr=new Set(bt.values()),zr=e=>{const t=e.split(";"),n=[];for(let r=0;r<t.length;r+=1){const i=t[r];if(i.includes(":")){n.push([i]);continue}const o=i===""?0:Number.parseInt(i,10);if(o===38||o===48||o===58){const s=t[r+1];let c=0;s==="5"?c=2:s==="2"?c=4:s?.includes(":")&&(c=1),n.push(t.slice(r,r+1+c)),r+=c;continue}n.push([i])}return n},Cr=e=>{const t=e[0],n=t.indexOf(":"),r=n===-1?t:t.slice(0,n);return r===""?0:Number.parseInt(r,10)},Rr=e=>e===38||e>=30&&e<=37||e>=90&&e<=97,Pr=e=>e===48||e>=40&&e<=47||e>=100&&e<=107;class Vr{activeForeground=void 0;activeBackground=void 0;activeUnderlineColor=void 0;activeAttributes=new Map;processEscape(t){const n=_r.exec(t);if(n)for(const r of zr(n[1])){const i=Cr(r);switch(i){case 0:{this.resetAll();break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}case 59:{this.activeUnderlineColor=void 0;break}default:this.applyParameter(i,`\x1B[${r.join(";")}m`)}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,this.activeUnderlineColor,...this.activeAttributes.values()].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[...this.activeAttributes.keys()].toReversed().map(n=>`\x1B[${String(n)}m`);return this.activeUnderlineColor&&t.push("\x1B[59m"),this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}resetAll(){this.activeForeground=void 0,this.activeBackground=void 0,this.activeUnderlineColor=void 0,this.activeAttributes.clear()}applyParameter(t,n){if(!((t===38||t===48||t===58)&&!n.includes(";")&&!n.includes(":")))if(Rr(t))this.activeForeground=n;else if(Pr(t))this.activeBackground=n;else if(t===58)this.activeUnderlineColor=n;else if(Fr.has(t))this.activeAttributes.delete(t);else{const r=bt.get(t);r!==void 0&&this.activeAttributes.set(r,n)}}}const De=/(?:\u{1B}\[|\u{9B})[\u{30}-\u{3F}]*[\u{20}-\u{2F}]*[\u{40}-\u{7E}]/uy,ie=(e,t)=>{if(j.has(e[t])){if(e.startsWith(V,t+1)){const n=e.indexOf(we,t);return n===-1?void 0:e.slice(t,n+1)}return De.lastIndex=t,De.exec(e)?.[0]}},Dr=(e,t)=>{if(!j.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const n=!0,r=e.slice(t+1,t+1+V.length).join("")===V;return{isInsideEscape:n,isInsideLinkEscape:r}},Ur=e=>{let t=0;for(let n=0;n<e.length;n+=1)e.codePointAt(n)>65535&&(n+=1),t+=1;return t},Gr=(e,t={})=>{let n="",r=!1,i=0,o="",s="",c=!1;const l=[...e],a=[];for(let u=0,h=0;u<l.length;u+=1)a.push(h),h+=l[u].length;for(let u=0;u<l.length;u++){const h=l[u];if(h&&j.has(h)){if(n){const m=t.getWidth?.(n)??0,y={isEscapeSequence:!1,isGrapheme:!0,text:n,width:m};if(c&&(y.isHyperlink=!0,y.hyperlinkUrl=s),t.onSegment?.(y)===!1)return;n=""}r=!0,i=u,o=h;const d=Dr(l,u),{isInsideLinkEscape:p}=d;if(p){let m=u+1;for(s="";m<l.length;){const w=l[m];if(w===we)break;s+=w,m+=1}s=s.slice(4);const y={hyperlinkUrl:s,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(y)===!1)return;u=m,c=!0,r=!1,o="";continue}if(u+1<l.length&&l[u+1]==="\\"&&c){const m={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(m)===!1)return;c=!1,s="",u+=1,r=!1,o="";continue}}if(r){const d=ie(e,a[i]);r=!1,d===void 0?(o=l.slice(i).join(""),u=l.length):(o=d,u=i+Ur(d)-1);const p={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(t.onSegment?.(p)===!1)return;o="";continue}n+=h;const g=t.getWidth?.(n)??0,f={isEscapeSequence:!1,isGrapheme:!0,text:n,width:g};if(c&&(f.isHyperlink=!0,f.hyperlinkUrl=s),t.onSegment?.(f)===!1)return;n=""}if(n){const u=t.getWidth?.(n)??0,h={isEscapeSequence:!1,isGrapheme:!0,text:n,width:u};c&&(h.isHyperlink=!0,h.hyperlinkUrl=s),t.onSegment?.(h)}if(o){const u={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};t.onSegment?.(u)}},Ue=e=>`${j.values().next().value}${V}${e}${we}`,Hr=(e,t,n)=>{let r=n,i=0;for(;i<e.length;){if(!j.has(e[i])){i+=1;continue}const o=ie(e,i);if(o===void 0){i+=1;continue}if(e.startsWith(V,i+1)){const s=o.slice(1+V.length,-1);r=s.length===0?void 0:s}else t.processEscape(o);i+=o.length}return r},Yr=e=>{if(e.length===0)return"";if(e.length===1)return e[0];const t=new Vr,n=e.length-1;let r="",i;for(const[o,s]of e.entries())o>0&&(r+=t.getStartEscapesForAllActiveAttributes(),i!==void 0&&(r+=Ue(i))),r+=s,i=Hr(s,t,i),o<n&&(i!==void 0&&(r+=Ue("")),r+=t.getEndEscapesForAllActiveAttributes(),r+=`
30
+ `);return r},qr=/(?=\s)|(?<=\s)/,Jr=new Intl.Segmenter("en",{granularity:"grapheme"}),Kr=/[^\u0000-\u02FF]/,Se=/^\s+$/,Ge=new Map,Xr=e=>{const t=Ge.get(e);if(t!==void 0)return t;const n=I(e);return Ge.set(e,n),n},Qr=e=>{if(!Kr.test(e))return[e];const t=[];let n="";for(const{segment:r}of Jr.segment(e)){if(I(r)>1){n!==""&&(t.push(n),n=""),t.push(r);continue}n+=r}return n!==""&&t.push(n),t},He=e=>e.split(qr).flatMap(t=>t===""||Se.test(t)?[t]:Qr(t)),Ye="x",Zr=e=>{let t="",n=0;for(;n<e.length;){const r=j.has(e[n])?ie(e,n):void 0;if(r===void 0){if(j.has(e[n]))return t+Ye.repeat(e.length-n);t+=e[n],n+=1;continue}t+=Ye.repeat(r.length),n+=r.length}return t},wt=e=>{if(![...j].some(r=>e.includes(r)))return He(e);const t=[];let n=0;for(const r of He(Zr(e)))t.push(e.slice(n,n+r.length)),n+=r.length;return t},z=e=>{const t=e.split(" ");let n=t.length;for(;n>0&&I(t[n-1])===0;)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},St=(e,t,n)=>{if(e.length===0)return[""];if(t<=0)return[e];const r=[];let i="",o=0,s=0;for(;s<e.length;){const c=e.codePointAt(s),l=String.fromCodePoint(c),a=l.length;if(j.has(l)){const g=ie(e,s);if(g===void 0){i+=e.slice(s);break}i+=g,s+=g.length;continue}const u=Xr(l),h=l===" ";if(u===0){i+=l,s+=a;continue}if(o+u>t&&(i&&r.push(i),i="",o=0,h&&n)){for(;s<e.length&&e[s]===" ";)s+=1;continue}if(i+=l,o+=u,o===t&&s+a<e.length&&(r.push(i),i="",o=0,s+a<e.length&&e[s+a]===" "&&n)){for(s+=a;s<e.length&&e[s]===" ";)s+=1;continue}s+=a}return i&&r.push(i),n?r.map(c=>z(c)):r},ei=(e,t,n)=>{if(e.length===0)return[];const r=n?e.trim():e;if(r.length===0)return[];const i=[];let o="",s=0;return Gr(r,{getWidth:I,onSegment:c=>{const l=c.text??"";if(c.isEscapeSequence)o+=l;else{const a=l===" ";if(c.width===0)return o+=l,!0;if(s+c.width>t&&(o&&i.push(o),o="",s=0,a))return n||i.push(l),!0;o+=l,s+=c.width}return!0}}),o&&i.push(o),n?i.map(c=>z(c)):i},ti=(e,t,n)=>{if(e.length===0)return[];const r=n?e.trim():e;if(r.length===0)return[];const i=wt(r),o=[];let s="",c=0,l=0;for(;l<i.length;){const a=i[l],u=Se.test(a),h=I(a);if(a.length===0){l+=1;continue}if(n&&u&&c===0){l+=1;continue}if(c+h>t&&c>0){n?o.push(z(s)):o.push(s),s="",c=0;continue}s+=a,c+=h,l+=1}return s&&(n?o.push(z(s)):o.push(s)),o},ni=(e,t,n)=>{if(e.length===0)return[];const r=n?e.trim():e;if(r.length===0)return[];const i=wt(r),o=[];let s="",c=0,l=0;for(;l<i.length;){const a=i[l],u=Se.test(a),h=I(a);if(a.length===0){l+=1;continue}if(n&&u&&c===0){l+=1;continue}if(h>t){s&&o.push(n?z(s):s);const g=St(a,t,n);if(g.length>0){for(let f=0;f<g.length-1;f+=1)o.push(g[f]);s=g.at(-1),c=I(s)}else s="",c=0;l+=1;continue}if(c+h>t&&c>0&&(o.push(n?z(s):s),s="",c=0,n&&u)){l+=1;continue}s+=a,c+=h,l+=1}return s&&o.push(n?z(s):s),o},U={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},ri=(e,t={})=>{const{removeZeroWidthCharacters:n=!0,trim:r=!0,width:i=80,wrapMode:o=U.PRESERVE_WORDS}=t;if(r&&e.trim()==="")return"";let s=e.normalize("NFC").replaceAll(`\r
31
+ `,`
32
+ `);return n&&(s=s.replaceAll(Tr,"")),s.split(`
33
+ `).map(c=>{if(r&&c.trim()==="")return"";let l;switch(o){case U.BREAK_AT_CHARACTERS:{l=ei(c,i,r);break}case U.BREAK_WORDS:{l=ni(c,i,r);break}case U.STRICT_WIDTH:{l=St(c,i,r);break}default:l=ti(c,i,r)}return Yr(l)}).join(`
34
+ `)},vt=80,At=24,me=(e,t,{shell:n,env:r}={})=>Tt(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:n,env:r}).trim(),ee=(e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),Et=(e,t)=>{const{columns:n,rows:r}=ee(e,t);if(!(Number.isNaN(n)||Number.isNaN(r))&&!(n===vt&&r===At))return{columns:n,rows:r}},ii=()=>{if(T.platform!=="linux")return!0;try{const e=D.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const n=e.slice(t+2).trim().split(/\s+/),r=Number.parseInt(n[2],10),i=Number.parseInt(n[5],10);return Number.isNaN(r)||Number.isNaN(i)||i<=0?!1:r===i}catch{return!1}};function si(){const{env:e,stdout:t,stderr:n}=T;if(t?.columns&&t?.rows)return ee(t.columns,t.rows);if(n?.columns&&n?.rows)return ee(n.columns,n.rows);if(e.COLUMNS&&e.LINES)return ee(e.COLUMNS,e.LINES);const r={columns:vt,rows:At};return T.platform==="win32"?ue()??r:T.platform==="darwin"?qe()??ue()??r:qe()??ue()??oi()??r}const qe=()=>{try{const e=T.platform==="darwin"?D.constants.O_EVTONLY|D.constants.O_NONBLOCK:D.constants.O_NONBLOCK,{columns:t,rows:n}=Mt.WriteStream(D.openSync("/dev/tty",e));return{columns:t,rows:n}}catch{}},ue=()=>{try{const e=me("tput",["cols"],{env:{TERM:"dumb",...T.env}}),t=me("tput",["lines"],{env:{TERM:"dumb",...T.env}});if(e&&t)return Et(e,t)}catch{}},oi=()=>{try{if(!ii())return;const e=me("resize",["-u"]).match(/\d+/g);if(e.length===2)return Et(e[0],e[1])}catch{}},ci=e=>{const t=Object.keys(e).map(n=>e[n].badge??"");return t.length===0?"":t.reduce((n,r)=>n.length>r.length?n:r,"")},li=e=>{const t=Object.keys(e).map(n=>e[n].label??"");return t.length===0?"":t.reduce((n,r)=>n.length>r.length?n:r,"")},{bold:ai,cyan:ui,green:Je,grey:fi,magenta:hi,red:di,yellow:fe}=te,pi={indent:2,quoteStyle:"single",stylize:(e,t)=>{const n={bigint:fe,boolean:fe,date:hi,null:ai,number:fe,regexp:di,special:ui,string:Je,symbol:Je,undefined:fi};return Object.hasOwn(n,t)?n[t](e):e}},{bold:gi,underline:mi}=te,yi=(e,t)=>{let n=t.uppercase.label?e.toUpperCase():e;return n=t.underline.label?mi(n):n,t.bold.label&&(n=gi(n)),n},$i=e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":");class bi{styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:$i,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=jt}setLoggerTypes(t){this.loggerTypes=t}}const{bgGrey:wi,cyan:Si,green:vi,greenBright:Ai,grey:E,red:he,underline:Ke,white:Ei}=te,Ii=/[\\/]pail[\\/]dist/,de=e=>!Ii.test(e);class Ti extends bi{#e;#r;#i;#c=!1;#s;#n;#t;#o=!1;#l="";#a="";constructor(t={}){const{error:n,inspect:r,...i}=t;super({uppercase:{label:!0,...i.uppercase},...i}),this.#s={...pi,...r},this.#n={...n,color:{fileLine:vi,hint:Si,marker:he,message:he,method:Ai,title:he}},this.#e=Ot,this.#r=kt,this.#u()}setLoggerTypes(t){super.setLoggerTypes(t),this.#u()}setStdout(t){this.#e=t,this.#t=void 0,this.#o=!1}setStderr(t){this.#r=t}setInteractiveManager(t){this.#i=t}setIsInteractive(t){this.#c=t}log(t){this._log(this._formatMessage(t),t.type.level)}#u(){this.#l=ci(this.loggerTypes),this.#a=li(this.loggerTypes)}#f(){return!this.#o&&typeof this.#e.on=="function"&&(this.#o=!0,this.#e.on("resize",()=>{this.#t=void 0})),this.#t===void 0&&(this.#t=si().columns),this.#t}_formatMessage(t){let n=this.#f();typeof this.styles.messageLength=="number"&&(n=this.styles.messageLength);const{badge:r,context:i,date:o,error:s,file:c,groups:l,label:a,message:u,prefix:h,repeated:g,scope:f,suffix:d,traceError:p,type:m}=t,{color:y}=this.loggerTypes[m.name],w=y?te[y]:Ei,S=l.map(()=>" ").join(""),$=[];if(l.length>0&&$.push(`${S+E(`[${l.at(-1)??""}]`)} `),o&&$.push(`${E(this.styles.dateFormatter(typeof o=="string"?new Date(o):o))} `),r)$.push(w(r));else{const b=this.#l;b.length>0&&$.push(`${E(".".repeat(b.length))} `)}const v=this.#a;if(a){const b=I(v),N=I(a);$.push(`${w(yi(a,this.styles))} `,E(".".repeat(Math.max(0,b-N))))}else $.push(E(".".repeat(v.length+2)));g&&$.push(`${wi.white(`[${String(g)}x]`)} `),Array.isArray(f)&&f.length>0&&$.push(` ${E(`[${f.join(" > ")}]`)} `),h&&$.push(`${E(`${Array.isArray(f)&&f.length>0?". ":" "}[${this.styles.underline.prefix?Ke(h):h}]`)} `);const A=I($.join(" "));if(c){const b=(c.name??"")+(c.line?`:${String(c.line)}`:""),N=I(b);if(N+A+2>n)$.push(E(` ${b}`));else{const se=Math.max(0,n-A-N-2);$.push(E(`${".".repeat(se)} ${b}`))}}else $.push(E(".".repeat(Math.max(0,n-A-1))));if($.length>0&&$.push(`
35
+
36
+ `),u!==Wt){const b=typeof u=="string"?u:Ce(u,this.#s);$.push(S+ri(b,{trim:!1,width:n-3,wrapMode:U.PRESERVE_WORDS}))}if(i){let b=!1;$.push(...i.map(N=>{if(N instanceof Error)return b=!0,`
37
+
38
+ ${oe(N,{...this.#n,filterStacktrace:de,prefix:S})}`;if(typeof N=="object")return` ${Ce(N,this.#s)}`;const se=(b?`
39
+
40
+ `:" ")+String(N);return b=!1,se}))}return s&&$.push(oe(s,{...this.#n,filterStacktrace:de,prefix:S})),p&&$.push(`
41
+
42
+ ${oe(p,{...this.#n,filterStacktrace:de,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:S})}`),d&&$.push(`
43
+ `,S+E(this.styles.underline.suffix?Ke(d):d)),$.join("")}_log(t,n){const r=Bt(n)?"stderr":"stdout",i=r==="stderr"?this.#r:this.#e;this.#c&&this.#i!==void 0&&i.isTTY?this.#i.update(r,t.split(`
44
+ `),0):Lt(`${t}
45
+ `,i)}}export{Ti as PrettyReporter};
@@ -0,0 +1,34 @@
1
+ import{createRequire as yt}from"node:module";import De from"@visulima/colorize";let bt;const $t=e=>(bt??=yt(import.meta.url))(e),C=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:O,ue=e=>{if(typeof C<"u"&&C.versions&&C.versions.node){const[t,n]=C.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return C.getBuiltinModule(e)}return $t(e)},O=C,{execFileSync:wt}=ue("node:child_process"),P=ue("node:fs"),vt=ue("node:tty"),ro={alert:7,critical:6,debug:1,emergency:8,error:5,informational:2,notice:3,trace:2,warning:4},St={alert:{color:"red",label:"alert",logLevel:"alert"},await:{color:"blue",label:"awaiting",logLevel:"informational"},complete:{color:"cyan",label:"complete",logLevel:"informational"},critical:{color:"redBright",label:"critical",logLevel:"critical"},debug:{color:"gray",label:"debug",logLevel:"debug"},emergency:{color:"redBright",label:"emergency",logLevel:"emergency"},error:{color:"red",label:"error",logLevel:"error"},info:{color:"blueBright",label:"info",logLevel:"informational"},log:{label:"",logLevel:"informational"},notice:{color:"magentaBright",label:"notice",logLevel:"notice"},pending:{color:"magenta",label:"pending",logLevel:"informational"},start:{color:"greenBright",label:"start",logLevel:"informational"},stop:{color:"red",label:"stop",logLevel:"informational"},success:{color:"green",label:"success",logLevel:"informational"},trace:{color:"cyanBright",label:"trace",logLevel:"trace"},wait:{color:"blue",label:"waiting",logLevel:"informational"},warn:{color:"yellow",label:"warning",logLevel:"warning"},warning:{color:"yellow",label:"warning",logLevel:"warning"},watch:{color:"yellowBright",label:"watching",logLevel:"informational"}},oo=Symbol("EMPTY"),io=e=>{const t=Object.keys(e).map(n=>e[n].label??"");return t.length===0?"":t.reduce((n,r)=>n.length>r.length?n:r,"")},E="[Inspection threw]",$=(e,t,n,r,o,s=", ",i=Number.POSITIVE_INFINITY)=>{const l=e.length;if(l===0)return"";const c=Number.isFinite(i)&&l>i,a=c?Math.max(0,Math.floor(i)):l;if(a===0)return`…(${String(l)})`;let u=r;o!==void 0&&(u=o);const f=n.truncate,p=Number.isFinite(f);let d="",h="",g="";for(let m=0;m<a;m+=1){const y=m+1===a,b=m+2===a;p&&(g=`…(${String(a-m)})`);let v=e[m];n.truncate=f-d.length-(y?0:s.length);const I=h||u(v,t,n,r)+(y?"":s),w=d.length+I.length,T=w+g.length;if(y&&w>f&&d.length+g.length<=f||!y&&!b&&T>f)break;v=e[m+1];const B=b?"":s;if(y?h="":h=u(v,t,n,r)+B,!y&&b&&T>f&&w+h.length>f)break;if(d+=I,!y&&!b&&w+h.length>=f){g=`…(${String(a-m-1)})`;break}g=""}return c&&g===""&&(g=`${s}… ${String(l-a)} more`),`${d}${g}`},At=([e,t],n,r)=>(r.truncate-=3,t?`${r.stylize(String(e),"yellow")}=${r.stylize(`"${t}"`,"string")}`:r.stylize(String(e),"yellow")),Ve=e=>{try{return Object.create(e,{length:{value:e.length}})}catch{return}},Et=(e,t,n,r)=>{let o;try{o=e.nodeType}catch{return E}if(o===1)return Ue(e,e,n,r);if(o===3){let s;try{s=e.data}catch{return E}return r(s,void 0,n)}return r(e,void 0,n)},le=(e,t,n,r)=>{const o=Ve(e);return o===void 0?E:$(o,e,t,n,Et,`
2
+ `)},Ue=(e,t,n,r)=>{let o,s;try{o=e.getAttributeNames().map(d=>[d,e.getAttribute(d)]),s=e.tagName.toLowerCase()}catch{return E}const i=n.stylize(`<${s}`,"special"),l=n.stylize(">","special"),c=n.stylize(`</${s}>`,"special");n.truncate-=s.length*2+5;let a="";o.length>0&&(a+=" ",a+=$(o,t,n,r,At," ")),n.truncate-=a.length;const{truncate:u}=n;let f;try{f=Ve(e.children)}catch{f=void 0}let p;return f===void 0?p=E:(p=le(f,n,r),p&&p.length>u&&(p=`…(${String(f.length)})`)),`${i}${a}${l}${p}${c}`},Nt=(e,t,n)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${$(e,e,t,n,void 0,", ",t.maxArrayLength)} ]`),It=(e,t)=>{let n;if(e===" ")n=" ";else if(typeof e=="number"&&e>0)n=Array.from({length:e+1}).join(" ");else return;return{base:n,prev:`
3
+ ${Array.from({length:t+1}).join(n)}`}},Z=(e,t)=>{if(e.length===0)return"";const n=t.prev+t.base;return n+e.split("\0\0").join(`,${n}`)+t.prev},xt=/^[a-z_]\w*$/i,Ot=/^"|"$/g,kt=(e,t)=>{if(xt.test(e))return e;const n=JSON.stringify(e);return t.quoteStyle==="double"?n.replaceAll('"',String.raw`\"`):n.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(Ot,"'")},D=([e,t],n,r,o)=>{r.truncate-=2;let s;typeof e=="string"?s=kt(e,r):typeof e=="number"?s=String(e):s=`[${o(e,n,r)}]`,r.truncate-=s.length;const i=o(t,n,r);return`${s}: ${i}`},Lt=Symbol.for("chai/inspect"),ne=e=>({[Lt]:()=>e}),V=(e,t)=>{let n;try{n=Object.getOwnPropertyDescriptor(e,t)}catch{n=void 0}if(n===void 0||"value"in n)try{return e[t]}catch{return ne(E)}if(n.get===void 0)return ne("[Setter]");try{return e[t]}catch{return ne(E)}},Tt=e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},Bt=e=>{const t=[];for(const n of Object.keys(e)){const r=Number(n);Number.isInteger(r)&&r>=0&&String(r)===n&&r<4294967295||t.push(n)}return t},jt=(e,t,n,r)=>{const o=Bt(e);if(e.length===0&&o.length===0)return"[]";t.truncate-=4;const s=!!r&&Tt(e);let i=$(e,e,t,n,void 0,s?"\0\0":", ",t.maxArrayLength);t.truncate-=i.length;let l="";return o.length>0&&(l=$(o.map(c=>[c,V(e,c)]),e,t,n,D)),s&&r&&(i=Z(i,r)),`[${s?"":" "}${i}${l?`, ${l}`:""}${s?"":" "}]`},Wt=50,pe=(e,t)=>{const n=new Uint8Array(e),r=Math.min(n.length,Wt);let o="",s=!1;for(let a=0;a<r;a+=1){const u=n[a];u!==0&&(s=!0),o+=(a===0?"":" ")+u.toString(16).padStart(2,"0")}n.length>r&&(o+=` ... ${String(n.length-r)} more byte${n.length-r===1?"":"s"}`);const i=e instanceof ArrayBuffer?"ArrayBuffer":"SharedArrayBuffer",l=s||n.length>r,c=o!==""&&l?`[Uint8Contents]: <${o}>, `:"";return`${t.stylize(i,"special")} { ${c}byteLength: ${t.stylize(String(e.byteLength),"number")} }`},me=/\d(?=(?:\d{3})+(?!\d))/g,Mt=/\d{3}/g,_t=/_$/,Ge=(e,t)=>{if(t.length<4||t.length===4&&t.codePointAt(0)===45||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY||t.includes("e"))return t;if(typeof e=="number"){const n=e<0?-Math.floor(-e):Math.floor(e);if(n!==e){const r=String(n),o=t.slice(r.length+1);return`${r.replace(me,"$&_")}.${o.replace(Mt,"$&_").replace(_t,"")}`}}return t.replace(me,"$&_")},Ft=e=>e>="\uD800"&&e<="\uDBFF",L=(e,t,n="…")=>{e=String(e);const r=n.length,o=e.length;if(r>t&&o>r)return n;if(o>t&&o>r){let s=t-r;return s>0&&Ft(e[s-1])&&(s-=1),`${e.slice(0,s)}${n}`}return e},ye=(e,t)=>{let n=L(e.toString(),t.truncate-1);return n!=="…"&&(n+="n"),t.stylize(t.numericSeparator?Ge(e,n):n,"bigint")},He=e=>{try{return Array.isArray(e)}catch{return!1}},W=(e,t)=>{try{return e[t]}catch{return}},zt=(e,t)=>{try{return e instanceof t}catch{return!1}},be=(e,t)=>{try{return Object.getOwnPropertyDescriptor(e,t)?.enumerable??!1}catch{return!0}},Ct=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),K=(e,t,n,r)=>{if("window"in globalThis&&e===globalThis)return"{ [object Window] }";if(e===globalThis)return"{ [object globalThis] }";let o,s;try{o=Object.getOwnPropertyNames(e),s=Object.getOwnPropertySymbols(e)}catch{return E}let i,l;try{i=t.showHidden?o:o.filter(d=>Object.getOwnPropertyDescriptor(e,d)?.enumerable)}catch{i=o.filter(d=>be(e,d))}try{l=s.filter(d=>t.showHidden||Object.getOwnPropertyDescriptor(e,d)?.enumerable)}catch{l=s.filter(d=>be(e,d))}let c;try{const d=Ct(e)===Object.prototype||e.constructor===Object,h=e instanceof Object?"":"null prototype";let g;!d&&Symbol.toStringTag in e?g=e[Symbol.toStringTag]:g=h?"Object":"",c=g||h?`[${[g,h].filter(Boolean).join(": ")}] `:""}catch{c=""}if(i.length===0&&l.length===0)return`${c}{}`;t.truncate-=4;const a=r?"\0\0":", ",u=$(i.map(d=>[d,V(e,d)]),e,t,n,D,a),f=$(l.map(d=>[d,V(e,d)]),e,t,n,D,a);let p="";return u&&f&&(p=a),r?`${c}{${Z(u+p+f,r)}}`:`${c}{ ${u}${p}${f} }`},Rt=(e,t,n,r)=>{let o;try{o=typeof e.constructor=="function"?e.constructor.name:""}catch{o=""}return(!o||o==="_class")&&(o="<Anonymous Class>"),t.truncate-=o.length,`${o} ${K(e,t,n,r)}`},Pt=(e,t)=>{const n=t.stylize(String(e.byteLength),"number"),r=t.stylize(String(e.byteOffset),"number"),o=t.stylize(String(e.buffer.byteLength),"number");return`${t.stylize("DataView","special")} { byteLength: ${n}, byteOffset: ${r}, buffer: ArrayBuffer { byteLength: ${o} } }`},Dt=(e,t)=>{const n=e.toJSON();if(n===null)return"Invalid Date";const r=n.split("T"),o=r[0];return t.stylize(`${o}T${L(r[1],t.truncate-o.length-1)}`,"date")},Vt=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),Ut=(e,t,n)=>{const r=Object.getOwnPropertyNames(e).filter(l=>!Vt.has(l)),{name:o}=e;t.truncate-=o.length;let s="";typeof e.message=="string"?s=L(e.message,t.truncate):r.unshift("message"),s=s?`: ${s}`:"",t.truncate-=s.length+5;const i=$(r.map(l=>[l,V(e,l)]),e,t,n,D);return`${o}${s}${i?` { ${i} }`:""}`},$e=(e,t)=>{let n,r,o;try{n=e[Symbol.toStringTag]||"Function",r=e.toString(),{name:o}=e}catch{return t.stylize(E,"special")}return r.length<t.truncate-12?t.stylize(`[${n}: ${r}]`,"special"):o?t.stylize(`[${n} ${L(o,t.truncate-11)}]`,"special"):t.stylize(`[${n}]`,"special")},we=(e,t)=>{const n=W(e,Symbol.toStringTag),r=typeof n=="string"?n:"Generator";return`${t.stylize(`Object [${r}]`,"special")} {}`},Gt=([e,t],n,r,o)=>(r.truncate-=4,e=o(e,n,r),r.truncate-=e.length,`${e} => ${o(t,n,r)}`),Ht=(e,t,n,r)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let o=$([...e.entries()],e,t,n,Gt,r?"\0\0":", ",t.maxArrayLength);return r&&(o=Z(o,r)),`Map (${String(e.size)}) {${r?"":" "}${o}${r?"":" "}}`};function ve(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(L(t.numericSeparator?Ge(e,e.toString()):e.toString(),t.truncate),"number")}const Yt=()=>"Promise{…}",qt=(e,t)=>{const n=t.truncate-(2+e.flags.length);return t.stylize(`/${L(e.source,n)}/${e.flags}`,"regexp")},Jt=(e,t,n,r)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let o=$([...e],e,t,n,void 0,r?"\0\0":", ",t.maxArrayLength);return r&&(o=Z(o,r)),`Set (${String(e.size)}) {${r?"":" "}${o}${r?"":" "}}`},Kt=(e,t)=>{const n=t.quoteStyle==="double"?'"':"'";return n+e+n},Se=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"),Xt={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},Qt=16,Zt=e=>Xt[e]||String.raw`\u${`0000${e.codePointAt(0).toString(Qt)}`.slice(-4)}`,Ae=(e,t)=>(Se.test(e)&&(e=e.replaceAll(Se,Zt)),t.stylize(Kt(L(e,t.truncate-2),t),"string")),Ee=e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),en=e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],S=(e,t,n)=>{const r=en(e);t.truncate-=r.length+4;const o=Object.keys(e).slice(e.length);if(e.length===0&&o.length===0)return`${r}[]`;let s="";const i=Number.isFinite(t.maxArrayLength)?Math.min(e.length,Math.max(0,Math.floor(t.maxArrayLength))):e.length;for(let c=0;c<i;c++){const a=`${t.stylize(L(e[c],t.truncate),"number")}${c===i-1?"":", "}`;if(t.truncate-=a.length,c!==i-1&&t.truncate<=3){s+=`…(${String(e.length-c)})`;break}s+=a}i<e.length&&(s+=`${s?", ":""}… ${String(e.length-i)} more`);let l="";return o.length>0&&(l=$(o.map(c=>[c,V(e,c)]),e,t,n,D)),`${r}[ ${s}${l?`, ${l}`:""} ]`},Ne=e=>typeof W(e,Symbol.toStringTag)!="string",tn=e=>typeof e=="function",Ye=(e,t,n)=>{if(e==null)return;const r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0)return;const o=n==="get"?r.get:r.value;return typeof o=="function"?o:void 0},qe=(e,t)=>{if(e!==void 0)return n=>{try{return e.call(n,t),!0}catch{return!1}}},j=(e,t)=>qe(Ye(e,t,"get")),x=(e,t,n)=>qe(Ye(e,t,"value"),n),Ie=Object.freeze({}),A=j(Reflect.getPrototypeOf(Int8Array.prototype),"length"),nn=typeof SharedArrayBuffer=="function"?SharedArrayBuffer.prototype:void 0,rn=Object.assign(Object.create(null),{Arguments:Ne,Array:He,ArrayBuffer:j(ArrayBuffer.prototype,"byteLength"),BigInt:x(BigInt.prototype,"valueOf"),Boolean:x(Boolean.prototype,"valueOf"),DataView:j(DataView.prototype,"byteLength"),Date:x(Date.prototype,"valueOf"),Error:Ne,Float32Array:A,Float64Array:A,Function:tn,Int8Array:A,Int16Array:A,Int32Array:A,Map:j(Map.prototype,"size"),Number:x(Number.prototype,"valueOf"),RegExp:j(RegExp.prototype,"source"),Set:j(Set.prototype,"size"),SharedArrayBuffer:j(nn,"byteLength"),String:x(String.prototype,"valueOf"),Symbol:x(Symbol.prototype,"valueOf"),Uint8Array:A,Uint8ClampedArray:A,Uint16Array:A,Uint32Array:A,WeakMap:x(WeakMap.prototype,"has",Ie),WeakSet:x(WeakSet.prototype,"has",Ie)}),on=(e,t)=>{const n=rn[t];return n===void 0||n(e)},xe=new WeakMap,Oe=Object.create(null),sn=Object.assign(Object.create(null),{Arguments:Nt,Array:jt,ArrayBuffer:pe,AsyncGenerator:we,BigInt:ye,bigint:ye,Boolean:(e,t)=>t.stylize(String(e),"boolean"),boolean:(e,t)=>t.stylize(String(e),"boolean"),DataView:Pt,Date:Dt,Error:Ut,Float32Array:S,Float64Array:S,Function:$e,function:$e,Generator:we,HTMLCollection:le,Int8Array:S,Int16Array:S,Int32Array:S,Map:Ht,NodeList:le,null:(e,t)=>t.stylize("null","null"),Number:ve,number:ve,Promise:Yt,RegExp:qt,Set:Jt,SharedArrayBuffer:pe,String:Ae,string:Ae,Symbol:Ee,symbol:Ee,Uint8Array:S,Uint8ClampedArray:S,Uint16Array:S,Uint32Array:S,undefined:(e,t)=>t.stylize("undefined","undefined"),WeakMap:(e,t)=>t.stylize("WeakMap{…}","special"),WeakSet:(e,t)=>t.stylize("WeakSet{…}","special")}),ln=Symbol.for("nodejs.util.inspect.custom"),cn=Symbol.for("chai/inspect"),an=(e,t,n,r)=>{const o=W(e,cn);if(typeof o=="function")return o.call(e,t);if(!("window"in globalThis)){const c=W(e,ln);if(typeof c=="function")return c.call(e,r,t)}const s=W(e,"inspect");if(typeof s=="function")return s.call(e,r,t);const i=W(e,"constructor");if(typeof i=="function"&&xe.has(i))return xe.get(i)?.(e,t)??"unknown";const l=Object.hasOwn(Oe,n)?Oe[n]:void 0;return l?l(e,t):""},re=(e,t,n)=>{const{depth:r,inspect:o,seen:s}=n;if(s.includes(e))return"[Circular]";if(r>=t.depth&&t.depth>0&&typeof e=="object"&&e!==null)return He(e)?"[Array]":"[Object]";const i=t.indent?It(t.indent,r):void 0;let l=e===null?"null":typeof e;if(l==="object")try{l=Object.prototype.toString.call(e).slice(8,-1)}catch{l="Object"}let c=sn[l];if(c!==void 0&&typeof e=="object"&&e!==null&&!on(e,l)&&(c=void 0),c!==void 0)return c(e,t,o,i);if(t.customInspect&&e){const f=an(e,t,l,t.depth-r);if(f)return typeof f=="string"?f:o(f,e,t)}let a=!1;if(e)try{a=Object.getPrototypeOf(e)}catch{a=Object.prototype}if(a===Object.prototype||a===null)return K(e,t,o,i);if(e&&typeof HTMLElement=="function"&&zt(e,HTMLElement))return Ue(e,e,t,o);const u=W(e,"constructor");return u!==void 0?u!==Object?Rt(e,t,o,i):K(e,t,o,i):e===Object(e)?K(e,t,o,i):t.stylize(String(e),l)},so=(e,t={})=>{const n={customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,stylize:o=>o,truncate:Number.POSITIVE_INFINITY,...t};if(n.indent!==void 0&&n.indent!==" "&&!(Number.parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');const r={depth:0,inspect:void 0,seen:[]};return r.inspect=(o,s,i)=>{if(s==null){r.depth+=1;const c=re(o,i,r);return r.depth-=1,c}r.seen.push(s),r.depth+=1;const l=re(o,i,r);return r.depth-=1,r.seen.pop(),l},re(e,n,r)},un=new Set(["alert","critical","emergency","error","trace","warning"]),lo=e=>un.has(e),co=(e,t)=>t?(t.__write??t.write.bind(t)).call(t,e):!1,fn=globalThis.process??Object.create(null),ke={versions:{}},U=new Proxy(fn,{get(e,t){if(t in e)return e[t];if(t in ke)return ke[t]}}),ee=e=>{let t;return()=>{if(t===void 0){if(typeof U.getBuiltinModule!="function")throw new TypeError(`[@visulima/error] Cannot load ${e}: this runtime implements no process.getBuiltinModule(). Requires Node ^22.14.0 || >=24.10.0, or another runtime providing process.getBuiltinModule().`);t=U.getBuiltinModule(e)}return t}},dn=e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
4
+ `),hn=(e,t,n,r)=>{const o={column:0,line:-1,...e.start},s={...o,...e.end},i=o.line,l=o.column,c=s.line,a=s.column;let u=Math.max(i-(n+1),0),f=Math.min(t.length,c+r);i===-1&&(u=0),c===-1&&(f=t.length);const p=c-i,d={};if(p)for(let h=0;h<=p;h++){const g=h+i;if(!l)d[g]=!0;else if(h===0){const m=t[g-1]?.length;d[g]=[l,(m??0)-l+1]}else if(h===p)d[g]=[0,a];else{const m=t[g-h]?.length;d[g]=[0,m]}}else l===a?d[i]=l?[l,0]:!0:d[i]=[l,(a??0)-(l??0)];return{end:f,markerLines:d,start:u}},gn=U.platform==="win32"&&!U.env?.WT_SESSION?">":"❯",pn=(e,t,n)=>{const r={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...n,color:{gutter:h=>h,marker:h=>h,message:h=>h,...n?.color}},o=typeof t.start.column=="number";let s=(e.includes("\r")?dn(e):e).split(`
5
+ `);typeof r.tabWidth=="number"&&e.includes(" ")&&(s=s.map(h=>h.replaceAll(" "," ".repeat(r.tabWidth))));const{end:i,markerLines:l,start:c}=hn(t,s,r.linesAbove,r.linesBelow),a=String(i).length,{gutter:u,marker:f,message:p}=r.color;let d=s.slice(c,i).map((h,g)=>{const m=c+1+g,y=l[m],b=String(m).padStart(a),v=!l[m+1],I=` ${b}${r.showGutter?" |":""}`;if(y){let w="";if(Array.isArray(y)){const T=h.replaceAll(/[^\t]/g," ").slice(0,Math.max(y[0]-1,0)),B=y[1]||1;w=[`
6
+ `,r.prefix+u(I.replaceAll(/\d/g," "))," ",T,f("^").repeat(B)].join(""),v&&r.message&&(w+=` ${p(r.message)}`)}return[r.prefix+f(gn),u(I),h.length>0?` ${h}`:"",w].join("")}return`${r.prefix} ${u(I)}${h.length>0?` ${h}`:""}`}).join(`
7
+ `);return r.message&&!o&&(d=`${r.prefix+" ".repeat(a+1)+r.message}
8
+ ${d}`),d},mn=()=>U.env?.DEBUG==="true",_=(e,...t)=>{if(mn()){const n=t.map(r=>typeof r=="function"?r():r);console.debug(`error:parse-stacktrace: ${e}`,...n)}},F="<unknown>",yn=/^(?:node:internal\/|node:|internal\/)/,bn=e=>e!==void 0&&yn.test(e),$n=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,wn=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,vn=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,Sn=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,An=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,En=/in\s(.*)\s\(at\s(.+)\)\sat/,Nn=/^(?:.*@)?(.*):(\d+):(\d+)$/,In=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,xn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,On=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,Le=/\(error: ([^)]*)\)/,kn=/at\s/,Ln=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,Tn=/Error: |AggregateError:/,Je=/^Anonymous function$/,Bn=/^\s*in\s.*/,jn=/^.*?\s*at\s.*/,Wn=/^.*?\s*@.*|\[native code\]/,Ke=(e,t)=>{const n=e.includes("safari-extension"),r=e.includes("safari-web-extension");return n||r?[e.includes("@")?e.split("@")[0]:F,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Xe=(e,t)=>{const n=vn.exec(t);n&&(e.file=n[1],e.line=+n[2],e.column=+n[3])},Mn=e=>{const t=En.exec(e);if(t){_(`parse nested node error stack line: "${e}"`,()=>`found: ${JSON.stringify(t)}`);const r=t[2].split(":");return{column:r[2]?+r[2]:void 0,file:r[0],line:r[1]?+r[1]:void 0,methodName:t[1]??F,raw:e,type:void 0}}const n=An.exec(e);if(n){_(`parse node error stack line: "${e}"`,()=>`found: ${JSON.stringify(n)}`);const r={column:n[4]?+n[4]:void 0,file:n[2]?n[2].replace(kn,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]??F,raw:e,type:e.startsWith("internal")?"internal":void 0};return Xe(r,`${n[2]}:${n[3]}:${n[4]}`),r}},_n=e=>{const t=$n.exec(e);if(t){_(`parse chrome error stack line: "${e}"`,()=>`found: ${JSON.stringify(t)}`);const n=t[2]?.startsWith("native"),r=t[2]?.startsWith("eval")||t[1]?.startsWith("eval");let o,s;if(r){const a=wn.exec(e);if(a){const u=Ln.exec(a[1]);u?(t[2]=u[4]??u[1],t[3]=u[5]??u[2],t[4]=u[3]):a[2]&&(t[2]=a[1]),a[2]&&(o={column:a[4]?+a[4]:void 0,file:a[2],line:a[3]?+a[3]:void 0,methodName:"eval",raw:e,type:"eval"})}else{const u=Sn.exec(e);u&&(s={column:u[4]?+u[4]:void 0,file:u[2],line:u[3]?+u[3]:void 0},o={column:u[6]?+u[6]:void 0,file:u[1],line:u[5]?+u[5]:void 0,methodName:"eval",raw:u[0],type:"eval"})}}const[i,l]=Ke(t[1]?t[1].replace(Je,"<anonymous>"):F,t[2]),c={column:t[4]?+t[4]:void 0,evalOrigin:o,file:l,line:t[3]?+t[3]:void 0,methodName:i,raw:e,type:r?"eval":n?"native":bn(l)?"internal":void 0};return s?(c.column=s.column,c.file=s.file,c.line=s.line):Xe(c,`${l}:${t[3]}:${t[4]}`),c}},Fn=(e,t)=>{const n=In.exec(e);if(n){_(`parse gecko error stack line: "${e}"`,()=>`found: ${JSON.stringify(n)}`);const r=n[3]?.includes(" > eval"),o=r&&n[3]&&xn.exec(n[3]);let s;r&&o&&(n[3]=o[1],s={column:n[5]?+n[5]:void 0,file:n[3],line:n[4]?+n[4]:void 0,methodName:"eval",raw:e,type:"eval"},n[4]=o[2]);const[i,l]=Ke(n[1]?n[1].replace(Je,"<anonymous>"):F,n[3]);let c;(t?.type==="safari"||!r&&t?.type==="firefox")&&t.column?c=t.column:!r&&n[5]&&(c=+n[5]);let a;return(t?.type==="safari"||!r&&t?.type==="firefox")&&t.line?a=t.line:n[4]&&(a=+n[4]),{column:c,evalOrigin:s,file:l,line:a,methodName:i,raw:e,type:r?"eval":l.includes("[native code]")?"native":void 0}}},zn=(e,t)=>{const n=On.exec(e);if(!(n&&n[2].includes(" > eval"))&&n)return _(`parse firefox error stack line: "${e}"`,()=>`found: ${JSON.stringify(n)}`),{column:n[4]?+n[4]:t?.column??void 0,file:n[2],line:n[3]?+n[3]:t?.line??void 0,methodName:n[1]||F,raw:e,type:void 0}},Cn=e=>{const t=Nn.exec(e);if(t)return _(`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:F,raw:e,type:void 0}},Qe=(e,{filter:t,frameLimit:n=50}={})=>{const r=e;let o=(typeof r.stacktrace=="string"?r.stacktrace:e.stack??"").split(`
9
+ `).map(s=>(Le.test(s)?s.replace(Le,"$1"):s).trim()).filter(s=>!Tn.test(s)&&s!=="eval code");return t&&(o=o.filter(s=>t(s))),o=o.slice(0,n),o.reduce((s,i,l)=>{if(!i||i.length>1024)return s;let c;if(Bn.test(i))c=Mn(i);else if(jn.test(i))c=_n(i);else if(Wn.test(i)){let a;if(l===0){const u=e,f=u.columnNumber,p=u.lineNumber,d=u.line,h=u.column;f||p?a={column:f,line:p,type:"firefox"}:(d||h)&&(a={column:h,line:d,type:"safari"})}c=zn(i,a)??Fn(i,a)}else c=Cn(i);return c?s.push(c):_(`parse error stack line: "${i}"`,"not parser found"),s},[])},Te=ee("node:fs"),X=ee("node:path"),Rn=ee("node:process"),Pn=ee("node:url"),k=(e,t,n)=>n===0?e:t===" "?e+" ".repeat(n):e+" ".repeat(t*n),Ze=e=>e.replaceAll("\\","/"),Dn=e=>{if(!e.startsWith("file:"))return e;try{return Pn().fileURLToPath(e)}catch{return e}},Vn=(e,t)=>{const n=e.replace("async file:","file:");return Ze(X().relative(t,Dn(n)))},Un=(e,t,n)=>{if(t)return n.title(e.message);const r=e.message?`: ${e.message}`:"";return n.title(e.name+r)},et=(e,{color:t,hideErrorTitle:n,indentation:r,prefix:o},s)=>`${k(o,r,s)}${Un(e,n,t)}
10
+ `,tt=(e,{color:t,indentation:n,prefix:r},o)=>{if(e.hint===void 0)return;const s=k(r,n,o);let i="";if(Array.isArray(e.hint))for(const l of e.hint)i+=`${s+l}
11
+ `;else i+=s+e.hint;return t.hint(i)},fe=(e,t)=>{if(!t||e.file===void 0||e.line===void 0)return{trace:e};try{const n=t({column:e.column,file:e.file,line:e.line});return n?{source:n.source,trace:{...e,column:n.column??e.column,file:n.file??e.file,line:n.line??e.line}}:{trace:e}}catch{return{trace:e}}},de=(e,t,n=0)=>{const{color:r,cwd:o,displayShortPath:s,indentation:i,prefix:l}=t,{trace:c}=e;let a;c.file===void 0?a="<unknown>":a=s?Vn(c.file,o):Ze(c.file);const{fileLine:u,method:f}=r;return`${k(l,i,n)}at ${c.methodName?`${f(c.methodName)} `:""}${u(a)}:${u(c.line?.toString()??"")}`},Gn=(e,t)=>{if(t.allowAllFilePaths)return!0;const n=X().resolve(t.cwd),r=X().resolve(n,e);return r===n||r.startsWith(n+X().sep)},Hn=e=>{try{return Te().existsSync(e)?Te().readFileSync(e,"utf8"):void 0}catch{return}},nt=(e,t,n)=>{const{color:r,indentation:o,linesAbove:s,linesBelow:i,prefix:l,showGutter:c,showLineNumbers:a,tabWidth:u}=t,{source:f,trace:p}=e;if(p.file===void 0)return;let d;if(f===void 0){const h=p.file.replace("file://","");if(!Gn(h,t))return;const g=Hn(h);if(g===void 0)return;d=g}else d=f;return pn(d,{start:{column:p.column,line:p.line}},{color:r,linesAbove:s,linesBelow:i,prefix:k(l,o,n),showGutter:c,showLineNumbers:a,tabWidth:u})},rt=(e,t,n)=>{if(e.errors.length===0)return;let r=`${k(t.prefix,t.indentation,n)}Errors:
12
+
13
+ `,o=!0;for(const s of e.errors)o?o=!1:r+=`
14
+
15
+ `,r+=it(s,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},n+1);return`
16
+ ${r}`},Yn=e=>{if(typeof e=="object"&&e!==null)try{return JSON.stringify(e)}catch{return Object.prototype.toString.call(e)}return String(e)},ot=(e,t,n,r=new Set)=>{r.add(e);let o=`${k(t.prefix,t.indentation,n)}Caused by:
17
+
18
+ `;const{cause:s}=e;if(!(s instanceof Error)){const c=Yn(s);return o+=`${k(t.prefix,t.indentation,n)}${t.color.title(c)}
19
+ `,`
20
+ ${o}`}o+=et(s,t,n);const i=Qe(s).shift(),l=tt(s,t,n);if(l&&(o+=`${l}
21
+ `),i){const c=fe(i,t.sourceMap);if(o+=de(c,t,n),!t.hideErrorCauseCodeView){const a=nt(c,t,n);a!==void 0&&(o+=`
22
+ ${a}`)}}if(s instanceof AggregateError){const c=rt(s,t,n);c!==void 0&&(o+=`
23
+ ${c}`)}return s.cause&&(o+=r.has(s)?`
24
+ ${k(t.prefix,t.indentation,n+1)}Caused by: [Circular]`:`
25
+ ${ot(s,t,n+1,r)}`),`
26
+ ${o}`},qn=(e,t)=>(e.length>0?`
27
+ `:"")+e.map(n=>de(fe(n,t.sourceMap),t)).join(`
28
+ `),it=(e,t,n)=>{const r={allowAllFilePaths:!1,cwd:Rn().cwd(),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:l=>l,gutter:l=>l,hint:l=>l,marker:l=>l,message:l=>l,method:l=>l,title:l=>l,...t.color}},o=Qe(e,{filter:t.filterStacktrace,frameLimit:r.framesMaxLimit}),s=o.shift(),i=s?fe(s,r.sourceMap):void 0;return[t.hideMessage?void 0:et(e,r,n),tt(e,r,n),i?de(i,r,n):void 0,i&&!r.hideErrorCodeView?nt(i,r,n):void 0,e instanceof AggregateError?rt(e,r,n):void 0,e.cause===void 0||e.cause===null?void 0:ot(e,r,n),o.length>0?qn(o,r):void 0].filter(Boolean).join(`
29
+ `)},ao=(e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return it(e,t,0)},Jn=[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],Kn=12288,Xn=65510,Qn=[12288,12288,65281,65376,65504,65510],Zn=8361,er=65518,tr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],nr=32,rr=10630,or=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],ir=4352,sr=262141,st=[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],G=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){const o=Math.floor((n+r)/2),s=o*2;if(t<e[s])r=o-1;else if(t>e[s+1])n=o+1;else return!0}return!1},Be=19968,[lr,cr]=ar(st);function ar(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){const o=e[r],s=e[r+1];if(Be>=o&&Be<=s)return[o,s];s-o>n-t&&(t=o,n=s)}return[t,n]}const ur=e=>e<161||e>1114109?!1:G(Jn,e),fr=e=>e<Kn||e>Xn?!1:G(Qn,e),dr=e=>e<Zn||e>er?!1:G(tr,e),hr=e=>e<nr||e>rr?!1:G(or,e),gr=e=>e>=lr&&e<=cr?!0:e<ir||e>sr?!1:G(st,e);function pr(e){return ur(e)?"ambiguous":fr(e)?"fullwidth":dr(e)?"halfwidth":hr(e)?"narrow":gr(e)?"wide":"neutral"}function mr(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function lt(e){return mr(e),pr(e)}const ct=String.raw,je=ct`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,yr=()=>new RegExp(ct`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${je}(?:\u200D${je})*`,"gu"),N=new Set(["\x1B","›"]),he="\x07",R="]8;;",br=/[\u200B\uFEFF\u2060-\u2064]/g,at=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\)|\][^\u0007\u001B]{0,1000}(?:\u0007|\u001B\\))/g,H=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,$r=yr(),We=new Map,wr=e=>[e.ambiguousIsNarrow?1:0,e.control,e.fullWidth,e.regular,e.wide].join("|"),vr=e=>{const t=wr(e.width);let n=We.get(t);return n||(n=new Map,We.set(t,n)),n},Y=new RegExp(at.source,"y"),oe=new RegExp($r.source,"uy"),q=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,ut=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",Sr=(e,t)=>{const n=vr(t),r=Math.floor(e/65536),o=e%65536;let s=n.get(r);if(s||(s=new Map,n.set(r,s)),s.has(o))return s.get(o);let i;switch(ut(e)){case"control":{i=t.width.control;break}case"latin":{i=t.width.regular;break}case"wide":{i=t.width.wide;break}case"zero":{i=0;break}default:switch(lt(e)){case"ambiguous":{i=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{i=t.width.fullWidth;break}case"wide":{i=t.width.wide;break}default:i=t.width.regular}}return s.set(o,i),i},Ar=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,ce=(e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const n={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?ce(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}},r=Math.max(0,n.truncation.limit-n.truncation.ellipsisWidth),{length:o}=e,s=o>1e4;let i=0,l=0,c=o,a=!1;const u=e.includes("\x1B")||e.includes("›");for(;i<o;){if(u&&(e[i]==="\x1B"||e[i]==="›")){if(e.startsWith("\x1B]8;;",i)){const m="\x1B]8;;\x07",y=m.length,b=e.indexOf("\x07",i+5);if(b!==-1){const v=e.indexOf(m,b+1);if(v!==-1){const I=v+y,w=e.slice(b+1,v).replace(at,""),T=ce(w,{ambiguousIsNarrow:n.width.ambiguousIsNarrow,ansiWidth:n.width.ansi,controlWidth:n.width.control,countAnsiEscapeCodes:!1,ellipsis:n.truncation.ellipsis,ellipsisWidth:n.truncation.ellipsisWidth,emojiWidth:n.width.emoji,fullWidth:n.width.fullWidth,halfWidth:n.width.halfWidth,limit:Math.max(0,r-l),regularWidth:n.width.regular,tabWidth:n.width.tab,wideWidth:n.width.wide}),B=T.width;if(T.truncated)a=!0,c=Math.min(c,i);else if(l+B>r&&(c=Math.min(c,i),a=!0,l+B>n.truncation.limit))break;if(l+=B,i=I,a&&l>=n.truncation.limit)break;continue}}}if(Y.lastIndex=i,Y.test(e)){const m=Y.lastIndex-i,y=n.truncation.countAnsiEscapeCodes?m:n.width.ansi;if(l+y>r&&(c=Math.min(c,i),l+y>n.truncation.limit)){a=!0;break}l+=y,i=Y.lastIndex;continue}}const d=e.codePointAt(i);if(d===8203||d===65279||d>=8288&&d<=8292){i+=1;continue}if(d===9){if(l+n.width.tab>r&&(c=Math.min(c,i),l+n.width.tab>n.truncation.limit)){a=!0;break}l+=n.width.tab,i+=1;continue}if(q.lastIndex=i,q.test(e)){const m=(q.lastIndex-i)*n.width.regular;if(l+m>r){const y=n.width.regular>0?Math.floor((r-l)/n.width.regular):0;if(c=Math.min(c,i+y),l+m>n.truncation.limit){a=!0;break}}l+=m,i=q.lastIndex;continue}if((d<=31||d>=127&&d<=159)&&(H.lastIndex=i,H.test(e))){const m=(H.lastIndex-i)*n.width.control;if(l+m>r){const y=n.width.control>0?Math.floor((r-l)/n.width.control):0;if(c=Math.min(c,i+y),l+m>n.truncation.limit){a=!0;break}}l+=m,i=H.lastIndex;continue}if(oe.lastIndex=i,oe.test(e)){if(l+n.width.emoji>r&&(c=Math.min(c,i),l+n.width.emoji>n.truncation.limit)){a=!0;break}l+=n.width.emoji,i=oe.lastIndex;continue}const h=e.codePointAt(i)??0;if(Ar(h)){i+=h>65535?2:1;continue}let g;if(s)g=Sr(h,n);else switch(ut(h)){case"control":{g=n.width.control;break}case"latin":{g=n.width.regular;break}case"wide":{g=n.width.wide;break}case"zero":{g=0;break}default:switch(lt(h)){case"ambiguous":{g=n.width.ambiguousIsNarrow?n.width.regular:n.width.wide;break}case"fullwidth":{g=n.width.fullWidth;break}case"wide":{g=n.width.wide;break}default:g=n.width.regular}}if(l+g>r&&(c=Math.min(c,i),l+g>n.truncation.limit)){a=!0;break}l+=g,i+=h>65535?2:1}let f=l,p=!1;return a&&n.truncation.limit>=n.truncation.ellipsisWidth&&(f=n.truncation.limit,p=!0),{ellipsed:p,index:a?c:o,truncated:a,width:f}},z=(e,t={})=>ce(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,Er=/^(?:\u001B\[|\u009B)([\d:;]*)m$/,ft=new Map([[1,22],[2,22],[3,23],[4,24],[5,25],[6,25],[7,27],[8,28],[9,29],[21,24],[53,55]]),Nr=new Set(ft.values()),Ir=e=>{const t=e.split(";"),n=[];for(let r=0;r<t.length;r+=1){const o=t[r];if(o.includes(":")){n.push([o]);continue}const s=o===""?0:Number.parseInt(o,10);if(s===38||s===48||s===58){const i=t[r+1];let l=0;i==="5"?l=2:i==="2"?l=4:i?.includes(":")&&(l=1),n.push(t.slice(r,r+1+l)),r+=l;continue}n.push([o])}return n},xr=e=>{const t=e[0],n=t.indexOf(":"),r=n===-1?t:t.slice(0,n);return r===""?0:Number.parseInt(r,10)},Or=e=>e===38||e>=30&&e<=37||e>=90&&e<=97,kr=e=>e===48||e>=40&&e<=47||e>=100&&e<=107;class Lr{activeForeground=void 0;activeBackground=void 0;activeUnderlineColor=void 0;activeAttributes=new Map;processEscape(t){const n=Er.exec(t);if(n)for(const r of Ir(n[1])){const o=xr(r);switch(o){case 0:{this.resetAll();break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}case 59:{this.activeUnderlineColor=void 0;break}default:this.applyParameter(o,`\x1B[${r.join(";")}m`)}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,this.activeUnderlineColor,...this.activeAttributes.values()].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[...this.activeAttributes.keys()].toReversed().map(n=>`\x1B[${String(n)}m`);return this.activeUnderlineColor&&t.push("\x1B[59m"),this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}resetAll(){this.activeForeground=void 0,this.activeBackground=void 0,this.activeUnderlineColor=void 0,this.activeAttributes.clear()}applyParameter(t,n){if(!((t===38||t===48||t===58)&&!n.includes(";")&&!n.includes(":")))if(Or(t))this.activeForeground=n;else if(kr(t))this.activeBackground=n;else if(t===58)this.activeUnderlineColor=n;else if(Nr.has(t))this.activeAttributes.delete(t);else{const r=ft.get(t);r!==void 0&&this.activeAttributes.set(r,n)}}}const Me=/(?:\u{1B}\[|\u{9B})[\u{30}-\u{3F}]*[\u{20}-\u{2F}]*[\u{40}-\u{7E}]/uy,te=(e,t)=>{if(N.has(e[t])){if(e.startsWith(R,t+1)){const n=e.indexOf(he,t);return n===-1?void 0:e.slice(t,n+1)}return Me.lastIndex=t,Me.exec(e)?.[0]}},Tr=(e,t)=>{if(!N.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const n=!0,r=e.slice(t+1,t+1+R.length).join("")===R;return{isInsideEscape:n,isInsideLinkEscape:r}},Br=e=>{let t=0;for(let n=0;n<e.length;n+=1)e.codePointAt(n)>65535&&(n+=1),t+=1;return t},jr=(e,t={})=>{let n="",r=!1,o=0,s="",i="",l=!1;const c=[...e],a=[];for(let u=0,f=0;u<c.length;u+=1)a.push(f),f+=c[u].length;for(let u=0;u<c.length;u++){const f=c[u];if(f&&N.has(f)){if(n){const m=t.getWidth?.(n)??0,y={isEscapeSequence:!1,isGrapheme:!0,text:n,width:m};if(l&&(y.isHyperlink=!0,y.hyperlinkUrl=i),t.onSegment?.(y)===!1)return;n=""}r=!0,o=u,s=f;const h=Tr(c,u),{isInsideLinkEscape:g}=h;if(g){let m=u+1;for(i="";m<c.length;){const b=c[m];if(b===he)break;i+=b,m+=1}i=i.slice(4);const y={hyperlinkUrl:i,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(y)===!1)return;u=m,l=!0,r=!1,s="";continue}if(u+1<c.length&&c[u+1]==="\\"&&l){const m={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(m)===!1)return;l=!1,i="",u+=1,r=!1,s="";continue}}if(r){const h=te(e,a[o]);r=!1,h===void 0?(s=c.slice(o).join(""),u=c.length):(s=h,u=o+Br(h)-1);const g={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};if(t.onSegment?.(g)===!1)return;s="";continue}n+=f;const p=t.getWidth?.(n)??0,d={isEscapeSequence:!1,isGrapheme:!0,text:n,width:p};if(l&&(d.isHyperlink=!0,d.hyperlinkUrl=i),t.onSegment?.(d)===!1)return;n=""}if(n){const u=t.getWidth?.(n)??0,f={isEscapeSequence:!1,isGrapheme:!0,text:n,width:u};l&&(f.isHyperlink=!0,f.hyperlinkUrl=i),t.onSegment?.(f)}if(s){const u={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};t.onSegment?.(u)}},_e=e=>`${N.values().next().value}${R}${e}${he}`,Wr=(e,t,n)=>{let r=n,o=0;for(;o<e.length;){if(!N.has(e[o])){o+=1;continue}const s=te(e,o);if(s===void 0){o+=1;continue}if(e.startsWith(R,o+1)){const i=s.slice(1+R.length,-1);r=i.length===0?void 0:i}else t.processEscape(s);o+=s.length}return r},Mr=e=>{if(e.length===0)return"";if(e.length===1)return e[0];const t=new Lr,n=e.length-1;let r="",o;for(const[s,i]of e.entries())s>0&&(r+=t.getStartEscapesForAllActiveAttributes(),o!==void 0&&(r+=_e(o))),r+=i,o=Wr(i,t,o),s<n&&(o!==void 0&&(r+=_e("")),r+=t.getEndEscapesForAllActiveAttributes(),r+=`
30
+ `);return r},_r=/(?=\s)|(?<=\s)/,Fr=new Intl.Segmenter("en",{granularity:"grapheme"}),zr=/[^\u0000-\u02FF]/,ge=/^\s+$/,Fe=new Map,Cr=e=>{const t=Fe.get(e);if(t!==void 0)return t;const n=z(e);return Fe.set(e,n),n},Rr=e=>{if(!zr.test(e))return[e];const t=[];let n="";for(const{segment:r}of Fr.segment(e)){if(z(r)>1){n!==""&&(t.push(n),n=""),t.push(r);continue}n+=r}return n!==""&&t.push(n),t},ze=e=>e.split(_r).flatMap(t=>t===""||ge.test(t)?[t]:Rr(t)),Ce="x",Pr=e=>{let t="",n=0;for(;n<e.length;){const r=N.has(e[n])?te(e,n):void 0;if(r===void 0){if(N.has(e[n]))return t+Ce.repeat(e.length-n);t+=e[n],n+=1;continue}t+=Ce.repeat(r.length),n+=r.length}return t},dt=e=>{if(![...N].some(r=>e.includes(r)))return ze(e);const t=[];let n=0;for(const r of ze(Pr(e)))t.push(e.slice(n,n+r.length)),n+=r.length;return t},M=e=>{const t=e.split(" ");let n=t.length;for(;n>0&&z(t[n-1])===0;)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},ht=(e,t,n)=>{if(e.length===0)return[""];if(t<=0)return[e];const r=[];let o="",s=0,i=0;for(;i<e.length;){const l=e.codePointAt(i),c=String.fromCodePoint(l),a=c.length;if(N.has(c)){const p=te(e,i);if(p===void 0){o+=e.slice(i);break}o+=p,i+=p.length;continue}const u=Cr(c),f=c===" ";if(u===0){o+=c,i+=a;continue}if(s+u>t&&(o&&r.push(o),o="",s=0,f&&n)){for(;i<e.length&&e[i]===" ";)i+=1;continue}if(o+=c,s+=u,s===t&&i+a<e.length&&(r.push(o),o="",s=0,i+a<e.length&&e[i+a]===" "&&n)){for(i+=a;i<e.length&&e[i]===" ";)i+=1;continue}i+=a}return o&&r.push(o),n?r.map(l=>M(l)):r},Dr=(e,t,n)=>{if(e.length===0)return[];const r=n?e.trim():e;if(r.length===0)return[];const o=[];let s="",i=0;return jr(r,{getWidth:z,onSegment:l=>{const c=l.text??"";if(l.isEscapeSequence)s+=c;else{const a=c===" ";if(l.width===0)return s+=c,!0;if(i+l.width>t&&(s&&o.push(s),s="",i=0,a))return n||o.push(c),!0;s+=c,i+=l.width}return!0}}),s&&o.push(s),n?o.map(l=>M(l)):o},Vr=(e,t,n)=>{if(e.length===0)return[];const r=n?e.trim():e;if(r.length===0)return[];const o=dt(r),s=[];let i="",l=0,c=0;for(;c<o.length;){const a=o[c],u=ge.test(a),f=z(a);if(a.length===0){c+=1;continue}if(n&&u&&l===0){c+=1;continue}if(l+f>t&&l>0){n?s.push(M(i)):s.push(i),i="",l=0;continue}i+=a,l+=f,c+=1}return i&&(n?s.push(M(i)):s.push(i)),s},Ur=(e,t,n)=>{if(e.length===0)return[];const r=n?e.trim():e;if(r.length===0)return[];const o=dt(r),s=[];let i="",l=0,c=0;for(;c<o.length;){const a=o[c],u=ge.test(a),f=z(a);if(a.length===0){c+=1;continue}if(n&&u&&l===0){c+=1;continue}if(f>t){i&&s.push(n?M(i):i);const p=ht(a,t,n);if(p.length>0){for(let d=0;d<p.length-1;d+=1)s.push(p[d]);i=p.at(-1),l=z(i)}else i="",l=0;c+=1;continue}if(l+f>t&&l>0&&(s.push(n?M(i):i),i="",l=0,n&&u)){c+=1;continue}i+=a,l+=f,c+=1}return i&&s.push(n?M(i):i),s},J={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},uo=(e,t={})=>{const{removeZeroWidthCharacters:n=!0,trim:r=!0,width:o=80,wrapMode:s=J.PRESERVE_WORDS}=t;if(r&&e.trim()==="")return"";let i=e.normalize("NFC").replaceAll(`\r
31
+ `,`
32
+ `);return n&&(i=i.replaceAll(br,"")),i.split(`
33
+ `).map(l=>{if(r&&l.trim()==="")return"";let c;switch(s){case J.BREAK_AT_CHARACTERS:{c=Dr(l,o,r);break}case J.BREAK_WORDS:{c=Ur(l,o,r);break}case J.STRICT_WIDTH:{c=ht(l,o,r);break}default:c=Vr(l,o,r)}return Mr(c)}).join(`
34
+ `)},gt=80,pt=24,ae=(e,t,{shell:n,env:r}={})=>wt(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:n,env:r}).trim(),Q=(e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),mt=(e,t)=>{const{columns:n,rows:r}=Q(e,t);if(!(Number.isNaN(n)||Number.isNaN(r))&&!(n===gt&&r===pt))return{columns:n,rows:r}},Gr=()=>{if(O.platform!=="linux")return!0;try{const e=P.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const n=e.slice(t+2).trim().split(/\s+/),r=Number.parseInt(n[2],10),o=Number.parseInt(n[5],10);return Number.isNaN(r)||Number.isNaN(o)||o<=0?!1:r===o}catch{return!1}};function fo(){const{env:e,stdout:t,stderr:n}=O;if(t?.columns&&t?.rows)return Q(t.columns,t.rows);if(n?.columns&&n?.rows)return Q(n.columns,n.rows);if(e.COLUMNS&&e.LINES)return Q(e.COLUMNS,e.LINES);const r={columns:gt,rows:pt};return O.platform==="win32"?ie()??r:O.platform==="darwin"?Re()??ie()??r:Re()??ie()??Hr()??r}const Re=()=>{try{const e=O.platform==="darwin"?P.constants.O_EVTONLY|P.constants.O_NONBLOCK:P.constants.O_NONBLOCK,{columns:t,rows:n}=vt.WriteStream(P.openSync("/dev/tty",e));return{columns:t,rows:n}}catch{}},ie=()=>{try{const e=ae("tput",["cols"],{env:{TERM:"dumb",...O.env}}),t=ae("tput",["lines"],{env:{TERM:"dumb",...O.env}});if(e&&t)return mt(e,t)}catch{}},Hr=()=>{try{if(!Gr())return;const e=ae("resize",["-u"]).match(/\d+/g);if(e.length===2)return mt(e[0],e[1])}catch{}},ho=e=>{const t=Object.keys(e).map(n=>e[n].badge??"");return t.length===0?"":t.reduce((n,r)=>n.length>r.length?n:r,"")},{bold:Yr,cyan:qr,green:Pe,grey:Jr,magenta:Kr,red:Xr,yellow:se}=De,go={indent:2,quoteStyle:"single",stylize:(e,t)=>{const n={bigint:se,boolean:se,date:Kr,null:Yr,number:se,regexp:Xr,special:qr,string:Pe,symbol:Pe,undefined:Jr};return Object.hasOwn(n,t)?n[t](e):e}},{bold:Qr,underline:Zr}=De,po=(e,t)=>{let n=t.uppercase.label?e.toUpperCase():e;return n=t.underline.label?Zr(n):n,t.bold.label&&(n=Qr(n)),n},eo=e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":");class mo{styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:eo,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=St}setLoggerTypes(t){this.loggerTypes=t}}export{mo as A,ro as E,St as L,J as R,uo as X,so as Y,oo as a,ho as b,z as c,go as d,po as f,io as g,lo as i,fo as t,co as w,ao as z};
@@ -1 +1 @@
1
- import{PrettyReporter as t}from"../../packem_shared/PrettyReporter-BR6Olx7E.js";export{t as PrettyReporter};
1
+ import{PrettyReporter as t}from"../../packem_shared/PrettyReporter-Ds4uei6o.js";export{t as PrettyReporter};
@@ -1,11 +1,11 @@
1
- import{createRequire as re}from"node:module";import z from"@visulima/colorize";import{A as Y,d as k,i as q,w as D,b as F,g as W,t as G,c as f,f as X,a as Z,Y as j,Z as H,v as J,z as S}from"../../packem_shared/abstract-pretty-reporter-CZoTcUjq.js";const P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:B,stderr:V}=P,{bgGrey:K,bold:v,cyan:N,green:Q,greenBright:U,grey:a,red:b,underline:R,white:ee}=z,te=/[\\/]pail[\\/]dist/,L=$=>!te.test($);class ne extends Y{#e;#r;#i;#a=!1;#o;#s;#t;#n=!1;#h="";#l="";constructor(t={}){const{error:o,inspect:h,...i}=t;super({uppercase:{label:!0,...i.uppercase},...i}),this.#o={...k,indent:void 0,...h},this.#s={...o,color:{fileLine:Q,hint:N,marker:b,message:b,method:U,title:b}},this.#e=B,this.#r=V,this.#p()}setLoggerTypes(t){super.setLoggerTypes(t),this.#p()}setStdout(t){this.#e=t,this.#t=void 0,this.#n=!1}setStderr(t){this.#r=t}setInteractiveManager(t){this.#i=t}setIsInteractive(t){this.#a=t}log(t){const o=this.formatMessage(t),h=t.type.level,i=q(h)?"stderr":"stdout",n=i==="stderr"?this.#r:this.#e;this.#a&&this.#i!==void 0&&n.isTTY?this.#i.update(i,o.split(`
1
+ import{createRequire as re}from"node:module";import z from"@visulima/colorize";import{A as Y,d as k,i as q,w as D,b as F,g as W,t as G,c as f,f as X,a as H,Y as R,X as J,R as K,z as S}from"../../packem_shared/abstract-pretty-reporter-BJn6mWP0.js";const P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:B,stderr:V}=P,{bgGrey:N,bold:j,cyan:Q,green:U,greenBright:Z,grey:a,red:b,underline:v,white:ee}=z,te=/[\\/]pail[\\/]dist/,L=$=>!te.test($);class ne extends Y{#e;#r;#i;#a=!1;#o;#s;#t;#n=!1;#h="";#l="";constructor(t={}){const{error:o,inspect:h,...i}=t;super({uppercase:{label:!0,...i.uppercase},...i}),this.#o={...k,indent:void 0,...h},this.#s={...o,color:{fileLine:U,hint:Q,marker:b,message:b,method:Z,title:b}},this.#e=B,this.#r=V,this.#p()}setLoggerTypes(t){super.setLoggerTypes(t),this.#p()}setStdout(t){this.#e=t,this.#t=void 0,this.#n=!1}setStderr(t){this.#r=t}setInteractiveManager(t){this.#i=t}setIsInteractive(t){this.#a=t}log(t){const o=this.formatMessage(t),h=t.type.level,i=q(h)?"stderr":"stdout",n=i==="stderr"?this.#r:this.#e;this.#a&&this.#i!==void 0&&n.isTTY?this.#i.update(i,o.split(`
2
2
  `),0):D(`${o}
3
- `,n)}#p(){this.#h=F(this.loggerTypes),this.#l=W(this.loggerTypes)}#c(){return!this.#n&&typeof this.#e.on=="function"&&(this.#n=!0,this.#e.on("resize",()=>{this.#t=void 0})),this.#t===void 0&&(this.#t=G().columns),this.#t}formatMessage(t){let o=this.#c();typeof this.styles.messageLength=="number"&&(o=this.styles.messageLength);const{badge:h,context:i,date:n,error:_,file:p,groups:g,label:d,message:c,prefix:u,repeated:x,scope:m,suffix:y,traceError:E,type:C}=t,{color:T}=this.loggerTypes[C.name],M=T?z[T]:ee,l=g.map(()=>" ").join(""),e=[];if(g.length>0&&e.push(`${l+a(`[${g.at(-1)??""}]`)} `),n&&e.push(`${a(this.styles.dateFormatter(typeof n=="string"?new Date(n):n))} `),h)e.push(v(M(h)));else{const s=this.#h;s.length>0&&e.push(a(" ".repeat(s.length)))}const A=this.#l,w=f(A);if(d){const s=f(d),r=Math.max(0,w-s);e.push(`${v(M(X(d,this.styles)))} `," ".repeat(r))}else e.push(" ".repeat(w+1));x&&e.push(`${K.white(`[${String(x)}x]`)} `),Array.isArray(m)&&m.length>0&&e.push(`${a(`[${m.join(" > ")}]`)} `),u&&e.push(`${a(`[${this.styles.underline.prefix?R(u):u}]`)} `);const I=f(e.join(""));if(c!==Z){const s=typeof c=="string"?c:j(c,this.#o);e.push(l+H(s,{trim:!1,width:o-3,wrapMode:J.PRESERVE_WORDS}))}if(i){let s=!1;e.push(...i.map(r=>{if(r instanceof Error)return s=!0,`
3
+ `,n)}#p(){this.#h=F(this.loggerTypes),this.#l=W(this.loggerTypes)}#c(){return!this.#n&&typeof this.#e.on=="function"&&(this.#n=!0,this.#e.on("resize",()=>{this.#t=void 0})),this.#t===void 0&&(this.#t=G().columns),this.#t}formatMessage(t){let o=this.#c();typeof this.styles.messageLength=="number"&&(o=this.styles.messageLength);const{badge:h,context:i,date:n,error:_,file:p,groups:g,label:d,message:c,prefix:u,repeated:x,scope:m,suffix:y,traceError:E,type:C}=t,{color:T}=this.loggerTypes[C.name],M=T?z[T]:ee,l=g.map(()=>" ").join(""),e=[];if(g.length>0&&e.push(`${l+a(`[${g.at(-1)??""}]`)} `),n&&e.push(`${a(this.styles.dateFormatter(typeof n=="string"?new Date(n):n))} `),h)e.push(j(M(h)));else{const s=this.#h;s.length>0&&e.push(a(" ".repeat(s.length)))}const A=this.#l,w=f(A);if(d){const s=f(d),r=Math.max(0,w-s);e.push(`${j(M(X(d,this.styles)))} `," ".repeat(r))}else e.push(" ".repeat(w+1));x&&e.push(`${N.white(`[${String(x)}x]`)} `),Array.isArray(m)&&m.length>0&&e.push(`${a(`[${m.join(" > ")}]`)} `),u&&e.push(`${a(`[${this.styles.underline.prefix?v(u):u}]`)} `);const I=f(e.join(""));if(c!==H){const s=typeof c=="string"?c:R(c,this.#o);e.push(l+J(s,{trim:!1,width:o-3,wrapMode:K.PRESERVE_WORDS}))}if(i){let s=!1;e.push(...i.map(r=>{if(r instanceof Error)return s=!0,`
4
4
 
5
- ${S(r,{...this.#s,filterStacktrace:L,prefix:l})}`;if(typeof r=="object")return` ${j(r,this.#o)}`;const O=(s?`
5
+ ${S(r,{...this.#s,filterStacktrace:L,prefix:l})}`;if(typeof r=="object")return` ${R(r,this.#o)}`;const O=(s?`
6
6
 
7
7
  `:" ")+String(r);return s=!1,O}))}if(_&&e.push(S(_,{...this.#s,filterStacktrace:L,prefix:l})),E&&e.push(`
8
8
 
9
- ${S(E,{...this.#s,filterStacktrace:L,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:l})}`),y&&e.push(` ${l}${a(this.styles.underline.suffix?R(y):y)}`),p){const s=(p.name??"")+(p.line?`:${String(p.line)}`:""),r=Math.max(0,I-f("Caller: "));e.push(`
9
+ ${S(E,{...this.#s,filterStacktrace:L,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:l})}`),y&&e.push(` ${l}${a(this.styles.underline.suffix?v(y):y)}`),p){const s=(p.name??"")+(p.line?`:${String(p.line)}`:""),r=Math.max(0,I-f("Caller: "));e.push(`
10
10
  `,a("Caller: ")," ".repeat(r),s,`
11
11
  `)}return e.join("")}}export{ne as SimpleReporter};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/pail",
3
- "version": "5.0.1",
3
+ "version": "6.0.1",
4
4
  "description": "Highly configurable Logger for Node.js, Edge and Browser.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -251,7 +251,7 @@
251
251
  "MIGRATION-GUIDE.md"
252
252
  ],
253
253
  "dependencies": {
254
- "@visulima/colorize": "2.2.0",
254
+ "@visulima/colorize": "3.0.0",
255
255
  "@visulima/interactive-manager": "1.0.1"
256
256
  },
257
257
  "peerDependencies": {
@@ -1,47 +0,0 @@
1
- import{createRequire as Ee}from"node:module";import et from"@visulima/colorize";import{L as je,E as Me}from"./constants-ep2nsfdy.js";import{i as We,w as Fe}from"./write-stream-D2XwCKdN.js";let Ie;const Ne=t=>(Ie??=Ee(import.meta.url))(t),C=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:T,$t=t=>{if(typeof C<"u"&&C.versions&&C.versions.node){const[e,n]=C.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return C.getBuiltinModule(t)}return Ne(t)},T=C,{stdout:Oe,stderr:ke}=T,{execFileSync:Te}=$t("node:child_process"),V=$t("node:fs"),Be=$t("node:tty"),Le=globalThis.process??Object.create(null),vt={versions:{}},G=new Proxy(Le,{get(t,e){if(e in t)return t[e];if(e in vt)return vt[e]}}),nt=t=>{let e;return()=>{if(e===void 0){if(typeof G.getBuiltinModule!="function")throw new TypeError(`[@visulima/error] Cannot load ${t}: this runtime implements no process.getBuiltinModule(). Requires Node ^22.14.0 || >=24.10.0, or another runtime providing process.getBuiltinModule().`);e=G.getBuiltinModule(t)}return e}},_e=t=>t.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
2
- `),ze=(t,e,n,r)=>{const s={column:0,line:-1,...t.start},o={...s,...t.end},i=s.line,c=s.column,l=o.line,a=o.column;let u=Math.max(i-(n+1),0),d=Math.min(e.length,l+r);i===-1&&(u=0),l===-1&&(d=e.length);const h=l-i,f={};if(h)for(let p=0;p<=h;p++){const g=p+i;if(!c)f[g]=!0;else if(p===0){const m=e[g-1]?.length;f[g]=[c,(m??0)-c+1]}else if(p===h)f[g]=[0,a];else{const m=e[g-p]?.length;f[g]=[0,m]}}else c===a?f[i]=c?[c,0]:!0:f[i]=[c,(a??0)-(c??0)];return{end:d,markerLines:f,start:u}},Re=G.platform==="win32"&&!G.env?.WT_SESSION?">":"❯",Ce=(t,e,n)=>{const r={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...n,color:{gutter:p=>p,marker:p=>p,message:p=>p,...n?.color}},s=typeof e.start.column=="number";let o=(t.includes("\r")?_e(t):t).split(`
3
- `);typeof r.tabWidth=="number"&&t.includes(" ")&&(o=o.map(p=>p.replaceAll(" "," ".repeat(r.tabWidth))));const{end:i,markerLines:c,start:l}=ze(e,o,r.linesAbove,r.linesBelow),a=String(i).length,{gutter:u,marker:d,message:h}=r.color;let f=o.slice(l,i).map((p,g)=>{const m=l+1+g,$=c[m],S=String(m).padStart(a),w=!c[m+1],y=` ${S}${r.showGutter?" |":""}`;if($){let v="";if(Array.isArray($)){const x=p.replaceAll(/[^\t]/g," ").slice(0,Math.max($[0]-1,0)),b=$[1]||1;v=[`
4
- `,r.prefix+u(y.replaceAll(/\d/g," "))," ",x,d("^").repeat(b)].join(""),w&&r.message&&(v+=` ${h(r.message)}`)}return[r.prefix+d(Re),u(y),p.length>0?` ${p}`:"",v].join("")}return`${r.prefix} ${u(y)}${p.length>0?` ${p}`:""}`}).join(`
5
- `);return r.message&&!s&&(f=`${r.prefix+" ".repeat(a+1)+r.message}
6
- ${f}`),f},Pe=()=>G.env?.DEBUG==="true",z=(t,...e)=>{if(Pe()){const n=e.map(r=>typeof r=="function"?r():r);console.debug(`error:parse-stacktrace: ${t}`,...n)}},R="<unknown>",Ve=/^(?:node:internal\/|node:|internal\/)/,De=t=>t!==void 0&&Ve.test(t),Ge=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,He=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,Ue=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,qe=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,Ye=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,Je=/in\s(.*)\s\(at\s(.+)\)\sat/,Ke=/^(?:.*@)?(.*):(\d+):(\d+)$/,Ze=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Xe=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Qe=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,At=/\(error: ([^)]*)\)/,tn=/at\s/,en=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,nn=/Error: |AggregateError:/,Jt=/^Anonymous function$/,rn=/^\s*in\s.*/,sn=/^.*?\s*at\s.*/,on=/^.*?\s*@.*|\[native code\]/,Kt=(t,e)=>{const n=t.includes("safari-extension"),r=t.includes("safari-web-extension");return n||r?[t.includes("@")?t.split("@")[0]:R,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Zt=(t,e)=>{const n=Ue.exec(e);n&&(t.file=n[1],t.line=+n[2],t.column=+n[3])},cn=t=>{const e=Je.exec(t);if(e){z(`parse nested node error stack line: "${t}"`,()=>`found: ${JSON.stringify(e)}`);const r=e[2].split(":");return{column:r[2]?+r[2]:void 0,file:r[0],line:r[1]?+r[1]:void 0,methodName:e[1]??R,raw:t,type:void 0}}const n=Ye.exec(t);if(n){z(`parse node error stack line: "${t}"`,()=>`found: ${JSON.stringify(n)}`);const r={column:n[4]?+n[4]:void 0,file:n[2]?n[2].replace(tn,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]??R,raw:t,type:t.startsWith("internal")?"internal":void 0};return Zt(r,`${n[2]}:${n[3]}:${n[4]}`),r}},ln=t=>{const e=Ge.exec(t);if(e){z(`parse chrome error stack line: "${t}"`,()=>`found: ${JSON.stringify(e)}`);const n=e[2]?.startsWith("native"),r=e[2]?.startsWith("eval")||e[1]?.startsWith("eval");let s,o;if(r){const a=He.exec(t);if(a){const u=en.exec(a[1]);u?(e[2]=u[4]??u[1],e[3]=u[5]??u[2],e[4]=u[3]):a[2]&&(e[2]=a[1]),a[2]&&(s={column:a[4]?+a[4]:void 0,file:a[2],line:a[3]?+a[3]:void 0,methodName:"eval",raw:t,type:"eval"})}else{const u=qe.exec(t);u&&(o={column:u[4]?+u[4]:void 0,file:u[2],line:u[3]?+u[3]:void 0},s={column:u[6]?+u[6]:void 0,file:u[1],line:u[5]?+u[5]:void 0,methodName:"eval",raw:u[0],type:"eval"})}}const[i,c]=Kt(e[1]?e[1].replace(Jt,"<anonymous>"):R,e[2]),l={column:e[4]?+e[4]:void 0,evalOrigin:s,file:c,line:e[3]?+e[3]:void 0,methodName:i,raw:t,type:r?"eval":n?"native":De(c)?"internal":void 0};return o?(l.column=o.column,l.file=o.file,l.line=o.line):Zt(l,`${c}:${e[3]}:${e[4]}`),l}},an=(t,e)=>{const n=Ze.exec(t);if(n){z(`parse gecko error stack line: "${t}"`,()=>`found: ${JSON.stringify(n)}`);const r=n[3]?.includes(" > eval"),s=r&&n[3]&&Xe.exec(n[3]);let o;r&&s&&(n[3]=s[1],o={column:n[5]?+n[5]:void 0,file:n[3],line:n[4]?+n[4]:void 0,methodName:"eval",raw:t,type:"eval"},n[4]=s[2]);const[i,c]=Kt(n[1]?n[1].replace(Jt,"<anonymous>"):R,n[3]);let l;(e?.type==="safari"||!r&&e?.type==="firefox")&&e.column?l=e.column:!r&&n[5]&&(l=+n[5]);let a;return(e?.type==="safari"||!r&&e?.type==="firefox")&&e.line?a=e.line:n[4]&&(a=+n[4]),{column:l,evalOrigin:o,file:c,line:a,methodName:i,raw:t,type:r?"eval":c.includes("[native code]")?"native":void 0}}},un=(t,e)=>{const n=Qe.exec(t);if(!(n&&n[2].includes(" > eval"))&&n)return z(`parse firefox error stack line: "${t}"`,()=>`found: ${JSON.stringify(n)}`),{column:n[4]?+n[4]:e?.column??void 0,file:n[2],line:n[3]?+n[3]:e?.line??void 0,methodName:n[1]||R,raw:t,type:void 0}},fn=t=>{const e=Ke.exec(t);if(e)return z(`parse react android native error stack line: "${t}"`,()=>`found: ${JSON.stringify(e)}`),{column:e[3]?+e[3]:void 0,file:e[1],line:e[2]?+e[2]:void 0,methodName:R,raw:t,type:void 0}},Xt=(t,{filter:e,frameLimit:n=50}={})=>{const r=t;let s=(typeof r.stacktrace=="string"?r.stacktrace:t.stack??"").split(`
7
- `).map(o=>(At.test(o)?o.replace(At,"$1"):o).trim()).filter(o=>!nn.test(o)&&o!=="eval code");return e&&(s=s.filter(o=>e(o))),s=s.slice(0,n),s.reduce((o,i,c)=>{if(!i||i.length>1024)return o;let l;if(rn.test(i))l=cn(i);else if(sn.test(i))l=ln(i);else if(on.test(i)){let a;if(c===0){const u=t,d=u.columnNumber,h=u.lineNumber,f=u.line,p=u.column;d||h?a={column:d,line:h,type:"firefox"}:(f||p)&&(a={column:p,line:f,type:"safari"})}l=un(i,a)??an(i,a)}else l=fn(i);return l?o.push(l):z(`parse error stack line: "${i}"`,"not parser found"),o},[])},xt=nt("node:fs"),X=nt("node:path"),dn=nt("node:process"),hn=nt("node:url"),M=(t,e,n)=>n===0?t:e===" "?t+" ".repeat(n):t+" ".repeat(e*n),Qt=t=>t.replaceAll("\\","/"),pn=t=>{if(!t.startsWith("file:"))return t;try{return hn().fileURLToPath(t)}catch{return t}},gn=(t,e)=>{const n=t.replace("async file:","file:");return Qt(X().relative(e,pn(n)))},mn=(t,e,n)=>{if(e)return n.title(t.message);const r=t.message?`: ${t.message}`:"";return n.title(t.name+r)},te=(t,{color:e,hideErrorTitle:n,indentation:r,prefix:s},o)=>`${M(s,r,o)}${mn(t,n,e)}
8
- `,ee=(t,{color:e,indentation:n,prefix:r},s)=>{if(t.hint===void 0)return;const o=M(r,n,s);let i="";if(Array.isArray(t.hint))for(const c of t.hint)i+=`${o+c}
9
- `;else i+=o+t.hint;return e.hint(i)},bt=(t,e)=>{if(!e||t.file===void 0||t.line===void 0)return{trace:t};try{const n=e({column:t.column,file:t.file,line:t.line});return n?{source:n.source,trace:{...t,column:n.column??t.column,file:n.file??t.file,line:n.line??t.line}}:{trace:t}}catch{return{trace:t}}},wt=(t,e,n=0)=>{const{color:r,cwd:s,displayShortPath:o,indentation:i,prefix:c}=e,{trace:l}=t;let a;l.file===void 0?a="<unknown>":a=o?gn(l.file,s):Qt(l.file);const{fileLine:u,method:d}=r;return`${M(c,i,n)}at ${l.methodName?`${d(l.methodName)} `:""}${u(a)}:${u(l.line?.toString()??"")}`},yn=(t,e)=>{if(e.allowAllFilePaths)return!0;const n=X().resolve(e.cwd),r=X().resolve(n,t);return r===n||r.startsWith(n+X().sep)},$n=t=>{try{return xt().existsSync(t)?xt().readFileSync(t,"utf8"):void 0}catch{return}},ne=(t,e,n)=>{const{color:r,indentation:s,linesAbove:o,linesBelow:i,prefix:c,showGutter:l,showLineNumbers:a,tabWidth:u}=e,{source:d,trace:h}=t;if(h.file===void 0)return;let f;if(d===void 0){const p=h.file.replace("file://","");if(!yn(p,e))return;const g=$n(p);if(g===void 0)return;f=g}else f=d;return Ce(f,{start:{column:h.column,line:h.line}},{color:r,linesAbove:o,linesBelow:i,prefix:M(c,s,n),showGutter:l,showLineNumbers:a,tabWidth:u})},re=(t,e,n)=>{if(t.errors.length===0)return;let r=`${M(e.prefix,e.indentation,n)}Errors:
10
-
11
- `,s=!0;for(const o of t.errors)s?s=!1:r+=`
12
-
13
- `,r+=oe(o,{...e,framesMaxLimit:1,hideErrorCodeView:e.hideErrorErrorsCodeView},n+1);return`
14
- ${r}`},bn=t=>{if(typeof t=="object"&&t!==null)try{return JSON.stringify(t)}catch{return Object.prototype.toString.call(t)}return String(t)},se=(t,e,n,r=new Set)=>{r.add(t);let s=`${M(e.prefix,e.indentation,n)}Caused by:
15
-
16
- `;const{cause:o}=t;if(!(o instanceof Error)){const l=bn(o);return s+=`${M(e.prefix,e.indentation,n)}${e.color.title(l)}
17
- `,`
18
- ${s}`}s+=te(o,e,n);const i=Xt(o).shift(),c=ee(o,e,n);if(c&&(s+=`${c}
19
- `),i){const l=bt(i,e.sourceMap);if(s+=wt(l,e,n),!e.hideErrorCauseCodeView){const a=ne(l,e,n);a!==void 0&&(s+=`
20
- ${a}`)}}if(o instanceof AggregateError){const l=re(o,e,n);l!==void 0&&(s+=`
21
- ${l}`)}return o.cause&&(s+=r.has(o)?`
22
- ${M(e.prefix,e.indentation,n+1)}Caused by: [Circular]`:`
23
- ${se(o,e,n+1,r)}`),`
24
- ${s}`},wn=(t,e)=>(t.length>0?`
25
- `:"")+t.map(n=>wt(bt(n,e.sourceMap),e)).join(`
26
- `),oe=(t,e,n)=>{const r={allowAllFilePaths:!1,cwd:dn().cwd(),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,...e,color:{fileLine:c=>c,gutter:c=>c,hint:c=>c,marker:c=>c,message:c=>c,method:c=>c,title:c=>c,...e.color}},s=Xt(t,{filter:e.filterStacktrace,frameLimit:r.framesMaxLimit}),o=s.shift(),i=o?bt(o,r.sourceMap):void 0;return[e.hideMessage?void 0:te(t,r,n),ee(t,r,n),i?wt(i,r,n):void 0,i&&!r.hideErrorCodeView?ne(i,r,n):void 0,t instanceof AggregateError?re(t,r,n):void 0,t.cause===void 0||t.cause===null?void 0:se(t,r,n),s.length>0?wn(s,r):void 0].filter(Boolean).join(`
27
- `)},it=(t,e={})=>{if(e.framesMaxLimit!==void 0&&e.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return oe(t,e,0)},B="[Inspection threw]",I=(t,e,n,r,s,o=", ",i=Number.POSITIVE_INFINITY)=>{const c=t.length;if(c===0)return"";const l=Number.isFinite(i)&&c>i,a=l?Math.max(0,Math.floor(i)):c;if(a===0)return`…(${String(c)})`;let u=r;s!==void 0&&(u=s);const d=n.truncate,h=Number.isFinite(d);let f="",p="",g="";for(let m=0;m<a;m+=1){const $=m+1===a,S=m+2===a;h&&(g=`…(${String(a-m)})`);let w=t[m];n.truncate=d-f.length-($?0:o.length);const y=p||u(w,e,n,r)+($?"":o),v=f.length+y.length,x=v+g.length;if($&&v>d&&f.length+g.length<=d||!$&&!S&&x>d)break;w=t[m+1];const b=S?"":o;if($?p="":p=u(w,e,n,r)+b,!$&&S&&x>d&&v+p.length>d)break;if(f+=y,!$&&!S&&v+p.length>=d){g=`…(${String(a-m-1)})`;break}g=""}return l&&g===""&&(g=`${o}… ${String(c-a)} more`),`${f}${g}`},Sn=([t,e],n,r)=>(r.truncate-=3,e?`${r.stylize(String(t),"yellow")}=${r.stylize(`"${e}"`,"string")}`:r.stylize(String(t),"yellow")),ie=t=>{try{return Object.create(t,{length:{value:t.length}})}catch{return}},vn=(t,e,n,r)=>{let s;try{s=t.nodeType}catch{return B}if(s===1)return ce(t,t,n,r);if(s===3){let o;try{o=t.data}catch{return B}return r(o,void 0,n)}return r(t,void 0,n)},gt=(t,e,n,r)=>{const s=ie(t);return s===void 0?B:I(s,t,e,n,vn,`
28
- `)},ce=(t,e,n,r)=>{let s,o;try{s=t.getAttributeNames().map(f=>[f,t.getAttribute(f)]),o=t.tagName.toLowerCase()}catch{return B}const i=n.stylize(`<${o}`,"special"),c=n.stylize(">","special"),l=n.stylize(`</${o}>`,"special");n.truncate-=o.length*2+5;let a="";s.length>0&&(a+=" ",a+=I(s,e,n,r,Sn," ")),n.truncate-=a.length;const{truncate:u}=n;let d;try{d=ie(t.children)}catch{d=void 0}let h;return d===void 0?h=B:(h=gt(d,n,r),h&&h.length>u&&(h=`…(${String(d.length)})`)),`${i}${a}${c}${h}${l}`},An=(t,e,n)=>t.length===0?"Arguments []":(e.truncate-=13,`Arguments [ ${I(t,t,e,n,void 0,", ",e.maxArrayLength)} ]`),xn=(t,e)=>{let n;if(t===" ")n=" ";else if(typeof t=="number"&&t>0)n=Array.from({length:t+1}).join(" ");else return;return{base:n,prev:`
29
- ${Array.from({length:e+1}).join(n)}`}},rt=(t,e)=>{if(t.length===0)return"";const n=e.prev+e.base;return n+t.split("\0\0").join(`,${n}`)+e.prev},En=/^[a-z_]\w*$/i,In=/^"|"$/g,Nn=(t,e)=>{if(En.test(t))return t;const n=JSON.stringify(t);return e.quoteStyle==="double"?n.replaceAll('"',String.raw`\"`):n.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(In,"'")},H=([t,e],n,r,s)=>{r.truncate-=2;let o;typeof t=="string"?o=Nn(t,r):typeof t=="number"?o=String(t):o=`[${s(t,n,r)}]`,r.truncate-=o.length;const i=s(e,n,r);return`${o}: ${i}`},On=Symbol.for("chai/inspect"),ct=t=>({[On]:()=>t}),U=(t,e)=>{let n;try{n=Object.getOwnPropertyDescriptor(t,e)}catch{n=void 0}if(n===void 0||"value"in n)try{return t[e]}catch{return ct(B)}if(n.get===void 0)return ct("[Setter]");try{return t[e]}catch{return ct(B)}},kn=t=>{for(const e of t)if(Array.isArray(e)||typeof e=="object"&&e!==null)return!0;return!1},Tn=t=>{const e=[];for(const n of Object.keys(t)){const r=Number(n);Number.isInteger(r)&&r>=0&&String(r)===n&&r<4294967295||e.push(n)}return e},Bn=(t,e,n,r)=>{const s=Tn(t);if(t.length===0&&s.length===0)return"[]";e.truncate-=4;const o=!!r&&kn(t);let i=I(t,t,e,n,void 0,o?"\0\0":", ",e.maxArrayLength);e.truncate-=i.length;let c="";return s.length>0&&(c=I(s.map(l=>[l,U(t,l)]),t,e,n,H)),o&&r&&(i=rt(i,r)),`[${o?"":" "}${i}${c?`, ${c}`:""}${o?"":" "}]`},jn=50,Et=(t,e)=>{const n=new Uint8Array(t),r=Math.min(n.length,jn);let s="",o=!1;for(let a=0;a<r;a+=1){const u=n[a];u!==0&&(o=!0),s+=(a===0?"":" ")+u.toString(16).padStart(2,"0")}n.length>r&&(s+=` ... ${String(n.length-r)} more byte${n.length-r===1?"":"s"}`);const i=t instanceof ArrayBuffer?"ArrayBuffer":"SharedArrayBuffer",c=o||n.length>r,l=s!==""&&c?`[Uint8Contents]: <${s}>, `:"";return`${e.stylize(i,"special")} { ${l}byteLength: ${e.stylize(String(t.byteLength),"number")} }`},It=/\d(?=(?:\d{3})+(?!\d))/g,Mn=/\d{3}/g,Wn=/_$/,le=(t,e)=>{if(e.length<4||e.length===4&&e.codePointAt(0)===45||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY||e.includes("e"))return e;if(typeof t=="number"){const n=t<0?-Math.floor(-t):Math.floor(t);if(n!==t){const r=String(n),s=e.slice(r.length+1);return`${r.replace(It,"$&_")}.${s.replace(Mn,"$&_").replace(Wn,"")}`}}return e.replace(It,"$&_")},Fn=t=>t>="\uD800"&&t<="\uDBFF",W=(t,e,n="…")=>{t=String(t);const r=n.length,s=t.length;if(r>e&&s>r)return n;if(s>e&&s>r){let o=e-r;return o>0&&Fn(t[o-1])&&(o-=1),`${t.slice(0,o)}${n}`}return t},Nt=(t,e)=>{let n=W(t.toString(),e.truncate-1);return n!=="…"&&(n+="n"),e.stylize(e.numericSeparator?le(t,n):n,"bigint")},ae=t=>{try{return Array.isArray(t)}catch{return!1}},L=(t,e)=>{try{return t[e]}catch{return}},Ln=(t,e)=>{try{return t instanceof e}catch{return!1}},Ot=(t,e)=>{try{return Object.getOwnPropertyDescriptor(t,e)?.enumerable??!1}catch{return!0}},_n=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:void 0),Q=(t,e,n,r)=>{if("window"in globalThis&&t===globalThis)return"{ [object Window] }";if(t===globalThis)return"{ [object globalThis] }";let s,o;try{s=Object.getOwnPropertyNames(t),o=Object.getOwnPropertySymbols(t)}catch{return B}let i,c;try{i=e.showHidden?s:s.filter(f=>Object.getOwnPropertyDescriptor(t,f)?.enumerable)}catch{i=s.filter(f=>Ot(t,f))}try{c=o.filter(f=>e.showHidden||Object.getOwnPropertyDescriptor(t,f)?.enumerable)}catch{c=o.filter(f=>Ot(t,f))}let l;try{const f=_n(t)===Object.prototype||t.constructor===Object,p=t instanceof Object?"":"null prototype";let g;!f&&Symbol.toStringTag in t?g=t[Symbol.toStringTag]:g=p?"Object":"",l=g||p?`[${[g,p].filter(Boolean).join(": ")}] `:""}catch{l=""}if(i.length===0&&c.length===0)return`${l}{}`;e.truncate-=4;const a=r?"\0\0":", ",u=I(i.map(f=>[f,U(t,f)]),t,e,n,H,a),d=I(c.map(f=>[f,U(t,f)]),t,e,n,H,a);let h="";return u&&d&&(h=a),r?`${l}{${rt(u+h+d,r)}}`:`${l}{ ${u}${h}${d} }`},zn=(t,e,n,r)=>{let s;try{s=typeof t.constructor=="function"?t.constructor.name:""}catch{s=""}return(!s||s==="_class")&&(s="<Anonymous Class>"),e.truncate-=s.length,`${s} ${Q(t,e,n,r)}`},Rn=(t,e)=>{const n=e.stylize(String(t.byteLength),"number"),r=e.stylize(String(t.byteOffset),"number"),s=e.stylize(String(t.buffer.byteLength),"number");return`${e.stylize("DataView","special")} { byteLength: ${n}, byteOffset: ${r}, buffer: ArrayBuffer { byteLength: ${s} } }`},Cn=(t,e)=>{const n=t.toJSON();if(n===null)return"Invalid Date";const r=n.split("T"),s=r[0];return e.stylize(`${s}T${W(r[1],e.truncate-s.length-1)}`,"date")},Pn=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),Vn=(t,e,n)=>{const r=Object.getOwnPropertyNames(t).filter(c=>!Pn.has(c)),{name:s}=t;e.truncate-=s.length;let o="";typeof t.message=="string"?o=W(t.message,e.truncate):r.unshift("message"),o=o?`: ${o}`:"",e.truncate-=o.length+5;const i=I(r.map(c=>[c,U(t,c)]),t,e,n,H);return`${s}${o}${i?` { ${i} }`:""}`},kt=(t,e)=>{let n,r,s;try{n=t[Symbol.toStringTag]||"Function",r=t.toString(),{name:s}=t}catch{return e.stylize(B,"special")}return r.length<e.truncate-12?e.stylize(`[${n}: ${r}]`,"special"):s?e.stylize(`[${n} ${W(s,e.truncate-11)}]`,"special"):e.stylize(`[${n}]`,"special")},Tt=(t,e)=>{const n=L(t,Symbol.toStringTag),r=typeof n=="string"?n:"Generator";return`${e.stylize(`Object [${r}]`,"special")} {}`},Dn=([t,e],n,r,s)=>(r.truncate-=4,t=s(t,n,r),r.truncate-=t.length,`${t} => ${s(e,n,r)}`),Gn=(t,e,n,r)=>{if(t.size<=0)return"Map (0) {}";e.truncate-=7;let s=I([...t.entries()],t,e,n,Dn,r?"\0\0":", ",e.maxArrayLength);return r&&(s=rt(s,r)),`Map (${String(t.size)}) {${r?"":" "}${s}${r?"":" "}}`};function Bt(t,e){return Number.isNaN(t)?e.stylize("NaN","number"):t===Number.POSITIVE_INFINITY?e.stylize("Infinity","number"):t===Number.NEGATIVE_INFINITY?e.stylize("-Infinity","number"):t===0?e.stylize(1/t===Number.POSITIVE_INFINITY?"+0":"-0","number"):e.stylize(W(e.numericSeparator?le(t,t.toString()):t.toString(),e.truncate),"number")}const Hn=()=>"Promise{…}",Un=(t,e)=>{const n=e.truncate-(2+t.flags.length);return e.stylize(`/${W(t.source,n)}/${t.flags}`,"regexp")},qn=(t,e,n,r)=>{if(t.size===0)return"Set (0) {}";e.truncate-=7;let s=I([...t],t,e,n,void 0,r?"\0\0":", ",e.maxArrayLength);return r&&(s=rt(s,r)),`Set (${String(t.size)}) {${r?"":" "}${s}${r?"":" "}}`},Yn=(t,e)=>{const n=e.quoteStyle==="double"?'"':"'";return n+t+n},jt=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"),Jn={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},Kn=16,Zn=t=>Jn[t]||String.raw`\u${`0000${t.codePointAt(0).toString(Kn)}`.slice(-4)}`,Mt=(t,e)=>(jt.test(t)&&(t=t.replaceAll(jt,Zn)),e.stylize(Yn(W(t,e.truncate-2),e),"string")),Wt=t=>"description"in Symbol.prototype?t.description?`Symbol(${t.description})`:"Symbol()":t.toString(),Xn=t=>typeof Buffer=="function"&&t instanceof Buffer?"Buffer":t[Symbol.toStringTag],O=(t,e,n)=>{const r=Xn(t);e.truncate-=r.length+4;const s=Object.keys(t).slice(t.length);if(t.length===0&&s.length===0)return`${r}[]`;let o="";const i=Number.isFinite(e.maxArrayLength)?Math.min(t.length,Math.max(0,Math.floor(e.maxArrayLength))):t.length;for(let l=0;l<i;l++){const a=`${e.stylize(W(t[l],e.truncate),"number")}${l===i-1?"":", "}`;if(e.truncate-=a.length,l!==i-1&&e.truncate<=3){o+=`…(${String(t.length-l)})`;break}o+=a}i<t.length&&(o+=`${o?", ":""}… ${String(t.length-i)} more`);let c="";return s.length>0&&(c=I(s.map(l=>[l,U(t,l)]),t,e,n,H)),`${r}[ ${o}${c?`, ${c}`:""} ]`},Ft=t=>typeof L(t,Symbol.toStringTag)!="string",Qn=t=>typeof t=="function",ue=(t,e,n)=>{if(t==null)return;const r=Object.getOwnPropertyDescriptor(t,e);if(r===void 0)return;const s=n==="get"?r.get:r.value;return typeof s=="function"?s:void 0},fe=(t,e)=>{if(t!==void 0)return n=>{try{return t.call(n,e),!0}catch{return!1}}},F=(t,e)=>fe(ue(t,e,"get")),j=(t,e,n)=>fe(ue(t,e,"value"),n),Lt=Object.freeze({}),k=F(Reflect.getPrototypeOf(Int8Array.prototype),"length"),tr=typeof SharedArrayBuffer=="function"?SharedArrayBuffer.prototype:void 0,er=Object.assign(Object.create(null),{Arguments:Ft,Array:ae,ArrayBuffer:F(ArrayBuffer.prototype,"byteLength"),BigInt:j(BigInt.prototype,"valueOf"),Boolean:j(Boolean.prototype,"valueOf"),DataView:F(DataView.prototype,"byteLength"),Date:j(Date.prototype,"valueOf"),Error:Ft,Float32Array:k,Float64Array:k,Function:Qn,Int8Array:k,Int16Array:k,Int32Array:k,Map:F(Map.prototype,"size"),Number:j(Number.prototype,"valueOf"),RegExp:F(RegExp.prototype,"source"),Set:F(Set.prototype,"size"),SharedArrayBuffer:F(tr,"byteLength"),String:j(String.prototype,"valueOf"),Symbol:j(Symbol.prototype,"valueOf"),Uint8Array:k,Uint8ClampedArray:k,Uint16Array:k,Uint32Array:k,WeakMap:j(WeakMap.prototype,"has",Lt),WeakSet:j(WeakSet.prototype,"has",Lt)}),nr=(t,e)=>{const n=er[e];return n===void 0||n(t)},_t=new WeakMap,zt=Object.create(null),rr=Object.assign(Object.create(null),{Arguments:An,Array:Bn,ArrayBuffer:Et,AsyncGenerator:Tt,BigInt:Nt,bigint:Nt,Boolean:(t,e)=>e.stylize(String(t),"boolean"),boolean:(t,e)=>e.stylize(String(t),"boolean"),DataView:Rn,Date:Cn,Error:Vn,Float32Array:O,Float64Array:O,Function:kt,function:kt,Generator:Tt,HTMLCollection:gt,Int8Array:O,Int16Array:O,Int32Array:O,Map:Gn,NodeList:gt,null:(t,e)=>e.stylize("null","null"),Number:Bt,number:Bt,Promise:Hn,RegExp:Un,Set:qn,SharedArrayBuffer:Et,String:Mt,string:Mt,Symbol:Wt,symbol:Wt,Uint8Array:O,Uint8ClampedArray:O,Uint16Array:O,Uint32Array:O,undefined:(t,e)=>e.stylize("undefined","undefined"),WeakMap:(t,e)=>e.stylize("WeakMap{…}","special"),WeakSet:(t,e)=>e.stylize("WeakSet{…}","special")}),sr=Symbol.for("nodejs.util.inspect.custom"),or=Symbol.for("chai/inspect"),ir=(t,e,n,r)=>{const s=L(t,or);if(typeof s=="function")return s.call(t,e);if(!("window"in globalThis)){const l=L(t,sr);if(typeof l=="function")return l.call(t,r,e)}const o=L(t,"inspect");if(typeof o=="function")return o.call(t,r,e);const i=L(t,"constructor");if(typeof i=="function"&&_t.has(i))return _t.get(i)?.(t,e)??"unknown";const c=Object.hasOwn(zt,n)?zt[n]:void 0;return c?c(t,e):""},lt=(t,e,n)=>{const{depth:r,inspect:s,seen:o}=n;if(o.includes(t))return"[Circular]";if(r>=e.depth&&e.depth>0&&typeof t=="object"&&t!==null)return ae(t)?"[Array]":"[Object]";const i=e.indent?xn(e.indent,r):void 0;let c=t===null?"null":typeof t;if(c==="object")try{c=Object.prototype.toString.call(t).slice(8,-1)}catch{c="Object"}let l=rr[c];if(l!==void 0&&typeof t=="object"&&t!==null&&!nr(t,c)&&(l=void 0),l!==void 0)return l(t,e,s,i);if(e.customInspect&&t){const d=ir(t,e,c,e.depth-r);if(d)return typeof d=="string"?d:s(d,t,e)}let a=!1;if(t)try{a=Object.getPrototypeOf(t)}catch{a=Object.prototype}if(a===Object.prototype||a===null)return Q(t,e,s,i);if(t&&typeof HTMLElement=="function"&&Ln(t,HTMLElement))return ce(t,t,e,s);const u=L(t,"constructor");return u!==void 0?u!==Object?zn(t,e,s,i):Q(t,e,s,i):t===Object(t)?Q(t,e,s,i):e.stylize(String(t),c)},Rt=(t,e={})=>{const n={customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,stylize:s=>s,truncate:Number.POSITIVE_INFINITY,...e};if(n.indent!==void 0&&n.indent!==" "&&!(Number.parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');const r={depth:0,inspect:void 0,seen:[]};return r.inspect=(s,o,i)=>{if(o==null){r.depth+=1;const l=lt(s,i,r);return r.depth-=1,l}r.seen.push(o),r.depth+=1;const c=lt(s,i,r);return r.depth-=1,r.seen.pop(),c},lt(t,n,r)},cr=[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],lr=12288,ar=65510,ur=[12288,12288,65281,65376,65504,65510],fr=8361,dr=65518,hr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],pr=32,gr=10630,mr=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],yr=4352,$r=262141,de=[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],Y=(t,e)=>{let n=0,r=Math.floor(t.length/2)-1;for(;n<=r;){const s=Math.floor((n+r)/2),o=s*2;if(e<t[o])r=s-1;else if(e>t[o+1])n=s+1;else return!0}return!1},Ct=19968,[br,wr]=Sr(de);function Sr(t){let e=t[0],n=t[1];for(let r=0;r<t.length;r+=2){const s=t[r],o=t[r+1];if(Ct>=s&&Ct<=o)return[s,o];o-s>n-e&&(e=s,n=o)}return[e,n]}const vr=t=>t<161||t>1114109?!1:Y(cr,t),Ar=t=>t<lr||t>ar?!1:Y(ur,t),xr=t=>t<fr||t>dr?!1:Y(hr,t),Er=t=>t<pr||t>gr?!1:Y(mr,t),Ir=t=>t>=br&&t<=wr?!0:t<yr||t>$r?!1:Y(de,t);function Nr(t){return vr(t)?"ambiguous":Ar(t)?"fullwidth":xr(t)?"halfwidth":Er(t)?"narrow":Ir(t)?"wide":"neutral"}function Or(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function he(t){return Or(t),Nr(t)}const pe=String.raw,Pt=pe`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,kr=()=>new RegExp(pe`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${Pt}(?:\u200D${Pt})*`,"gu"),P=new Set(["\x1B","›"]),st="\x07",ge="[",St="m",q="]8;;",Tr=39,Br=/[\u200B\uFEFF\u2060-\u2064]/g,jr=new RegExp(`(?:\\${ge}(?<code>\\d+)m|\\${q}(?<uri>.*)${st})`),Mr=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]])),me=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,J=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Wr=kr(),Vt=new Map,Fr=t=>[t.ambiguousIsNarrow?1:0,t.control,t.fullWidth,t.regular,t.wide].join("|"),Lr=t=>{const e=Fr(t.width);let n=Vt.get(e);return n||(n=new Map,Vt.set(e,n)),n},K=new RegExp(me.source,"y"),at=new RegExp(Wr.source,"uy"),Z=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,ye=t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other",_r=(t,e)=>{const n=Lr(e),r=Math.floor(t/65536),s=t%65536;let o=n.get(r);if(o||(o=new Map,n.set(r,o)),o.has(s))return o.get(s);let i;switch(ye(t)){case"control":{i=e.width.control;break}case"latin":{i=e.width.regular;break}case"wide":{i=e.width.wide;break}case"zero":{i=0;break}default:switch(he(t)){case"ambiguous":{i=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{i=e.width.fullWidth;break}case"wide":{i=e.width.wide;break}default:i=e.width.regular}}return o.set(s,i),i},zr=t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,mt=(t,e={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const n={truncation:{countAnsiEscapeCodes:e.countAnsiEscapeCodes??!1,ellipsis:e.ellipsis??"",ellipsisWidth:e.ellipsisWidth??(e.ellipsis?mt(e.ellipsis,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:e.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:e.ambiguousIsNarrow??!1,ansi:e.ansiWidth??0,control:e.controlWidth??0,emoji:e.emojiWidth??2,fullWidth:e.fullWidth??2,halfWidth:e.halfWidth??1,regular:e.regularWidth??1,tab:e.tabWidth??8,wide:e.wideWidth??2}},r=Math.max(0,n.truncation.limit-n.truncation.ellipsisWidth),{length:s}=t,o=s>1e4;let i=0,c=0,l=s,a=!1;const u=t.includes("\x1B")||t.includes("›");for(;i<s;){if(u&&(t[i]==="\x1B"||t[i]==="›")){if(t.startsWith("\x1B]8;;",i)){const m="\x1B]8;;\x07",$=m.length,S=t.indexOf("\x07",i+5);if(S!==-1){const w=t.indexOf(m,S+1);if(w!==-1){const y=w+$,v=t.slice(S+1,w).replace(me,""),x=mt(v,{ambiguousIsNarrow:n.width.ambiguousIsNarrow,ansiWidth:n.width.ansi,controlWidth:n.width.control,countAnsiEscapeCodes:!1,ellipsis:n.truncation.ellipsis,ellipsisWidth:n.truncation.ellipsisWidth,emojiWidth:n.width.emoji,fullWidth:n.width.fullWidth,halfWidth:n.width.halfWidth,limit:Math.max(0,r-c),regularWidth:n.width.regular,tabWidth:n.width.tab,wideWidth:n.width.wide}),b=x.width;if(x.truncated)a=!0,l=Math.min(l,i);else if(c+b>r&&(l=Math.min(l,i),a=!0,c+b>n.truncation.limit))break;if(c+=b,i=y,a&&c>=n.truncation.limit)break;continue}}}if(K.lastIndex=i,K.test(t)){const m=K.lastIndex-i,$=n.truncation.countAnsiEscapeCodes?m:n.width.ansi;if(c+$>r&&(l=Math.min(l,i),c+$>n.truncation.limit)){a=!0;break}c+=$,i=K.lastIndex;continue}}const f=t.codePointAt(i);if(f===8203||f===65279||f>=8288&&f<=8292){i+=1;continue}if(f===9){if(c+n.width.tab>r&&(l=Math.min(l,i),c+n.width.tab>n.truncation.limit)){a=!0;break}c+=n.width.tab,i+=1;continue}if(Z.lastIndex=i,Z.test(t)){const m=(Z.lastIndex-i)*n.width.regular;if(c+m>r){const $=n.width.regular>0?Math.floor((r-c)/n.width.regular):0;if(l=Math.min(l,i+$),c+m>n.truncation.limit){a=!0;break}}c+=m,i=Z.lastIndex;continue}if((f<=31||f>=127&&f<=159)&&(J.lastIndex=i,J.test(t))){const m=(J.lastIndex-i)*n.width.control;if(c+m>r){const $=n.width.control>0?Math.floor((r-c)/n.width.control):0;if(l=Math.min(l,i+$),c+m>n.truncation.limit){a=!0;break}}c+=m,i=J.lastIndex;continue}if(at.lastIndex=i,at.test(t)){if(c+n.width.emoji>r&&(l=Math.min(l,i),c+n.width.emoji>n.truncation.limit)){a=!0;break}c+=n.width.emoji,i=at.lastIndex;continue}const p=t.codePointAt(i)??0;if(zr(p)){i+=p>65535?2:1;continue}let g;if(o)g=_r(p,n);else switch(ye(p)){case"control":{g=n.width.control;break}case"latin":{g=n.width.regular;break}case"wide":{g=n.width.wide;break}case"zero":{g=0;break}default:switch(he(p)){case"ambiguous":{g=n.width.ambiguousIsNarrow?n.width.regular:n.width.wide;break}case"fullwidth":{g=n.width.fullWidth;break}case"wide":{g=n.width.wide;break}default:g=n.width.regular}}if(c+g>r&&(l=Math.min(l,i),c+g>n.truncation.limit)){a=!0;break}c+=g,i+=p>65535?2:1}let d=c,h=!1;return a&&n.truncation.limit>=n.truncation.ellipsisWidth&&(d=n.truncation.limit,h=!0),{ellipsed:h,index:a?l:s,truncated:a,width:d}},A=(t,e={})=>mt(t,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,Rr=/\x1B\[(\d+)m/;class $e{activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(e){const n=Rr.exec(e);if(!n)return;const r=Number.parseInt(n[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 s={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[r];s&&(this.activeFormatting=this.activeFormatting.filter(o=>!o.includes(s)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const e=[];if(this.activeFormatting.length>0){const n={"\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 s=n[r];s&&e.push(s)})}return this.activeForeground&&e.push("\x1B[39m"),this.activeBackground&&e.push("\x1B[49m"),e.join("")}}const Cr=(t,e)=>{if(!P.has(t[e]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const n=!0,r=t.slice(e+1,e+1+q.length).join("")===q;return{isInsideEscape:n,isInsideLinkEscape:r}},Pr=(t,e={})=>{const n=new $e;let r="",s=!1,o="",i="",c=!1;const l=[...t];for(let a=0;a<l.length;a++){const u=l[a];if(u&&P.has(u)){if(r){const g=e.getWidth?.(r)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:r,width:g};if(c&&(m.isHyperlink=!0,m.hyperlinkUrl=i),e.onSegment?.(m,n)===!1)return;r=""}s=!0,o=u;const f=Cr(l,a),{isInsideLinkEscape:p}=f;if(p){let g=a+1;for(i="";g<l.length;){const $=l[g];if($===st)break;i+=$,g+=1}i=i.slice(4);const m={hyperlinkUrl:i,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(e.onSegment?.(m,n)===!1)return;a=g,c=!0,s=!1,o="";continue}if(a+1<l.length&&l[a+1]==="\\"&&c){const g={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(e.onSegment?.(g,n)===!1)return;c=!1,i="",a+=1,s=!1,o="";continue}}if(s){if(o!==u&&(o+=u),u===St){s=!1,n.processEscape(o);const f={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(e.onSegment?.(f,n)===!1)return;o=""}continue}r+=u;const d=e.getWidth?.(r)??0,h={isEscapeSequence:!1,isGrapheme:!0,text:r,width:d};if(c&&(h.isHyperlink=!0,h.hyperlinkUrl=i),e.onSegment?.(h,n)===!1)return;r=""}if(r){const a=e.getWidth?.(r)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:r,width:a};c&&(u.isHyperlink=!0,u.hyperlinkUrl=i),e.onSegment?.(u,n)}if(o){const a={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};e.onSegment?.(a,n)}},Dt=t=>`${P.values().next().value}${ge}${String(t)}${St}`,Gt=t=>`${P.values().next().value}${q}${t}${st}`,Vr=t=>{if(t.length===0)return"";if(t.length===1)return t[0];let e="",n,r;const s=t.join(`
30
- `),o=[...s];let i=0;for(const[c,l]of o.entries()){if(e+=l,P.has(l)){const u=jr.exec(s.slice(i))?.groups??{};if(u.code!==void 0){const d=Number.parseFloat(u.code);n=d===Tr?void 0:d}else u.uri!==void 0&&(r=u.uri.length===0?void 0:u.uri)}const a=Mr.get(Number(n));o[c+1]===`
31
- `?(r&&(e+=Gt("")),n&&a&&(e+=Dt(a))):l===`
32
- `&&(n&&a&&(e+=Dt(n)),r&&(e+=Gt(r))),i+=l.length}return e},be=/(?=\s)|(?<=\s)/,we=/^\s+$/,Ht=new Map,Dr=t=>{const e=Ht.get(t);if(e!==void 0)return e;const n=A(t);return Ht.set(t,n),n},ut=t=>{if(!t.includes("\x1B"))return t;let e=t;return t.includes("\x1B[30m")&&(e+="\x1B[39m"),t.includes("\x1B[42m")&&(e+="\x1B[49m"),e},_=t=>{const e=t.split(" ");let n=e.length;for(;n>0&&A(e[n-1])===0;)n--;return n===e.length?t:e.slice(0,n).join(" ")+e.slice(n).join("")},Se=(t,e,n)=>{if(t.length===0)return[""];if(e<=0)return[t];const r=[],s=new $e;let o="",i=0,c=!1,l=!1,a="",u=0;for(;u<t.length;){const d=t.codePointAt(u),h=String.fromCodePoint(d),f=h.length;if(P.has(h)){c=!0,a=h,o+=h,l=t.startsWith(q,u+1),u+=1;continue}if(c){a+=h,o+=h,l?h===st&&(c=l=!1):h===St&&(c=!1,s.processEscape(a)),u+=1;continue}const p=Dr(h),g=h===" ";if(p===0){o+=h,u+=f;continue}if(i+p>e&&(o&&r.push(o+s.getEndEscapesForAllActiveAttributes()),o=s.getStartEscapesForAllActiveAttributes(),i=A(o),g&&n)){for(;u<t.length&&t[u]===" ";)u+=1;continue}if(o+=h,i+=p,i===e&&u+f<t.length&&(r.push(o+s.getEndEscapesForAllActiveAttributes()),o=s.getStartEscapesForAllActiveAttributes(),i=A(o),u+f<t.length&&t[u+f]===" "&&n)){for(u+=f;u<t.length&&t[u]===" ";)u+=1;continue}u+=f}return o&&r.push(o+s.getEndEscapesForAllActiveAttributes()),n?r.map(d=>_(d)):r},Gr=(t,e,n)=>{if(t.length===0)return[];const r=n?t.trim():t;if(r.length===0)return[];const s=[];let o="",i=0;return Pr(r,{getWidth:A,onSegment:(c,l)=>{const a=c.text??"";if(c.isEscapeSequence)o+=a;else{const u=a===" ";if(c.width===0)return o+=a,!0;if(i+c.width>e&&(o&&s.push(o),o=l.getStartEscapesForAllActiveAttributes(),i=0,u))return n||s.push(l.getStartEscapesForAllActiveAttributes()+a),!0;o+=a,i+=c.width}return!0}}),o&&s.push(o),n?s.map(c=>_(c)):s},Hr=(t,e,n)=>{if(t.length===0)return[];const r=n?t.trim():t;if(r.length===0)return[];const s=r.split(be),o=[];let i="",c=0,l=0;for(;l<s.length;){const a=s[l],u=we.test(a),d=A(a);if(a.length===0){l+=1;continue}if(n&&u&&c===0){l+=1;continue}if(c+d>e&&c>0){n?o.push(_(i)):o.push(i),i="",c=0;continue}i+=a,c+=d,l+=1}return i&&(n?o.push(_(i)):o.push(i)),o},Ur=(t,e,n)=>{if(t.length===0)return[];const r=n?t.trim():t;if(r.length===0)return[];const s=r.split(be),o=[];let i="",c=0,l=0;for(;l<s.length;){const a=s[l],u=we.test(a),d=A(a);if(a.length===0){l+=1;continue}if(n&&u&&c===0){l+=1;continue}if(d>e){i&&o.push(ut(n?_(i):i));const h=Se(a,e,n);if(h.length>0){for(let f=0;f<h.length-1;f+=1)o.push(h[f]);i=h.at(-1),c=A(i)}else i="",c=0;l+=1;continue}if(c+d>e&&c>0&&(o.push(ut(n?_(i):i)),i="",c=0,n&&u)){l+=1;continue}i+=a,c+=d,l+=1}return i&&o.push(ut(n?_(i):i)),o},D={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},qr=(t,e={})=>{const{removeZeroWidthCharacters:n=!0,trim:r=!0,width:s=80,wrapMode:o=D.PRESERVE_WORDS}=e;if(r&&t.trim()==="")return"";let i=t.normalize("NFC").replaceAll(`\r
33
- `,`
34
- `);return n&&(i=i.replaceAll(Br,"")),i.split(`
35
- `).map(c=>{if(r&&c.trim()==="")return"";let l;switch(o){case D.BREAK_AT_CHARACTERS:{l=Gr(c,s,r);break}case D.BREAK_WORDS:{l=Ur(c,s,r);break}case D.STRICT_WIDTH:{l=Se(c,s,r);break}default:l=Hr(c,s,r)}return Vr(l)}).join(`
36
- `)},ve=80,Ae=24,yt=(t,e,{shell:n,env:r}={})=>Te(t,e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:n,env:r}).trim(),tt=(t,e)=>({columns:Number.parseInt(t,10),rows:Number.parseInt(e,10)}),xe=(t,e)=>{const{columns:n,rows:r}=tt(t,e);if(!(Number.isNaN(n)||Number.isNaN(r))&&!(n===ve&&r===Ae))return{columns:n,rows:r}},Yr=()=>{if(T.platform!=="linux")return!0;try{const t=V.readFileSync("/proc/self/stat","utf8"),e=t.lastIndexOf(") ");if(e===-1)return!1;const n=t.slice(e+2).trim().split(/\s+/),r=Number.parseInt(n[2],10),s=Number.parseInt(n[5],10);return Number.isNaN(r)||Number.isNaN(s)||s<=0?!1:r===s}catch{return!1}};function Jr(){const{env:t,stdout:e,stderr:n}=T;if(e?.columns&&e?.rows)return tt(e.columns,e.rows);if(n?.columns&&n?.rows)return tt(n.columns,n.rows);if(t.COLUMNS&&t.LINES)return tt(t.COLUMNS,t.LINES);const r={columns:ve,rows:Ae};return T.platform==="win32"?ft()??r:T.platform==="darwin"?Ut()??ft()??r:Ut()??ft()??Kr()??r}const Ut=()=>{try{const t=T.platform==="darwin"?V.constants.O_EVTONLY|V.constants.O_NONBLOCK:V.constants.O_NONBLOCK,{columns:e,rows:n}=Be.WriteStream(V.openSync("/dev/tty",t));return{columns:e,rows:n}}catch{}},ft=()=>{try{const t=yt("tput",["cols"],{env:{TERM:"dumb",...T.env}}),e=yt("tput",["lines"],{env:{TERM:"dumb",...T.env}});if(t&&e)return xe(t,e)}catch{}},Kr=()=>{try{if(!Yr())return;const t=yt("resize",["-u"]).match(/\d+/g);if(t.length===2)return xe(t[0],t[1])}catch{}},Zr=t=>{const e=Object.keys(t).map(n=>t[n].badge??"");return e.length===0?"":e.reduce((n,r)=>n.length>r.length?n:r,"")},Xr=t=>{const e=Object.keys(t).map(n=>t[n].label??"");return e.length===0?"":e.reduce((n,r)=>n.length>r.length?n:r,"")},{bold:Qr,cyan:ts,green:qt,grey:es,magenta:ns,red:rs,yellow:dt}=et,ss={indent:2,quoteStyle:"single",stylize:(t,e)=>{const n={bigint:dt,boolean:dt,date:ns,null:Qr,number:dt,regexp:rs,special:ts,string:qt,symbol:qt,undefined:es};return Object.hasOwn(n,e)?n[e](t):t}},{bold:os,underline:is}=et,cs=(t,e)=>{let n=e.uppercase.label?t.toUpperCase():t;return n=e.underline.label?is(n):n,e.bold.label&&(n=os(n)),n},ls=t=>[t.getHours(),t.getMinutes(),t.getSeconds()].map(e=>String(e).padStart(2,"0")).join(":");class as{styles;loggerTypes;constructor(e){this.styles={bold:{label:!1},dateFormatter:ls,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...e},this.loggerTypes=je}setLoggerTypes(e){this.loggerTypes=e}}const{bgGrey:us,cyan:fs,green:ds,greenBright:hs,grey:E,red:ht,underline:Yt,white:ps}=et,gs=/[\\/]pail[\\/]dist/,pt=t=>!gs.test(t);class ws extends as{#t;#r;#s;#c=!1;#o;#n;#e;#i=!1;#l="";#a="";constructor(e={}){const{error:n,inspect:r,...s}=e;super({uppercase:{label:!0,...s.uppercase},...s}),this.#o={...ss,...r},this.#n={...n,color:{fileLine:ds,hint:fs,marker:ht,message:ht,method:hs,title:ht}},this.#t=Oe,this.#r=ke,this.#u()}setLoggerTypes(e){super.setLoggerTypes(e),this.#u()}setStdout(e){this.#t=e,this.#e=void 0,this.#i=!1}setStderr(e){this.#r=e}setInteractiveManager(e){this.#s=e}setIsInteractive(e){this.#c=e}log(e){this._log(this._formatMessage(e),e.type.level)}#u(){this.#l=Zr(this.loggerTypes),this.#a=Xr(this.loggerTypes)}#f(){return!this.#i&&typeof this.#t.on=="function"&&(this.#i=!0,this.#t.on("resize",()=>{this.#e=void 0})),this.#e===void 0&&(this.#e=Jr().columns),this.#e}_formatMessage(e){let n=this.#f();typeof this.styles.messageLength=="number"&&(n=this.styles.messageLength);const{badge:r,context:s,date:o,error:i,file:c,groups:l,label:a,message:u,prefix:d,repeated:h,scope:f,suffix:p,traceError:g,type:m}=e,{color:$}=this.loggerTypes[m.name],S=$?et[$]:ps,w=l.map(()=>" ").join(""),y=[];if(l.length>0&&y.push(`${w+E(`[${l.at(-1)??""}]`)} `),o&&y.push(`${E(this.styles.dateFormatter(typeof o=="string"?new Date(o):o))} `),r)y.push(S(r));else{const b=this.#l;b.length>0&&y.push(`${E(".".repeat(b.length))} `)}const v=this.#a;if(a){const b=A(v),N=A(a);y.push(`${S(cs(a,this.styles))} `,E(".".repeat(Math.max(0,b-N))))}else y.push(E(".".repeat(v.length+2)));h&&y.push(`${us.white(`[${String(h)}x]`)} `),Array.isArray(f)&&f.length>0&&y.push(` ${E(`[${f.join(" > ")}]`)} `),d&&y.push(`${E(`${Array.isArray(f)&&f.length>0?". ":" "}[${this.styles.underline.prefix?Yt(d):d}]`)} `);const x=A(y.join(" "));if(c){const b=(c.name??"")+(c.line?`:${String(c.line)}`:""),N=A(b);if(N+x+2>n)y.push(E(` ${b}`));else{const ot=Math.max(0,n-x-N-2);y.push(E(`${".".repeat(ot)} ${b}`))}}else y.push(E(".".repeat(Math.max(0,n-x-1))));if(y.length>0&&y.push(`
37
-
38
- `),u!==Me){const b=typeof u=="string"?u:Rt(u,this.#o);y.push(w+qr(b,{trim:!1,width:n-3,wrapMode:D.PRESERVE_WORDS}))}if(s){let b=!1;y.push(...s.map(N=>{if(N instanceof Error)return b=!0,`
39
-
40
- ${it(N,{...this.#n,filterStacktrace:pt,prefix:w})}`;if(typeof N=="object")return` ${Rt(N,this.#o)}`;const ot=(b?`
41
-
42
- `:" ")+String(N);return b=!1,ot}))}return i&&y.push(it(i,{...this.#n,filterStacktrace:pt,prefix:w})),g&&y.push(`
43
-
44
- ${it(g,{...this.#n,filterStacktrace:pt,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:w})}`),p&&y.push(`
45
- `,w+E(this.styles.underline.suffix?Yt(p):p)),y.join("")}_log(e,n){const r=We(n)?"stderr":"stdout",s=r==="stderr"?this.#r:this.#t;this.#c&&this.#s!==void 0&&s.isTTY?this.#s.update(r,e.split(`
46
- `),0):Fe(`${e}
47
- `,s)}}export{ws as PrettyReporter};
@@ -1,36 +0,0 @@
1
- import{createRequire as yt}from"node:module";import Pe from"@visulima/colorize";let bt;const $t=e=>(bt??=yt(import.meta.url))(e),z=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:I,fe=e=>{if(typeof z<"u"&&z.versions&&z.versions.node){const[t,n]=z.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return z.getBuiltinModule(e)}return $t(e)},I=z,{execFileSync:wt}=fe("node:child_process"),P=fe("node:fs"),vt=fe("node:tty"),qr={alert:7,critical:6,debug:1,emergency:8,error:5,informational:2,notice:3,trace:2,warning:4},St={alert:{color:"red",label:"alert",logLevel:"alert"},await:{color:"blue",label:"awaiting",logLevel:"informational"},complete:{color:"cyan",label:"complete",logLevel:"informational"},critical:{color:"redBright",label:"critical",logLevel:"critical"},debug:{color:"gray",label:"debug",logLevel:"debug"},emergency:{color:"redBright",label:"emergency",logLevel:"emergency"},error:{color:"red",label:"error",logLevel:"error"},info:{color:"blueBright",label:"info",logLevel:"informational"},log:{label:"",logLevel:"informational"},notice:{color:"magentaBright",label:"notice",logLevel:"notice"},pending:{color:"magenta",label:"pending",logLevel:"informational"},start:{color:"greenBright",label:"start",logLevel:"informational"},stop:{color:"red",label:"stop",logLevel:"informational"},success:{color:"green",label:"success",logLevel:"informational"},trace:{color:"cyanBright",label:"trace",logLevel:"trace"},wait:{color:"blue",label:"waiting",logLevel:"informational"},warn:{color:"yellow",label:"warning",logLevel:"warning"},warning:{color:"yellow",label:"warning",logLevel:"warning"},watch:{color:"yellowBright",label:"watching",logLevel:"informational"}},Yr=Symbol("EMPTY"),Jr=e=>{const t=Object.keys(e).map(n=>e[n].label??"");return t.length===0?"":t.reduce((n,r)=>n.length>r.length?n:r,"")},E="[Inspection threw]",b=(e,t,n,r,o,s=", ",i=Number.POSITIVE_INFINITY)=>{const l=e.length;if(l===0)return"";const c=Number.isFinite(i)&&l>i,a=c?Math.max(0,Math.floor(i)):l;if(a===0)return`…(${String(l)})`;let u=r;o!==void 0&&(u=o);const d=n.truncate,g=Number.isFinite(d);let f="",h="",p="";for(let m=0;m<a;m+=1){const y=m+1===a,$=m+2===a;g&&(p=`…(${String(a-m)})`);let v=e[m];n.truncate=d-f.length-(y?0:s.length);const x=h||u(v,t,n,r)+(y?"":s),w=f.length+x.length,L=w+p.length;if(y&&w>d&&f.length+p.length<=d||!y&&!$&&L>d)break;v=e[m+1];const T=$?"":s;if(y?h="":h=u(v,t,n,r)+T,!y&&$&&L>d&&w+h.length>d)break;if(f+=x,!y&&!$&&w+h.length>=d){p=`…(${String(a-m-1)})`;break}p=""}return c&&p===""&&(p=`${s}… ${String(l-a)} more`),`${f}${p}`},At=([e,t],n,r)=>(r.truncate-=3,t?`${r.stylize(String(e),"yellow")}=${r.stylize(`"${t}"`,"string")}`:r.stylize(String(e),"yellow")),Ce=e=>{try{return Object.create(e,{length:{value:e.length}})}catch{return}},Et=(e,t,n,r)=>{let o;try{o=e.nodeType}catch{return E}if(o===1)return De(e,e,n,r);if(o===3){let s;try{s=e.data}catch{return E}return r(s,void 0,n)}return r(e,void 0,n)},ce=(e,t,n,r)=>{const o=Ce(e);return o===void 0?E:b(o,e,t,n,Et,`
2
- `)},De=(e,t,n,r)=>{let o,s;try{o=e.getAttributeNames().map(f=>[f,e.getAttribute(f)]),s=e.tagName.toLowerCase()}catch{return E}const i=n.stylize(`<${s}`,"special"),l=n.stylize(">","special"),c=n.stylize(`</${s}>`,"special");n.truncate-=s.length*2+5;let a="";o.length>0&&(a+=" ",a+=b(o,t,n,r,At," ")),n.truncate-=a.length;const{truncate:u}=n;let d;try{d=Ce(e.children)}catch{d=void 0}let g;return d===void 0?g=E:(g=ce(d,n,r),g&&g.length>u&&(g=`…(${String(d.length)})`)),`${i}${a}${l}${g}${c}`},xt=(e,t,n)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${b(e,e,t,n,void 0,", ",t.maxArrayLength)} ]`),Nt=(e,t)=>{let n;if(e===" ")n=" ";else if(typeof e=="number"&&e>0)n=Array.from({length:e+1}).join(" ");else return;return{base:n,prev:`
3
- ${Array.from({length:t+1}).join(n)}`}},Q=(e,t)=>{if(e.length===0)return"";const n=t.prev+t.base;return n+e.split("\0\0").join(`,${n}`)+t.prev},It=/^[a-z_]\w*$/i,Ot=/^"|"$/g,kt=(e,t)=>{if(It.test(e))return e;const n=JSON.stringify(e);return t.quoteStyle==="double"?n.replaceAll('"',String.raw`\"`):n.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(Ot,"'")},C=([e,t],n,r,o)=>{r.truncate-=2;let s;typeof e=="string"?s=kt(e,r):typeof e=="number"?s=String(e):s=`[${o(e,n,r)}]`,r.truncate-=s.length;const i=o(t,n,r);return`${s}: ${i}`},Bt=Symbol.for("chai/inspect"),ne=e=>({[Bt]:()=>e}),D=(e,t)=>{let n;try{n=Object.getOwnPropertyDescriptor(e,t)}catch{n=void 0}if(n===void 0||"value"in n)try{return e[t]}catch{return ne(E)}if(n.get===void 0)return ne("[Setter]");try{return e[t]}catch{return ne(E)}},Lt=e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},Tt=e=>{const t=[];for(const n of Object.keys(e)){const r=Number(n);Number.isInteger(r)&&r>=0&&String(r)===n&&r<4294967295||t.push(n)}return t},jt=(e,t,n,r)=>{const o=Tt(e);if(e.length===0&&o.length===0)return"[]";t.truncate-=4;const s=!!r&&Lt(e);let i=b(e,e,t,n,void 0,s?"\0\0":", ",t.maxArrayLength);t.truncate-=i.length;let l="";return o.length>0&&(l=b(o.map(c=>[c,D(e,c)]),e,t,n,C)),s&&r&&(i=Q(i,r)),`[${s?"":" "}${i}${l?`, ${l}`:""}${s?"":" "}]`},Ft=50,pe=(e,t)=>{const n=new Uint8Array(e),r=Math.min(n.length,Ft);let o="",s=!1;for(let a=0;a<r;a+=1){const u=n[a];u!==0&&(s=!0),o+=(a===0?"":" ")+u.toString(16).padStart(2,"0")}n.length>r&&(o+=` ... ${String(n.length-r)} more byte${n.length-r===1?"":"s"}`);const i=e instanceof ArrayBuffer?"ArrayBuffer":"SharedArrayBuffer",l=s||n.length>r,c=o!==""&&l?`[Uint8Contents]: <${o}>, `:"";return`${t.stylize(i,"special")} { ${c}byteLength: ${t.stylize(String(e.byteLength),"number")} }`},me=/\d(?=(?:\d{3})+(?!\d))/g,Wt=/\d{3}/g,Mt=/_$/,Ve=(e,t)=>{if(t.length<4||t.length===4&&t.codePointAt(0)===45||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY||t.includes("e"))return t;if(typeof e=="number"){const n=e<0?-Math.floor(-e):Math.floor(e);if(n!==e){const r=String(n),o=t.slice(r.length+1);return`${r.replace(me,"$&_")}.${o.replace(Wt,"$&_").replace(Mt,"")}`}}return t.replace(me,"$&_")},_t=e=>e>="\uD800"&&e<="\uDBFF",B=(e,t,n="…")=>{e=String(e);const r=n.length,o=e.length;if(r>t&&o>r)return n;if(o>t&&o>r){let s=t-r;return s>0&&_t(e[s-1])&&(s-=1),`${e.slice(0,s)}${n}`}return e},ye=(e,t)=>{let n=B(e.toString(),t.truncate-1);return n!=="…"&&(n+="n"),t.stylize(t.numericSeparator?Ve(e,n):n,"bigint")},Ge=e=>{try{return Array.isArray(e)}catch{return!1}},F=(e,t)=>{try{return e[t]}catch{return}},zt=(e,t)=>{try{return e instanceof t}catch{return!1}},be=(e,t)=>{try{return Object.getOwnPropertyDescriptor(e,t)?.enumerable??!1}catch{return!0}},Rt=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),K=(e,t,n,r)=>{if("window"in globalThis&&e===globalThis)return"{ [object Window] }";if(e===globalThis)return"{ [object globalThis] }";let o,s;try{o=Object.getOwnPropertyNames(e),s=Object.getOwnPropertySymbols(e)}catch{return E}let i,l;try{i=t.showHidden?o:o.filter(f=>Object.getOwnPropertyDescriptor(e,f)?.enumerable)}catch{i=o.filter(f=>be(e,f))}try{l=s.filter(f=>t.showHidden||Object.getOwnPropertyDescriptor(e,f)?.enumerable)}catch{l=s.filter(f=>be(e,f))}let c;try{const f=Rt(e)===Object.prototype||e.constructor===Object,h=e instanceof Object?"":"null prototype";let p;!f&&Symbol.toStringTag in e?p=e[Symbol.toStringTag]:p=h?"Object":"",c=p||h?`[${[p,h].filter(Boolean).join(": ")}] `:""}catch{c=""}if(i.length===0&&l.length===0)return`${c}{}`;t.truncate-=4;const a=r?"\0\0":", ",u=b(i.map(f=>[f,D(e,f)]),e,t,n,C,a),d=b(l.map(f=>[f,D(e,f)]),e,t,n,C,a);let g="";return u&&d&&(g=a),r?`${c}{${Q(u+g+d,r)}}`:`${c}{ ${u}${g}${d} }`},Pt=(e,t,n,r)=>{let o;try{o=typeof e.constructor=="function"?e.constructor.name:""}catch{o=""}return(!o||o==="_class")&&(o="<Anonymous Class>"),t.truncate-=o.length,`${o} ${K(e,t,n,r)}`},Ct=(e,t)=>{const n=t.stylize(String(e.byteLength),"number"),r=t.stylize(String(e.byteOffset),"number"),o=t.stylize(String(e.buffer.byteLength),"number");return`${t.stylize("DataView","special")} { byteLength: ${n}, byteOffset: ${r}, buffer: ArrayBuffer { byteLength: ${o} } }`},Dt=(e,t)=>{const n=e.toJSON();if(n===null)return"Invalid Date";const r=n.split("T"),o=r[0];return t.stylize(`${o}T${B(r[1],t.truncate-o.length-1)}`,"date")},Vt=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),Gt=(e,t,n)=>{const r=Object.getOwnPropertyNames(e).filter(l=>!Vt.has(l)),{name:o}=e;t.truncate-=o.length;let s="";typeof e.message=="string"?s=B(e.message,t.truncate):r.unshift("message"),s=s?`: ${s}`:"",t.truncate-=s.length+5;const i=b(r.map(l=>[l,D(e,l)]),e,t,n,C);return`${o}${s}${i?` { ${i} }`:""}`},$e=(e,t)=>{let n,r,o;try{n=e[Symbol.toStringTag]||"Function",r=e.toString(),{name:o}=e}catch{return t.stylize(E,"special")}return r.length<t.truncate-12?t.stylize(`[${n}: ${r}]`,"special"):o?t.stylize(`[${n} ${B(o,t.truncate-11)}]`,"special"):t.stylize(`[${n}]`,"special")},we=(e,t)=>{const n=F(e,Symbol.toStringTag),r=typeof n=="string"?n:"Generator";return`${t.stylize(`Object [${r}]`,"special")} {}`},Ht=([e,t],n,r,o)=>(r.truncate-=4,e=o(e,n,r),r.truncate-=e.length,`${e} => ${o(t,n,r)}`),Ut=(e,t,n,r)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let o=b([...e.entries()],e,t,n,Ht,r?"\0\0":", ",t.maxArrayLength);return r&&(o=Q(o,r)),`Map (${String(e.size)}) {${r?"":" "}${o}${r?"":" "}}`};function ve(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(B(t.numericSeparator?Ve(e,e.toString()):e.toString(),t.truncate),"number")}const qt=()=>"Promise{…}",Yt=(e,t)=>{const n=t.truncate-(2+e.flags.length);return t.stylize(`/${B(e.source,n)}/${e.flags}`,"regexp")},Jt=(e,t,n,r)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let o=b([...e],e,t,n,void 0,r?"\0\0":", ",t.maxArrayLength);return r&&(o=Q(o,r)),`Set (${String(e.size)}) {${r?"":" "}${o}${r?"":" "}}`},Kt=(e,t)=>{const n=t.quoteStyle==="double"?'"':"'";return n+e+n},Se=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"),Zt={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},Xt=16,Qt=e=>Zt[e]||String.raw`\u${`0000${e.codePointAt(0).toString(Xt)}`.slice(-4)}`,Ae=(e,t)=>(Se.test(e)&&(e=e.replaceAll(Se,Qt)),t.stylize(Kt(B(e,t.truncate-2),t),"string")),Ee=e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),en=e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],S=(e,t,n)=>{const r=en(e);t.truncate-=r.length+4;const o=Object.keys(e).slice(e.length);if(e.length===0&&o.length===0)return`${r}[]`;let s="";const i=Number.isFinite(t.maxArrayLength)?Math.min(e.length,Math.max(0,Math.floor(t.maxArrayLength))):e.length;for(let c=0;c<i;c++){const a=`${t.stylize(B(e[c],t.truncate),"number")}${c===i-1?"":", "}`;if(t.truncate-=a.length,c!==i-1&&t.truncate<=3){s+=`…(${String(e.length-c)})`;break}s+=a}i<e.length&&(s+=`${s?", ":""}… ${String(e.length-i)} more`);let l="";return o.length>0&&(l=b(o.map(c=>[c,D(e,c)]),e,t,n,C)),`${r}[ ${s}${l?`, ${l}`:""} ]`},xe=e=>typeof F(e,Symbol.toStringTag)!="string",tn=e=>typeof e=="function",He=(e,t,n)=>{if(e==null)return;const r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0)return;const o=n==="get"?r.get:r.value;return typeof o=="function"?o:void 0},Ue=(e,t)=>{if(e!==void 0)return n=>{try{return e.call(n,t),!0}catch{return!1}}},j=(e,t)=>Ue(He(e,t,"get")),N=(e,t,n)=>Ue(He(e,t,"value"),n),Ne=Object.freeze({}),A=j(Reflect.getPrototypeOf(Int8Array.prototype),"length"),nn=typeof SharedArrayBuffer=="function"?SharedArrayBuffer.prototype:void 0,rn=Object.assign(Object.create(null),{Arguments:xe,Array:Ge,ArrayBuffer:j(ArrayBuffer.prototype,"byteLength"),BigInt:N(BigInt.prototype,"valueOf"),Boolean:N(Boolean.prototype,"valueOf"),DataView:j(DataView.prototype,"byteLength"),Date:N(Date.prototype,"valueOf"),Error:xe,Float32Array:A,Float64Array:A,Function:tn,Int8Array:A,Int16Array:A,Int32Array:A,Map:j(Map.prototype,"size"),Number:N(Number.prototype,"valueOf"),RegExp:j(RegExp.prototype,"source"),Set:j(Set.prototype,"size"),SharedArrayBuffer:j(nn,"byteLength"),String:N(String.prototype,"valueOf"),Symbol:N(Symbol.prototype,"valueOf"),Uint8Array:A,Uint8ClampedArray:A,Uint16Array:A,Uint32Array:A,WeakMap:N(WeakMap.prototype,"has",Ne),WeakSet:N(WeakSet.prototype,"has",Ne)}),on=(e,t)=>{const n=rn[t];return n===void 0||n(e)},Ie=new WeakMap,Oe=Object.create(null),sn=Object.assign(Object.create(null),{Arguments:xt,Array:jt,ArrayBuffer:pe,AsyncGenerator:we,BigInt:ye,bigint:ye,Boolean:(e,t)=>t.stylize(String(e),"boolean"),boolean:(e,t)=>t.stylize(String(e),"boolean"),DataView:Ct,Date:Dt,Error:Gt,Float32Array:S,Float64Array:S,Function:$e,function:$e,Generator:we,HTMLCollection:ce,Int8Array:S,Int16Array:S,Int32Array:S,Map:Ut,NodeList:ce,null:(e,t)=>t.stylize("null","null"),Number:ve,number:ve,Promise:qt,RegExp:Yt,Set:Jt,SharedArrayBuffer:pe,String:Ae,string:Ae,Symbol:Ee,symbol:Ee,Uint8Array:S,Uint8ClampedArray:S,Uint16Array:S,Uint32Array:S,undefined:(e,t)=>t.stylize("undefined","undefined"),WeakMap:(e,t)=>t.stylize("WeakMap{…}","special"),WeakSet:(e,t)=>t.stylize("WeakSet{…}","special")}),ln=Symbol.for("nodejs.util.inspect.custom"),cn=Symbol.for("chai/inspect"),an=(e,t,n,r)=>{const o=F(e,cn);if(typeof o=="function")return o.call(e,t);if(!("window"in globalThis)){const c=F(e,ln);if(typeof c=="function")return c.call(e,r,t)}const s=F(e,"inspect");if(typeof s=="function")return s.call(e,r,t);const i=F(e,"constructor");if(typeof i=="function"&&Ie.has(i))return Ie.get(i)?.(e,t)??"unknown";const l=Object.hasOwn(Oe,n)?Oe[n]:void 0;return l?l(e,t):""},re=(e,t,n)=>{const{depth:r,inspect:o,seen:s}=n;if(s.includes(e))return"[Circular]";if(r>=t.depth&&t.depth>0&&typeof e=="object"&&e!==null)return Ge(e)?"[Array]":"[Object]";const i=t.indent?Nt(t.indent,r):void 0;let l=e===null?"null":typeof e;if(l==="object")try{l=Object.prototype.toString.call(e).slice(8,-1)}catch{l="Object"}let c=sn[l];if(c!==void 0&&typeof e=="object"&&e!==null&&!on(e,l)&&(c=void 0),c!==void 0)return c(e,t,o,i);if(t.customInspect&&e){const d=an(e,t,l,t.depth-r);if(d)return typeof d=="string"?d:o(d,e,t)}let a=!1;if(e)try{a=Object.getPrototypeOf(e)}catch{a=Object.prototype}if(a===Object.prototype||a===null)return K(e,t,o,i);if(e&&typeof HTMLElement=="function"&&zt(e,HTMLElement))return De(e,e,t,o);const u=F(e,"constructor");return u!==void 0?u!==Object?Pt(e,t,o,i):K(e,t,o,i):e===Object(e)?K(e,t,o,i):t.stylize(String(e),l)},Kr=(e,t={})=>{const n={customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,stylize:o=>o,truncate:Number.POSITIVE_INFINITY,...t};if(n.indent!==void 0&&n.indent!==" "&&!(Number.parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');const r={depth:0,inspect:void 0,seen:[]};return r.inspect=(o,s,i)=>{if(s==null){r.depth+=1;const c=re(o,i,r);return r.depth-=1,c}r.seen.push(s),r.depth+=1;const l=re(o,i,r);return r.depth-=1,r.seen.pop(),l},re(e,n,r)},un=new Set(["alert","critical","emergency","error","trace","warning"]),Zr=e=>un.has(e),Xr=(e,t)=>t?(t.__write??t.write.bind(t)).call(t,e):!1,fn=globalThis.process??Object.create(null),ke={versions:{}},V=new Proxy(fn,{get(e,t){if(t in e)return e[t];if(t in ke)return ke[t]}}),ee=e=>{let t;return()=>{if(t===void 0){if(typeof V.getBuiltinModule!="function")throw new TypeError(`[@visulima/error] Cannot load ${e}: this runtime implements no process.getBuiltinModule(). Requires Node ^22.14.0 || >=24.10.0, or another runtime providing process.getBuiltinModule().`);t=V.getBuiltinModule(e)}return t}},dn=e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
4
- `),gn=(e,t,n,r)=>{const o={column:0,line:-1,...e.start},s={...o,...e.end},i=o.line,l=o.column,c=s.line,a=s.column;let u=Math.max(i-(n+1),0),d=Math.min(t.length,c+r);i===-1&&(u=0),c===-1&&(d=t.length);const g=c-i,f={};if(g)for(let h=0;h<=g;h++){const p=h+i;if(!l)f[p]=!0;else if(h===0){const m=t[p-1]?.length;f[p]=[l,(m??0)-l+1]}else if(h===g)f[p]=[0,a];else{const m=t[p-h]?.length;f[p]=[0,m]}}else l===a?f[i]=l?[l,0]:!0:f[i]=[l,(a??0)-(l??0)];return{end:d,markerLines:f,start:u}},hn=V.platform==="win32"&&!V.env?.WT_SESSION?">":"❯",pn=(e,t,n)=>{const r={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...n,color:{gutter:h=>h,marker:h=>h,message:h=>h,...n?.color}},o=typeof t.start.column=="number";let s=(e.includes("\r")?dn(e):e).split(`
5
- `);typeof r.tabWidth=="number"&&e.includes(" ")&&(s=s.map(h=>h.replaceAll(" "," ".repeat(r.tabWidth))));const{end:i,markerLines:l,start:c}=gn(t,s,r.linesAbove,r.linesBelow),a=String(i).length,{gutter:u,marker:d,message:g}=r.color;let f=s.slice(c,i).map((h,p)=>{const m=c+1+p,y=l[m],$=String(m).padStart(a),v=!l[m+1],x=` ${$}${r.showGutter?" |":""}`;if(y){let w="";if(Array.isArray(y)){const L=h.replaceAll(/[^\t]/g," ").slice(0,Math.max(y[0]-1,0)),T=y[1]||1;w=[`
6
- `,r.prefix+u(x.replaceAll(/\d/g," "))," ",L,d("^").repeat(T)].join(""),v&&r.message&&(w+=` ${g(r.message)}`)}return[r.prefix+d(hn),u(x),h.length>0?` ${h}`:"",w].join("")}return`${r.prefix} ${u(x)}${h.length>0?` ${h}`:""}`}).join(`
7
- `);return r.message&&!o&&(f=`${r.prefix+" ".repeat(a+1)+r.message}
8
- ${f}`),f},mn=()=>V.env?.DEBUG==="true",M=(e,...t)=>{if(mn()){const n=t.map(r=>typeof r=="function"?r():r);console.debug(`error:parse-stacktrace: ${e}`,...n)}},_="<unknown>",yn=/^(?:node:internal\/|node:|internal\/)/,bn=e=>e!==void 0&&yn.test(e),$n=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,wn=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,vn=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,Sn=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,An=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,En=/in\s(.*)\s\(at\s(.+)\)\sat/,xn=/^(?:.*@)?(.*):(\d+):(\d+)$/,Nn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,In=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,On=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,Be=/\(error: ([^)]*)\)/,kn=/at\s/,Bn=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,Ln=/Error: |AggregateError:/,qe=/^Anonymous function$/,Tn=/^\s*in\s.*/,jn=/^.*?\s*at\s.*/,Fn=/^.*?\s*@.*|\[native code\]/,Ye=(e,t)=>{const n=e.includes("safari-extension"),r=e.includes("safari-web-extension");return n||r?[e.includes("@")?e.split("@")[0]:_,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Je=(e,t)=>{const n=vn.exec(t);n&&(e.file=n[1],e.line=+n[2],e.column=+n[3])},Wn=e=>{const t=En.exec(e);if(t){M(`parse nested node error stack line: "${e}"`,()=>`found: ${JSON.stringify(t)}`);const r=t[2].split(":");return{column:r[2]?+r[2]:void 0,file:r[0],line:r[1]?+r[1]:void 0,methodName:t[1]??_,raw:e,type:void 0}}const n=An.exec(e);if(n){M(`parse node error stack line: "${e}"`,()=>`found: ${JSON.stringify(n)}`);const r={column:n[4]?+n[4]:void 0,file:n[2]?n[2].replace(kn,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]??_,raw:e,type:e.startsWith("internal")?"internal":void 0};return Je(r,`${n[2]}:${n[3]}:${n[4]}`),r}},Mn=e=>{const t=$n.exec(e);if(t){M(`parse chrome error stack line: "${e}"`,()=>`found: ${JSON.stringify(t)}`);const n=t[2]?.startsWith("native"),r=t[2]?.startsWith("eval")||t[1]?.startsWith("eval");let o,s;if(r){const a=wn.exec(e);if(a){const u=Bn.exec(a[1]);u?(t[2]=u[4]??u[1],t[3]=u[5]??u[2],t[4]=u[3]):a[2]&&(t[2]=a[1]),a[2]&&(o={column:a[4]?+a[4]:void 0,file:a[2],line:a[3]?+a[3]:void 0,methodName:"eval",raw:e,type:"eval"})}else{const u=Sn.exec(e);u&&(s={column:u[4]?+u[4]:void 0,file:u[2],line:u[3]?+u[3]:void 0},o={column:u[6]?+u[6]:void 0,file:u[1],line:u[5]?+u[5]:void 0,methodName:"eval",raw:u[0],type:"eval"})}}const[i,l]=Ye(t[1]?t[1].replace(qe,"<anonymous>"):_,t[2]),c={column:t[4]?+t[4]:void 0,evalOrigin:o,file:l,line:t[3]?+t[3]:void 0,methodName:i,raw:e,type:r?"eval":n?"native":bn(l)?"internal":void 0};return s?(c.column=s.column,c.file=s.file,c.line=s.line):Je(c,`${l}:${t[3]}:${t[4]}`),c}},_n=(e,t)=>{const n=Nn.exec(e);if(n){M(`parse gecko error stack line: "${e}"`,()=>`found: ${JSON.stringify(n)}`);const r=n[3]?.includes(" > eval"),o=r&&n[3]&&In.exec(n[3]);let s;r&&o&&(n[3]=o[1],s={column:n[5]?+n[5]:void 0,file:n[3],line:n[4]?+n[4]:void 0,methodName:"eval",raw:e,type:"eval"},n[4]=o[2]);const[i,l]=Ye(n[1]?n[1].replace(qe,"<anonymous>"):_,n[3]);let c;(t?.type==="safari"||!r&&t?.type==="firefox")&&t.column?c=t.column:!r&&n[5]&&(c=+n[5]);let a;return(t?.type==="safari"||!r&&t?.type==="firefox")&&t.line?a=t.line:n[4]&&(a=+n[4]),{column:c,evalOrigin:s,file:l,line:a,methodName:i,raw:e,type:r?"eval":l.includes("[native code]")?"native":void 0}}},zn=(e,t)=>{const n=On.exec(e);if(!(n&&n[2].includes(" > eval"))&&n)return M(`parse firefox error stack line: "${e}"`,()=>`found: ${JSON.stringify(n)}`),{column:n[4]?+n[4]:t?.column??void 0,file:n[2],line:n[3]?+n[3]:t?.line??void 0,methodName:n[1]||_,raw:e,type:void 0}},Rn=e=>{const t=xn.exec(e);if(t)return M(`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:_,raw:e,type:void 0}},Ke=(e,{filter:t,frameLimit:n=50}={})=>{const r=e;let o=(typeof r.stacktrace=="string"?r.stacktrace:e.stack??"").split(`
9
- `).map(s=>(Be.test(s)?s.replace(Be,"$1"):s).trim()).filter(s=>!Ln.test(s)&&s!=="eval code");return t&&(o=o.filter(s=>t(s))),o=o.slice(0,n),o.reduce((s,i,l)=>{if(!i||i.length>1024)return s;let c;if(Tn.test(i))c=Wn(i);else if(jn.test(i))c=Mn(i);else if(Fn.test(i)){let a;if(l===0){const u=e,d=u.columnNumber,g=u.lineNumber,f=u.line,h=u.column;d||g?a={column:d,line:g,type:"firefox"}:(f||h)&&(a={column:h,line:f,type:"safari"})}c=zn(i,a)??_n(i,a)}else c=Rn(i);return c?s.push(c):M(`parse error stack line: "${i}"`,"not parser found"),s},[])},Le=ee("node:fs"),Z=ee("node:path"),Pn=ee("node:process"),Cn=ee("node:url"),O=(e,t,n)=>n===0?e:t===" "?e+" ".repeat(n):e+" ".repeat(t*n),Ze=e=>e.replaceAll("\\","/"),Dn=e=>{if(!e.startsWith("file:"))return e;try{return Cn().fileURLToPath(e)}catch{return e}},Vn=(e,t)=>{const n=e.replace("async file:","file:");return Ze(Z().relative(t,Dn(n)))},Gn=(e,t,n)=>{if(t)return n.title(e.message);const r=e.message?`: ${e.message}`:"";return n.title(e.name+r)},Xe=(e,{color:t,hideErrorTitle:n,indentation:r,prefix:o},s)=>`${O(o,r,s)}${Gn(e,n,t)}
10
- `,Qe=(e,{color:t,indentation:n,prefix:r},o)=>{if(e.hint===void 0)return;const s=O(r,n,o);let i="";if(Array.isArray(e.hint))for(const l of e.hint)i+=`${s+l}
11
- `;else i+=s+e.hint;return t.hint(i)},de=(e,t)=>{if(!t||e.file===void 0||e.line===void 0)return{trace:e};try{const n=t({column:e.column,file:e.file,line:e.line});return n?{source:n.source,trace:{...e,column:n.column??e.column,file:n.file??e.file,line:n.line??e.line}}:{trace:e}}catch{return{trace:e}}},ge=(e,t,n=0)=>{const{color:r,cwd:o,displayShortPath:s,indentation:i,prefix:l}=t,{trace:c}=e;let a;c.file===void 0?a="<unknown>":a=s?Vn(c.file,o):Ze(c.file);const{fileLine:u,method:d}=r;return`${O(l,i,n)}at ${c.methodName?`${d(c.methodName)} `:""}${u(a)}:${u(c.line?.toString()??"")}`},Hn=(e,t)=>{if(t.allowAllFilePaths)return!0;const n=Z().resolve(t.cwd),r=Z().resolve(n,e);return r===n||r.startsWith(n+Z().sep)},Un=e=>{try{return Le().existsSync(e)?Le().readFileSync(e,"utf8"):void 0}catch{return}},et=(e,t,n)=>{const{color:r,indentation:o,linesAbove:s,linesBelow:i,prefix:l,showGutter:c,showLineNumbers:a,tabWidth:u}=t,{source:d,trace:g}=e;if(g.file===void 0)return;let f;if(d===void 0){const h=g.file.replace("file://","");if(!Hn(h,t))return;const p=Un(h);if(p===void 0)return;f=p}else f=d;return pn(f,{start:{column:g.column,line:g.line}},{color:r,linesAbove:s,linesBelow:i,prefix:O(l,o,n),showGutter:c,showLineNumbers:a,tabWidth:u})},tt=(e,t,n)=>{if(e.errors.length===0)return;let r=`${O(t.prefix,t.indentation,n)}Errors:
12
-
13
- `,o=!0;for(const s of e.errors)o?o=!1:r+=`
14
-
15
- `,r+=rt(s,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},n+1);return`
16
- ${r}`},qn=e=>{if(typeof e=="object"&&e!==null)try{return JSON.stringify(e)}catch{return Object.prototype.toString.call(e)}return String(e)},nt=(e,t,n,r=new Set)=>{r.add(e);let o=`${O(t.prefix,t.indentation,n)}Caused by:
17
-
18
- `;const{cause:s}=e;if(!(s instanceof Error)){const c=qn(s);return o+=`${O(t.prefix,t.indentation,n)}${t.color.title(c)}
19
- `,`
20
- ${o}`}o+=Xe(s,t,n);const i=Ke(s).shift(),l=Qe(s,t,n);if(l&&(o+=`${l}
21
- `),i){const c=de(i,t.sourceMap);if(o+=ge(c,t,n),!t.hideErrorCauseCodeView){const a=et(c,t,n);a!==void 0&&(o+=`
22
- ${a}`)}}if(s instanceof AggregateError){const c=tt(s,t,n);c!==void 0&&(o+=`
23
- ${c}`)}return s.cause&&(o+=r.has(s)?`
24
- ${O(t.prefix,t.indentation,n+1)}Caused by: [Circular]`:`
25
- ${nt(s,t,n+1,r)}`),`
26
- ${o}`},Yn=(e,t)=>(e.length>0?`
27
- `:"")+e.map(n=>ge(de(n,t.sourceMap),t)).join(`
28
- `),rt=(e,t,n)=>{const r={allowAllFilePaths:!1,cwd:Pn().cwd(),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:l=>l,gutter:l=>l,hint:l=>l,marker:l=>l,message:l=>l,method:l=>l,title:l=>l,...t.color}},o=Ke(e,{filter:t.filterStacktrace,frameLimit:r.framesMaxLimit}),s=o.shift(),i=s?de(s,r.sourceMap):void 0;return[t.hideMessage?void 0:Xe(e,r,n),Qe(e,r,n),i?ge(i,r,n):void 0,i&&!r.hideErrorCodeView?et(i,r,n):void 0,e instanceof AggregateError?tt(e,r,n):void 0,e.cause===void 0||e.cause===null?void 0:nt(e,r,n),o.length>0?Yn(o,r):void 0].filter(Boolean).join(`
29
- `)},Qr=(e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return rt(e,t,0)},Jn=[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],Kn=12288,Zn=65510,Xn=[12288,12288,65281,65376,65504,65510],Qn=8361,er=65518,tr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],nr=32,rr=10630,or=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],sr=4352,ir=262141,ot=[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],H=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){const o=Math.floor((n+r)/2),s=o*2;if(t<e[s])r=o-1;else if(t>e[s+1])n=o+1;else return!0}return!1},Te=19968,[lr,cr]=ar(ot);function ar(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){const o=e[r],s=e[r+1];if(Te>=o&&Te<=s)return[o,s];s-o>n-t&&(t=o,n=s)}return[t,n]}const ur=e=>e<161||e>1114109?!1:H(Jn,e),fr=e=>e<Kn||e>Zn?!1:H(Xn,e),dr=e=>e<Qn||e>er?!1:H(tr,e),gr=e=>e<nr||e>rr?!1:H(or,e),hr=e=>e>=lr&&e<=cr?!0:e<sr||e>ir?!1:H(ot,e);function pr(e){return ur(e)?"ambiguous":fr(e)?"fullwidth":dr(e)?"halfwidth":gr(e)?"narrow":hr(e)?"wide":"neutral"}function mr(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function st(e){return mr(e),pr(e)}const it=String.raw,je=it`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,yr=()=>new RegExp(it`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${je}(?:\u200D${je})*`,"gu"),R=new Set(["\x1B","›"]),te="\x07",lt="[",he="m",G="]8;;",br=39,$r=/[\u200B\uFEFF\u2060-\u2064]/g,wr=new RegExp(`(?:\\${lt}(?<code>\\d+)m|\\${G}(?<uri>.*)${te})`),vr=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]])),ct=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,U=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Sr=yr(),Fe=new Map,Ar=e=>[e.ambiguousIsNarrow?1:0,e.control,e.fullWidth,e.regular,e.wide].join("|"),Er=e=>{const t=Ar(e.width);let n=Fe.get(t);return n||(n=new Map,Fe.set(t,n)),n},q=new RegExp(ct.source,"y"),oe=new RegExp(Sr.source,"uy"),Y=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,at=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",xr=(e,t)=>{const n=Er(t),r=Math.floor(e/65536),o=e%65536;let s=n.get(r);if(s||(s=new Map,n.set(r,s)),s.has(o))return s.get(o);let i;switch(at(e)){case"control":{i=t.width.control;break}case"latin":{i=t.width.regular;break}case"wide":{i=t.width.wide;break}case"zero":{i=0;break}default:switch(st(e)){case"ambiguous":{i=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{i=t.width.fullWidth;break}case"wide":{i=t.width.wide;break}default:i=t.width.regular}}return s.set(o,i),i},Nr=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,ae=(e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const n={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?ae(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}},r=Math.max(0,n.truncation.limit-n.truncation.ellipsisWidth),{length:o}=e,s=o>1e4;let i=0,l=0,c=o,a=!1;const u=e.includes("\x1B")||e.includes("›");for(;i<o;){if(u&&(e[i]==="\x1B"||e[i]==="›")){if(e.startsWith("\x1B]8;;",i)){const m="\x1B]8;;\x07",y=m.length,$=e.indexOf("\x07",i+5);if($!==-1){const v=e.indexOf(m,$+1);if(v!==-1){const x=v+y,w=e.slice($+1,v).replace(ct,""),L=ae(w,{ambiguousIsNarrow:n.width.ambiguousIsNarrow,ansiWidth:n.width.ansi,controlWidth:n.width.control,countAnsiEscapeCodes:!1,ellipsis:n.truncation.ellipsis,ellipsisWidth:n.truncation.ellipsisWidth,emojiWidth:n.width.emoji,fullWidth:n.width.fullWidth,halfWidth:n.width.halfWidth,limit:Math.max(0,r-l),regularWidth:n.width.regular,tabWidth:n.width.tab,wideWidth:n.width.wide}),T=L.width;if(L.truncated)a=!0,c=Math.min(c,i);else if(l+T>r&&(c=Math.min(c,i),a=!0,l+T>n.truncation.limit))break;if(l+=T,i=x,a&&l>=n.truncation.limit)break;continue}}}if(q.lastIndex=i,q.test(e)){const m=q.lastIndex-i,y=n.truncation.countAnsiEscapeCodes?m:n.width.ansi;if(l+y>r&&(c=Math.min(c,i),l+y>n.truncation.limit)){a=!0;break}l+=y,i=q.lastIndex;continue}}const f=e.codePointAt(i);if(f===8203||f===65279||f>=8288&&f<=8292){i+=1;continue}if(f===9){if(l+n.width.tab>r&&(c=Math.min(c,i),l+n.width.tab>n.truncation.limit)){a=!0;break}l+=n.width.tab,i+=1;continue}if(Y.lastIndex=i,Y.test(e)){const m=(Y.lastIndex-i)*n.width.regular;if(l+m>r){const y=n.width.regular>0?Math.floor((r-l)/n.width.regular):0;if(c=Math.min(c,i+y),l+m>n.truncation.limit){a=!0;break}}l+=m,i=Y.lastIndex;continue}if((f<=31||f>=127&&f<=159)&&(U.lastIndex=i,U.test(e))){const m=(U.lastIndex-i)*n.width.control;if(l+m>r){const y=n.width.control>0?Math.floor((r-l)/n.width.control):0;if(c=Math.min(c,i+y),l+m>n.truncation.limit){a=!0;break}}l+=m,i=U.lastIndex;continue}if(oe.lastIndex=i,oe.test(e)){if(l+n.width.emoji>r&&(c=Math.min(c,i),l+n.width.emoji>n.truncation.limit)){a=!0;break}l+=n.width.emoji,i=oe.lastIndex;continue}const h=e.codePointAt(i)??0;if(Nr(h)){i+=h>65535?2:1;continue}let p;if(s)p=xr(h,n);else switch(at(h)){case"control":{p=n.width.control;break}case"latin":{p=n.width.regular;break}case"wide":{p=n.width.wide;break}case"zero":{p=0;break}default:switch(st(h)){case"ambiguous":{p=n.width.ambiguousIsNarrow?n.width.regular:n.width.wide;break}case"fullwidth":{p=n.width.fullWidth;break}case"wide":{p=n.width.wide;break}default:p=n.width.regular}}if(l+p>r&&(c=Math.min(c,i),l+p>n.truncation.limit)){a=!0;break}l+=p,i+=h>65535?2:1}let d=l,g=!1;return a&&n.truncation.limit>=n.truncation.ellipsisWidth&&(d=n.truncation.limit,g=!0),{ellipsed:g,index:a?c:o,truncated:a,width:d}},k=(e,t={})=>ae(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,Ir=/\x1B\[(\d+)m/;class ut{activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const n=Ir.exec(t);if(!n)return;const r=Number.parseInt(n[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=t;else if(r>=40&&r<=47||r>=100&&r<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(r))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(r)){const o={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[r];o&&(this.activeFormatting=this.activeFormatting.filter(s=>!s.includes(o)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const n={"\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 o=n[r];o&&t.push(o)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}const Or=(e,t)=>{if(!R.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const n=!0,r=e.slice(t+1,t+1+G.length).join("")===G;return{isInsideEscape:n,isInsideLinkEscape:r}},kr=(e,t={})=>{const n=new ut;let r="",o=!1,s="",i="",l=!1;const c=[...e];for(let a=0;a<c.length;a++){const u=c[a];if(u&&R.has(u)){if(r){const p=t.getWidth?.(r)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:r,width:p};if(l&&(m.isHyperlink=!0,m.hyperlinkUrl=i),t.onSegment?.(m,n)===!1)return;r=""}o=!0,s=u;const f=Or(c,a),{isInsideLinkEscape:h}=f;if(h){let p=a+1;for(i="";p<c.length;){const y=c[p];if(y===te)break;i+=y,p+=1}i=i.slice(4);const m={hyperlinkUrl:i,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(m,n)===!1)return;a=p,l=!0,o=!1,s="";continue}if(a+1<c.length&&c[a+1]==="\\"&&l){const p={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(p,n)===!1)return;l=!1,i="",a+=1,o=!1,s="";continue}}if(o){if(s!==u&&(s+=u),u===he){o=!1,n.processEscape(s);const f={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};if(t.onSegment?.(f,n)===!1)return;s=""}continue}r+=u;const d=t.getWidth?.(r)??0,g={isEscapeSequence:!1,isGrapheme:!0,text:r,width:d};if(l&&(g.isHyperlink=!0,g.hyperlinkUrl=i),t.onSegment?.(g,n)===!1)return;r=""}if(r){const a=t.getWidth?.(r)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:r,width:a};l&&(u.isHyperlink=!0,u.hyperlinkUrl=i),t.onSegment?.(u,n)}if(s){const a={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};t.onSegment?.(a,n)}},We=e=>`${R.values().next().value}${lt}${String(e)}${he}`,Me=e=>`${R.values().next().value}${G}${e}${te}`,Br=e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",n,r;const o=e.join(`
30
- `),s=[...o];let i=0;for(const[l,c]of s.entries()){if(t+=c,R.has(c)){const u=wr.exec(o.slice(i))?.groups??{};if(u.code!==void 0){const d=Number.parseFloat(u.code);n=d===br?void 0:d}else u.uri!==void 0&&(r=u.uri.length===0?void 0:u.uri)}const a=vr.get(Number(n));s[l+1]===`
31
- `?(r&&(t+=Me("")),n&&a&&(t+=We(a))):c===`
32
- `&&(n&&a&&(t+=We(n)),r&&(t+=Me(r))),i+=c.length}return t},ft=/(?=\s)|(?<=\s)/,dt=/^\s+$/,_e=new Map,Lr=e=>{const t=_e.get(e);if(t!==void 0)return t;const n=k(e);return _e.set(e,n),n},se=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},W=e=>{const t=e.split(" ");let n=t.length;for(;n>0&&k(t[n-1])===0;)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},gt=(e,t,n)=>{if(e.length===0)return[""];if(t<=0)return[e];const r=[],o=new ut;let s="",i=0,l=!1,c=!1,a="",u=0;for(;u<e.length;){const d=e.codePointAt(u),g=String.fromCodePoint(d),f=g.length;if(R.has(g)){l=!0,a=g,s+=g,c=e.startsWith(G,u+1),u+=1;continue}if(l){a+=g,s+=g,c?g===te&&(l=c=!1):g===he&&(l=!1,o.processEscape(a)),u+=1;continue}const h=Lr(g),p=g===" ";if(h===0){s+=g,u+=f;continue}if(i+h>t&&(s&&r.push(s+o.getEndEscapesForAllActiveAttributes()),s=o.getStartEscapesForAllActiveAttributes(),i=k(s),p&&n)){for(;u<e.length&&e[u]===" ";)u+=1;continue}if(s+=g,i+=h,i===t&&u+f<e.length&&(r.push(s+o.getEndEscapesForAllActiveAttributes()),s=o.getStartEscapesForAllActiveAttributes(),i=k(s),u+f<e.length&&e[u+f]===" "&&n)){for(u+=f;u<e.length&&e[u]===" ";)u+=1;continue}u+=f}return s&&r.push(s+o.getEndEscapesForAllActiveAttributes()),n?r.map(d=>W(d)):r},Tr=(e,t,n)=>{if(e.length===0)return[];const r=n?e.trim():e;if(r.length===0)return[];const o=[];let s="",i=0;return kr(r,{getWidth:k,onSegment:(l,c)=>{const a=l.text??"";if(l.isEscapeSequence)s+=a;else{const u=a===" ";if(l.width===0)return s+=a,!0;if(i+l.width>t&&(s&&o.push(s),s=c.getStartEscapesForAllActiveAttributes(),i=0,u))return n||o.push(c.getStartEscapesForAllActiveAttributes()+a),!0;s+=a,i+=l.width}return!0}}),s&&o.push(s),n?o.map(l=>W(l)):o},jr=(e,t,n)=>{if(e.length===0)return[];const r=n?e.trim():e;if(r.length===0)return[];const o=r.split(ft),s=[];let i="",l=0,c=0;for(;c<o.length;){const a=o[c],u=dt.test(a),d=k(a);if(a.length===0){c+=1;continue}if(n&&u&&l===0){c+=1;continue}if(l+d>t&&l>0){n?s.push(W(i)):s.push(i),i="",l=0;continue}i+=a,l+=d,c+=1}return i&&(n?s.push(W(i)):s.push(i)),s},Fr=(e,t,n)=>{if(e.length===0)return[];const r=n?e.trim():e;if(r.length===0)return[];const o=r.split(ft),s=[];let i="",l=0,c=0;for(;c<o.length;){const a=o[c],u=dt.test(a),d=k(a);if(a.length===0){c+=1;continue}if(n&&u&&l===0){c+=1;continue}if(d>t){i&&s.push(se(n?W(i):i));const g=gt(a,t,n);if(g.length>0){for(let f=0;f<g.length-1;f+=1)s.push(g[f]);i=g.at(-1),l=k(i)}else i="",l=0;c+=1;continue}if(l+d>t&&l>0&&(s.push(se(n?W(i):i)),i="",l=0,n&&u)){c+=1;continue}i+=a,l+=d,c+=1}return i&&s.push(se(n?W(i):i)),s},J={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},eo=(e,t={})=>{const{removeZeroWidthCharacters:n=!0,trim:r=!0,width:o=80,wrapMode:s=J.PRESERVE_WORDS}=t;if(r&&e.trim()==="")return"";let i=e.normalize("NFC").replaceAll(`\r
33
- `,`
34
- `);return n&&(i=i.replaceAll($r,"")),i.split(`
35
- `).map(l=>{if(r&&l.trim()==="")return"";let c;switch(s){case J.BREAK_AT_CHARACTERS:{c=Tr(l,o,r);break}case J.BREAK_WORDS:{c=Fr(l,o,r);break}case J.STRICT_WIDTH:{c=gt(l,o,r);break}default:c=jr(l,o,r)}return Br(c)}).join(`
36
- `)},ht=80,pt=24,ue=(e,t,{shell:n,env:r}={})=>wt(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:n,env:r}).trim(),X=(e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),mt=(e,t)=>{const{columns:n,rows:r}=X(e,t);if(!(Number.isNaN(n)||Number.isNaN(r))&&!(n===ht&&r===pt))return{columns:n,rows:r}},Wr=()=>{if(I.platform!=="linux")return!0;try{const e=P.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const n=e.slice(t+2).trim().split(/\s+/),r=Number.parseInt(n[2],10),o=Number.parseInt(n[5],10);return Number.isNaN(r)||Number.isNaN(o)||o<=0?!1:r===o}catch{return!1}};function to(){const{env:e,stdout:t,stderr:n}=I;if(t?.columns&&t?.rows)return X(t.columns,t.rows);if(n?.columns&&n?.rows)return X(n.columns,n.rows);if(e.COLUMNS&&e.LINES)return X(e.COLUMNS,e.LINES);const r={columns:ht,rows:pt};return I.platform==="win32"?ie()??r:I.platform==="darwin"?ze()??ie()??r:ze()??ie()??Mr()??r}const ze=()=>{try{const e=I.platform==="darwin"?P.constants.O_EVTONLY|P.constants.O_NONBLOCK:P.constants.O_NONBLOCK,{columns:t,rows:n}=vt.WriteStream(P.openSync("/dev/tty",e));return{columns:t,rows:n}}catch{}},ie=()=>{try{const e=ue("tput",["cols"],{env:{TERM:"dumb",...I.env}}),t=ue("tput",["lines"],{env:{TERM:"dumb",...I.env}});if(e&&t)return mt(e,t)}catch{}},Mr=()=>{try{if(!Wr())return;const e=ue("resize",["-u"]).match(/\d+/g);if(e.length===2)return mt(e[0],e[1])}catch{}},no=e=>{const t=Object.keys(e).map(n=>e[n].badge??"");return t.length===0?"":t.reduce((n,r)=>n.length>r.length?n:r,"")},{bold:_r,cyan:zr,green:Re,grey:Rr,magenta:Pr,red:Cr,yellow:le}=Pe,ro={indent:2,quoteStyle:"single",stylize:(e,t)=>{const n={bigint:le,boolean:le,date:Pr,null:_r,number:le,regexp:Cr,special:zr,string:Re,symbol:Re,undefined:Rr};return Object.hasOwn(n,t)?n[t](e):e}},{bold:Dr,underline:Vr}=Pe,oo=(e,t)=>{let n=t.uppercase.label?e.toUpperCase():e;return n=t.underline.label?Vr(n):n,t.bold.label&&(n=Dr(n)),n},Gr=e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":");class so{styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:Gr,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=St}setLoggerTypes(t){this.loggerTypes=t}}export{so as A,qr as E,St as L,Kr as Y,eo as Z,Yr as a,no as b,k as c,ro as d,oo as f,Jr as g,Zr as i,to as t,J as v,Xr as w,Qr as z};