@visulima/pail 4.0.0-alpha.21 → 4.0.0-alpha.23
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 +74 -0
- package/LICENSE.md +841 -6
- package/README.md +53 -24
- package/dist/index.browser.d.ts +16 -5
- package/dist/index.browser.js +19 -19
- package/dist/index.server.d.ts +30 -5
- package/dist/index.server.js +28 -27
- package/dist/middleware/elysia.d.ts +5 -4
- package/dist/middleware/elysia.js +1 -1
- package/dist/middleware/express.d.ts +5 -4
- package/dist/middleware/express.js +1 -1
- package/dist/middleware/fastify.d.ts +5 -4
- package/dist/middleware/fastify.js +1 -1
- package/dist/middleware/hono.d.ts +5 -4
- package/dist/middleware/hono.js +1 -1
- package/dist/middleware/next/handler.d.ts +5 -4
- package/dist/middleware/next/handler.js +1 -1
- package/dist/middleware/sveltekit.d.ts +5 -4
- package/dist/middleware/sveltekit.js +1 -1
- package/dist/packem_shared/AbstractJsonReporter-Bp_JCrMQ.js +1 -0
- package/dist/packem_shared/AbstractJsonReporter-C6iu_u9-.js +1 -0
- package/dist/packem_shared/JsonReporter-BXktpC__.js +2 -0
- package/dist/packem_shared/JsonReporter-bmem9lcg.js +1 -0
- package/dist/packem_shared/{PrettyReporter-D75CJT0C.js → PrettyReporter-DsHfKOU7.js} +3 -3
- package/dist/packem_shared/PrettyReporter-LXeSlx8P.js +44 -0
- package/dist/packem_shared/{abstract-json-reporter.d-Boj5w068.d.ts → abstract-json-reporter.d-wfESoEa-.d.ts} +3 -2
- package/dist/packem_shared/abstract-pretty-reporter-eLxhddj0.js +57 -0
- package/dist/packem_shared/addKnownErrorConstructor-C1OJTj2D-f9no2VNI.js +25 -0
- package/dist/packem_shared/{create-middleware-logger.d-MK7moe4r.d.ts → create-middleware-logger.d-B-JmQ1Sl.d.ts} +2 -2
- package/dist/packem_shared/{headers-D-K_EnkH.js → headers-DH0H2s8W.js} +1 -1
- package/dist/packem_shared/index-Q1764hvO.js +1 -0
- package/dist/packem_shared/index.d-T71KjNAr.d.ts +16 -0
- package/dist/packem_shared/serializeError-C-NFvZ8_-D0CA_Qlx.js +1 -0
- package/dist/packem_shared/{types.d-Ck_RSjLg.d.ts → types.d-bWnqHJKL.d.ts} +2 -37
- package/dist/packem_shared/{wide-event.d-DkYD7YVK.d.ts → wide-event.d-D3ATYpoK.d.ts} +17 -5
- package/dist/packem_shared/write-console-log-based-on-level-BqjxV016.js +1 -0
- package/dist/packem_shared/write-stream-C7jxLxIT.js +1 -0
- package/dist/processor/caller/caller-processor.d.ts +2 -1
- package/dist/processor/environment-processor.d.ts +2 -1
- package/dist/processor/message-formatter-processor.d.ts +9 -1
- package/dist/processor/message-formatter-processor.js +1 -1
- package/dist/processor/opentelemetry-processor.d.ts +2 -1
- package/dist/processor/redact-processor.d.ts +41 -2
- package/dist/processor/sampling-processor.d.ts +2 -1
- package/dist/reporter/file/json-file-reporter.d.ts +21 -3
- package/dist/reporter/file/json-file-reporter.js +1 -1
- package/dist/reporter/http/abstract-http-reporter.d.ts +46 -3
- package/dist/reporter/http/abstract-http-reporter.js +2 -2
- package/dist/reporter/http/http-reporter.d.ts +4 -3
- package/dist/reporter/http/http-reporter.edge-light.d.ts +57 -1
- package/dist/reporter/http/http-reporter.edge-light.js +2 -2
- package/dist/reporter/json/index.browser.d.ts +1 -1
- package/dist/reporter/json/index.browser.js +1 -1
- package/dist/reporter/json/index.d.ts +6 -4
- package/dist/reporter/json/index.js +1 -1
- package/dist/reporter/pretty/index.browser.js +1 -1
- package/dist/reporter/pretty/index.d.ts +58 -38
- package/dist/reporter/pretty/index.js +1 -1
- package/dist/reporter/simple/simple-reporter.server.d.ts +87 -5
- package/dist/reporter/simple/simple-reporter.server.js +8 -8
- package/dist/wide-event.d.ts +4 -3
- package/dist/wide-event.js +1 -1
- package/package.json +5 -5
- package/dist/packem_shared/AbstractJsonReporter-CF0KKdQS.js +0 -1
- package/dist/packem_shared/AbstractJsonReporter-CVwjgboT.js +0 -1
- package/dist/packem_shared/JsonReporter-BJFnahby.js +0 -1
- package/dist/packem_shared/JsonReporter-CnLM-d0U.js +0 -2
- package/dist/packem_shared/PrettyReporter-D9aBMmxI.js +0 -45
- package/dist/packem_shared/abstract-pretty-reporter-zijeSUgy.js +0 -34
- package/dist/packem_shared/index-COQEZODZ.js +0 -1
- package/dist/packem_shared/write-console-log-based-on-level-DDSKGBKj.js +0 -1
- package/dist/packem_shared/write-stream-B6BXco86.js +0 -1
- /package/dist/packem_shared/{createPailError-CbU1Ogfa.js → PailError-CbU1Ogfa.js} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as r}from"node:module";import{r as n}from"./write-stream-B6BXco86.js";import{AbstractJsonReporter as a}from"./AbstractJsonReporter-CF0KKdQS.js";const d=r(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:i,stderr:c}=o;class h extends a{#s;#t;constructor(s={}){super(s),this.#s=i,this.#t=c}setStdout(s){this.#s=s}setStderr(s){this.#t=s}_log(s,t){const e=["error","warn"].includes(t)?this.#t:this.#s;n(`${s}
|
|
2
|
-
`,e)}}export{h as default};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import{createRequire as ft}from"node:module";import ee from"@visulima/colorize";import{L as bt,E as yt}from"./constants-ep2nsfdy.js";import{r as wt}from"./write-stream-B6BXco86.js";const dt=ft(import.meta.url),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,X=e=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[t,r]=P.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return P.getBuiltinModule(e)}return dt(e)},j=P,{stdout:ht,stderr:pt}=j,{createRequire:gt}=X("node:module"),{execFileSync:mt}=X("node:child_process"),V=X("node:fs"),$t=X("node:tty");var St=Object.defineProperty,me=(e,t)=>St(e,"name",{value:t,configurable:!0}),vt=Object.defineProperty,xt=me((e,t)=>vt(e,"name",{value:t,configurable:!0}),"r$1");const Et=xt(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
2
|
-
`),"normalizeLF"),Nt=globalThis.process??Object.create(null),we={versions:{}},Se=new Proxy(Nt,{get(e,t){if(t in e)return e[t];if(t in we)return we[t]}});var At=Object.defineProperty,It=me((e,t)=>At(e,"name",{value:t,configurable:!0}),"b");const kt=It((e,t,r,n)=>{const i={column:0,line:-1,...e.start},s={...i,...e.end},o=i.line,l=i.column,a=s.line,u=s.column;let c=Math.max(o-(r+1),0),f=Math.min(t.length,a+n);o===-1&&(c=0),a===-1&&(f=t.length);const p=a-o,h={};if(p)for(let d=0;d<=p;d++){const g=d+o;if(!l)h[g]=!0;else if(d===0){const m=t[g-1]?.length;h[g]=[l,(m??0)-l+1]}else if(d===p)h[g]=[0,u];else{const m=t[g-d]?.length;h[g]=[0,m]}}else l===u?h[o]=l?[l,0]:!0:h[o]=[l,(u??0)-(l??0)];return{end:f,markerLines:h,start:c}},"getMarkerLines");var Tt=Object.defineProperty,U=me((e,t)=>Tt(e,"name",{value:t,configurable:!0}),"t");const Ot=Se.platform==="win32"&&!Se.env?.WT_SESSION?">":"❯",jt=U((e,t,r)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:U(d=>d,"gutter"),marker:U(d=>d,"marker"),message:U(d=>d,"message"),...r?.color}},i=typeof t.start.column=="number";let s=Et(e).split(`
|
|
3
|
-
`);typeof n.tabWidth=="number"&&(s=s.map(d=>d.replaceAll(" "," ".repeat(n.tabWidth))));const{end:o,markerLines:l,start:a}=kt(t,s,n.linesAbove,n.linesBelow),u=String(o).length,{gutter:c,marker:f,message:p}=n.color;let h=s.slice(a,o).map((d,g)=>{const m=a+1+g,b=l[m],x=String(m).padStart(u),A=!l[m+1],S=` ${x}${n.showGutter?" |":""}`;if(b){let $="";if(Array.isArray(b)){const W=d.replaceAll(/[^\t]/g," ").slice(0,Math.max(b[0]-1,0)),k=b[1]||1;$=[`
|
|
4
|
-
`,n.prefix+c(S.replaceAll(/\d/g," "))," ",W,f("^").repeat(k)].join(""),A&&n.message&&($+=` ${p(n.message)}`)}return[n.prefix+f(Ot),c(S),d.length>0?` ${d}`:"",$].join("")}return`${n.prefix} ${c(S)}${d.length>0?` ${d}`:""}`}).join(`
|
|
5
|
-
`);return n.message&&!i&&(h=`${n.prefix+" ".repeat(u+1)+n.message}
|
|
6
|
-
${h}`),h},"codeFrame");var Bt=Object.defineProperty,Wt=(e,t)=>Bt(e,"name",{value:t,configurable:!0}),_t=Object.defineProperty,O=Wt((e,t)=>_t(e,"name",{value:t,configurable:!0}),"u");const F=O((e,...t)=>{process.env.DEBUG&&process.env.DEBUG==="true"&&console.debug(`error:parse-stacktrace: ${e}`,...t)},"debugLog"),M="<unknown>",Ft=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Mt=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,Rt=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,Pt=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,Ct=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,Lt=/in\s(.*)\s\(at\s(.+)\)\sat/,zt=/^(?:.*@)?(.*):(\d+):(\d+)$/,Vt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ht=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Gt=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,ve=/\(error: (.*)\)/,qt=/at\s/,Dt=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,Ut=/\S*(?:Error: |AggregateError:)/,ze=/^Anonymous function$/,Yt=/^\s*in\s.*/,Kt=/^.*?\s*at\s.*/,Jt=/^.*?\s*@.*|\[native code\]/,Ve=O((e,t)=>{const r=e.includes("safari-extension"),n=e.includes("safari-web-extension");return r||n?[e.includes("@")?e.split("@")[0]:M,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},"extractSafariExtensionDetails"),He=O((e,t)=>{const r=Rt.exec(t);r&&(e.file=r[1],e.line=+r[2],e.column=+r[3])},"parseMapped"),Zt=O(e=>{const t=Lt.exec(e);if(t){F(`parse nested node error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const n=t[2].split(":");return{column:n[2]?+n[2]:void 0,file:n[0],line:n[1]?+n[1]:void 0,methodName:t[1]??M,raw:e,type:void 0}}const r=Ct.exec(e);if(r){F(`parse node error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n={column:r[4]?+r[4]:void 0,file:r[2]?r[2].replace(qt,""):void 0,line:r[3]?+r[3]:void 0,methodName:r[1]??M,raw:e,type:e.startsWith("internal")?"internal":void 0};return He(n,`${r[2]}:${r[3]}:${r[4]}`),n}},"parseNode"),Qt=O(e=>{const t=Ft.exec(e);if(t){F(`parse chrome error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const r=t[2]?.startsWith("native"),n=t[2]?.startsWith("eval")||t[1]?.startsWith("eval");let i,s;if(n){const u=Mt.exec(e);if(u){const c=Dt.exec(u[1]);c?(t[2]=c[4]??c[1],t[3]=c[5]??c[2],t[4]=c[3]):u[2]&&(t[2]=u[1]),u[2]&&(i={column:u[4]?+u[4]:void 0,file:u[2],line:u[3]?+u[3]:void 0,methodName:"eval",raw:e,type:"eval"})}else{const c=Pt.exec(e);c&&(s={column:c[4]?+c[4]:void 0,file:c[2],line:c[3]?+c[3]:void 0},i={column:c[6]?+c[6]:void 0,file:c[1],line:c[5]?+c[5]:void 0,methodName:"eval",raw:c[0],type:"eval"})}}const[o,l]=Ve(t[1]?t[1].replace(ze,"<anonymous>"):M,t[2]),a={column:t[4]?+t[4]:void 0,evalOrigin:i,file:l,line:t[3]?+t[3]:void 0,methodName:o,raw:e,type:n?"eval":r?"native":void 0};return s?(a.column=s.column,a.file=s.file,a.line=s.line):He(a,`${l}:${t[3]}:${t[4]}`),a}},"parseChromium"),Xt=O((e,t)=>{const r=Vt.exec(e);if(r){F(`parse gecko error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n=r[3]?.includes(" > eval"),i=n&&r[3]&&Ht.exec(r[3]);let s;n&&i&&(r[3]=i[1],s={column:r[5]?+r[5]:void 0,file:r[3],line:r[4]?+r[4]:void 0,methodName:"eval",raw:e,type:"eval"},r[4]=i[2]);const[o,l]=Ve(r[1]?r[1].replace(ze,"<anonymous>"):M,r[3]);let a;(t?.type==="safari"||!n&&t?.type==="firefox")&&t.column?a=t.column:!n&&r[5]&&(a=+r[5]);let u;return(t?.type==="safari"||!n&&t?.type==="firefox")&&t.line?u=t.line:r[4]&&(u=+r[4]),{column:a,evalOrigin:s,file:l,line:u,methodName:o,raw:e,type:n?"eval":l.includes("[native code]")?"native":void 0}}},"parseGecko"),er=O((e,t)=>{const r=Gt.exec(e);if(!(r&&r[2].includes(" > eval"))&&r)return F(`parse firefox error stack line: "${e}"`,`found: ${JSON.stringify(r)}`),{column:r[4]?+r[4]:t?.column??void 0,file:r[2],line:r[3]?+r[3]:t?.line??void 0,methodName:r[1]||M,raw:e,type:void 0}},"parseFirefox"),tr=O(e=>{const t=zt.exec(e);if(t)return F(`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:M,raw:e,type:void 0}},"parseReactAndroidNative"),Ge=O((e,{filter:t,frameLimit:r=50}={})=>{const n=e;let i=(typeof n.stacktrace=="string"?n.stacktrace:e.stack??"").split(`
|
|
7
|
-
`).map(s=>(ve.test(s)?s.replace(ve,"$1"):s).trim()).filter(s=>!Ut.test(s)&&s!=="eval code");return t&&(i=i.filter(s=>t(s))),i=i.slice(0,r),i.reduce((s,o,l)=>{if(!o||o.length>1024)return s;let a;if(Yt.test(o))a=Zt(o);else if(Kt.test(o))a=Qt(o);else if(Jt.test(o)){let u;if(l===0){const c=e,f=c.columnNumber,p=c.lineNumber,h=c.line,d=c.column;f||p?u={column:f,line:p,type:"firefox"}:(h||d)&&(u={column:d,line:h,type:"safari"})}a=er(o,u)??Xt(o,u)}else a=tr(o);return a?s.push(a):F(`parse error stack line: "${o}"`,"not parser found"),s},[])},"parseStacktrace");var rr=Object.defineProperty,qe=(e,t)=>rr(e,"name",{value:t,configurable:!0});const nr=gt(import.meta.url),C=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$e=qe(e=>{if(typeof C<"u"&&C.versions&&C.versions.node){const[t,r]=C.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return C.getBuiltinModule(e)}return nr(e)},"__cjs_getBuiltinModule"),{existsSync:ir,readFileSync:sr}=$e("node:fs"),{relative:or}=$e("node:path"),{cwd:lr}=C,{fileURLToPath:ar}=$e("node:url");var ur=Object.defineProperty,y=qe((e,t)=>ur(e,"name",{value:t,configurable:!0}),"o");const R=y((e,t,r)=>r===0?e:t===" "?e+" ".repeat(r):e+" ".repeat(t*r),"getPrefix"),cr=y((e,t)=>{const r=e.replace("async file:","file:");return or(t,r.startsWith("file:")?ar(r):r)},"getRelativePath"),fr=y((e,t,r)=>{if(t)return r.title(e.message);const n=e.message?`: ${e.message}`:"";return r.title(e.name+n)},"getTitleText"),De=y((e,{color:t,hideErrorTitle:r,indentation:n,prefix:i},s)=>`${R(i,n,s)}${fr(e,r,t)}
|
|
8
|
-
`,"getMessage"),Ue=y((e,{color:t,indentation:r,prefix:n},i)=>{if(e.hint===void 0)return;const s=R(n,r,i);let o="";if(Array.isArray(e.hint))for(const l of e.hint)o+=`${s+l}
|
|
9
|
-
`;else o+=s+e.hint;return t.hint(o)},"getHint"),be=y((e,{color:t,cwd:r,displayShortPath:n,indentation:i,prefix:s},o=0)=>{const l=n?cr(e.file,r):e.file,{fileLine:a,method:u}=t;return`${R(s,i,o)}at ${e.methodName?`${u(e.methodName)} `:""}${a(l)}:${a(e.line?.toString()??"")}`},"getMainFrame"),Ye=y((e,{color:t,indentation:r,linesAbove:n,linesBelow:i,prefix:s,showGutter:o,showLineNumbers:l,tabWidth:a},u)=>{if(e.file===void 0)return;const c=e.file.replace("file://","");if(!ir(c))return;const f=sr(c,"utf8");return jt(f,{start:{column:e.column,line:e.line}},{color:t,linesAbove:n,linesBelow:i,prefix:R(s,r,u),showGutter:o,showLineNumbers:l,tabWidth:a})},"getCode"),Ke=y((e,t,r)=>{if(e.errors.length===0)return;let n=`${R(t.prefix,t.indentation,r)}Errors:
|
|
10
|
-
|
|
11
|
-
`,i=!0;for(const s of e.errors)i?i=!1:n+=`
|
|
12
|
-
|
|
13
|
-
`,n+=Ze(s,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},r+1);return`
|
|
14
|
-
${n}`},"getErrors"),Je=y((e,t,r,n=new Set)=>{n.add(e);let i=`${R(t.prefix,t.indentation,r)}Caused by:
|
|
15
|
-
|
|
16
|
-
`;const s=e.cause;i+=De(s,t,r);const o=Ge(s).shift(),l=Ue(s,t,r);if(l&&(i+=`${l}
|
|
17
|
-
`),o&&(i+=be(o,t,r),!t.hideErrorCauseCodeView)){const a=Ye(o,t,r);a!==void 0&&(i+=`
|
|
18
|
-
${a}`)}if(s instanceof AggregateError){const a=Ke(s,t,r);a!==void 0&&(i+=`
|
|
19
|
-
${a}`)}return s.cause&&(n.has(s)?i+=`
|
|
20
|
-
${R(t.prefix,t.indentation,r+1)}Caused by: [Circular]`:i+=`
|
|
21
|
-
${Je(s,t,r+1,n)}`),`
|
|
22
|
-
${i}`},"getCause"),dr=y((e,t)=>(e.length>0?`
|
|
23
|
-
`:"")+e.map(r=>be(r,t)).join(`
|
|
24
|
-
`),"getStacktrace"),Ze=y((e,t,r)=>{const n={cwd:lr(),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:y(o=>o,"fileLine"),gutter:y(o=>o,"gutter"),hint:y(o=>o,"hint"),marker:y(o=>o,"marker"),message:y(o=>o,"message"),method:y(o=>o,"method"),title:y(o=>o,"title"),...t.color}},i=Ge(e,{filter:t.filterStacktrace,frameLimit:n.framesMaxLimit}),s=i.shift();return[t.hideMessage?void 0:De(e,n,r),Ue(e,n,r),s?be(s,n,r):void 0,s&&!n.hideErrorCodeView?Ye(s,n,r):void 0,e instanceof AggregateError?Ke(e,n,r):void 0,e.cause===void 0?void 0:Je(e,n,r),i.length>0?dr(i,n):void 0].filter(Boolean).join(`
|
|
25
|
-
`).replaceAll("\\","/")},"internalRenderError"),ie=y((e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return Ze(e,t,0)},"renderError"),N=(e,t,r,n,i,s=", ")=>{const o=e.length;if(o===0)return"";let l=n;i!==void 0&&(l=i);const a=r.truncate;let u="",c="",f="";for(let p=0;p<o;p+=1){const h=p+1===e.length,d=p+2===e.length;f=`…(${String(e.length-p)})`;let g=e[p];r.truncate=a-u.length-(h?0:s.length);const m=c||l(g,t,r,n)+(h?"":s),b=u.length+m.length,x=b+f.length;if(h&&b>a&&u.length+f.length<=a||!h&&!d&&x>a)break;g=e[p+1];const A=d?"":s;if(h?c="":c=l(g,t,r,n)+A,!h&&d&&x>a&&b+c.length>a)break;if(u+=m,!h&&!d&&b+c.length>=a){f=`…(${String(e.length-p-1)})`;break}f=""}return`${u}${f}`},hr=([e,t],r,n)=>(n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:n.stylize(String(e),"yellow")),pr=(e,t,r)=>{switch(e.nodeType){case 1:return Qe(e,e,r,t);case 3:return t(e.data,t,r);default:return t(e,t,r)}},he=(e,t,r,n)=>N(e,e,t,r,pr,`
|
|
26
|
-
`),Qe=(e,t,r,n)=>{const i=e.getAttributeNames(),s=e.tagName.toLowerCase(),o=r.stylize(`<${s}`,"special"),l=r.stylize(">","special"),a=r.stylize(`</${s}>`,"special");r.truncate-=s.length*2+5;let u="";i.length>0&&(u+=" ",u+=N(i.map(p=>[p,e.getAttribute(p)]),t,r,n,hr," ")),r.truncate-=u.length;const{truncate:c}=r;let f=he(e.children,r,n);return f&&f.length>c&&(f=`…(${String(e.children.length)})`),`${o}${u}${l}${f}${a}`},gr=(e,t,r)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${N(e,e,t,r)} ]`),mr=(e,t)=>{let r;if(e===" ")r=" ";else if(typeof e=="number"&&e>0)r=Array.from({length:e+1}).join(" ");else return;return{base:r,prev:`
|
|
27
|
-
${Array.from({length:t+1}).join(r)}`}},te=(e,t)=>{if(e.length===0)return"";const r=t.prev+t.base;return r+e.split("\0\0").join(`,${r}`)+t.prev},$r=/^[a-z_]\w*$/i,br=/^"|"$/g,yr=(e,t)=>{if($r.test(e))return e;const r=JSON.stringify(e);return t.quoteStyle==="double"?r.replaceAll('"',String.raw`\"`):r.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(br,"'")},G=([e,t],r,n,i)=>{n.truncate-=2;let s;typeof e=="string"?s=yr(e,n):typeof e=="number"?s=String(e):s=`[${i(e,r,n)}]`,n.truncate-=s.length;const o=i(t,r,n);return`${s}: ${o}`},wr=e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},Sr=(e,t,r,n)=>{const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return"[]";t.truncate-=4;const s=!!n&&wr(e);let o=N(e,e,t,r,void 0,s?"\0\0":", ");t.truncate-=o.length;let l="";return i.length>0&&(l=N(i.map(a=>[a,e[a]]),e,t,r,G)),s&&n&&(o=te(o,n)),`[${s?"":" "}${o}${l?`, ${l}`:""}${s?"":" "}]`},xe=/\d(?=(?:\d{3})+(?!\d))/g,vr=/\d{3}/g,xr=/_$/,Xe=(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 r=e<0?-Math.floor(-e):Math.floor(e);if(r!==e){const n=String(r),i=t.slice(n.length+1);return`${n.replace(xe,"$&_")}.${i.replace(vr,"$&_").replace(xr,"")}`}}return t.replace(xe,"$&_")},Er=e=>e>="\uD800"&&e<="\uDBFF",B=(e,t,r="…")=>{e=String(e);const n=r.length,i=e.length;if(n>t&&i>n)return r;if(i>t&&i>n){let s=t-n;return s>0&&Er(e[s-1])&&(s-=1),`${e.slice(0,s)}${r}`}return e},Ee=(e,t)=>{let r=B(e.toString(),t.truncate-1);return r!=="…"&&(r+="n"),t.stylize(t.numericSeparator?Xe(e,r):r,"bigint")},Nr=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),J=(e,t,r,n)=>{if("window"in globalThis&&e===globalThis)return"{ [object Window] }";if(e===globalThis)return"{ [object globalThis] }";const i=Object.getOwnPropertyNames(e),s=Object.getOwnPropertySymbols(e),o=Nr(e)===Object.prototype||e.constructor===Object,l=e instanceof Object?"":"null prototype";let a;!o&&Symbol.toStringTag in e?a=e[Symbol.toStringTag]:a=l?"Object":"";const u=a||l?`[${[a,l].filter(Boolean).join(": ")}] `:"";if(i.length===0&&s.length===0)return`${u}{}`;t.truncate-=4;const c=n?"\0\0":", ",f=N(i.map(d=>[d,e[d]]),e,t,r,G,c),p=N(s.map(d=>[d,e[d]]),e,t,r,G,c);let h="";return f&&p&&(h=c),n?`${u}{${te(f+h+p,n)}}`:`${u}{ ${f}${h}${p} }`},Ar=(e,t,r,n)=>{let i="";return i=i||e.constructor.name,(!i||i==="_class")&&(i="<Anonymous Class>"),t.truncate-=i.length,`${i} ${J(e,t,r,n)}`},Ir=(e,t)=>{const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),i=n[0];return t.stylize(`${i}T${B(n[1],t.truncate-i.length-1)}`,"date")},kr=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),Tr=(e,t,r)=>{const n=Object.getOwnPropertyNames(e).filter(l=>!kr.has(l)),{name:i}=e;t.truncate-=i.length;let s="";typeof e.message=="string"?s=B(e.message,t.truncate):n.unshift("message"),s=s?`: ${s}`:"",t.truncate-=s.length+5;const o=N(n.map(l=>[l,e[l]]),e,t,r,G);return`${i}${s}${o?` { ${o} }`:""}`},Ne=(e,t)=>{const r=e[Symbol.toStringTag]||"Function",n=e.toString();if(n.length<t.truncate-12)return t.stylize(`[${r}: ${n}]`,"special");const{name:i}=e;return i?t.stylize(`[${r} ${B(i,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")},Or=([e,t],r,n,i)=>(n.truncate-=4,e=i(e,r,n),n.truncate-=e.length,`${e} => ${i(t,r,n)}`),jr=(e,t,r,n)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let i=N([...e.entries()],e,t,r,Or,n?"\0\0":", ");return n&&(i=te(i,n)),`Map (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`};function Ae(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?Xe(e,e.toString()):e.toString(),t.truncate),"number")}const Br=()=>"Promise{…}",Wr=(e,t)=>{const r=t.truncate-(2+e.flags.length);return t.stylize(`/${B(e.source,r)}/${e.flags}`,"regexp")},_r=(e,t,r,n)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let i=N([...e],e,t,r,void 0,n?"\0\0":", ");return n&&(i=te(i,n)),`Set (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},Fr=(e,t)=>{const r=t.quoteStyle==="double"?'"':"'";return t.quoteStyle==="double"&&(e=e.replaceAll('"','"')),r+e+r},Ie=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"),Mr={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},Rr=16,Pr=e=>Mr[e]||String.raw`\u${`0000${e.codePointAt(0).toString(Rr)}`.slice(-4)}`,ke=(e,t)=>(Ie.test(e)&&(e=e.replaceAll(Ie,Pr)),t.stylize(Fr(B(e,t.truncate-2),t),"string")),Te=e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),Cr=e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],T=(e,t,r)=>{const n=Cr(e);t.truncate-=n.length+4;const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return`${n}[]`;let s="";for(let l=0;l<e.length;l++){const a=`${t.stylize(B(e[l],t.truncate),"number")}${l===e.length-1?"":", "}`;if(t.truncate-=a.length,l!==e.length-1&&t.truncate<=3){s+=`…(${String(e.length-l)})`;break}s+=a}let o="";return i.length>0&&(o=N(i.map(l=>[l,e[l]]),e,t,r,G)),`${n}[ ${s}${o?`, ${o}`:""} ]`},Oe=new WeakMap,Lr={},zr={Arguments:gr,Array:Sr,ArrayBuffer:()=>"",BigInt:Ee,bigint:Ee,Boolean:(e,t)=>t.stylize(String(e),"boolean"),boolean:(e,t)=>t.stylize(String(e),"boolean"),DataView:()=>"",Date:Ir,Error:Tr,Float32Array:T,Float64Array:T,Function:Ne,function:Ne,Generator:()=>"",HTMLCollection:he,Int8Array:T,Int16Array:T,Int32Array:T,Map:jr,NodeList:he,null:(e,t)=>t.stylize("null","null"),Number:Ae,number:Ae,Promise:Br,RegExp:Wr,Set:_r,String:ke,string:ke,Symbol:Te,symbol:Te,Uint8Array:T,Uint8ClampedArray:T,Uint16Array:T,Uint32Array:T,undefined:(e,t)=>t.stylize("undefined","undefined"),WeakMap:(e,t)=>t.stylize("WeakMap{…}","special"),WeakSet:(e,t)=>t.stylize("WeakSet{…}","special")},je=Symbol.for("nodejs.util.inspect.custom"),se=Symbol.for("chai/inspect"),Vr=(e,t,r,n)=>{if(se in e&&typeof e[se]=="function")return e[se](t);if(!("window"in globalThis)&&typeof e[je]=="function")return e[je](n,t);if("inspect"in e&&typeof e.inspect=="function")return e.inspect(n,t);if("constructor"in e&&Oe.has(e.constructor))return Oe.get(e.constructor)?.(e,t)??"unknown";const i=Lr[r];return i?i(e,t):""},oe=(e,t,r)=>{const{depth:n,inspect:i,seen:s}=r;if(s.includes(e))return"[Circular]";if(n>=t.depth&&t.depth>0&&typeof e=="object")return Array.isArray(e)?"[Array]":"[Object]";const o=t.indent?mr(t.indent,n):void 0;let l=e===null?"null":typeof e;l==="object"&&(l=Object.prototype.toString.call(e).slice(8,-1));const a=zr[l];if(a!==void 0)return a(e,t,i,o);if(t.customInspect&&e){const c=Vr(e,t,l,t.depth-n);if(c)return typeof c=="string"?c:i(c,e,t)}const u=e?Object.getPrototypeOf(e):!1;return u===Object.prototype||u===null?J(e,t,i,o):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?Qe(e,e,t,i):"constructor"in e?e.constructor!==Object?Ar(e,t,i,o):J(e,t,i,o):e===Object(e)?J(e,t,i,o):t.stylize(String(e),l)},Be=(e,t={})=>{const r={breakLength:Number.POSITIVE_INFINITY,customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,showProxy:!1,stylize:i=>i,truncate:Number.POSITIVE_INFINITY,...t};if(r.indent!==void 0&&r.indent!==" "&&!(Number.parseInt(r.indent,10)===r.indent&&r.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');const n={depth:0,inspect:void 0,seen:[]};return n.inspect=(i,s,o)=>{if(s==null){n.depth+=1;const a=oe(i,o,n);return n.depth-=1,a}n.seen.push(s),n.depth+=1;const l=oe(i,o,n);return n.depth-=1,n.seen.pop(),l},oe(e,r,n)},Hr=[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],Gr=12288,qr=65510,Dr=[12288,12288,65281,65376,65504,65510],Ur=8361,Yr=65518,Kr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Jr=32,Zr=10630,Qr=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Xr=4352,en=262141,et=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],D=(e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){const i=Math.floor((r+n)/2),s=i*2;if(t<e[s])n=i-1;else if(t>e[s+1])r=i+1;else return!0}return!1},We=19968,[tn,rn]=nn(et);function nn(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){const i=e[n],s=e[n+1];if(We>=i&&We<=s)return[i,s];s-i>r-t&&(t=i,r=s)}return[t,r]}const sn=e=>e<161||e>1114109?!1:D(Hr,e),on=e=>e<Gr||e>qr?!1:D(Dr,e),ln=e=>e<Ur||e>Yr?!1:D(Kr,e),an=e=>e<Jr||e>Zr?!1:D(Qr,e),un=e=>e>=tn&&e<=rn?!0:e<Xr||e>en?!1:D(et,e);function cn(e){return sn(e)?"ambiguous":on(e)?"fullwidth":ln(e)?"halfwidth":an(e)?"narrow":un(e)?"wide":"neutral"}function fn(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function tt(e){return fn(e),cn(e)}const rt=String.raw,_e=rt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,dn=()=>new RegExp(rt`\p{RI}{2}|(?)${_e}(?:\u200D${_e})*`,"gu"),L=new Set(["\x1B",""]),re="\x07",nt="[",ye="m",q="]8;;",hn=39,pn=/[\u200B\uFEFF\u2060-\u2064]/g,gn=new RegExp(`(?:\\${nt}(?<code>\\d+)m|\\${q}(?<uri>.*)${re})`),mn=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]])),z=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Y=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,le=dn(),Fe=new Map,K=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Z=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",$n=(e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=Fe.get(r);if(i||(i=new Map,Fe.set(r,i)),i.has(n))return i.get(n);let s;if(Z(e)==="latin")s=t.width.regular;else if(Z(e)==="control")s=t.width.control;else if(Z(e)==="wide")s=t.width.wide;else switch(tt(e)){case"ambiguous":{s=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{s=t.width.fullWidth;break}case"wide":{s=t.width.wide;break}default:s=t.width.regular}return i.set(n,s),s},bn=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,pe=(e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?pe(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},n=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=e,s=i>1e4;let o=0,l=0,a=i,u=!1;const c=e.includes("\x1B")||e.includes("");for(;o<i;){if(c&&(e[o]==="\x1B"||e[o]==="")){if(e.startsWith("\x1B]8;;",o)){const m="\x1B]8;;\x07",b=m.length,x=e.indexOf("\x07",o+5);if(x!==-1){const A=e.indexOf(m,x+1);if(A!==-1){const S=A+b,$=e.slice(x+1,A).replace(z,""),W=pe($,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,n-l),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),k=W.width;if(W.truncated)u=!0,a=Math.min(a,o);else if(l+k>n&&(a=Math.min(a,o),u=!0,l+k>r.truncation.limit))break;if(l+=k,o=S,u&&l>=r.truncation.limit)break;continue}}}if(z.lastIndex=o,z.test(e)){const m=z.lastIndex-o,b=r.truncation.countAnsiEscapeCodes?m:r.width.ansi;if(l+b>n&&(a=Math.min(a,o),l+b>r.truncation.limit)){u=!0;break}l+=b,o=z.lastIndex;continue}}const h=e.codePointAt(o);if(h===8203||h===65279||h>=8288&&h<=8292){o+=1;continue}if(h===9){if(l+r.width.tab>n&&(a=Math.min(a,o),l+r.width.tab>r.truncation.limit)){u=!0;break}l+=r.width.tab,o+=1;continue}if(K.lastIndex=o,K.test(e)){const m=(K.lastIndex-o)*r.width.regular;if(l+m>n){const b=Math.floor((n-l)/r.width.regular);if(a=Math.min(a,o+b),l+m>r.truncation.limit){u=!0;break}}l+=m,o=K.lastIndex;continue}if((h<=31||h>=127&&h<=159)&&(Y.lastIndex=o,Y.test(e))){const m=(Y.lastIndex-o)*r.width.control;if(l+m>n&&(a=Math.min(a,o+Math.floor((n-l)/r.width.control)),l+m>r.truncation.limit)){u=!0;break}l+=m,o=Y.lastIndex;continue}if(le.lastIndex=o,le.test(e)){if(l+r.width.emoji>n&&(a=Math.min(a,o),l+r.width.emoji>r.truncation.limit)){u=!0;break}l+=r.width.emoji,o=le.lastIndex;continue}const d=e.codePointAt(o)??0;if(bn(d)){o+=d>65535?2:1;continue}let g;if(s)g=$n(d,r);else switch(Z(d)){case"control":{g=r.width.control;break}case"latin":{g=r.width.regular;break}case"wide":{g=r.width.wide;break}case"zero":{g=0;break}default:switch(tt(d)){case"ambiguous":{g=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{g=r.width.fullWidth;break}case"wide":{g=r.width.wide;break}default:g=r.width.regular}}if(l+g>n&&(a=Math.min(a,o),l+g>r.truncation.limit)){u=!0;break}l+=g,o+=d>65535?2:1}let f=l,p=!1;return u&&r.truncation.limit>=r.truncation.ellipsisWidth&&(f=r.truncation.limit,p=!0),{ellipsed:p,index:u?a:i,truncated:u,width:f}},v=(e,t={})=>pe(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,yn=/\x1B\[(\d+)m/;let it=class{activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=yn.exec(t);if(!r)return;const n=Number.parseInt(r[1],10);switch(n){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(n>=30&&n<=37||n>=90&&n<=97)this.activeForeground=t;else if(n>=40&&n<=47||n>=100&&n<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(n))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(n)){const i={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[n];i&&(this.activeFormatting=this.activeFormatting.filter(s=>!s.includes(i)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const r={"\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(n=>{const i=r[n];i&&t.push(i)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}};const wn=(e,t)=>{if(!L.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+q.length).join("")===q;return{isInsideEscape:r,isInsideLinkEscape:n}},Sn=(e,t={})=>{const r=new it;let n="",i=!1,s="",o="",l=!1;const a=[...e];for(let u=0;u<a.length;u++){const c=a[u];if(c&&L.has(c)){if(n){const g=t.getWidth?.(n)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:n,width:g};if(l&&(m.isHyperlink=!0,m.hyperlinkUrl=o),t.onSegment?.(m,r)===!1)return;n=""}i=!0,s=c;const h=wn(a,u),{isInsideLinkEscape:d}=h;if(d){let g=u+1;for(o="";g<a.length;){const b=a[g];if(b===re)break;o+=b,g+=1}o=o.slice(4);const m={hyperlinkUrl:o,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(m,r)===!1)return;u=g,l=!0,i=!1,s="";continue}if(u+1<a.length&&a[u+1]==="\\"&&l){const g={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(g,r)===!1)return;l=!1,o="",u+=1,i=!1,s="";continue}}if(i){if(s!==c&&(s+=c),c===ye){i=!1,r.processEscape(s);const h={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};if(t.onSegment?.(h,r)===!1)return;s=""}continue}n+=c;const f=t.getWidth?.(n)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:n,width:f};if(l&&(p.isHyperlink=!0,p.hyperlinkUrl=o),t.onSegment?.(p,r)===!1)return;n=""}if(n){const u=t.getWidth?.(n)??0,c={isEscapeSequence:!1,isGrapheme:!0,text:n,width:u};l&&(c.isHyperlink=!0,c.hyperlinkUrl=o),t.onSegment?.(c,r)}if(s){const u={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};t.onSegment?.(u,r)}},Me=e=>`${L.values().next().value}${nt}${String(e)}${ye}`,Re=e=>`${L.values().next().value}${q}${e}${re}`,vn=e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const i=e.join(`
|
|
28
|
-
`),s=[...i];let o=0;for(const[l,a]of s.entries()){if(t+=a,L.has(a)){const c=gn.exec(i.slice(o))?.groups??{};if(c.code!==void 0){const f=Number.parseFloat(c.code);r=f===hn?void 0:f}else c.uri!==void 0&&(n=c.uri.length===0?void 0:c.uri)}const u=mn.get(Number(r));s[l+1]===`
|
|
29
|
-
`?(n&&(t+=Re("")),r&&u&&(t+=Me(u))):a===`
|
|
30
|
-
`&&(r&&u&&(t+=Me(r)),n&&(t+=Re(n))),o+=a.length}return t},st=/(?=\s)|(?<=\s)/,ot=/^\s+$/,ae=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},_=e=>{const t=e.split(" ");let r=t.length;for(;r>0&&v(t[r-1])===0;)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},lt=(e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],i=new it;let s="",o=0,l=!1,a=!1,u="",c=0;for(;c<e.length;){const f=e[c];if(L.has(f)){l=!0,u=f,s+=f,a=e.startsWith(q,c+1),c+=1;continue}if(l){u+=f,s+=f,a?f===re&&(l=a=!1):f===ye&&(l=!1,i.processEscape(u)),c+=1;continue}const p=v(f),h=f===" ";if(p===0){s+=f,c+=1;continue}if(o+p>t&&(s&&n.push(s+i.getEndEscapesForAllActiveAttributes()),s=i.getStartEscapesForAllActiveAttributes(),o=v(s),h&&r)){for(;c<e.length&&e[c]===" ";)c+=1;continue}if(s+=f,o+=p,o===t&&c<e.length-1&&(n.push(s+i.getEndEscapesForAllActiveAttributes()),s=i.getStartEscapesForAllActiveAttributes(),o=v(s),c+1<e.length&&e[c+1]===" "&&r)){for(c+=1;c<e.length&&e[c]===" ";)c+=1;continue}c+=1}return s&&n.push(s+i.getEndEscapesForAllActiveAttributes()),r?n.map(f=>_(f)):n},xn=(e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=[];let s="",o=0;return Sn(n,{getWidth:v,onSegment:(l,a)=>{const u=l.text??"";if(l.isEscapeSequence)s+=u;else{const c=u===" ";if(l.width===0)return s+=u,!0;if(o+l.width>t&&(s&&i.push(s),s=a.getStartEscapesForAllActiveAttributes(),o=0,c))return r||i.push(a.getStartEscapesForAllActiveAttributes()+u),!0;s+=u,o+=l.width}return!0}}),s&&i.push(s),r?i.map(l=>_(l)):i},En=(e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(st),s=[];let o="",l=0,a=0;for(;a<i.length;){const u=i[a],c=ot.test(u),f=v(u);if(u.length===0){a+=1;continue}if(r&&c&&l===0){a+=1;continue}if(l+f>t&&l>0){r?s.push(_(o)):s.push(o),o="",l=0;continue}o+=u,l+=f,a+=1}return o&&(r?s.push(_(o)):s.push(o)),s},Nn=(e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(st),s=[];let o="",l=0,a=0;for(;a<i.length;){const u=i[a],c=ot.test(u),f=v(u);if(u.length===0){a+=1;continue}if(r&&c&&l===0){a+=1;continue}if(f>t){o&&s.push(ae(r?_(o):o));const p=lt(u,t,r);if(p.length>0){for(let h=0;h<p.length-1;h+=1)s.push(p[h]);o=p.at(-1),l=v(o)}else o="",l=0;a+=1;continue}if(l+f>t&&l>0&&(s.push(ae(r?_(o):o)),o="",l=0,r&&c)){a+=1;continue}o+=u,l+=f,a+=1}return o&&s.push(ae(r?_(o):o)),s},H={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},An=(e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:i=80,wrapMode:s=H.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let o=e.normalize("NFC").replaceAll(`\r
|
|
31
|
-
`,`
|
|
32
|
-
`);return r&&(o=o.replaceAll(pn,"")),o.split(`
|
|
33
|
-
`).map(l=>{if(n&&l.trim()==="")return"";let a;switch(s){case H.BREAK_AT_CHARACTERS:{a=xn(l,i,n);break}case H.BREAK_WORDS:{a=Nn(l,i,n);break}case H.STRICT_WIDTH:{a=lt(l,i,n);break}default:a=En(l,i,n)}return vn(a)}).join(`
|
|
34
|
-
`)},at=80,ut=24,ge=(e,t,{shell:r,env:n}={})=>mt(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),Q=(e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),ct=(e,t)=>{const{columns:r,rows:n}=Q(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===at&&n===ut))return{columns:r,rows:n}},In=()=>{if(j.platform!=="linux")return!0;try{const e=V.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const r=e.slice(t+2).trim().split(/\s+/),n=Number.parseInt(r[2],10),i=Number.parseInt(r[5],10);return Number.isNaN(n)||Number.isNaN(i)||i<=0?!1:n===i}catch{return!1}};function kn(){const{env:e,stdout:t,stderr:r}=j;if(t?.columns&&t?.rows)return Q(t.columns,t.rows);if(r?.columns&&r?.rows)return Q(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return Q(e.COLUMNS,e.LINES);const n={columns:at,rows:ut};return j.platform==="win32"?ue()??n:j.platform==="darwin"?Pe()??ue()??n:Pe()??ue()??Tn()??n}const Pe=()=>{try{const e=j.platform==="darwin"?V.constants.O_EVTONLY|V.constants.O_NONBLOCK:V.constants.O_NONBLOCK,{columns:t,rows:r}=$t.WriteStream(V.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},ue=()=>{try{const e=ge("tput",["cols"],{env:{TERM:"dumb",...j.env}}),t=ge("tput",["lines"],{env:{TERM:"dumb",...j.env}});if(e&&t)return ct(e,t)}catch{}},Tn=()=>{try{if(!In())return;const e=ge("resize",["-u"]).match(/\d+/g);if(e.length===2)return ct(e[0],e[1])}catch{}},On=e=>{const t=Object.keys(e).map(r=>e[r].badge??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},jn=e=>{const t=Object.keys(e).map(r=>e[r].label??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},{bold:Bn,cyan:Wn,green:Ce,grey:_n,magenta:Fn,red:Mn,yellow:ce}=ee,Rn={indent:2,quoteStyle:"single",stylize:(e,t)=>{const r={bigint:ce,boolean:ce,date:Fn,null:Bn,number:ce,regexp:Mn,special:Wn,string:Ce,symbol:Ce,undefined:_n};return Object.hasOwn(r,t)?r[t](e):e}},{bold:Pn,underline:Cn}=ee,Ln=(e,t)=>{let r=t.uppercase.label?e.toUpperCase():e;return r=t.underline.label?Cn(r):r,t.bold.label&&(r=Pn(r)),r},zn=e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":");class Vn{styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:zn,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=bt}setLoggerTypes(t){this.loggerTypes=t}}const{bgGrey:Hn,cyan:Gn,green:qn,greenBright:Dn,grey:E,red:fe,underline:Le,white:Un}=ee,Yn=/[\\/]pail[\\/]dist/,de=e=>!Yn.test(e);class ei extends Vn{#t;#r;#n;#s=!1;#i;#e;constructor(t={}){const{error:r,inspect:n,...i}=t;super({uppercase:{label:!0,...i.uppercase},...i}),this.#i={...Rn,...n},this.#e={...r,color:{fileLine:qn,hint:Gn,marker:fe,message:fe,method:Dn,title:fe}},this.#t=ht,this.#r=pt}setStdout(t){this.#t=t}setStderr(t){this.#r=t}setInteractiveManager(t){this.#n=t}setIsInteractive(t){this.#s=t}log(t){this._log(this._formatMessage(t),t.type.level)}_formatMessage(t){const{columns:r}=kn();let n=r;typeof this.styles.messageLength=="number"&&(n=this.styles.messageLength);const{badge:i,context:s,date:o,error:l,file:a,groups:u,label:c,message:f,prefix:p,repeated:h,scope:d,suffix:g,traceError:m,type:b}=t,{color:x}=this.loggerTypes[b.name],A=x?ee[x]:Un,S=u.map(()=>" ").join(""),$=[];if(u.length>0&&$.push(`${S+E(`[${u.at(-1)??""}]`)} `),o&&$.push(`${E(this.styles.dateFormatter(typeof o=="string"?new Date(o):o))} `),i)$.push(A(i));else{const w=On(this.loggerTypes);w.length>0&&$.push(`${E(".".repeat(w.length))} `)}const W=jn(this.loggerTypes);if(c){const w=v(W),I=v(c);$.push(`${A(Ln(c,this.styles))} `,E(".".repeat(Math.max(0,w-I))))}else $.push(E(".".repeat(W.length+2)));h&&$.push(`${Hn.white(`[${String(h)}x]`)} `),Array.isArray(d)&&d.length>0&&$.push(` ${E(`[${d.join(" > ")}]`)} `),p&&$.push(`${E(`${Array.isArray(d)&&d.length>0?". ":" "}[${this.styles.underline.prefix?Le(p):p}]`)} `);const k=v($.join(" "));if(a){const w=(a.name??"")+(a.line?`:${String(a.line)}`:""),I=v(w);if(I+k+2>n)$.push(E(` ${w}`));else{const ne=Math.max(0,n-k-I-2);$.push(E(`${".".repeat(ne)} ${w}`))}}else $.push(E(".".repeat(Math.max(0,n-k-1))));if($.length>0&&$.push(`
|
|
35
|
-
|
|
36
|
-
`),f!==yt){const w=typeof f=="string"?f:Be(f,this.#i);$.push(S+An(w,{trim:!1,width:n-3,wrapMode:H.STRICT_WIDTH}))}if(s){let w=!1;$.push(...s.map(I=>{if(I instanceof Error)return w=!0,`
|
|
37
|
-
|
|
38
|
-
${ie(I,{...this.#e,filterStacktrace:de,prefix:S})}`;if(typeof I=="object")return` ${Be(I,this.#i)}`;const ne=(w?`
|
|
39
|
-
|
|
40
|
-
`:" ")+String(I);return w=!1,ne}))}return l&&$.push(ie(l,{...this.#e,filterStacktrace:de,prefix:S})),m&&$.push(`
|
|
41
|
-
|
|
42
|
-
${ie(m,{...this.#e,filterStacktrace:de,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:S})}`),g&&$.push(`
|
|
43
|
-
`,S+E(this.styles.underline.suffix?Le(g):g)),$.join("")}_log(t,r){const n=["error","trace","warn"].includes(r)?"stderr":"stdout",i=n==="stderr"?this.#r:this.#t;this.#s&&this.#n!==void 0&&i.isTTY?this.#n.update(n,t.split(`
|
|
44
|
-
`),0):wt(`${t}
|
|
45
|
-
`,i)}}export{ei as PrettyReporter};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import{createRequire as rt}from"node:module";import Be from"@visulima/colorize";const nt=rt(import.meta.url),B=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,J=e=>{if(typeof B<"u"&&B.versions&&B.versions.node){const[t,r]=B.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return B.getBuiltinModule(e)}return nt(e)},{createRequire:it}=J("node:module"),A=B,{execFileSync:st}=J("node:child_process"),P=J("node:fs"),ot=J("node:tty"),Nn={alert:7,critical:6,debug:1,emergency:8,error:5,informational:2,notice:3,trace:2,warning:4},lt={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"}},An=Symbol("EMPTY"),In=e=>{const t=Object.keys(e).map(r=>e[r].label??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},w=(e,t,r,n,i,s=", ")=>{const o=e.length;if(o===0)return"";let l=n;i!==void 0&&(l=i);const a=r.truncate;let c="",u="",f="";for(let h=0;h<o;h+=1){const d=h+1===e.length,g=h+2===e.length;f=`…(${String(e.length-h)})`;let m=e[h];r.truncate=a-c.length-(d?0:s.length);const p=u||l(m,t,r,n)+(d?"":s),$=c.length+p.length,S=$+f.length;if(d&&$>a&&c.length+f.length<=a||!d&&!g&&S>a)break;m=e[h+1];const N=g?"":s;if(d?u="":u=l(m,t,r,n)+N,!d&&g&&S>a&&$+u.length>a)break;if(c+=p,!d&&!g&&$+u.length>=a){f=`…(${String(e.length-h-1)})`;break}f=""}return`${c}${f}`},at=([e,t],r,n)=>(n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:n.stylize(String(e),"yellow")),ct=(e,t,r)=>{switch(e.nodeType){case 1:return _e(e,e,r,t);case 3:return t(e.data,t,r);default:return t(e,t,r)}},se=(e,t,r,n)=>w(e,e,t,r,ct,`
|
|
2
|
-
`),_e=(e,t,r,n)=>{const i=e.getAttributeNames(),s=e.tagName.toLowerCase(),o=r.stylize(`<${s}`,"special"),l=r.stylize(">","special"),a=r.stylize(`</${s}>`,"special");r.truncate-=s.length*2+5;let c="";i.length>0&&(c+=" ",c+=w(i.map(h=>[h,e.getAttribute(h)]),t,r,n,at," ")),r.truncate-=c.length;const{truncate:u}=r;let f=se(e.children,r,n);return f&&f.length>u&&(f=`…(${String(e.children.length)})`),`${o}${c}${l}${f}${a}`},ut=(e,t,r)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${w(e,e,t,r)} ]`),ft=(e,t)=>{let r;if(e===" ")r=" ";else if(typeof e=="number"&&e>0)r=Array.from({length:e+1}).join(" ");else return;return{base:r,prev:`
|
|
3
|
-
${Array.from({length:t+1}).join(r)}`}},Z=(e,t)=>{if(e.length===0)return"";const r=t.prev+t.base;return r+e.split("\0\0").join(`,${r}`)+t.prev},dt=/^[a-z_]\w*$/i,gt=/^"|"$/g,ht=(e,t)=>{if(dt.test(e))return e;const r=JSON.stringify(e);return t.quoteStyle==="double"?r.replaceAll('"',String.raw`\"`):r.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(gt,"'")},R=([e,t],r,n,i)=>{n.truncate-=2;let s;typeof e=="string"?s=ht(e,n):typeof e=="number"?s=String(e):s=`[${i(e,r,n)}]`,n.truncate-=s.length;const o=i(t,r,n);return`${s}: ${o}`},mt=e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},pt=(e,t,r,n)=>{const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return"[]";t.truncate-=4;const s=!!n&&mt(e);let o=w(e,e,t,r,void 0,s?"\0\0":", ");t.truncate-=o.length;let l="";return i.length>0&&(l=w(i.map(a=>[a,e[a]]),e,t,r,R)),s&&n&&(o=Z(o,n)),`[${s?"":" "}${o}${l?`, ${l}`:""}${s?"":" "}]`},de=/\d(?=(?:\d{3})+(?!\d))/g,$t=/\d{3}/g,bt=/_$/,je=(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 r=e<0?-Math.floor(-e):Math.floor(e);if(r!==e){const n=String(r),i=t.slice(n.length+1);return`${n.replace(de,"$&_")}.${i.replace($t,"$&_").replace(bt,"")}`}}return t.replace(de,"$&_")},wt=e=>e>="\uD800"&&e<="\uDBFF",x=(e,t,r="…")=>{e=String(e);const n=r.length,i=e.length;if(n>t&&i>n)return r;if(i>t&&i>n){let s=t-n;return s>0&&wt(e[s-1])&&(s-=1),`${e.slice(0,s)}${r}`}return e},ge=(e,t)=>{let r=x(e.toString(),t.truncate-1);return r!=="…"&&(r+="n"),t.stylize(t.numericSeparator?je(e,r):r,"bigint")},yt=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),Y=(e,t,r,n)=>{if("window"in globalThis&&e===globalThis)return"{ [object Window] }";if(e===globalThis)return"{ [object globalThis] }";const i=Object.getOwnPropertyNames(e),s=Object.getOwnPropertySymbols(e),o=yt(e)===Object.prototype||e.constructor===Object,l=e instanceof Object?"":"null prototype";let a;!o&&Symbol.toStringTag in e?a=e[Symbol.toStringTag]:a=l?"Object":"";const c=a||l?`[${[a,l].filter(Boolean).join(": ")}] `:"";if(i.length===0&&s.length===0)return`${c}{}`;t.truncate-=4;const u=n?"\0\0":", ",f=w(i.map(g=>[g,e[g]]),e,t,r,R,u),h=w(s.map(g=>[g,e[g]]),e,t,r,R,u);let d="";return f&&h&&(d=u),n?`${c}{${Z(f+d+h,n)}}`:`${c}{ ${f}${d}${h} }`},vt=(e,t,r,n)=>{let i="";return i=i||e.constructor.name,(!i||i==="_class")&&(i="<Anonymous Class>"),t.truncate-=i.length,`${i} ${Y(e,t,r,n)}`},St=(e,t)=>{const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),i=n[0];return t.stylize(`${i}T${x(n[1],t.truncate-i.length-1)}`,"date")},Et=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),xt=(e,t,r)=>{const n=Object.getOwnPropertyNames(e).filter(l=>!Et.has(l)),{name:i}=e;t.truncate-=i.length;let s="";typeof e.message=="string"?s=x(e.message,t.truncate):n.unshift("message"),s=s?`: ${s}`:"",t.truncate-=s.length+5;const o=w(n.map(l=>[l,e[l]]),e,t,r,R);return`${i}${s}${o?` { ${o} }`:""}`},he=(e,t)=>{const r=e[Symbol.toStringTag]||"Function",n=e.toString();if(n.length<t.truncate-12)return t.stylize(`[${r}: ${n}]`,"special");const{name:i}=e;return i?t.stylize(`[${r} ${x(i,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")},Nt=([e,t],r,n,i)=>(n.truncate-=4,e=i(e,r,n),n.truncate-=e.length,`${e} => ${i(t,r,n)}`),At=(e,t,r,n)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let i=w([...e.entries()],e,t,r,Nt,n?"\0\0":", ");return n&&(i=Z(i,n)),`Map (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`};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(x(t.numericSeparator?je(e,e.toString()):e.toString(),t.truncate),"number")}const It=()=>"Promise{…}",kt=(e,t)=>{const r=t.truncate-(2+e.flags.length);return t.stylize(`/${x(e.source,r)}/${e.flags}`,"regexp")},Ot=(e,t,r,n)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let i=w([...e],e,t,r,void 0,n?"\0\0":", ");return n&&(i=Z(i,n)),`Set (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},Tt=(e,t)=>{const r=t.quoteStyle==="double"?'"':"'";return t.quoteStyle==="double"&&(e=e.replaceAll('"','"')),r+e+r},pe=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"),Bt={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},_t=16,jt=e=>Bt[e]||String.raw`\u${`0000${e.codePointAt(0).toString(_t)}`.slice(-4)}`,$e=(e,t)=>(pe.test(e)&&(e=e.replaceAll(pe,jt)),t.stylize(Tt(x(e,t.truncate-2),t),"string")),be=e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),Ft=e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],y=(e,t,r)=>{const n=Ft(e);t.truncate-=n.length+4;const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return`${n}[]`;let s="";for(let l=0;l<e.length;l++){const a=`${t.stylize(x(e[l],t.truncate),"number")}${l===e.length-1?"":", "}`;if(t.truncate-=a.length,l!==e.length-1&&t.truncate<=3){s+=`…(${String(e.length-l)})`;break}s+=a}let o="";return i.length>0&&(o=w(i.map(l=>[l,e[l]]),e,t,r,R)),`${n}[ ${s}${o?`, ${o}`:""} ]`},we=new WeakMap,Wt={},Lt={Arguments:ut,Array:pt,ArrayBuffer:()=>"",BigInt:ge,bigint:ge,Boolean:(e,t)=>t.stylize(String(e),"boolean"),boolean:(e,t)=>t.stylize(String(e),"boolean"),DataView:()=>"",Date:St,Error:xt,Float32Array:y,Float64Array:y,Function:he,function:he,Generator:()=>"",HTMLCollection:se,Int8Array:y,Int16Array:y,Int32Array:y,Map:At,NodeList:se,null:(e,t)=>t.stylize("null","null"),Number:me,number:me,Promise:It,RegExp:kt,Set:Ot,String:$e,string:$e,Symbol:be,symbol:be,Uint8Array:y,Uint8ClampedArray:y,Uint16Array:y,Uint32Array:y,undefined:(e,t)=>t.stylize("undefined","undefined"),WeakMap:(e,t)=>t.stylize("WeakMap{…}","special"),WeakSet:(e,t)=>t.stylize("WeakSet{…}","special")},ye=Symbol.for("nodejs.util.inspect.custom"),Q=Symbol.for("chai/inspect"),Mt=(e,t,r,n)=>{if(Q in e&&typeof e[Q]=="function")return e[Q](t);if(!("window"in globalThis)&&typeof e[ye]=="function")return e[ye](n,t);if("inspect"in e&&typeof e.inspect=="function")return e.inspect(n,t);if("constructor"in e&&we.has(e.constructor))return we.get(e.constructor)?.(e,t)??"unknown";const i=Wt[r];return i?i(e,t):""},ee=(e,t,r)=>{const{depth:n,inspect:i,seen:s}=r;if(s.includes(e))return"[Circular]";if(n>=t.depth&&t.depth>0&&typeof e=="object")return Array.isArray(e)?"[Array]":"[Object]";const o=t.indent?ft(t.indent,n):void 0;let l=e===null?"null":typeof e;l==="object"&&(l=Object.prototype.toString.call(e).slice(8,-1));const a=Lt[l];if(a!==void 0)return a(e,t,i,o);if(t.customInspect&&e){const u=Mt(e,t,l,t.depth-n);if(u)return typeof u=="string"?u:i(u,e,t)}const c=e?Object.getPrototypeOf(e):!1;return c===Object.prototype||c===null?Y(e,t,i,o):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?_e(e,e,t,i):"constructor"in e?e.constructor!==Object?vt(e,t,i,o):Y(e,t,i,o):e===Object(e)?Y(e,t,i,o):t.stylize(String(e),l)},kn=(e,t={})=>{const r={breakLength:Number.POSITIVE_INFINITY,customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,showProxy:!1,stylize:i=>i,truncate:Number.POSITIVE_INFINITY,...t};if(r.indent!==void 0&&r.indent!==" "&&!(Number.parseInt(r.indent,10)===r.indent&&r.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');const n={depth:0,inspect:void 0,seen:[]};return n.inspect=(i,s,o)=>{if(s==null){n.depth+=1;const a=ee(i,o,n);return n.depth-=1,a}n.seen.push(s),n.depth+=1;const l=ee(i,o,n);return n.depth-=1,n.seen.pop(),l},ee(e,r,n)},On=(e,t)=>(t.__write??t.write.bind(t)).call(t,e);var Pt=Object.defineProperty,ae=(e,t)=>Pt(e,"name",{value:t,configurable:!0}),Rt=Object.defineProperty,Ct=ae((e,t)=>Rt(e,"name",{value:t,configurable:!0}),"r$1");const zt=Ct(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
4
|
-
`),"normalizeLF"),Vt=globalThis.process??Object.create(null),ve={versions:{}},Se=new Proxy(Vt,{get(e,t){if(t in e)return e[t];if(t in ve)return ve[t]}});var Gt=Object.defineProperty,Dt=ae((e,t)=>Gt(e,"name",{value:t,configurable:!0}),"b");const Ht=Dt((e,t,r,n)=>{const i={column:0,line:-1,...e.start},s={...i,...e.end},o=i.line,l=i.column,a=s.line,c=s.column;let u=Math.max(o-(r+1),0),f=Math.min(t.length,a+n);o===-1&&(u=0),a===-1&&(f=t.length);const h=a-o,d={};if(h)for(let g=0;g<=h;g++){const m=g+o;if(!l)d[m]=!0;else if(g===0){const p=t[m-1]?.length;d[m]=[l,(p??0)-l+1]}else if(g===h)d[m]=[0,c];else{const p=t[m-g]?.length;d[m]=[0,p]}}else l===c?d[o]=l?[l,0]:!0:d[o]=[l,(c??0)-(l??0)];return{end:f,markerLines:d,start:u}},"getMarkerLines");var qt=Object.defineProperty,G=ae((e,t)=>qt(e,"name",{value:t,configurable:!0}),"t");const Yt=Se.platform==="win32"&&!Se.env?.WT_SESSION?">":"❯",Ut=G((e,t,r)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:G(g=>g,"gutter"),marker:G(g=>g,"marker"),message:G(g=>g,"message"),...r?.color}},i=typeof t.start.column=="number";let s=zt(e).split(`
|
|
5
|
-
`);typeof n.tabWidth=="number"&&(s=s.map(g=>g.replaceAll(" "," ".repeat(n.tabWidth))));const{end:o,markerLines:l,start:a}=Ht(t,s,n.linesAbove,n.linesBelow),c=String(o).length,{gutter:u,marker:f,message:h}=n.color;let d=s.slice(a,o).map((g,m)=>{const p=a+1+m,$=l[p],S=String(p).padStart(c),N=!l[p+1],F=` ${S}${n.showGutter?" |":""}`;if($){let W="";if(Array.isArray($)){const V=g.replaceAll(/[^\t]/g," ").slice(0,Math.max($[0]-1,0)),L=$[1]||1;W=[`
|
|
6
|
-
`,n.prefix+u(F.replaceAll(/\d/g," "))," ",V,f("^").repeat(L)].join(""),N&&n.message&&(W+=` ${h(n.message)}`)}return[n.prefix+f(Yt),u(F),g.length>0?` ${g}`:"",W].join("")}return`${n.prefix} ${u(F)}${g.length>0?` ${g}`:""}`}).join(`
|
|
7
|
-
`);return n.message&&!i&&(d=`${n.prefix+" ".repeat(c+1)+n.message}
|
|
8
|
-
${d}`),d},"codeFrame");var Kt=Object.defineProperty,Jt=(e,t)=>Kt(e,"name",{value:t,configurable:!0}),Zt=Object.defineProperty,v=Jt((e,t)=>Zt(e,"name",{value:t,configurable:!0}),"u");const k=v((e,...t)=>{process.env.DEBUG&&process.env.DEBUG==="true"&&console.debug(`error:parse-stacktrace: ${e}`,...t)},"debugLog"),O="<unknown>",Xt=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Qt=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,er=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,tr=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,rr=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,nr=/in\s(.*)\s\(at\s(.+)\)\sat/,ir=/^(?:.*@)?(.*):(\d+):(\d+)$/,sr=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,or=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,lr=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,Ee=/\(error: (.*)\)/,ar=/at\s/,cr=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,ur=/\S*(?:Error: |AggregateError:)/,Fe=/^Anonymous function$/,fr=/^\s*in\s.*/,dr=/^.*?\s*at\s.*/,gr=/^.*?\s*@.*|\[native code\]/,We=v((e,t)=>{const r=e.includes("safari-extension"),n=e.includes("safari-web-extension");return r||n?[e.includes("@")?e.split("@")[0]:O,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},"extractSafariExtensionDetails"),Le=v((e,t)=>{const r=er.exec(t);r&&(e.file=r[1],e.line=+r[2],e.column=+r[3])},"parseMapped"),hr=v(e=>{const t=nr.exec(e);if(t){k(`parse nested node error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const n=t[2].split(":");return{column:n[2]?+n[2]:void 0,file:n[0],line:n[1]?+n[1]:void 0,methodName:t[1]??O,raw:e,type:void 0}}const r=rr.exec(e);if(r){k(`parse node error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n={column:r[4]?+r[4]:void 0,file:r[2]?r[2].replace(ar,""):void 0,line:r[3]?+r[3]:void 0,methodName:r[1]??O,raw:e,type:e.startsWith("internal")?"internal":void 0};return Le(n,`${r[2]}:${r[3]}:${r[4]}`),n}},"parseNode"),mr=v(e=>{const t=Xt.exec(e);if(t){k(`parse chrome error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const r=t[2]?.startsWith("native"),n=t[2]?.startsWith("eval")||t[1]?.startsWith("eval");let i,s;if(n){const c=Qt.exec(e);if(c){const u=cr.exec(c[1]);u?(t[2]=u[4]??u[1],t[3]=u[5]??u[2],t[4]=u[3]):c[2]&&(t[2]=c[1]),c[2]&&(i={column:c[4]?+c[4]:void 0,file:c[2],line:c[3]?+c[3]:void 0,methodName:"eval",raw:e,type:"eval"})}else{const u=tr.exec(e);u&&(s={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[o,l]=We(t[1]?t[1].replace(Fe,"<anonymous>"):O,t[2]),a={column:t[4]?+t[4]:void 0,evalOrigin:i,file:l,line:t[3]?+t[3]:void 0,methodName:o,raw:e,type:n?"eval":r?"native":void 0};return s?(a.column=s.column,a.file=s.file,a.line=s.line):Le(a,`${l}:${t[3]}:${t[4]}`),a}},"parseChromium"),pr=v((e,t)=>{const r=sr.exec(e);if(r){k(`parse gecko error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n=r[3]?.includes(" > eval"),i=n&&r[3]&&or.exec(r[3]);let s;n&&i&&(r[3]=i[1],s={column:r[5]?+r[5]:void 0,file:r[3],line:r[4]?+r[4]:void 0,methodName:"eval",raw:e,type:"eval"},r[4]=i[2]);const[o,l]=We(r[1]?r[1].replace(Fe,"<anonymous>"):O,r[3]);let a;(t?.type==="safari"||!n&&t?.type==="firefox")&&t.column?a=t.column:!n&&r[5]&&(a=+r[5]);let c;return(t?.type==="safari"||!n&&t?.type==="firefox")&&t.line?c=t.line:r[4]&&(c=+r[4]),{column:a,evalOrigin:s,file:l,line:c,methodName:o,raw:e,type:n?"eval":l.includes("[native code]")?"native":void 0}}},"parseGecko"),$r=v((e,t)=>{const r=lr.exec(e);if(!(r&&r[2].includes(" > eval"))&&r)return k(`parse firefox error stack line: "${e}"`,`found: ${JSON.stringify(r)}`),{column:r[4]?+r[4]:t?.column??void 0,file:r[2],line:r[3]?+r[3]:t?.line??void 0,methodName:r[1]||O,raw:e,type:void 0}},"parseFirefox"),br=v(e=>{const t=ir.exec(e);if(t)return k(`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:O,raw:e,type:void 0}},"parseReactAndroidNative"),Me=v((e,{filter:t,frameLimit:r=50}={})=>{const n=e;let i=(typeof n.stacktrace=="string"?n.stacktrace:e.stack??"").split(`
|
|
9
|
-
`).map(s=>(Ee.test(s)?s.replace(Ee,"$1"):s).trim()).filter(s=>!ur.test(s)&&s!=="eval code");return t&&(i=i.filter(s=>t(s))),i=i.slice(0,r),i.reduce((s,o,l)=>{if(!o||o.length>1024)return s;let a;if(fr.test(o))a=hr(o);else if(dr.test(o))a=mr(o);else if(gr.test(o)){let c;if(l===0){const u=e,f=u.columnNumber,h=u.lineNumber,d=u.line,g=u.column;f||h?c={column:f,line:h,type:"firefox"}:(d||g)&&(c={column:g,line:d,type:"safari"})}a=$r(o,c)??pr(o,c)}else a=br(o);return a?s.push(a):k(`parse error stack line: "${o}"`,"not parser found"),s},[])},"parseStacktrace");var wr=Object.defineProperty,Pe=(e,t)=>wr(e,"name",{value:t,configurable:!0});const yr=it(import.meta.url),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ce=Pe(e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[t,r]=_.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return _.getBuiltinModule(e)}return yr(e)},"__cjs_getBuiltinModule"),{existsSync:vr,readFileSync:Sr}=ce("node:fs"),{relative:Er}=ce("node:path"),{cwd:xr}=_,{fileURLToPath:Nr}=ce("node:url");var Ar=Object.defineProperty,b=Pe((e,t)=>Ar(e,"name",{value:t,configurable:!0}),"o");const T=b((e,t,r)=>r===0?e:t===" "?e+" ".repeat(r):e+" ".repeat(t*r),"getPrefix"),Ir=b((e,t)=>{const r=e.replace("async file:","file:");return Er(t,r.startsWith("file:")?Nr(r):r)},"getRelativePath"),kr=b((e,t,r)=>{if(t)return r.title(e.message);const n=e.message?`: ${e.message}`:"";return r.title(e.name+n)},"getTitleText"),Re=b((e,{color:t,hideErrorTitle:r,indentation:n,prefix:i},s)=>`${T(i,n,s)}${kr(e,r,t)}
|
|
10
|
-
`,"getMessage"),Ce=b((e,{color:t,indentation:r,prefix:n},i)=>{if(e.hint===void 0)return;const s=T(n,r,i);let o="";if(Array.isArray(e.hint))for(const l of e.hint)o+=`${s+l}
|
|
11
|
-
`;else o+=s+e.hint;return t.hint(o)},"getHint"),ue=b((e,{color:t,cwd:r,displayShortPath:n,indentation:i,prefix:s},o=0)=>{const l=n?Ir(e.file,r):e.file,{fileLine:a,method:c}=t;return`${T(s,i,o)}at ${e.methodName?`${c(e.methodName)} `:""}${a(l)}:${a(e.line?.toString()??"")}`},"getMainFrame"),ze=b((e,{color:t,indentation:r,linesAbove:n,linesBelow:i,prefix:s,showGutter:o,showLineNumbers:l,tabWidth:a},c)=>{if(e.file===void 0)return;const u=e.file.replace("file://","");if(!vr(u))return;const f=Sr(u,"utf8");return Ut(f,{start:{column:e.column,line:e.line}},{color:t,linesAbove:n,linesBelow:i,prefix:T(s,r,c),showGutter:o,showLineNumbers:l,tabWidth:a})},"getCode"),Ve=b((e,t,r)=>{if(e.errors.length===0)return;let n=`${T(t.prefix,t.indentation,r)}Errors:
|
|
12
|
-
|
|
13
|
-
`,i=!0;for(const s of e.errors)i?i=!1:n+=`
|
|
14
|
-
|
|
15
|
-
`,n+=De(s,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},r+1);return`
|
|
16
|
-
${n}`},"getErrors"),Ge=b((e,t,r,n=new Set)=>{n.add(e);let i=`${T(t.prefix,t.indentation,r)}Caused by:
|
|
17
|
-
|
|
18
|
-
`;const s=e.cause;i+=Re(s,t,r);const o=Me(s).shift(),l=Ce(s,t,r);if(l&&(i+=`${l}
|
|
19
|
-
`),o&&(i+=ue(o,t,r),!t.hideErrorCauseCodeView)){const a=ze(o,t,r);a!==void 0&&(i+=`
|
|
20
|
-
${a}`)}if(s instanceof AggregateError){const a=Ve(s,t,r);a!==void 0&&(i+=`
|
|
21
|
-
${a}`)}return s.cause&&(n.has(s)?i+=`
|
|
22
|
-
${T(t.prefix,t.indentation,r+1)}Caused by: [Circular]`:i+=`
|
|
23
|
-
${Ge(s,t,r+1,n)}`),`
|
|
24
|
-
${i}`},"getCause"),Or=b((e,t)=>(e.length>0?`
|
|
25
|
-
`:"")+e.map(r=>ue(r,t)).join(`
|
|
26
|
-
`),"getStacktrace"),De=b((e,t,r)=>{const n={cwd:xr(),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:b(o=>o,"fileLine"),gutter:b(o=>o,"gutter"),hint:b(o=>o,"hint"),marker:b(o=>o,"marker"),message:b(o=>o,"message"),method:b(o=>o,"method"),title:b(o=>o,"title"),...t.color}},i=Me(e,{filter:t.filterStacktrace,frameLimit:n.framesMaxLimit}),s=i.shift();return[t.hideMessage?void 0:Re(e,n,r),Ce(e,n,r),s?ue(s,n,r):void 0,s&&!n.hideErrorCodeView?ze(s,n,r):void 0,e instanceof AggregateError?Ve(e,n,r):void 0,e.cause===void 0?void 0:Ge(e,n,r),i.length>0?Or(i,n):void 0].filter(Boolean).join(`
|
|
27
|
-
`).replaceAll("\\","/")},"internalRenderError"),Tn=b((e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return De(e,t,0)},"renderError"),Tr=[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],Br=12288,_r=65510,jr=[12288,12288,65281,65376,65504,65510],Fr=8361,Wr=65518,Lr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Mr=32,Pr=10630,Rr=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Cr=4352,zr=262141,He=[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],z=(e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){const i=Math.floor((r+n)/2),s=i*2;if(t<e[s])n=i-1;else if(t>e[s+1])r=i+1;else return!0}return!1},xe=19968,[Vr,Gr]=Dr(He);function Dr(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){const i=e[n],s=e[n+1];if(xe>=i&&xe<=s)return[i,s];s-i>r-t&&(t=i,r=s)}return[t,r]}const Hr=e=>e<161||e>1114109?!1:z(Tr,e),qr=e=>e<Br||e>_r?!1:z(jr,e),Yr=e=>e<Fr||e>Wr?!1:z(Lr,e),Ur=e=>e<Mr||e>Pr?!1:z(Rr,e),Kr=e=>e>=Vr&&e<=Gr?!0:e<Cr||e>zr?!1:z(He,e);function Jr(e){return Hr(e)?"ambiguous":qr(e)?"fullwidth":Yr(e)?"halfwidth":Ur(e)?"narrow":Kr(e)?"wide":"neutral"}function Zr(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function qe(e){return Zr(e),Jr(e)}const Ye=String.raw,Ne=Ye`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Xr=()=>new RegExp(Ye`\p{RI}{2}|(?)${Ne}(?:\u200D${Ne})*`,"gu"),j=new Set(["\x1B",""]),X="\x07",Ue="[",fe="m",C="]8;;",Qr=39,en=/[\u200B\uFEFF\u2060-\u2064]/g,tn=new RegExp(`(?:\\${Ue}(?<code>\\d+)m|\\${C}(?<uri>.*)${X})`),rn=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]])),M=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,D=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,te=Xr(),Ae=new Map,H=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,U=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",nn=(e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=Ae.get(r);if(i||(i=new Map,Ae.set(r,i)),i.has(n))return i.get(n);let s;if(U(e)==="latin")s=t.width.regular;else if(U(e)==="control")s=t.width.control;else if(U(e)==="wide")s=t.width.wide;else switch(qe(e)){case"ambiguous":{s=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{s=t.width.fullWidth;break}case"wide":{s=t.width.wide;break}default:s=t.width.regular}return i.set(n,s),s},sn=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,oe=(e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?oe(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},n=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=e,s=i>1e4;let o=0,l=0,a=i,c=!1;const u=e.includes("\x1B")||e.includes("");for(;o<i;){if(u&&(e[o]==="\x1B"||e[o]==="")){if(e.startsWith("\x1B]8;;",o)){const p="\x1B]8;;\x07",$=p.length,S=e.indexOf("\x07",o+5);if(S!==-1){const N=e.indexOf(p,S+1);if(N!==-1){const F=N+$,W=e.slice(S+1,N).replace(M,""),V=oe(W,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,n-l),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),L=V.width;if(V.truncated)c=!0,a=Math.min(a,o);else if(l+L>n&&(a=Math.min(a,o),c=!0,l+L>r.truncation.limit))break;if(l+=L,o=F,c&&l>=r.truncation.limit)break;continue}}}if(M.lastIndex=o,M.test(e)){const p=M.lastIndex-o,$=r.truncation.countAnsiEscapeCodes?p:r.width.ansi;if(l+$>n&&(a=Math.min(a,o),l+$>r.truncation.limit)){c=!0;break}l+=$,o=M.lastIndex;continue}}const d=e.codePointAt(o);if(d===8203||d===65279||d>=8288&&d<=8292){o+=1;continue}if(d===9){if(l+r.width.tab>n&&(a=Math.min(a,o),l+r.width.tab>r.truncation.limit)){c=!0;break}l+=r.width.tab,o+=1;continue}if(H.lastIndex=o,H.test(e)){const p=(H.lastIndex-o)*r.width.regular;if(l+p>n){const $=Math.floor((n-l)/r.width.regular);if(a=Math.min(a,o+$),l+p>r.truncation.limit){c=!0;break}}l+=p,o=H.lastIndex;continue}if((d<=31||d>=127&&d<=159)&&(D.lastIndex=o,D.test(e))){const p=(D.lastIndex-o)*r.width.control;if(l+p>n&&(a=Math.min(a,o+Math.floor((n-l)/r.width.control)),l+p>r.truncation.limit)){c=!0;break}l+=p,o=D.lastIndex;continue}if(te.lastIndex=o,te.test(e)){if(l+r.width.emoji>n&&(a=Math.min(a,o),l+r.width.emoji>r.truncation.limit)){c=!0;break}l+=r.width.emoji,o=te.lastIndex;continue}const g=e.codePointAt(o)??0;if(sn(g)){o+=g>65535?2:1;continue}let m;if(s)m=nn(g,r);else switch(U(g)){case"control":{m=r.width.control;break}case"latin":{m=r.width.regular;break}case"wide":{m=r.width.wide;break}case"zero":{m=0;break}default:switch(qe(g)){case"ambiguous":{m=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{m=r.width.fullWidth;break}case"wide":{m=r.width.wide;break}default:m=r.width.regular}}if(l+m>n&&(a=Math.min(a,o),l+m>r.truncation.limit)){c=!0;break}l+=m,o+=g>65535?2:1}let f=l,h=!1;return c&&r.truncation.limit>=r.truncation.ellipsisWidth&&(f=r.truncation.limit,h=!0),{ellipsed:h,index:c?a:i,truncated:c,width:f}},E=(e,t={})=>oe(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,on=/\x1B\[(\d+)m/;class Ke{activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=on.exec(t);if(!r)return;const n=Number.parseInt(r[1],10);switch(n){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(n>=30&&n<=37||n>=90&&n<=97)this.activeForeground=t;else if(n>=40&&n<=47||n>=100&&n<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(n))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(n)){const i={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[n];i&&(this.activeFormatting=this.activeFormatting.filter(s=>!s.includes(i)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const r={"\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(n=>{const i=r[n];i&&t.push(i)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}const ln=(e,t)=>{if(!j.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+C.length).join("")===C;return{isInsideEscape:r,isInsideLinkEscape:n}},an=(e,t={})=>{const r=new Ke;let n="",i=!1,s="",o="",l=!1;const a=[...e];for(let c=0;c<a.length;c++){const u=a[c];if(u&&j.has(u)){if(n){const m=t.getWidth?.(n)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:n,width:m};if(l&&(p.isHyperlink=!0,p.hyperlinkUrl=o),t.onSegment?.(p,r)===!1)return;n=""}i=!0,s=u;const d=ln(a,c),{isInsideLinkEscape:g}=d;if(g){let m=c+1;for(o="";m<a.length;){const $=a[m];if($===X)break;o+=$,m+=1}o=o.slice(4);const p={hyperlinkUrl:o,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(p,r)===!1)return;c=m,l=!0,i=!1,s="";continue}if(c+1<a.length&&a[c+1]==="\\"&&l){const m={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(m,r)===!1)return;l=!1,o="",c+=1,i=!1,s="";continue}}if(i){if(s!==u&&(s+=u),u===fe){i=!1,r.processEscape(s);const d={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};if(t.onSegment?.(d,r)===!1)return;s=""}continue}n+=u;const f=t.getWidth?.(n)??0,h={isEscapeSequence:!1,isGrapheme:!0,text:n,width:f};if(l&&(h.isHyperlink=!0,h.hyperlinkUrl=o),t.onSegment?.(h,r)===!1)return;n=""}if(n){const c=t.getWidth?.(n)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:n,width:c};l&&(u.isHyperlink=!0,u.hyperlinkUrl=o),t.onSegment?.(u,r)}if(s){const c={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};t.onSegment?.(c,r)}},Ie=e=>`${j.values().next().value}${Ue}${String(e)}${fe}`,ke=e=>`${j.values().next().value}${C}${e}${X}`,cn=e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const i=e.join(`
|
|
28
|
-
`),s=[...i];let o=0;for(const[l,a]of s.entries()){if(t+=a,j.has(a)){const u=tn.exec(i.slice(o))?.groups??{};if(u.code!==void 0){const f=Number.parseFloat(u.code);r=f===Qr?void 0:f}else u.uri!==void 0&&(n=u.uri.length===0?void 0:u.uri)}const c=rn.get(Number(r));s[l+1]===`
|
|
29
|
-
`?(n&&(t+=ke("")),r&&c&&(t+=Ie(c))):a===`
|
|
30
|
-
`&&(r&&c&&(t+=Ie(r)),n&&(t+=ke(n))),o+=a.length}return t},Je=/(?=\s)|(?<=\s)/,Ze=/^\s+$/,re=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},I=e=>{const t=e.split(" ");let r=t.length;for(;r>0&&E(t[r-1])===0;)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},Xe=(e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],i=new Ke;let s="",o=0,l=!1,a=!1,c="",u=0;for(;u<e.length;){const f=e[u];if(j.has(f)){l=!0,c=f,s+=f,a=e.startsWith(C,u+1),u+=1;continue}if(l){c+=f,s+=f,a?f===X&&(l=a=!1):f===fe&&(l=!1,i.processEscape(c)),u+=1;continue}const h=E(f),d=f===" ";if(h===0){s+=f,u+=1;continue}if(o+h>t&&(s&&n.push(s+i.getEndEscapesForAllActiveAttributes()),s=i.getStartEscapesForAllActiveAttributes(),o=E(s),d&&r)){for(;u<e.length&&e[u]===" ";)u+=1;continue}if(s+=f,o+=h,o===t&&u<e.length-1&&(n.push(s+i.getEndEscapesForAllActiveAttributes()),s=i.getStartEscapesForAllActiveAttributes(),o=E(s),u+1<e.length&&e[u+1]===" "&&r)){for(u+=1;u<e.length&&e[u]===" ";)u+=1;continue}u+=1}return s&&n.push(s+i.getEndEscapesForAllActiveAttributes()),r?n.map(f=>I(f)):n},un=(e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=[];let s="",o=0;return an(n,{getWidth:E,onSegment:(l,a)=>{const c=l.text??"";if(l.isEscapeSequence)s+=c;else{const u=c===" ";if(l.width===0)return s+=c,!0;if(o+l.width>t&&(s&&i.push(s),s=a.getStartEscapesForAllActiveAttributes(),o=0,u))return r||i.push(a.getStartEscapesForAllActiveAttributes()+c),!0;s+=c,o+=l.width}return!0}}),s&&i.push(s),r?i.map(l=>I(l)):i},fn=(e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(Je),s=[];let o="",l=0,a=0;for(;a<i.length;){const c=i[a],u=Ze.test(c),f=E(c);if(c.length===0){a+=1;continue}if(r&&u&&l===0){a+=1;continue}if(l+f>t&&l>0){r?s.push(I(o)):s.push(o),o="",l=0;continue}o+=c,l+=f,a+=1}return o&&(r?s.push(I(o)):s.push(o)),s},dn=(e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(Je),s=[];let o="",l=0,a=0;for(;a<i.length;){const c=i[a],u=Ze.test(c),f=E(c);if(c.length===0){a+=1;continue}if(r&&u&&l===0){a+=1;continue}if(f>t){o&&s.push(re(r?I(o):o));const h=Xe(c,t,r);if(h.length>0){for(let d=0;d<h.length-1;d+=1)s.push(h[d]);o=h.at(-1),l=E(o)}else o="",l=0;a+=1;continue}if(l+f>t&&l>0&&(s.push(re(r?I(o):o)),o="",l=0,r&&u)){a+=1;continue}o+=c,l+=f,a+=1}return o&&s.push(re(r?I(o):o)),s},q={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},Bn=(e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:i=80,wrapMode:s=q.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let o=e.normalize("NFC").replaceAll(`\r
|
|
31
|
-
`,`
|
|
32
|
-
`);return r&&(o=o.replaceAll(en,"")),o.split(`
|
|
33
|
-
`).map(l=>{if(n&&l.trim()==="")return"";let a;switch(s){case q.BREAK_AT_CHARACTERS:{a=un(l,i,n);break}case q.BREAK_WORDS:{a=dn(l,i,n);break}case q.STRICT_WIDTH:{a=Xe(l,i,n);break}default:a=fn(l,i,n)}return cn(a)}).join(`
|
|
34
|
-
`)},Qe=80,et=24,le=(e,t,{shell:r,env:n}={})=>st(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),K=(e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),tt=(e,t)=>{const{columns:r,rows:n}=K(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===Qe&&n===et))return{columns:r,rows:n}},gn=()=>{if(A.platform!=="linux")return!0;try{const e=P.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const r=e.slice(t+2).trim().split(/\s+/),n=Number.parseInt(r[2],10),i=Number.parseInt(r[5],10);return Number.isNaN(n)||Number.isNaN(i)||i<=0?!1:n===i}catch{return!1}};function _n(){const{env:e,stdout:t,stderr:r}=A;if(t?.columns&&t?.rows)return K(t.columns,t.rows);if(r?.columns&&r?.rows)return K(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return K(e.COLUMNS,e.LINES);const n={columns:Qe,rows:et};return A.platform==="win32"?ne()??n:A.platform==="darwin"?Oe()??ne()??n:Oe()??ne()??hn()??n}const Oe=()=>{try{const e=A.platform==="darwin"?P.constants.O_EVTONLY|P.constants.O_NONBLOCK:P.constants.O_NONBLOCK,{columns:t,rows:r}=ot.WriteStream(P.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},ne=()=>{try{const e=le("tput",["cols"],{env:{TERM:"dumb",...A.env}}),t=le("tput",["lines"],{env:{TERM:"dumb",...A.env}});if(e&&t)return tt(e,t)}catch{}},hn=()=>{try{if(!gn())return;const e=le("resize",["-u"]).match(/\d+/g);if(e.length===2)return tt(e[0],e[1])}catch{}},jn=e=>{const t=Object.keys(e).map(r=>e[r].badge??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},{bold:mn,cyan:pn,green:Te,grey:$n,magenta:bn,red:wn,yellow:ie}=Be,Fn={indent:2,quoteStyle:"single",stylize:(e,t)=>{const r={bigint:ie,boolean:ie,date:bn,null:mn,number:ie,regexp:wn,special:pn,string:Te,symbol:Te,undefined:$n};return Object.hasOwn(r,t)?r[t](e):e}},{bold:yn,underline:vn}=Be,Wn=(e,t)=>{let r=t.uppercase.label?e.toUpperCase():e;return r=t.underline.label?vn(r):r,t.bold.label&&(r=yn(r)),r},Sn=e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":");class Ln{styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:Sn,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=lt}setLoggerTypes(t){this.loggerTypes=t}}export{Ln as A,Nn as E,lt as L,Bn as U,Tn as _,An as a,Fn as b,_n as c,jn as d,E as e,Wn as f,In as g,kn as h,q as i,On as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const J=e=>{const t=Object.keys(e).map(r=>e[r].label??"");return t.length===0?"":t.reduce((r,l)=>r.length>l.length?r:l,"")};var $=Object.defineProperty,B=(e,t)=>$(e,"name",{value:t,configurable:!0}),v=Object.defineProperty,g=B((e,t)=>v(e,"name",{value:t,configurable:!0}),"g$1");const x=new Map([["aliceblue","#f0f8ff"],["antiquewhite","#faebd7"],["aqua","#00ffff"],["aquamarine","#7fffd4"],["azure","#f0ffff"],["beige","#f5f5dc"],["bisque","#ffe4c4"],["black","#000000"],["blanchedalmond","#ffebcd"],["blue","#0000ff"],["blueviolet","#8a2be2"],["brown","#a52a2a"],["burlywood","#deb887"],["cadetblue","#5f9ea0"],["chartreuse","#7fff00"],["chocolate","#d2691e"],["coral","#ff7f50"],["cornflowerblue","#6495ed"],["cornsilk","#fff8dc"],["crimson","#dc143c"],["cyan","#00ffff"],["darkblue","#00008b"],["darkcyan","#008b8b"],["darkgoldenrod","#b8860b"],["darkgray","#a9a9a9"],["darkgreen","#006400"],["darkgrey","#a9a9a9"],["darkkhaki","#bdb76b"],["darkmagenta","#8b008b"],["darkolivegreen","#556b2f"],["darkorange","#ff8c00"],["darkorchid","#9932cc"],["darkred","#8b0000"],["darksalmon","#e9967a"],["darkseagreen","#8fbc8f"],["darkslateblue","#483d8b"],["darkslategray","#2f4f4f"],["darkslategrey","#2f4f4f"],["darkturquoise","#00ced1"],["darkviolet","#9400d3"],["deeppink","#ff1493"],["deepskyblue","#00bfff"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1e90ff"],["firebrick","#b22222"],["floralwhite","#fffaf0"],["forestgreen","#228b22"],["fuchsia","#ff00ff"],["gainsboro","#dcdcdc"],["ghostwhite","#f8f8ff"],["gold","#ffd700"],["goldenrod","#daa520"],["gray","#808080"],["green","#008000"],["greenyellow","#adff2f"],["grey","#808080"],["honeydew","#f0fff0"],["hotpink","#ff69b4"],["indianred","#cd5c5c"],["indigo","#4b0082"],["ivory","#fffff0"],["khaki","#f0e68c"],["lavender","#e6e6fa"],["lavenderblush","#fff0f5"],["lawngreen","#7cfc00"],["lemonchiffon","#fffacd"],["lightblue","#add8e6"],["lightcoral","#f08080"],["lightcyan","#e0ffff"],["lightgoldenrodyellow","#fafad2"],["lightgray","#d3d3d3"],["lightgreen","#90ee90"],["lightgrey","#d3d3d3"],["lightpink","#ffb6c1"],["lightsalmon","#ffa07a"],["lightseagreen","#20b2aa"],["lightskyblue","#87cefa"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#b0c4de"],["lightyellow","#ffffe0"],["lime","#00ff00"],["limegreen","#32cd32"],["linen","#faf0e6"],["magenta","#ff00ff"],["maroon","#800000"],["mediumaquamarine","#66cdaa"],["mediumblue","#0000cd"],["mediumorchid","#ba55d3"],["mediumpurple","#9370db"],["mediumseagreen","#3cb371"],["mediumslateblue","#7b68ee"],["mediumspringgreen","#00fa9a"],["mediumturquoise","#48d1cc"],["mediumvioletred","#c71585"],["midnightblue","#191970"],["mintcream","#f5fffa"],["mistyrose","#ffe4e1"],["moccasin","#ffe4b5"],["navajowhite","#ffdead"],["navy","#000080"],["oldlace","#fdf5e6"],["olive","#808000"],["olivedrab","#6b8e23"],["orange","#ffa500"],["orangered","#ff4500"],["orchid","#da70d6"],["palegoldenrod","#eee8aa"],["palegreen","#98fb98"],["paleturquoise","#afeeee"],["palevioletred","#db7093"],["papayawhip","#ffefd5"],["peachpuff","#ffdab9"],["peru","#cd853f"],["pink","#ffc0cb"],["plum","#dda0dd"],["powderblue","#b0e0e6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#ff0000"],["rosybrown","#bc8f8f"],["royalblue","#4169e1"],["saddlebrown","#8b4513"],["salmon","#fa8072"],["sandybrown","#f4a460"],["seagreen","#2e8b57"],["seashell","#fff5ee"],["sienna","#a0522d"],["silver","#c0c0c0"],["skyblue","#87ceeb"],["slateblue","#6a5acd"],["slategray","#708090"],["slategrey","#708090"],["snow","#fffafa"],["springgreen","#00ff7f"],["steelblue","#4682b4"],["tan","#d2b48c"],["teal","#008080"],["thistle","#d8bfd8"],["tomato","#ff6347"],["turquoise","#40e0d0"],["violet","#ee82ee"],["wheat","#f5deb3"],["white","#ffffff"],["whitesmoke","#f5f5f5"],["yellow","#ffff00"],["yellowgreen","#9acd32"]]),A=/^#([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})?$/i,S=/^#([\dA-F])([\dA-F])([\dA-F])([\dA-F])?$/i,D=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,C=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,k=g(()=>({__proto__:null,backgroundColor:null,color:null,fontStyle:null,fontWeight:null,textDecorationColor:null,textDecorationLine:[]}),"getDefaultCss"),p=/\s+/,m=g(e=>{x.has(e)&&(e=x.get(e));const t=A.exec(e);if(t)return[Number.parseInt(t[1],16),Number.parseInt(t[2],16),Number.parseInt(t[3],16)];const r=S.exec(e);if(r)return[Number.parseInt(`${r[1]}${r[1]}`,16),Number.parseInt(`${r[2]}${r[2]}`,16),Number.parseInt(`${r[3]}${r[3]}`,16)];const l=D.exec(e);if(l)return[Math.round(Math.max(0,Math.min(255,Number(l[1])))),Math.round(Math.max(0,Math.min(255,Number(l[2])))),Math.round(Math.max(0,Math.min(255,Number(l[3]))))];const f=C.exec(e);if(f){let a=Number(f[1])%360;a<0&&(a+=360);const i=Math.max(0,Math.min(100,Number(f[2])))/100,n=Math.max(0,Math.min(100,Number(f[3])))/100,s=(1-Math.abs(2*n-1))*i,u=s*(1-Math.abs(a/60%2-1)),o=n-s/2;let d,c,b;return a<60?{0:d,1:c,2:b}=[s,u,0]:a<120?{0:d,1:c,2:b}=[u,s,0]:a<180?{0:d,1:c,2:b}=[0,s,u]:a<240?{0:d,1:c,2:b}=[0,u,s]:a<300?{0:d,1:c,2:b}=[u,0,s]:{0:d,1:c,2:b}=[s,0,u],[Math.round((d+o)*255),Math.round((c+o)*255),Math.round((b+o)*255)]}return null},"parseCssColor"),h=g((e,t)=>e?.[0]===t?.[0]&&e?.[1]===t?.[1]&&e?.[2]===t?.[2],"colorEquals"),N=g(e=>{if(typeof e!="string")return k();const t=k(),r=[];let l=!1,f=null,a=0,i="";for(const n of e){if(n==="(")a+=1;else if(a>0)n===")"&&(a-=1);else if(l){if(n===";"){const s=i.trim();s!==""&&r.push([f,s]),f=null,i="",l=!1;continue}}else if(n===":"){f=i.trim(),i="",l=!0;continue}i+=n}if(l&&a===0){const n=i.trim();n!==""&&r.push([f,n]),f=null,i=""}for(const{0:n,1:s}of r)switch(n){case"background-color":{s!=null&&(t.backgroundColor=s);break}case"color":{s!=null&&(t.color=s);break}case"font-style":{["italic","oblique","oblique 14deg"].includes(s)&&(t.fontStyle="italic");break}case"font-weight":{s==="bold"&&(t.fontWeight=s);break}case"text-decoration":{t.textDecorationColor=null,t.textDecorationLine=[];const u=s.split(p);for(const o of u){const d=m(o);d!=null?t.textDecorationColor=d:["line-through","overline","underline"].includes(o)&&t.textDecorationLine.push(o)}break}case"text-decoration-color":{const u=m(s);u!=null&&(t.textDecorationColor=u);break}case"text-decoration-line":{t.textDecorationLine=[];const u=s.split(p);for(const o of u)["line-through","overline","underline"].includes(o)&&t.textDecorationLine.push(o);break}}return t},"parseCss"),M=g((e,t)=>{t=t??k();let r="";if(!h(e.backgroundColor,t.backgroundColor))if(e.backgroundColor==null)r+="\x1B[49m";else switch(e.backgroundColor){case"black":{r+="\x1B[40m";break}case"blue":{r+="\x1B[44m";break}case"cyan":{r+="\x1B[46m";break}case"green":{r+="\x1B[42m";break}case"magenta":{r+="\x1B[45m";break}case"red":{r+="\x1B[41m";break}case"white":{r+="\x1B[47m";break}case"yellow":{r+="\x1B[43m";break}default:if(Array.isArray(e.backgroundColor)){const{0:l,1:f,2:a}=e.backgroundColor;r+=`\x1B[48;2;${String(l)};${String(f)};${String(a)}m`}else{const l=m(e.backgroundColor);if(l===null)r+="\x1B[49m";else{const{0:f,1:a,2:i}=l;r+=`\x1B[48;2;${String(f)};${String(a)};${String(i)}m`}}}if(!h(e.color,t.color))if(e.color==null)r+="\x1B[39m";else switch(e.color){case"black":{r+="\x1B[30m";break}case"blue":{r+="\x1B[34m";break}case"cyan":{r+="\x1B[36m";break}case"green":{r+="\x1B[32m";break}case"magenta":{r+="\x1B[35m";break}case"red":{r+="\x1B[31m";break}case"white":{r+="\x1B[37m";break}case"yellow":{r+="\x1B[33m";break}default:if(Array.isArray(e.color)){const{0:l,1:f,2:a}=e.color;r+=`\x1B[38;2;${String(l)};${String(f)};${String(a)}m`}else{const l=m(e.color);if(l===null)r+="\x1B[39m";else{const{0:f,1:a,2:i}=l;r+=`\x1B[38;2;${String(f)};${String(a)};${String(i)}m`}}}if(e.fontWeight!==t.fontWeight&&(r+=e.fontWeight==="bold"?"\x1B[1m":"\x1B[22m"),e.fontStyle!==t.fontStyle&&(r+=e.fontStyle==="italic"?"\x1B[3m":"\x1B[23m"),!h(e.textDecorationColor,t.textDecorationColor))if(e.textDecorationColor==null)r+="\x1B[59m";else{const{0:l,1:f,2:a}=e.textDecorationColor;r+=`\x1B[58;2;${String(l)};${String(f)};${String(a)}m`}return e.textDecorationLine.includes("line-through")!==t.textDecorationLine.includes("line-through")&&(r+=e.textDecorationLine.includes("line-through")?"\x1B[9m":"\x1B[29m"),e.textDecorationLine.includes("overline")!==t.textDecorationLine.includes("overline")&&(r+=e.textDecorationLine.includes("overline")?"\x1B[53m":"\x1B[55m"),e.textDecorationLine.includes("underline")!==t.textDecorationLine.includes("underline")&&(r+=e.textDecorationLine.includes("underline")?"\x1B[4m":"\x1B[24m"),r},"cssToAnsi");var P=Object.defineProperty,y=B((e,t)=>P(e,"name",{value:t,configurable:!0}),"u");const L=y(e=>{try{return JSON.stringify(e)}catch{return'"[Circular]"'}},"tryStringify"),w="%".codePointAt(0),j="s".codePointAt(0),F="d".codePointAt(0),q="f".codePointAt(0),E="i".codePointAt(0),O="O".codePointAt(0),I="o".codePointAt(0),W="j".codePointAt(0),T="c".codePointAt(0),_=y((e,t=[],r={})=>{if(typeof e!="string"&&typeof e!="object"||e===null)throw new TypeError(`fmt must be a string or object, got ${e===null?"null":typeof e}`);const l=r.stringify??L,f=1;if(typeof e=="object"){const o=t.length+f;if(o===1)return"{}";const d=Array.from({length:o});d[0]=l(e);for(let c=1;c<o;c+=1)d[c]=l(t[c-f]);return d.join(" ")}if(t.length===0)return e;let a="",i=1-f,n=-1,s=!1,u;for(let o=0;o<e.length;){if(e.codePointAt(o)===w&&o+1<e.length){n=n>-1?n:0;const d=e.codePointAt(o+1);if(d===void 0){i+=1;break}switch(d){case T:{if(globalThis.window===void 0){const c=N(t[i]);n<o&&(a+=e.slice(n,o));const b=M(c,u);a+=b,b!==""&&(s=!0,u=c)}n=o+2,o+=1;break}case F:case q:{if(i>=t.length||t[i]==null)break;n<o&&(a+=e.slice(n,o));const c=t[i];a+=(typeof c=="symbol"?Number.NaN:Number(c)).toString(),n=o+2,o+=1;break}case E:{if(i>=t.length||t[i]==null)break;n<o&&(a+=e.slice(n,o));const c=t[i];a+=Math.floor(typeof c=="symbol"?Number.NaN:Number(c)).toString(),n=o+2,o+=1;break}case W:case O:case I:{if(i>=t.length||t[i]===void 0)break;n<o&&(a+=e.slice(n,o));const c=t[i],b=typeof c;if(b==="string"){a+=`'${c}'`,n=o+2,o+=1;break}if(b==="function"){a+=c.name?`[Function: ${c.name}]`:"[Function: <anonymous>]",n=o+2,o+=1;break}a+=l(c),n=o+2,o+=1;break}case w:{n<o&&(a+=e.slice(n,o)),a+="%",n=o+2,o+=1,i-=1;break}case j:{if(i>=t.length)break;n<o&&(a+=e.slice(n,o)),a+=typeof t[i]=="object"?l(t[i]):String(t[i]),n=o+2,o+=1;break}default:typeof r.formatters?.[d]=="function"&&(n<o&&(a+=e.slice(n,o)),a+=r.formatters[d](t[i]),n=o+2,o+=1)}i+=1}o+=1}return n===-1?e:(n<e.length&&(a+=e.slice(n)),s&&(a+="\x1B[0m"),a)},"format"),z=y((e={})=>{const t={};return typeof e.formatters=="object"&&Object.entries(e.formatters).forEach(([r,l])=>{if(r.length===0)throw new Error(`Formatter %${r} has no characters`);if(r.length>1)throw new Error(`Formatter %${r} has more than one character`);if(typeof l!="function")throw new TypeError(`Formatter for %${r} is not a function`);const f=r.codePointAt(0);if(f===void 0)throw new Error(`${r}.codePointAt(0) failed to return a value, please report this issue`);t[f]=l}),(r,l=[],f={})=>_(r,l,{...f,formatters:t})},"build");export{_ as $,z as J,J as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=r=>{const o=console;return r==="error"?o.__error??console.error:r==="warn"?o.__warn??console.warn:r==="trace"?o.__trace??console.trace:o.__log??console.log};export{e as o};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const i=(t,r)=>(r.__write??r.write.bind(r)).call(r,t);export{i as r};
|
|
File without changes
|