@visulima/packem 2.0.0-alpha.83 → 2.0.0-alpha.85
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 +36 -0
- package/dist/builder/typedoc/index.d.ts +1 -1
- package/dist/builder/typedoc/index.js +3 -3
- package/dist/cli/index.js +36 -36
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/preset/preact.d.ts +1 -1
- package/dist/config/preset/preact.js +2 -2
- package/dist/config/preset/react.d.ts +1 -1
- package/dist/config/preset/react.js +1 -1
- package/dist/config/preset/solid.d.ts +1 -1
- package/dist/config/preset/solid.js +1 -1
- package/dist/config/preset/svelte.d.ts +1 -1
- package/dist/config/preset/svelte.js +1 -1
- package/dist/config/preset/vue.d.ts +1 -1
- package/dist/config/preset/vue.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +39 -35
- package/dist/packem_shared/create-or-update-key-storage-CRDW-Kwa.js +28 -0
- package/dist/packem_shared/default-nqaAQAPN.js +1 -0
- package/dist/packem_shared/index-BSqT47P3.js +244 -0
- package/dist/packem_shared/oxcTransformPlugin-Dwvbw2jE-BSBF_-9X.js +177 -0
- package/dist/packem_shared/{types.d-Cm6dnCyD.d.ts → types.d-ICL9GlqC.d.ts} +8 -5
- package/dist/packem_shared/utils-Bsoe7qJG.js +1 -0
- package/dist/rollup/plugins/oxc/oxc-transformer.js +1 -1
- package/package.json +5 -5
- package/dist/packem_shared/create-or-update-key-storage-DUTe5Prf.js +0 -13
- package/dist/packem_shared/default-Dj-WgmWM.js +0 -1
- package/dist/packem_shared/index-BcKJ8RJU.js +0 -255
- package/dist/packem_shared/oxcResolvePlugin-DeIohkWk-rspLVIoy.js +0 -170
- package/dist/packem_shared/oxcTransformPlugin-Dwvbw2jE-Bbz81VnA.js +0 -4
- package/dist/packem_shared/utils-nmTpa3um.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1,41 +1,45 @@
|
|
|
1
|
-
var Qt=Object.defineProperty;var w=(t,e)=>Qt(t,"name",{value:e,configurable:!0});import{createRequire as Ke}from"node:module";import{e as Ae,t as Yt,U as Zt,_ as Xt,C as er,j as xe,Z as tr,Q as Qe,v as Le,W as rr,K as sr,$ as Pe,a as At,r as ir,b as nr,h as or,T as ar}from"./packem_shared/index-BcKJ8RJU.js";import{g as Lt}from"./packem_shared/create-or-update-key-storage-DUTe5Prf.js";var lr=Object.defineProperty,v=w((t,e)=>lr(t,"name",{value:e,configurable:!0}),"f$1");const cr=Ke(import.meta.url),ae=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:re,Ye=v(t=>{if(typeof ae<"u"&&ae.versions&&ae.versions.node){const[e,r]=ae.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return ae.getBuiltinModule(t)}return cr(t)},"__cjs_getBuiltinModule"),re=ae,{execFileSync:ur}=Ye("node:child_process"),ge=Ye("node:fs"),fr=Ye("node:tty"),Ze=[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],Xe=[12288,12288,65281,65376,65504,65510],et=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],tt=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],je=[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],me=v((t,e)=>{let r=0,s=Math.floor(t.length/2)-1;for(;r<=s;){const i=Math.floor((r+s)/2),o=i*2;if(e<t[o])s=i-1;else if(e>t[o+1])r=i+1;else return!0}return!1},"isInRange"),hr=Ze[0],gr=Ze.at(-1),dr=Xe[0],pr=Xe.at(-1),mr=et[0],br=et.at(-1),yr=tt[0],wr=tt.at(-1),$r=je[0],vr=je.at(-1),dt=19968,[xr,Sr]=Mt(je);function Mt(t){let e=t[0],r=t[1];for(let s=0;s<t.length;s+=2){const i=t[s],o=t[s+1];if(dt>=i&&dt<=o)return[i,o];o-i>r-e&&(e=i,r=o)}return[e,r]}w(Mt,"Ft$1");v(Mt,"findWideFastPathRange");const Er=v(t=>t<hr||t>gr?!1:me(Ze,t),"isAmbiguous"),kr=v(t=>t<dr||t>pr?!1:me(Xe,t),"isFullWidth"),Tr=v(t=>t<mr||t>br?!1:me(et,t),"isHalfWidth"),Ar=v(t=>t<yr||t>wr?!1:me(tt,t),"isNarrow"),Lr=v(t=>t>=xr&&t<=Sr?!0:t<$r||t>vr?!1:me(je,t),"isWide");function Bt(t){return Er(t)?"ambiguous":kr(t)?"fullwidth":Tr(t)?"halfwidth":Ar(t)?"narrow":Lr(t)?"wide":"neutral"}w(Bt,"Ht$1");v(Bt,"getCategory");function Ot(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}w(Ot,"Dt$1");v(Ot,"validate");function rt(t){return Ot(t),Bt(t)}w(rt,"it");v(rt,"eastAsianWidthType");const jt=String.raw,pt=jt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Mr=v(()=>new RegExp(jt`\p{RI}{2}|(?)${pt}(?:\u200D${pt})*`,"gu"),"emojiRegex"),ue=new Set(["\x1B",""]),Ne="\x07",Nt="[",st="m",Me="]8;;",Br=39,Or=/[\u200B\uFEFF\u2060-\u2064]/g,jr=new RegExp(`(?:\\${Nt}(?<code>\\d+)m|\\${Me}(?<uri>.*)${Ne})`),Nr=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]])),fe=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Se=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Re=Mr(),mt=new Map,Ee=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,ke=v(t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other","getCharType"),Ir=v((t,e)=>{const r=Math.floor(t/65536),s=t%65536;let i=mt.get(r);if(i||(i=new Map,mt.set(r,i)),i.has(s))return i.get(s);let o;if(ke(t)==="latin")o=e.width.regular;else if(ke(t)==="control")o=e.width.control;else if(ke(t)==="wide")o=e.width.wide;else switch(rt(t)){case"ambiguous":{o=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{o=e.width.fullWidth;break}case"wide":{o=e.width.wide;break}default:o=e.width.regular}return i.set(s,o),o},"getCachedCharWidth"),Fr=v(t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,"isCombiningCharacter"),He=v((t,e={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:e.countAnsiEscapeCodes??!1,ellipsis:e.ellipsis??"",ellipsisWidth:e.ellipsisWidth??(e.ellipsis?He(e.ellipsis,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:e.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:e.ambiguousIsNarrow??!1,ansi:e.ansiWidth??0,control:e.controlWidth??0,emoji:e.emojiWidth??2,fullWidth:e.fullWidth??2,halfWidth:e.halfWidth??1,regular:e.regularWidth??1,tab:e.tabWidth??8,wide:e.wideWidth??2}},s=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=t,o=i>1e4;let a=0,n=0,c=i,u=!1;const l=t.includes("\x1B")||t.includes("");for(;a<i;){if(l&&(t[a]==="\x1B"||t[a]==="")){if(t.startsWith("\x1B]8;;",a)){const S="\x1B]8;;\x07",I=S.length,z=t.indexOf("\x07",a+5);if(z!==-1){const J=t.indexOf(S,z+1);if(J!==-1){const d=J+I,g=t.slice(z+1,J).replace(fe,""),x=He(g,{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,s-n),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),R=x.width;if(x.truncated)u=!0,c=Math.min(c,a);else if(n+R>s&&(c=Math.min(c,a),u=!0,n+R>r.truncation.limit))break;if(n+=R,a=d,u&&n>=r.truncation.limit)break;continue}}}if(fe.lastIndex=a,fe.test(t)){const S=fe.lastIndex-a,I=r.truncation.countAnsiEscapeCodes?S:r.width.ansi;if(n+I>s&&(c=Math.min(c,a),n+I>r.truncation.limit)){u=!0;break}n+=I,a=fe.lastIndex;continue}}const $=t.codePointAt(a);if($===8203||$===65279||$>=8288&&$<=8292){a+=1;continue}if($===9){if(n+r.width.tab>s&&(c=Math.min(c,a),n+r.width.tab>r.truncation.limit)){u=!0;break}n+=r.width.tab,a+=1;continue}if(Ee.lastIndex=a,Ee.test(t)){const S=(Ee.lastIndex-a)*r.width.regular;if(n+S>s){const I=Math.floor((s-n)/r.width.regular);if(c=Math.min(c,a+I),n+S>r.truncation.limit){u=!0;break}}n+=S,a=Ee.lastIndex;continue}if(($<=31||$>=127&&$<=159)&&(Se.lastIndex=a,Se.test(t))){const S=(Se.lastIndex-a)*r.width.control;if(n+S>s&&(c=Math.min(c,a+Math.floor((s-n)/r.width.control)),n+S>r.truncation.limit)){u=!0;break}n+=S,a=Se.lastIndex;continue}if(Re.lastIndex=a,Re.test(t)){if(n+r.width.emoji>s&&(c=Math.min(c,a),n+r.width.emoji>r.truncation.limit)){u=!0;break}n+=r.width.emoji,a=Re.lastIndex;continue}const P=t.codePointAt(a)??0;if(Fr(P)){a+=P>65535?2:1;continue}let E;if(o)E=Ir(P,r);else switch(ke(P)){case"control":{E=r.width.control;break}case"latin":{E=r.width.regular;break}case"wide":{E=r.width.wide;break}case"zero":{E=0;break}default:switch(rt(P)){case"ambiguous":{E=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{E=r.width.fullWidth;break}case"wide":{E=r.width.wide;break}default:E=r.width.regular}}if(n+E>s&&(c=Math.min(c,a),n+E>r.truncation.limit)){u=!0;break}n+=E,a+=P>65535?2:1}let h=n,p=!1;return u&&r.truncation.limit>=r.truncation.ellipsisWidth&&(h=r.truncation.limit,p=!0),{ellipsed:p,index:u?c:i,truncated:u,width:h}},"getStringTruncatedWidth"),se=v((t,e={})=>He(t,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth"),Pr=/\x1B\[(\d+)m/;class It{static{w(this,"at")}static{v(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(e){const r=Pr.exec(e);if(!r)return;const s=Number.parseInt(r[1],10);switch(s){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(s>=30&&s<=37||s>=90&&s<=97)this.activeForeground=e;else if(s>=40&&s<=47||s>=100&&s<=107)this.activeBackground=e;else if([1,2,3,4,7,8,9].includes(s))this.activeFormatting.push(e);else if([22,23,24,27,28,29].includes(s)){const i={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[s];i&&(this.activeFormatting=this.activeFormatting.filter(o=>!o.includes(i)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const e=[];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(s=>{const i=r[s];i&&e.push(i)})}return this.activeForeground&&e.push("\x1B[39m"),this.activeBackground&&e.push("\x1B[49m"),e.join("")}}const Ft=v((t,e)=>{if(!ue.has(t[e]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,s=t.slice(e+1,e+1+Me.length).join("")===Me;return{isInsideEscape:r,isInsideLinkEscape:s}},"checkEscapeSequence"),Rr=v((t,e={})=>{const r=new It;let s="",i=!1,o="",a="",n=!1;const c=[...t];for(let u=0;u<c.length;u++){const l=c[u];if(l&&ue.has(l)){if(s){const E=e.getWidth?.(s)??0,S={isEscapeSequence:!1,isGrapheme:!0,text:s,width:E};if(n&&(S.isHyperlink=!0,S.hyperlinkUrl=a),e.onSegment?.(S,r)===!1)return;s=""}i=!0,o=l;const $=Ft(c,u),{isInsideLinkEscape:P}=$;if(P){let E=u+1;for(a="";E<c.length;){const I=c[E];if(I===Ne)break;a+=I,E+=1}a=a.slice(4);const S={hyperlinkUrl:a,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(e.onSegment?.(S,r)===!1)return;u=E,n=!0,i=!1,o="";continue}if(u+1<c.length&&c[u+1]==="\\"&&n){const E={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(e.onSegment?.(E,r)===!1)return;n=!1,a="",u+=1,i=!1,o="";continue}}if(i){if(o!==l&&(o+=l),l===st){i=!1,r.processEscape(o);const $={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(e.onSegment?.($,r)===!1)return;o=""}continue}s+=l;const h=e.getWidth?.(s)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:s,width:h};if(n&&(p.isHyperlink=!0,p.hyperlinkUrl=a),e.onSegment?.(p,r)===!1)return;s=""}if(s){const u=e.getWidth?.(s)??0,l={isEscapeSequence:!1,isGrapheme:!0,text:s,width:u};n&&(l.isHyperlink=!0,l.hyperlinkUrl=a),e.onSegment?.(l,r)}if(o){const u={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};e.onSegment?.(u,r)}},"processAnsiString"),bt=v(t=>`${ue.values().next().value}${Nt}${String(t)}${st}`,"wrapAnsiCode"),yt=v(t=>`${ue.values().next().value}${Me}${t}${Ne}`,"wrapAnsiHyperlink"),_r=v(t=>{if(t.length===0)return"";if(t.length===1)return t[0];let e="",r,s;const i=t.join(`
|
|
2
|
-
`),o=[...i];let a=0;for(const[n,c]of o.entries()){if(e+=c,
|
|
3
|
-
`?(s&&(e+=
|
|
4
|
-
`&&(r&&u&&(e+=
|
|
1
|
+
import{createRequire as He}from"node:module";import{n as Ht,Z as xe,Y as Jt,J as Je,h as Se,y as yt,X as Gt,q as Ut,M as zt,a as Kt,A as be,K as Yt,k as Qt,b as Zt,c as Be,d as Xt,T as er}from"./packem_shared/index-BSqT47P3.js";import{g as wt}from"./packem_shared/create-or-update-key-storage-CRDW-Kwa.js";const tr=He(import.meta.url),ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:Q,Ge=t=>{if(typeof ie<"u"&&ie.versions&&ie.versions.node){const[e,r]=ie.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return ie.getBuiltinModule(t)}return tr(t)},Q=ie,{execFileSync:rr}=Ge("node:child_process"),ue=Ge("node:fs"),sr=Ge("node:tty"),Ue=[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],ze=[12288,12288,65281,65376,65504,65510],Ke=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Ye=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Ae=[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],ge=(t,e)=>{let r=0,s=Math.floor(t.length/2)-1;for(;r<=s;){const i=Math.floor((r+s)/2),o=i*2;if(e<t[o])s=i-1;else if(e>t[o+1])r=i+1;else return!0}return!1},ir=Ue[0],nr=Ue.at(-1),or=ze[0],ar=ze.at(-1),lr=Ke[0],cr=Ke.at(-1),ur=Ye[0],fr=Ye.at(-1),hr=Ae[0],gr=Ae.at(-1),nt=19968,[dr,pr]=mr(Ae);function mr(t){let e=t[0],r=t[1];for(let s=0;s<t.length;s+=2){const i=t[s],o=t[s+1];if(nt>=i&&nt<=o)return[i,o];o-i>r-e&&(e=i,r=o)}return[e,r]}const br=t=>t<ir||t>nr?!1:ge(Ue,t),yr=t=>t<or||t>ar?!1:ge(ze,t),wr=t=>t<lr||t>cr?!1:ge(Ke,t),$r=t=>t<ur||t>fr?!1:ge(Ye,t),vr=t=>t>=dr&&t<=pr?!0:t<hr||t>gr?!1:ge(Ae,t);function xr(t){return br(t)?"ambiguous":yr(t)?"fullwidth":wr(t)?"halfwidth":$r(t)?"narrow":vr(t)?"wide":"neutral"}function Sr(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function $t(t){return Sr(t),xr(t)}const vt=String.raw,ot=vt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,kr=()=>new RegExp(vt`\p{RI}{2}|(?)${ot}(?:\u200D${ot})*`,"gu"),ae=new Set(["\x1B",""]),Le="\x07",xt="[",Qe="m",ke="]8;;",Er=39,Tr=/[\u200B\uFEFF\u2060-\u2064]/g,Ar=new RegExp(`(?:\\${xt}(?<code>\\d+)m|\\${ke}(?<uri>.*)${Le})`),Lr=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]])),le=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,ye=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,je=kr(),at=new Map,we=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,$e=t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other",Mr=(t,e)=>{const r=Math.floor(t/65536),s=t%65536;let i=at.get(r);if(i||(i=new Map,at.set(r,i)),i.has(s))return i.get(s);let o;if($e(t)==="latin")o=e.width.regular;else if($e(t)==="control")o=e.width.control;else if($e(t)==="wide")o=e.width.wide;else switch($t(t)){case"ambiguous":{o=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{o=e.width.fullWidth;break}case"wide":{o=e.width.wide;break}default:o=e.width.regular}return i.set(s,o),o},Or=t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,Ce=(t,e={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:e.countAnsiEscapeCodes??!1,ellipsis:e.ellipsis??"",ellipsisWidth:e.ellipsisWidth??(e.ellipsis?Ce(e.ellipsis,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:e.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:e.ambiguousIsNarrow??!1,ansi:e.ansiWidth??0,control:e.controlWidth??0,emoji:e.emojiWidth??2,fullWidth:e.fullWidth??2,halfWidth:e.halfWidth??1,regular:e.regularWidth??1,tab:e.tabWidth??8,wide:e.wideWidth??2}},s=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=t,o=i>1e4;let a=0,n=0,c=i,u=!1;const l=t.includes("\x1B")||t.includes("");for(;a<i;){if(l&&(t[a]==="\x1B"||t[a]==="")){if(t.startsWith("\x1B]8;;",a)){const v="\x1B]8;;\x07",B=v.length,V=t.indexOf("\x07",a+5);if(V!==-1){const H=t.indexOf(v,V+1);if(H!==-1){const d=H+B,g=t.slice(V+1,H).replace(le,""),$=Ce(g,{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,s-n),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),I=$.width;if($.truncated)u=!0,c=Math.min(c,a);else if(n+I>s&&(c=Math.min(c,a),u=!0,n+I>r.truncation.limit))break;if(n+=I,a=d,u&&n>=r.truncation.limit)break;continue}}}if(le.lastIndex=a,le.test(t)){const v=le.lastIndex-a,B=r.truncation.countAnsiEscapeCodes?v:r.width.ansi;if(n+B>s&&(c=Math.min(c,a),n+B>r.truncation.limit)){u=!0;break}n+=B,a=le.lastIndex;continue}}const w=t.codePointAt(a);if(w===8203||w===65279||w>=8288&&w<=8292){a+=1;continue}if(w===9){if(n+r.width.tab>s&&(c=Math.min(c,a),n+r.width.tab>r.truncation.limit)){u=!0;break}n+=r.width.tab,a+=1;continue}if(we.lastIndex=a,we.test(t)){const v=(we.lastIndex-a)*r.width.regular;if(n+v>s){const B=Math.floor((s-n)/r.width.regular);if(c=Math.min(c,a+B),n+v>r.truncation.limit){u=!0;break}}n+=v,a=we.lastIndex;continue}if((w<=31||w>=127&&w<=159)&&(ye.lastIndex=a,ye.test(t))){const v=(ye.lastIndex-a)*r.width.control;if(n+v>s&&(c=Math.min(c,a+Math.floor((s-n)/r.width.control)),n+v>r.truncation.limit)){u=!0;break}n+=v,a=ye.lastIndex;continue}if(je.lastIndex=a,je.test(t)){if(n+r.width.emoji>s&&(c=Math.min(c,a),n+r.width.emoji>r.truncation.limit)){u=!0;break}n+=r.width.emoji,a=je.lastIndex;continue}const N=t.codePointAt(a)??0;if(Or(N)){a+=N>65535?2:1;continue}let k;if(o)k=Mr(N,r);else switch($e(N)){case"control":{k=r.width.control;break}case"latin":{k=r.width.regular;break}case"wide":{k=r.width.wide;break}case"zero":{k=0;break}default:switch($t(N)){case"ambiguous":{k=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{k=r.width.fullWidth;break}case"wide":{k=r.width.wide;break}default:k=r.width.regular}}if(n+k>s&&(c=Math.min(c,a),n+k>r.truncation.limit)){u=!0;break}n+=k,a+=N>65535?2:1}let h=n,p=!1;return u&&r.truncation.limit>=r.truncation.ellipsisWidth&&(h=r.truncation.limit,p=!0),{ellipsed:p,index:u?c:i,truncated:u,width:h}},Z=(t,e={})=>Ce(t,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,Br=/\x1B\[(\d+)m/;class St{activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(e){const r=Br.exec(e);if(!r)return;const s=Number.parseInt(r[1],10);switch(s){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(s>=30&&s<=37||s>=90&&s<=97)this.activeForeground=e;else if(s>=40&&s<=47||s>=100&&s<=107)this.activeBackground=e;else if([1,2,3,4,7,8,9].includes(s))this.activeFormatting.push(e);else if([22,23,24,27,28,29].includes(s)){const i={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[s];i&&(this.activeFormatting=this.activeFormatting.filter(o=>!o.includes(i)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const e=[];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(s=>{const i=r[s];i&&e.push(i)})}return this.activeForeground&&e.push("\x1B[39m"),this.activeBackground&&e.push("\x1B[49m"),e.join("")}}const kt=(t,e)=>{if(!ae.has(t[e]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,s=t.slice(e+1,e+1+ke.length).join("")===ke;return{isInsideEscape:r,isInsideLinkEscape:s}},jr=(t,e={})=>{const r=new St;let s="",i=!1,o="",a="",n=!1;const c=[...t];for(let u=0;u<c.length;u++){const l=c[u];if(l&&ae.has(l)){if(s){const k=e.getWidth?.(s)??0,v={isEscapeSequence:!1,isGrapheme:!0,text:s,width:k};if(n&&(v.isHyperlink=!0,v.hyperlinkUrl=a),e.onSegment?.(v,r)===!1)return;s=""}i=!0,o=l;const w=kt(c,u),{isInsideLinkEscape:N}=w;if(N){let k=u+1;for(a="";k<c.length;){const B=c[k];if(B===Le)break;a+=B,k+=1}a=a.slice(4);const v={hyperlinkUrl:a,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(e.onSegment?.(v,r)===!1)return;u=k,n=!0,i=!1,o="";continue}if(u+1<c.length&&c[u+1]==="\\"&&n){const k={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(e.onSegment?.(k,r)===!1)return;n=!1,a="",u+=1,i=!1,o="";continue}}if(i){if(o!==l&&(o+=l),l===Qe){i=!1,r.processEscape(o);const w={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(e.onSegment?.(w,r)===!1)return;o=""}continue}s+=l;const h=e.getWidth?.(s)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:s,width:h};if(n&&(p.isHyperlink=!0,p.hyperlinkUrl=a),e.onSegment?.(p,r)===!1)return;s=""}if(s){const u=e.getWidth?.(s)??0,l={isEscapeSequence:!1,isGrapheme:!0,text:s,width:u};n&&(l.isHyperlink=!0,l.hyperlinkUrl=a),e.onSegment?.(l,r)}if(o){const u={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};e.onSegment?.(u,r)}},lt=t=>`${ae.values().next().value}${xt}${String(t)}${Qe}`,ct=t=>`${ae.values().next().value}${ke}${t}${Le}`,Nr=t=>{if(t.length===0)return"";if(t.length===1)return t[0];let e="",r,s;const i=t.join(`
|
|
2
|
+
`),o=[...i];let a=0;for(const[n,c]of o.entries()){if(e+=c,ae.has(c)){const l=Ar.exec(i.slice(a))?.groups??{};if(l.code!==void 0){const h=Number.parseFloat(l.code);r=h===Er?void 0:h}else l.uri!==void 0&&(s=l.uri.length===0?void 0:l.uri)}const u=Lr.get(Number(r));o[n+1]===`
|
|
3
|
+
`?(s&&(e+=ct("")),r&&u&&(e+=lt(u))):c===`
|
|
4
|
+
`&&(r&&u&&(e+=lt(r)),s&&(e+=ct(s))),a+=c.length}return e},Et=/(?=\s)|(?<=\s)/,Tt=/^\s+$/,Ne=t=>{if(!t.includes("\x1B"))return t;let e=t;return t.includes("\x1B[30m")&&(e+="\x1B[39m"),t.includes("\x1B[42m")&&(e+="\x1B[49m"),e},te=t=>{const e=t.split(" ");let r=e.length;for(;r>0&&Z(e[r-1])===0;)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},At=(t,e,r)=>{if(t.length===0)return[""];if(e<=0)return[t];const s=[],i=new St;let o="",a=0,n=!1,c=!1,u="",l=0;for(;l<t.length;){const h=t[l];if(ae.has(h)){n=!0,u=h,o+=h,c=kt([...t],l).isInsideLinkEscape,l+=1;continue}if(n){u+=h,o+=h,c?h===Le&&(n=c=!1):h===Qe&&(n=!1,i.processEscape(u)),l+=1;continue}const p=Z(h),w=h===" ";if(p===0){o+=h,l+=1;continue}if(a+p>e&&(o&&s.push(o+i.getEndEscapesForAllActiveAttributes()),o=i.getStartEscapesForAllActiveAttributes(),a=Z(o),w&&r)){for(;l<t.length&&t[l]===" ";)l+=1;continue}if(o+=h,a+=p,a===e&&l<t.length-1&&(s.push(o+i.getEndEscapesForAllActiveAttributes()),o=i.getStartEscapesForAllActiveAttributes(),a=Z(o),l+1<t.length&&t[l+1]===" "&&r)){for(l+=1;l<t.length&&t[l]===" ";)l+=1;continue}l+=1}return o&&s.push(o+i.getEndEscapesForAllActiveAttributes()),r?s.map(h=>te(h)):s},Ir=(t,e,r)=>{if(t.length===0)return[];const s=r?t.trim():t;if(s.length===0)return[];const i=[];let o="",a=0;return jr(s,{getWidth:Z,onSegment:(n,c)=>{const u=n.text??"";if(n.isEscapeSequence)o+=u;else{const l=u===" ";if(n.width===0)return o+=u,!0;if(a+n.width>e&&(o&&i.push(o),o=c.getStartEscapesForAllActiveAttributes(),a=0,l))return r||i.push(c.getStartEscapesForAllActiveAttributes()+u),!0;o+=u,a+=n.width}return!0}}),o&&i.push(o),r?i.map(n=>te(n)):i},Pr=(t,e,r)=>{if(t.length===0)return[];const s=r?t.trim():t;if(s.length===0)return[];const i=s.split(Et),o=[];let a="",n=0,c=0;for(;c<i.length;){const u=i[c],l=Tt.test(u),h=Z(u);if(u.length===0){c+=1;continue}if(r&&l&&n===0){c+=1;continue}if(n+h>e&&n>0){r?o.push(te(a)):o.push(a),a="",n=0;continue}a+=u,n+=h,c+=1}return a&&(r?o.push(te(a)):o.push(a)),o},Fr=(t,e,r)=>{if(t.length===0)return[];const s=r?t.trim():t;if(s.length===0)return[];const i=s.split(Et),o=[];let a="",n=0,c=0;for(;c<i.length;){const u=i[c],l=Tt.test(u),h=Z(u);if(u.length===0){c+=1;continue}if(r&&l&&n===0){c+=1;continue}if(h>e){a&&o.push(Ne(r?te(a):a));const p=At(u,e,r);if(p.length>0){for(let w=0;w<p.length-1;w+=1)o.push(p[w]);a=p.at(-1),n=Z(a)}else a="",n=0;c+=1;continue}if(n+h>e&&n>0&&(o.push(Ne(r?te(a):a)),a="",n=0,r&&l)){c+=1;continue}a+=u,n+=h,c+=1}return a&&o.push(Ne(r?te(a):a)),o},fe={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},Rr=(t,e={})=>{const{removeZeroWidthCharacters:r=!0,trim:s=!0,width:i=80,wrapMode:o=fe.PRESERVE_WORDS}=e;if(s&&t.trim()==="")return"";let a=t.normalize("NFC").replaceAll(`\r
|
|
5
5
|
`,`
|
|
6
|
-
`);return r&&(a=a.replaceAll(
|
|
7
|
-
`).map(n=>{if(s&&n.trim()==="")return"";let c;switch(o){case
|
|
8
|
-
`)},
|
|
6
|
+
`);return r&&(a=a.replaceAll(Tr,"")),a.split(`
|
|
7
|
+
`).map(n=>{if(s&&n.trim()==="")return"";let c;switch(o){case fe.BREAK_AT_CHARACTERS:{c=Ir(n,i,s);break}case fe.BREAK_WORDS:{c=Fr(n,i,s);break}case fe.STRICT_WIDTH:{c=At(n,i,s);break}default:c=Pr(n,i,s)}return Nr(c)}).join(`
|
|
8
|
+
`)},Lt=80,Mt=24,We=(t,e,{shell:r,env:s}={})=>rr(t,e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:s}).trim(),ve=(t,e)=>({columns:Number.parseInt(t,10),rows:Number.parseInt(e,10)}),Ot=(t,e)=>{const{columns:r,rows:s}=ve(t,e);if(!(Number.isNaN(r)||Number.isNaN(s))&&!(r===Lt&&s===Mt))return{columns:r,rows:s}},_r=()=>{if(Q.platform!=="linux")return!0;try{const t=ue.readFileSync("/proc/self/stat","utf8"),e=t.lastIndexOf(") ");if(e===-1)return!1;const r=t.slice(e+2).trim().split(/\s+/),s=Number.parseInt(r[2],10),i=Number.parseInt(r[5],10);return Number.isNaN(s)||Number.isNaN(i)||i<=0?!1:s===i}catch{return!1}};function Cr(){const{env:t,stdout:e,stderr:r}=Q;if(e?.columns&&e?.rows)return ve(e.columns,e.rows);if(r?.columns&&r?.rows)return ve(r.columns,r.rows);if(t.COLUMNS&&t.LINES)return ve(t.COLUMNS,t.LINES);const s={columns:Lt,rows:Mt};return Q.platform==="win32"?Ie()??s:Q.platform==="darwin"?ut()??Ie()??s:ut()??Ie()??Wr()??s}const ut=()=>{try{const t=Q.platform==="darwin"?ue.constants.O_EVTONLY|ue.constants.O_NONBLOCK:ue.constants.O_NONBLOCK,{columns:e,rows:r}=sr.WriteStream(ue.openSync("/dev/tty",t));return{columns:e,rows:r}}catch{}},Ie=()=>{try{const t=We("tput",["cols"],{env:{TERM:"dumb",...Q.env}}),e=We("tput",["lines"],{env:{TERM:"dumb",...Q.env}});if(t&&e)return Ot(t,e)}catch{}},Wr=()=>{try{if(!_r())return;const t=We("resize",["-u"]).match(/\d+/g);if(t.length===2)return Ot(t[0],t[1])}catch{}};let Dr=class{#r;#e=!1;#t=!1;#s=0;#i=0;constructor(e,r){this.#r={stderr:r,stdout:e}}get lastLength(){return this.#s}get outside(){return this.#i}get isHooked(){return this.#e}get isSuspended(){return this.#t}erase(e,r=this.#s){this.#r[e].erase(r)}hook(){if(this.#e)return!1;const e=Object.values(this.#r);for(const r of e)r.active();return this.#n(!0),!0}resume(e,r){if(this.#t){this.#t=!1,r&&this.erase(e,r),this.#s=0;const s=Object.values(this.#r);for(const i of s)i.active()}}suspend(e,r=!0){if(!this.#t){this.#t=!0,r&&this.erase(e);const s=Object.values(this.#r);for(const i of s)i.renew()}}unhook(e=!0){if(!this.#e)return!1;const r=Object.values(this.#r);for(const s of r)s.inactive(e);return this.#n(),!0}update(e,r,s=0){if(r.length>0){const i=this.#r[e],{columns:o,rows:a}=Cr(),n=s>a?a-1:Math.max(0,Math.min(a-1,s)),c=this.lastLength-n,u=Math.max(c-a,this.outside);let l=r.reduce((h,p)=>[...h,Rr(p,{trim:!1,width:o,wrapMode:fe.STRICT_WIDTH})],[]);a<=c?(i.erase(a),n<u&&(l=l.slice(u-n+1))):c&&i.erase(c),i.write(`${l.join(`
|
|
9
9
|
`)}
|
|
10
|
-
`),this.#s=u?u+l.length+1:l.length,this.#i=Math.max(this.lastLength-a,this.outside)}}#n(e=!1){this.#e=e,this.#s=0,this.#i=0}};
|
|
11
|
-
`),this.#e.forEach(r=>{this.write(r)}),this.#e=[]),this.renew()}renew(){this.#s.write=this.#t,this.write(
|
|
12
|
-
${
|
|
13
|
-
${
|
|
14
|
-
${
|
|
15
|
-
${
|
|
16
|
-
${
|
|
17
|
-
${
|
|
18
|
-
${
|
|
19
|
-
${
|
|
20
|
-
${
|
|
21
|
-
${
|
|
22
|
-
${
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
${
|
|
26
|
-
${
|
|
27
|
-
${
|
|
28
|
-
${
|
|
29
|
-
${L}`),m.pop(),`{${C}}`}case"number":return isFinite(f)?String(f):g?g(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(f);default:return g?g(f):void 0}}w(ee,"X"),O(ee,"K"),y(ee,"V"),s(ee,"stringifyIndent");function te(q,f,m){switch(typeof f){case"string":return n(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(q),typeof f!="object")return te(q,f,m);if(f===null)return"null"}if(m.indexOf(f)!==-1)return x;let A="";const k=f.length!==void 0;if(k&&Array.isArray(f)){if(f.length===0)return"[]";if(G<m.length+1)return'"[Array]"';m.push(f);const C=Math.min(f.length,F);let j=0;for(;j<C-1;j++){const M=te(String(j),f[j],m);A+=M!==void 0?M:"null",A+=","}const D=te(String(j),f[j],m);if(A+=D!==void 0?D:"null",f.length-1>F){const M=f.length-F-1;A+=`,"... ${S(M)} not stringified"`}return m.pop(),`[${A}]`}let L=Object.keys(f);const b=L.length;if(b===0)return"{}";if(G<m.length+1)return'"[Object]"';let T="",_=Math.min(b,F);k&&l(f)&&(A+=h(f,",",F),L=L.slice(f.length),_-=f.length,T=","),B&&(L=c(L,W)),m.push(f);for(let C=0;C<_;C++){const j=L[C],D=te(j,f[j],m);D!==void 0&&(A+=`${T}${n(j)}:${D}`,T=",")}if(b>F){const C=b-F;A+=`${T}"...":"${S(C)} not stringified"`}return m.pop(),`{${A}}`}case"number":return isFinite(f)?String(f):g?g(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(f);default:return g?g(f):void 0}}w(te,"Z"),O(te,"X"),y(te,"N"),s(te,"stringifySimple");function $e(q,f,m){if(arguments.length>1){let A="";if(typeof m=="number"?A=" ".repeat(Math.min(m,10)):typeof m=="string"&&(A=m.slice(0,10)),f!=null){if(typeof f=="function")return ie("",{"":q},[],f,A,"");if(Array.isArray(f))return ne("",q,[],I(f),A,"")}if(A.length!==0)return ee("",q,[],A,"")}return te("",q,[])}return w($e,"ue"),O($e,"ke"),y($e,"M"),s($e,"stringify"),$e}w(J,"K"),O(J,"Q"),y(J,"configure"),s(J,"configure")})(We,We.exports)),We.exports}w(ut,"We");O(ut,"Ot");y(ut,"requireSafeStableStringify");var Ms=ut();const Bs=Fe(Ms),Os=Bs.configure;var js=Object.defineProperty,Ns=y((t,e)=>js(t,"name",{value:e,configurable:!0}),"o$1");const Is=Ns(t=>{const e=console;return t==="error"?e.__error??console.error:t==="warn"?e.__warn??console.warn:t==="trace"?e.__trace??console.trace:e.__log??console.log},"writeConsoleLogBasedOnLevel");var Fs=Object.defineProperty,Ps=y((t,e)=>Fs(t,"name",{value:e,configurable:!0}),"t");let Rs=class{static{w(this,"Vt")}static{O(this,"Ct")}static{y(this,"a")}static{Ps(this,"RawReporter")}log(t){const{context:e=[],message:r,type:s}=t;Is(s.level)(r,...e)}};var _s=Object.defineProperty,Cs=y((t,e)=>_s(t,"name",{value:e,configurable:!0}),"a");const Ue=Cs(t=>t===void 0?[]:Array.isArray(t)?t:[t],"arrayify");var Ws=Object.defineProperty,Ds=y((t,e)=>Ws(t,"name",{value:e,configurable:!0}),"g$3");const Je=Ds((t,e)=>{const r={...t};return Object.keys(e).forEach(s=>{r[s]={...r[s],...e[s]}}),r},"mergeTypes");var qs=Object.defineProperty,Ge=y((t,e)=>qs(t,"name",{value:e,configurable:!0}),"d");const Vs=Ge(t=>{let e=!1;return function(...r){if(!e){e=!0;try{const s=t.apply(this,r);return e=!1,s}catch(s){throw e=!1,s}}}},"preventLoop");class ft{static{w(this,"Te")}static{O(this,"xe")}static{y(this,"PailBrowserImpl")}static{Ge(this,"PailBrowserImpl")}timersMap;countMap;seqTimers;lastLog;logLevels;disabled;paused;messageQueue;scopeName;types;longestLabel;processors;generalLogLevel;reporters;throttle;throttleMin;stringify;groups;startTimerMessage;endTimerMessage;rawReporter;force={};constructor(e){this.throttle=e.throttle??1e3,this.throttleMin=e.throttleMin??5;const r=e.parentLongestLabel,s=e.parentTypes,i=e.parentStringify,o=e.parentLogLevels;this.stringify=i??Os({strict:!0}),this.startTimerMessage=e.messages?.timerStart??"Initialized timer...",this.endTimerMessage=e.messages?.timerEnd??"Timer run for:",s&&r?(this.types=s,this.longestLabel=r):(this.types=Je(ir,e.types??{}),this.longestLabel=Ae(this.types)),this.logLevels=o&&!e.logLevels?o:{...nr,...e.logLevels},this.generalLogLevel=this.#t(e.logLevel),this.reporters=new Set,this.processors=new Set,this.disabled=e.disabled??!1,this.paused=!1,this.messageQueue=[],this.scopeName=Ue(e.scope).filter(Boolean),this.timersMap=new Map,this.countMap=new Map,this.groups=[],this.seqTimers=new Set,this.lastLog={},this.logger=Vs(this.logger.bind(this)),this.#r(),Array.isArray(e.reporters)&&this.registerReporters(e.reporters),this.rawReporter=this.extendReporter(e.rawReporter??new Rs),Array.isArray(e.processors)&&this.registerProcessors(e.processors)}#r(){for(const e in this.types)this[e]=this.logger.bind(this,e,!1,!1);for(const e in this.types)this.force[e]=this.logger.bind(this,e,!1,!0)}wrapConsole(){for(const e in this.types)console[`__${e}`]||(console[`__${e}`]=console[e]),console[e]=this[e]}restoreConsole(){for(const e in this.types)console[`__${e}`]&&(console[e]=console[`__${e}`],delete console[`__${e}`])}wrapException(){process.on("uncaughtException",e=>{this.error(e)}),process.on("unhandledRejection",e=>{this.error(e)})}disable(){this.disabled=!0}enable(){this.disabled=!1}isEnabled(){return!this.disabled}pause(){this.paused=!0}resume(){this.paused=!1;const e=this.messageQueue.splice(0);for(let r=0;r<e.length;r+=1){const{messageObject:s,raw:i,type:o}=e[r];this.logger(o,i,!1,...s)}}scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.scopeName=e.flat(),this}unscope(){this.scopeName=[]}child(e){const r=e?.types!==void 0,s=r?Je(this.types,e.types):this.types,i=e?.reporters??[],o=i.length>0?[...this.reporters,...i]:[...this.reporters],a=e?.processors??[],n=a.length>0?[...this.processors,...a]:[...this.processors],c=e?.logLevels?{...this.logLevels,...e.logLevels}:this.logLevels;let u;if(e?.scope){const p=Ue(e.scope).filter(Boolean);u=this.scopeName.length>0?[...this.scopeName,...p]:p}else u=this.scopeName.length>0?this.scopeName:[];const l=e?.messages?{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage,...e.messages}:{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage},h={disabled:e?.disabled??this.disabled,logLevel:e?.logLevel??this.generalLogLevel,logLevels:c,messages:l,processors:n,rawReporter:e?.rawReporter??this.rawReporter,reporters:o,scope:u,throttle:e?.throttle??this.throttle,throttleMin:e?.throttleMin??this.throttleMin};return r?(h.parentTypes=s,h.parentLongestLabel=Ae(s)):(h.parentTypes=this.types,h.parentLongestLabel=this.longestLabel),e?.logLevels||(h.parentLogLevels=this.logLevels),e?.messages||(h.parentMessages={timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage}),h.parentStringify=this.stringify,new ft(h)}time(e="default"){this.seqTimers.has(e)?this.logger("warn",!1,!1,{message:`Timer '${e}' already exists`,prefix:e}):(this.seqTimers.add(e),this.timersMap.set(e,Date.now()),this.logger("start",!1,!1,{message:this.startTimerMessage,prefix:e}))}timeLog(e,...r){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){const s=Date.now()-this.timersMap.get(e);this.logger("info",!1,!1,{context:r,message:s<1e3?`${String(s)} ms`:`${(s/1e3).toFixed(2)} s`,prefix:e})}else this.logger("warn",!1,!1,{context:r,message:"Timer not found",prefix:e})}timeEnd(e){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){const r=Date.now()-this.timersMap.get(e);this.timersMap.delete(e),this.logger("stop",!1,!1,{message:`${this.endTimerMessage} ${r<1e3?`${String(r)} ms`:`${(r/1e3).toFixed(2)} s`}`,prefix:e})}else this.logger("warn",!1,!1,{message:"Timer not found",prefix:e})}group(e="console.group"){globalThis.window===void 0?this.groups.push(e):console.group(e)}groupEnd(){globalThis.window===void 0?this.groups.pop():console.groupEnd()}count(e="default"){const r=this.countMap.get(e)??0;this.countMap.set(e,r+1),this.logger("log",!1,!1,{message:`${e}: ${String(r+1)}`,prefix:e})}countReset(e="default"){this.countMap.has(e)?this.countMap.delete(e):this.logger("warn",!1,!1,{message:`Count for ${e} does not exist`,prefix:e})}clear(){console.clear()}raw(e,...r){this.disabled||this.logger("log",!0,!1,{context:r,message:e})}extendReporter(e){return typeof e.setLoggerTypes=="function"&&e.setLoggerTypes(this.types),typeof e.setStringify=="function"&&e.setStringify(this.stringify),e}registerReporters(e){for(let r=0;r<e.length;r+=1)this.reporters.add(this.extendReporter(e[r]))}registerProcessors(e){for(let r=0;r<e.length;r+=1){const s=e[r];typeof s.setStringify=="function"&&s.setStringify(this.stringify),this.processors.add(s)}}#e(e,r){if(r)this.rawReporter.log(Object.freeze(e));else for(const s of this.reporters)s.log(Object.freeze(e))}#t(e){return e&&this.logLevels[e]?e:"debug"}#s(e,r,...s){const i={badge:void 0,context:void 0,error:void 0,label:void 0,message:Qe,prefix:void 0,repeated:void 0,scope:void 0,suffix:void 0};if(i.type={level:r.logLevel,name:e},i.groups=this.groups,i.scope=this.scopeName,i.date=new Date,s.length>0&&s[0]instanceof Error)i.error=s[0],s.length>1&&(i.context=s.slice(1));else if(s.length>0&&typeof s[0]=="object"&&s[0]!==null&&"message"in s[0]){const{context:o,message:a,prefix:n,suffix:c}=s[0];if(o&&(i.context=o),n&&(i.prefix=n),c&&(i.suffix=c),i.message=a,s.length>1){const u=s.slice(1);i.context?i.context=Array.isArray(i.context)?[...i.context,...u]:[i.context,...u]:i.context=u}}else s.length>1?(i.message=s[0],i.context=s.slice(1)):s.length===1?i.message=s[0]:i.message=void 0;return r.logLevel==="trace"&&(i.traceError=new Error("Trace")),r.badge&&(i.badge=r.badge),r.label&&(i.label=r.label),i}logger(e,r,s,...i){if(this.disabled)return;if(this.paused){this.messageQueue.push({messageObject:i,raw:r,type:e});return}const o=this.types[e],a=this.#t(o.logLevel);if(s||this.logLevels[a]>=this.logLevels[this.generalLogLevel]){let n=this.#s(e,o,...i);const c=Ge((l=!1)=>{const h=(this.lastLog.count??0)-this.throttleMin;if(this.lastLog.object&&h>0){const p={...this.lastLog.object};h>1&&(p.repeated=h),this.#e(p,r),this.lastLog.count=1}if(l){for(const p of this.processors)n={...p.process(n)};this.lastLog.object=n,this.#e(n,r)}},"resolveLog");clearTimeout(this.lastLog.timeout);const u=this.lastLog.time&&n.date?new Date(n.date).getTime()-this.lastLog.time.getTime():0;if(this.lastLog.time=new Date(n.date),u<this.throttle)try{if(this.lastLog.object&&JSON.stringify([n.label,n.scope,n.type,n.message,n.prefix,n.suffix,n.context])===JSON.stringify([this.lastLog.object.label,this.lastLog.object.scope,this.lastLog.object.type,this.lastLog.object.message,this.lastLog.object.prefix,this.lastLog.object.suffix,this.lastLog.object.context])&&(this.lastLog.count=(this.lastLog.count??0)+1,this.lastLog.count>this.throttleMin)){this.lastLog.timeout=setTimeout(c,this.throttle);return}}catch{}c(!0)}}}var Hs=Object.defineProperty,zs=y((t,e)=>Hs(t,"name",{value:e,configurable:!0}),"c$1");let Us=class{static{w(this,"Kt")}static{O(this,"Ht")}static{y(this,"v")}static{zs(this,"RawReporter")}#r;#e;#t;#s=!1;#i;constructor(t={}){this.#r=it,this.#e=nt,this.#i=t}setStdout(t){this.#r=t}setStderr(t){this.#e=t}setInteractiveManager(t){this.#t=t}setIsInteractive(t){this.#s=t}log(t){const{context:e,groups:r,message:s,type:i}=t,o=[];if(s!==Qe){const u=typeof s=="string"?s:Le(s,this.#i);o.push(u)}e&&o.push(...e.map(u=>typeof u=="object"?` ${Le(u,this.#i)}`:` ${String(u)}`));const a=["error","trace","warn"].includes(i.level)?"stderr":"stdout",n=a==="stderr"?this.#e:this.#r,c=r.map(()=>" ").join("");this.#s&&this.#t!==void 0&&n.isTTY?this.#t.update(a,(c+o.join("")).split(`
|
|
30
|
-
`),0):At(c+o.join(""),n)}};var Js=Object.defineProperty,Gs=y((t,e)=>Js(t,"name",{value:e,configurable:!0}),"m$1");class ht extends ft{static{w(this,"Me")}static{O(this,"Le")}static{y(this,"c")}constructor(e){const r=e.parentStderr,s=e.parentStdout,{interactive:i,processors:o,rawReporter:a,reporters:n,stderr:c,stdout:u}=e,l=r??c,h=s??u,p=e.parentLongestLabel,$=e.parentTypes,{parentLogLevels:P,parentMessages:E,parentStringify:S}=e,I={disabled:e.disabled,logLevel:e.logLevel,logLevels:e.logLevels,messages:e.messages,processors:[],rawReporter:e.rawReporter,reporters:[],scope:e.scope,throttle:e.throttle,throttleMin:e.throttleMin},z="types"in e;$&&p&&!z?(I.parentTypes=$,I.parentLongestLabel=p):z&&e.types!==void 0&&(I.types=e.types),S&&(I.parentStringify=S),P&&!e.logLevels&&(I.parentLogLevels=P),E&&!e.messages&&(I.parentMessages=E),super(I),this.options=e,this.interactive=i??!1,this.stdout=h,this.stderr=l,this.interactive&&(this.interactiveManager=new zr(new Be(this.stdout),new Be(this.stderr))),Array.isArray(n)&&this.registerReporters(n),this.rawReporter=this.extendReporter(a??new Us),Array.isArray(o)&&this.registerProcessors(o)}options;static{Gs(this,"PailServerImpl")}stdout;stderr;interactiveManager;interactive;scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.scopeName=e.flat(),this}child(e){const r=e?.types!==void 0,s=r?Je(this.types,e.types):this.types,i=e?.reporters??[],o=i.length>0?[...this.reporters,...i]:[...this.reporters],a=e?.processors??[],n=a.length>0?[...this.processors,...a]:[...this.processors],c=e?.logLevels?{...this.logLevels,...e.logLevels}:this.logLevels;let u;if(e?.scope){const p=Ue(e.scope).filter(Boolean);u=this.scopeName.length>0?[...this.scopeName,...p]:p}else u=this.scopeName.length>0?this.scopeName:[];const l=e?.messages?{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage,...e.messages}:{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage},h={disabled:e?.disabled??this.disabled,interactive:e?.interactive??this.interactive,logLevel:e?.logLevel??this.generalLogLevel,logLevels:c,messages:l,processors:n,rawReporter:e?.rawReporter??this.rawReporter,reporters:o,scope:u,stderr:e?.stderr??this.stderr,stdout:e?.stdout??this.stdout,throttle:e?.throttle??this.throttle,throttleMin:e?.throttleMin??this.throttleMin};return this.#r(h,e,r,s),new ht(h)}#r(e,r,s,i){s?(e.parentTypes=i,e.parentLongestLabel=Ae(i)):(e.parentTypes=this.types,e.parentLongestLabel=this.longestLabel),r?.logLevels||(e.parentLogLevels=this.logLevels),r?.messages||(e.parentMessages={timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage}),e.parentStringify=this.stringify,r?.stdout||(e.parentStdout=this.stdout),r?.stderr||(e.parentStderr=this.stderr)}getInteractiveManager(){return this.interactiveManager}wrapStd(){this.#e(this.stdout,"log"),this.#e(this.stderr,"log")}restoreStd(){this.#t(this.stdout),this.#t(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout.write($t),this.stderr.write($t)}extendReporter(e){return typeof e.setStdout=="function"&&e.setStdout(this.stdout),typeof e.setStderr=="function"&&e.setStderr(this.stderr),typeof e.setLoggerTypes=="function"&&e.setLoggerTypes(this.types),typeof e.setStringify=="function"&&e.setStringify(this.stringify),typeof e.setIsInteractive=="function"&&e.setIsInteractive(this.interactive),this.interactive&&typeof e.setInteractiveManager=="function"&&e.setInteractiveManager(this.interactiveManager),e}#e(e,r){e&&(e.__write||(e.__write=e.write),e.write=s=>{this[r](String(s).trim())})}#t(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}}const Ks=ht;var Qs=Object.defineProperty,Ys=y((t,e)=>Qs(t,"name",{value:e,configurable:!0}),"x"),Zs=Object.defineProperty,zt=Ys((t,e)=>Zs(t,"name",{value:e,configurable:!0}),"h"),Xs=Object.defineProperty,we=zt((t,e)=>Xs(t,"name",{value:e,configurable:!0}),"g$1");const xt=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"]]),ei=/^#([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})?$/i,ti=/^#([\dA-F])([\dA-F])([\dA-F])([\dA-F])?$/i,ri=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,si=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,Ut=we(()=>({__proto__:null,backgroundColor:null,color:null,fontStyle:null,fontWeight:null,textDecorationColor:null,textDecorationLine:[]}),"getDefaultCss"),St=/\s+/,Oe=we(t=>{xt.has(t)&&(t=xt.get(t));const e=ei.exec(t);if(e)return[Number.parseInt(e[1],16),Number.parseInt(e[2],16),Number.parseInt(e[3],16)];const r=ti.exec(t);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 s=ri.exec(t);if(s)return[Math.round(Math.max(0,Math.min(255,Number(s[1])))),Math.round(Math.max(0,Math.min(255,Number(s[2])))),Math.round(Math.max(0,Math.min(255,Number(s[3]))))];const i=si.exec(t);if(i){let o=Number(i[1])%360;o<0&&(o+=360);const a=Math.max(0,Math.min(100,Number(i[2])))/100,n=Math.max(0,Math.min(100,Number(i[3])))/100,c=(1-Math.abs(2*n-1))*a,u=c*(1-Math.abs(o/60%2-1)),l=n-c/2;let h,p,$;return o<60?{0:h,1:p,2:$}=[c,u,0]:o<120?{0:h,1:p,2:$}=[u,c,0]:o<180?{0:h,1:p,2:$}=[0,c,u]:o<240?{0:h,1:p,2:$}=[0,u,c]:o<300?{0:h,1:p,2:$}=[u,0,c]:{0:h,1:p,2:$}=[c,0,u],[Math.round((h+l)*255),Math.round((p+l)*255),Math.round(($+l)*255)]}return null},"parseCssColor"),De=we((t,e)=>t?.[0]===e?.[0]&&t?.[1]===e?.[1]&&t?.[2]===e?.[2],"colorEquals"),ii=we(t=>{const e=Ut(),r=[];let s=!1,i=null,o=0,a="";for(const n of t){if(n==="(")o+=1;else if(o>0)n===")"&&(o-=1);else if(s){if(n===";"){const c=a.trim();c!==""&&r.push([i,c]),i=null,a="",s=!1;continue}}else if(n===":"){i=a.trim(),a="",s=!0;continue}a+=n}if(s&&o===0){const n=a.trim();n!==""&&r.push([i,n]),i=null,a=""}for(const{0:n,1:c}of r)switch(n){case"background-color":{c!=null&&(e.backgroundColor=c);break}case"color":{c!=null&&(e.color=c);break}case"font-style":{["italic","oblique","oblique 14deg"].includes(c)&&(e.fontStyle="italic");break}case"font-weight":{c==="bold"&&(e.fontWeight=c);break}case"text-decoration":{e.textDecorationColor=null,e.textDecorationLine=[];const u=c.split(St);for(const l of u){const h=Oe(l);h!=null?e.textDecorationColor=h:["line-through","overline","underline"].includes(l)&&e.textDecorationLine.push(l)}break}case"text-decoration-color":{const u=Oe(c);u!=null&&(e.textDecorationColor=u);break}case"text-decoration-line":{e.textDecorationLine=[];const u=c.split(St);for(const l of u)["line-through","overline","underline"].includes(l)&&e.textDecorationLine.push(l);break}}return e},"parseCss"),ni=we((t,e)=>{e=e??Ut();let r="";if(!De(t.backgroundColor,e.backgroundColor))if(t.backgroundColor==null)r+="\x1B[49m";else switch(t.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(t.backgroundColor)){const{0:s,1:i,2:o}=t.backgroundColor;r+=`\x1B[48;2;${String(s)};${String(i)};${String(o)}m`}else{const s=Oe(t.backgroundColor);if(s===null)r+="\x1B[49m";else{const{0:i,1:o,2:a}=s;r+=`\x1B[48;2;${String(i)};${String(o)};${String(a)}m`}}}if(!De(t.color,e.color))if(t.color==null)r+="\x1B[39m";else switch(t.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(t.color)){const{0:s,1:i,2:o}=t.color;r+=`\x1B[38;2;${String(s)};${String(i)};${String(o)}m`}else{const s=Oe(t.color);if(s===null)r+="\x1B[39m";else{const{0:i,1:o,2:a}=s;r+=`\x1B[38;2;${String(i)};${String(o)};${String(a)}m`}}}if(t.fontWeight!==e.fontWeight&&(r+=t.fontWeight==="bold"?"\x1B[1m":"\x1B[22m"),t.fontStyle!==e.fontStyle&&(r+=t.fontStyle==="italic"?"\x1B[3m":"\x1B[23m"),!De(t.textDecorationColor,e.textDecorationColor))if(t.textDecorationColor==null)r+="\x1B[59m";else{const{0:s,1:i,2:o}=t.textDecorationColor;r+=`\x1B[58;2;${String(s)};${String(i)};${String(o)}m`}return t.textDecorationLine.includes("line-through")!==e.textDecorationLine.includes("line-through")&&(r+=t.textDecorationLine.includes("line-through")?"\x1B[9m":"\x1B[29m"),t.textDecorationLine.includes("overline")!==e.textDecorationLine.includes("overline")&&(r+=t.textDecorationLine.includes("overline")?"\x1B[53m":"\x1B[55m"),t.textDecorationLine.includes("underline")!==e.textDecorationLine.includes("underline")&&(r+=t.textDecorationLine.includes("underline")?"\x1B[4m":"\x1B[24m"),r},"cssToAnsi");var oi=Object.defineProperty,gt=zt((t,e)=>oi(t,"name",{value:e,configurable:!0}),"y");const ai=gt(t=>{try{return JSON.stringify(t)}catch{return'"[Circular]"'}},"tryStringify"),Et="%".codePointAt(0),li="s".codePointAt(0),ci="d".codePointAt(0),ui="f".codePointAt(0),fi="i".codePointAt(0),hi="O".codePointAt(0),gi="o".codePointAt(0),di="j".codePointAt(0),pi="c".codePointAt(0),mi=gt((t,e=[],r={})=>{if(typeof t!="string"&&typeof t!="object"||t===null)throw new TypeError(`fmt must be a string or object, got ${t===null?"null":typeof t}`);const s=r.stringify??ai,i=1;if(typeof t=="object"){const l=e.length+i;if(l===1)return"{}";const h=Array.from({length:l});h[0]=s(t);for(let p=1;p<l;p+=1)h[p]=s(e[p-i]);return h.join(" ")}if(e.length===0)return t;let o="",a=1-i,n=-1,c=!1,u;for(let l=0;l<t.length;){if(t.codePointAt(l)===Et&&l+1<t.length){n=n>-1?n:0;const h=t.codePointAt(l+1);if(h===void 0){a+=1;break}switch(h){case pi:{if(globalThis.window===void 0){const p=ii(e[a]);n<l&&(o+=t.slice(n,l)),o+=ni(p,u),o!==""&&(c=!0,u=p)}n=l+2,l+=1;break}case ci:case ui:{if(a>=e.length||e[a]==null)break;n<l&&(o+=t.slice(n,l)),o+=Number(e[a]).toString(),n=l+2,l+=1;break}case fi:{if(a>=e.length||e[a]==null)break;n<l&&(o+=t.slice(n,l)),o+=Math.floor(Number(e[a])).toString(),n=l+2,l+=1;break}case di:case hi:case gi:{if(a>=e.length||e[a]===void 0)break;n<l&&(o+=t.slice(n,l));const p=e[a],$=typeof p;if($==="string"){o+=`'${p}'`,n=l+2;break}if($==="function"){o+=p.name?`[Function: ${p.name}]`:"[Function: <anonymous>]",n=l+2;break}o+=s(p),n=l+2,l+=1;break}case Et:{n<l&&(o+=t.slice(n,l)),o+="%",n=l+2,l+=1,a-=1;break}case li:{if(a>=e.length)break;n<l&&(o+=t.slice(n,l)),o+=typeof e[a]=="object"?s(e[a]):String(e[a]),n=l+2,l+=1;break}default:typeof r.formatters?.[h]=="function"&&(n<l&&(o+=t.slice(n,l)),o+=r.formatters[h](e[a]),n=l+2,l+=1)}a+=1}l+=1}return n===-1?t:(n<t.length&&(o+=t.slice(n)),c&&(o+="\x1B[0m"),o)},"format"),bi=gt((t={})=>{const e={};return typeof t.formatters=="object"&&Object.entries(t.formatters).forEach(([r,s])=>{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 s!="function")throw new TypeError(`Formatter for %${r} is not a function`);const i=r.codePointAt(0);if(i===void 0)throw new Error(`${r}.codePointAt(0) failed to return a value, please report this issue`);e[i]=s}),(r,s=[],i={})=>mi(r,s,{...i,formatters:e})},"build");var yi=Object.defineProperty,kt=y((t,e)=>yi(t,"name",{value:e,configurable:!0}),"i$1");let wi=class{static{w(this,"xr")}static{O(this,"$r")}static{y(this,"g")}static{kt(this,"MessageFormatterProcessor")}#r;#e;constructor(t={}){this.#e=t.formatters}setStringify(t){this.#r=t}process(t){const e=bi({formatters:this.#e,stringify:kt(r=>this.#r?this.#r(r):JSON.stringify(r),"stringify")});return t.message!==void 0&&(t.message=this.#t(e,t.message,t.context??[])),t}#t(t,e,r=[]){if(typeof e=="string")return t(e,r);if(typeof e=="object"&&e!==null){const s=e,i=Object.keys(s);for(let o=0;o<i.length;o+=1){const a=i[o],n=s[a];(typeof n=="string"||Array.isArray(n)||typeof n=="object")&&(s[a]=this.#t(t,n,r))}}return e}};var $i=Object.defineProperty,Jt=y((t,e)=>$i(t,"name",{value:e,configurable:!0}),"M");const{bgGrey:vi,cyan:xi,green:Si,greenBright:Ei,grey:Q,red:qe,underline:Tt,white:ki}=Lt,Ti=/[\\/]pail[\\/]dist/,Ve=Jt(t=>!Ti.test(t),"pailFileFilter");class Ai extends Yt{static{w(this,"Br")}static{O(this,"Mr")}static{y(this,"PrettyReporter")}static{Jt(this,"PrettyReporter")}#r;#e;#t;#s=!1;#i;#n;constructor(e={}){const{error:r,inspect:s,...i}=e;super({uppercase:{label:!0,...i.uppercase},...i}),this.#i={...Zt,...s},this.#n={...r,color:{fileLine:Si,hint:xi,marker:qe,message:qe,method:Ei,title:qe}},this.#r=it,this.#e=nt}setStdout(e){this.#r=e}setStderr(e){this.#e=e}setInteractiveManager(e){this.#t=e}setIsInteractive(e){this.#s=e}log(e){this._log(this._formatMessage(e),e.type.level)}_formatMessage(e){const{columns:r}=Xt();let s=r;typeof this.styles.messageLength=="number"&&(s=this.styles.messageLength);const{badge:i,context:o,date:a,error:n,file:c,groups:u,label:l,message:h,prefix:p,repeated:$,scope:P,suffix:E,traceError:S,type:I}=e,{color:z}=this.loggerTypes[I.name],J=z?Lt[z]:ki,d=u.map(()=>" ").join(""),g=[];if(u.length>0&&g.push(`${d+Q(`[${u.at(-1)??""}]`)} `),a&&g.push(`${Q(this.styles.dateFormatter(typeof a=="string"?new Date(a):a))} `),i)g.push(J(i));else{const B=er(this.loggerTypes);B.length>0&&g.push(`${Q(".".repeat(B.length))} `)}const x=Ae(this.loggerTypes);if(l){const B=xe(x),W=xe(l);g.push(`${J(tr(l,this.styles))} `,Q(".".repeat(Math.max(0,B-W))))}else g.push(Q(".".repeat(x.length+2)));$&&g.push(`${vi.white(`[${String($)}x]`)} `),Array.isArray(P)&&P.length>0&&g.push(` ${Q(`[${P.join(" > ")}]`)} `),p&&g.push(`${Q(`${Array.isArray(P)&&P.length>0?". ":" "}[${this.styles.underline.prefix?Tt(p):p}]`)} `);const R=xe(g.join(" "));if(c){const B=(c.name??"")+(c.line?`:${String(c.line)}`:""),W=xe(B);if(W+R+2>s)g.push(Q(` ${B}`));else{const G=Math.max(0,s-R-W-2);g.push(Q(`${".".repeat(G)} ${B}`))}}else g.push(Q(".".repeat(Math.max(0,s-R-1))));if(g.length>0&&g.push(`
|
|
10
|
+
`),this.#s=u?u+l.length+1:l.length,this.#i=Math.max(this.lastLength-a,this.outside)}}#n(e=!1){this.#e=e,this.#s=0,this.#i=0}};const qr=He(import.meta.url),ce=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Vr=t=>{if(typeof ce<"u"&&ce.versions&&ce.versions.node){const[e,r]=ce.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return ce.getBuiltinModule(t)}return qr(t)},{StringDecoder:Hr}=Vr("node:string_decoder"),Jr="\x1B",de=`${Jr}[`,Gr=`${de}?25l`,Ur=`${de}G`,zr=`${de}?25h`,Kr=(t=1)=>`${de}${String(t)}A`,Yr=t=>`${de}${String(t)}K`,Qr=Yr(2),Zr=t=>{if(t<=0)return"";let e="";for(let r=0;r<t;r+=1)e+=Qr,r<t-1&&(e+=Kr());return e+=Ur,e};class Ee{static DRAIN=!0;#r=new Hr;#e=[];#t;#s;constructor(e){this.#t=e.write.bind(e),this.#s=e}active(){this.write(Gr),this.#s.write=(e,...r)=>{const s=r.at(-1);return this.#e.push(this.#r.write(typeof e=="string"?Buffer.from(e,typeof r[0]=="string"?r[0]:void 0):Buffer.from(e))),typeof s=="function"&&s(),Ee.DRAIN}}erase(e){e>0&&this.write(Zr(e+1))}inactive(e=!1){this.#e.length>0&&(e&&this.write(`
|
|
11
|
+
`),this.#e.forEach(r=>{this.write(r)}),this.#e=[]),this.renew()}renew(){this.#s.write=this.#t,this.write(zr)}write(e){this.#t.apply(this.#s,[e])}}var Xr=Object.defineProperty,Bt=(t,e)=>Xr(t,"name",{value:e,configurable:!0}),es=Object.defineProperty,jt=Bt((t,e)=>es(t,"name",{value:e,configurable:!0}),"e");class ts extends Error{static{Bt(this,"n")}static{jt(this,"PailError")}status;why;fix;link;constructor(e){const r=typeof e=="string"?{message:e}:e;super(r.message,r.cause===void 0?void 0:{cause:r.cause}),this.name="PailError",this.status=r.status??500,this.why=r.why,this.fix=r.fix,this.link=r.link}toJSON(){const e={message:this.message,name:this.name,status:this.status};return this.why&&(e.why=this.why),this.fix&&(e.fix=this.fix),this.link&&(e.link=this.link),this.stack&&(e.stack=this.stack),this.cause!==void 0&&(e.cause=this.cause instanceof Error?{message:this.cause.message,name:this.cause.name,stack:this.cause.stack}:this.cause),e}toString(){let e=`${this.name} [${String(this.status)}]: ${this.message}`;if(this.why&&(e+=`
|
|
12
|
+
Why: ${this.why}`),this.fix&&(e+=`
|
|
13
|
+
Fix: ${this.fix}`),this.link&&(e+=`
|
|
14
|
+
Link: ${this.link}`),this.cause!==void 0){const r=this.cause instanceof Error?this.cause.message:String(this.cause);e+=`
|
|
15
|
+
Cause: ${r}`}return e}}jt(t=>new ts(t),"createPailError");var rs=Object.defineProperty,y=(t,e)=>rs(t,"name",{value:e,configurable:!0});He(import.meta.url);const ss=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:Ze,stderr:Xe,env:he}=ss,is="\x1B",O="\x1B[",Nt=";";var ns=Object.defineProperty,os=y((t,e)=>ns(t,"name",{value:e,configurable:!0}),"t$3"),as=Object.defineProperty,ls=os((t,e)=>as(t,"name",{value:e,configurable:!0}),"t");const cs=typeof globalThis<"u"&&typeof globalThis.window=="object"&&globalThis.window.document!==void 0,us=/^(?:msys|cygwin)$/,fs=!cs&&(process.platform==="win32"||us.test(process.env.OSTYPE));var hs=Object.defineProperty,W=ls((t,e)=>hs(t,"name",{value:e,configurable:!0}),"n");const gs=W((t=1)=>`${O}${String(t)}D`,"cursorBackward");W((t=1)=>`${O}${String(t)}B`,"cursorDown");W((t=1)=>`${O}${String(t)}C`,"cursorForward");const ds=`${O}G`;W((t=1)=>gs(t),"cursorLeft");const ps=W((t=1)=>`${O}${String(t)}G`,"cursorHorizontalAbsolute");W((t,e)=>{let r="";return t<0?r+=`${O}${String(-t)}D`:t>0&&(r+=`${O}${String(t)}C`),e<0?r+=`${O}${String(-e)}A`:e>0&&(r+=`${O}${String(e)}B`),r},"cursorMove");W((t=1)=>`${O}${String(t)}E`,"cursorNextLine");W((t=1)=>`${O}${String(t)}F`,"cursorPreviousLine");const ms=W((t,e)=>e===void 0?ps(t+1):`${O}${String(e+1)}${Nt}${String(t+1)}H`,"cursorTo");W((t,e)=>e===void 0?`${O}${String(t)}H`:`${O}${String(t)}${Nt}${String(e)}H`,"cursorPosition");W((t=1)=>`${O}${String(t)}I`,"cursorHorizontalForwardTab");W((t=1)=>`${O}${String(t)}Z`,"cursorBackwardTab");W((t=1)=>`${O}${String(t)}X`,"eraseCharacter");W((t=1)=>`${O}${String(t)}d`,"cursorVerticalAbsolute");const bs=W((t=1)=>`${O}${String(t)}A`,"cursorUp");var ys=(t=>(t[t.Default=0]="Default",t[t.BlinkingBlock=1]="BlinkingBlock",t[t.SteadyBlock=2]="SteadyBlock",t[t.BlinkingUnderline=3]="BlinkingUnderline",t[t.SteadyUnderline=4]="SteadyUnderline",t[t.BlinkingBar=5]="BlinkingBar",t[t.SteadyBar=6]="SteadyBar",t))(ys||{});W(t=>`${O}${String(t)} q`,"setCursorStyle");var ws=Object.defineProperty,$s=y((t,e)=>ws(t,"name",{value:e,configurable:!0}),"o$3"),vs=Object.defineProperty,xs=$s((t,e)=>vs(t,"name",{value:e,configurable:!0}),"s"),Ss=Object.defineProperty,et=xs((t,e)=>Ss(t,"name",{value:e,configurable:!0}),"o"),ne=(t=>(t[t.ToEnd=0]="ToEnd",t[t.ToBeginning=1]="ToBeginning",t[t.EntireScreen=2]="EntireScreen",t[t.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",t))(ne||{});const Y=et(t=>{const e=t>=0&&t<=3?t:0;return`${O}${e===0?"":String(e)}J`},"eraseDisplay");var It=(t=>(t[t.ToEnd=0]="ToEnd",t[t.ToBeginning=1]="ToBeginning",t[t.EntireLine=2]="EntireLine",t))(It||{});const Me=et(t=>{const e=t>=0&&t<=2?t:0;return`${O}${e===0?"":String(e)}K`},"eraseInLine");Y(0);const ks=Me(2);Me(0);Me(1);et(t=>{if(t<=0)return"";let e="";for(let r=0;r<t;r+=1)e+=ks,r<t-1&&(e+=bs());return e+=ds,e},"eraseLines");Y(2);Y(1);Y(3);ms(0,0)+Y(ne.ToEnd);`${Me(It.EntireLine)}${O}`;`${O}${Y(ne.EntireScreen)}`;const ft=fs?`${Y(ne.EntireScreen)}${O}0f`:`${Y(ne.EntireScreen)}${Y(ne.EntireScreenAndScrollback)}${O}H${is}c`;var Es=Object.defineProperty,oe=y((t,e)=>Es(t,"name",{value:e,configurable:!0}),"t$2");function tt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}y(tt,"getDefaultExportFromCjs");oe(tt,"getDefaultExportFromCjs");function Pt(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}y(Pt,"getDefaultExportFromNamespaceIfPresent");oe(Pt,"getDefaultExportFromNamespaceIfPresent");function Ft(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")&&Object.keys(t).length===1?t.default:t}y(Ft,"getDefaultExportFromNamespaceIfNotNamed");oe(Ft,"getDefaultExportFromNamespaceIfNotNamed");function Rt(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=oe(y(function s(){var i=!1;try{i=this instanceof s}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)},"a"),"a");r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(s){var i=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:oe(function(){return t[s]},"get")})}),r}y(Rt,"getAugmentedNamespace");oe(Rt,"getAugmentedNamespace");var Pe={exports:{}},ht;function _t(){return ht||(ht=1,(function(t,e){var r=Object.defineProperty,s=y((d,g)=>r(d,"name",{value:g,configurable:!0}),"$");const{hasOwnProperty:i}=Object.prototype,o=H();o.configure=H,o.stringify=o,o.default=o,e.stringify=o,e.configure=H,t.exports=o;const a=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function n(d){return d.length<5e3&&!a.test(d)?`"${d}"`:JSON.stringify(d)}y(n,"strEscape"),s(n,"strEscape");function c(d,g){if(d.length>200||g)return d.sort(g);for(let $=1;$<d.length;$++){const I=d[$];let L=$;for(;L!==0&&d[L-1]>I;)d[L]=d[L-1],L--;d[L]=I}return d}y(c,"sort"),s(c,"sort");const u=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function l(d){return u.call(d)!==void 0&&d.length!==0}y(l,"isTypedArrayWithEntries"),s(l,"isTypedArrayWithEntries");function h(d,g,$){d.length<$&&($=d.length);const I=g===","?"":" ";let L=`"0":${I}${d[0]}`;for(let R=1;R<$;R++)L+=`${g}"${R}":${I}${d[R]}`;return L}y(h,"stringifyTypedArray"),s(h,"stringifyTypedArray");function p(d){if(i.call(d,"circularValue")){const g=d.circularValue;if(typeof g=="string")return`"${g}"`;if(g==null)return g;if(g===Error||g===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}y(p,"getCircularValueOption"),s(p,"getCircularValueOption");function w(d){let g;if(i.call(d,"deterministic")&&(g=d.deterministic,typeof g!="boolean"&&typeof g!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return g===void 0?!0:g}y(w,"getDeterministicOption"),s(w,"getDeterministicOption");function N(d,g){let $;if(i.call(d,g)&&($=d[g],typeof $!="boolean"))throw new TypeError(`The "${g}" argument must be of type boolean`);return $===void 0?!0:$}y(N,"getBooleanOption"),s(N,"getBooleanOption");function k(d,g){let $;if(i.call(d,g)){if($=d[g],typeof $!="number")throw new TypeError(`The "${g}" argument must be of type number`);if(!Number.isInteger($))throw new TypeError(`The "${g}" argument must be an integer`);if($<1)throw new RangeError(`The "${g}" argument must be >= 1`)}return $===void 0?1/0:$}y(k,"getPositiveIntegerOption"),s(k,"getPositiveIntegerOption");function v(d){return d===1?"1 item":`${d} items`}y(v,"getItemCount"),s(v,"getItemCount");function B(d){const g=new Set;for(const $ of d)(typeof $=="string"||typeof $=="number")&&g.add(String($));return g}y(B,"getUniqueReplacerSet"),s(B,"getUniqueReplacerSet");function V(d){if(i.call(d,"strict")){const g=d.strict;if(typeof g!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(g)return $=>{let I=`Object can not safely be stringified. Received type ${typeof $}`;throw typeof $!="function"&&(I+=` (${$.toString()})`),new Error(I)}}}y(V,"getStrictOption"),s(V,"getStrictOption");function H(d){d={...d};const g=V(d);g&&(d.bigint===void 0&&(d.bigint=!1),"circularValue"in d||(d.circularValue=Error));const $=p(d),I=N(d,"bigint"),L=w(d),R=typeof L=="function"?L:void 0,J=k(d,"maximumDepth"),j=k(d,"maximumBreadth");function re(C,f,m,E,x,T){let b=f[C];switch(typeof b=="object"&&b!==null&&typeof b.toJSON=="function"&&(b=b.toJSON(C)),b=E.call(f,C,b),typeof b){case"string":return n(b);case"object":{if(b===null)return"null";if(m.indexOf(b)!==-1)return $;let S="",P=",";const F=T;if(Array.isArray(b)){if(b.length===0)return"[]";if(J<m.length+1)return'"[Array]"';m.push(b),x!==""&&(T+=x,S+=`
|
|
16
|
+
${T}`,P=`,
|
|
17
|
+
${T}`);const q=Math.min(b.length,j);let z=0;for(;z<q-1;z++){const me=re(String(z),b,m,E,x,T);S+=me!==void 0?me:"null",S+=P}const K=re(String(z),b,m,E,x,T);if(S+=K!==void 0?K:"null",b.length-1>j){const me=b.length-j-1;S+=`${P}"... ${v(me)} not stringified"`}return x!==""&&(S+=`
|
|
18
|
+
${F}`),m.pop(),`[${S}]`}let M=Object.keys(b);const _=M.length;if(_===0)return"{}";if(J<m.length+1)return'"[Object]"';let A="",D="";x!==""&&(T+=x,P=`,
|
|
19
|
+
${T}`,A=" ");const G=Math.min(_,j);L&&!l(b)&&(M=c(M,R)),m.push(b);for(let q=0;q<G;q++){const z=M[q],K=re(z,b,m,E,x,T);K!==void 0&&(S+=`${D}${n(z)}:${A}${K}`,D=P)}if(_>j){const q=_-j;S+=`${D}"...":${A}"${v(q)} not stringified"`,D=P}return x!==""&&D.length>1&&(S=`
|
|
20
|
+
${T}${S}
|
|
21
|
+
${F}`),m.pop(),`{${S}}`}case"number":return isFinite(b)?String(b):g?g(b):"null";case"boolean":return b===!0?"true":"false";case"undefined":return;case"bigint":if(I)return String(b);default:return g?g(b):void 0}}y(re,"J"),s(re,"stringifyFnReplacer");function se(C,f,m,E,x,T){switch(typeof f=="object"&&f!==null&&typeof f.toJSON=="function"&&(f=f.toJSON(C)),typeof f){case"string":return n(f);case"object":{if(f===null)return"null";if(m.indexOf(f)!==-1)return $;const b=T;let S="",P=",";if(Array.isArray(f)){if(f.length===0)return"[]";if(J<m.length+1)return'"[Array]"';m.push(f),x!==""&&(T+=x,S+=`
|
|
22
|
+
${T}`,P=`,
|
|
23
|
+
${T}`);const _=Math.min(f.length,j);let A=0;for(;A<_-1;A++){const G=se(String(A),f[A],m,E,x,T);S+=G!==void 0?G:"null",S+=P}const D=se(String(A),f[A],m,E,x,T);if(S+=D!==void 0?D:"null",f.length-1>j){const G=f.length-j-1;S+=`${P}"... ${v(G)} not stringified"`}return x!==""&&(S+=`
|
|
24
|
+
${b}`),m.pop(),`[${S}]`}m.push(f);let F="";x!==""&&(T+=x,P=`,
|
|
25
|
+
${T}`,F=" ");let M="";for(const _ of E){const A=se(_,f[_],m,E,x,T);A!==void 0&&(S+=`${M}${n(_)}:${F}${A}`,M=P)}return x!==""&&M.length>1&&(S=`
|
|
26
|
+
${T}${S}
|
|
27
|
+
${b}`),m.pop(),`{${S}}`}case"number":return isFinite(f)?String(f):g?g(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(I)return String(f);default:return g?g(f):void 0}}y(se,"I"),s(se,"stringifyArrayReplacer");function X(C,f,m,E,x){switch(typeof f){case"string":return n(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(C),typeof f!="object")return X(C,f,m,E,x);if(f===null)return"null"}if(m.indexOf(f)!==-1)return $;const T=x;if(Array.isArray(f)){if(f.length===0)return"[]";if(J<m.length+1)return'"[Array]"';m.push(f),x+=E;let A=`
|
|
28
|
+
${x}`;const D=`,
|
|
29
|
+
${x}`,G=Math.min(f.length,j);let q=0;for(;q<G-1;q++){const K=X(String(q),f[q],m,E,x);A+=K!==void 0?K:"null",A+=D}const z=X(String(q),f[q],m,E,x);if(A+=z!==void 0?z:"null",f.length-1>j){const K=f.length-j-1;A+=`${D}"... ${v(K)} not stringified"`}return A+=`
|
|
30
|
+
${T}`,m.pop(),`[${A}]`}let b=Object.keys(f);const S=b.length;if(S===0)return"{}";if(J<m.length+1)return'"[Object]"';x+=E;const P=`,
|
|
31
|
+
${x}`;let F="",M="",_=Math.min(S,j);l(f)&&(F+=h(f,P,j),b=b.slice(f.length),_-=f.length,M=P),L&&(b=c(b,R)),m.push(f);for(let A=0;A<_;A++){const D=b[A],G=X(D,f[D],m,E,x);G!==void 0&&(F+=`${M}${n(D)}: ${G}`,M=P)}if(S>j){const A=S-j;F+=`${M}"...": "${v(A)} not stringified"`,M=P}return M!==""&&(F=`
|
|
32
|
+
${x}${F}
|
|
33
|
+
${T}`),m.pop(),`{${F}}`}case"number":return isFinite(f)?String(f):g?g(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(I)return String(f);default:return g?g(f):void 0}}y(X,"V"),s(X,"stringifyIndent");function ee(C,f,m){switch(typeof f){case"string":return n(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(C),typeof f!="object")return ee(C,f,m);if(f===null)return"null"}if(m.indexOf(f)!==-1)return $;let E="";const x=f.length!==void 0;if(x&&Array.isArray(f)){if(f.length===0)return"[]";if(J<m.length+1)return'"[Array]"';m.push(f);const F=Math.min(f.length,j);let M=0;for(;M<F-1;M++){const A=ee(String(M),f[M],m);E+=A!==void 0?A:"null",E+=","}const _=ee(String(M),f[M],m);if(E+=_!==void 0?_:"null",f.length-1>j){const A=f.length-j-1;E+=`,"... ${v(A)} not stringified"`}return m.pop(),`[${E}]`}let T=Object.keys(f);const b=T.length;if(b===0)return"{}";if(J<m.length+1)return'"[Object]"';let S="",P=Math.min(b,j);x&&l(f)&&(E+=h(f,",",j),T=T.slice(f.length),P-=f.length,S=","),L&&(T=c(T,R)),m.push(f);for(let F=0;F<P;F++){const M=T[F],_=ee(M,f[M],m);_!==void 0&&(E+=`${S}${n(M)}:${_}`,S=",")}if(b>j){const F=b-j;E+=`${S}"...":"${v(F)} not stringified"`}return m.pop(),`{${E}}`}case"number":return isFinite(f)?String(f):g?g(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(I)return String(f);default:return g?g(f):void 0}}y(ee,"N"),s(ee,"stringifySimple");function Oe(C,f,m){if(arguments.length>1){let E="";if(typeof m=="number"?E=" ".repeat(Math.min(m,10)):typeof m=="string"&&(E=m.slice(0,10)),f!=null){if(typeof f=="function")return re("",{"":C},[],f,E,"");if(Array.isArray(f))return se("",C,[],B(f),E,"")}if(E.length!==0)return X("",C,[],E,"")}return ee("",C,[])}return y(Oe,"M"),s(Oe,"stringify"),Oe}y(H,"configure"),s(H,"configure")})(Pe,Pe.exports)),Pe.exports}y(_t,"requireSafeStableStringify");var Ts=_t();const As=tt(Ts),Ls=As.configure;var Ms=Object.defineProperty,Os=y((t,e)=>Ms(t,"name",{value:e,configurable:!0}),"o$1");const Bs=Os(t=>{const e=console;return t==="error"?e.__error??console.error:t==="warn"?e.__warn??console.warn:t==="trace"?e.__trace??console.trace:e.__log??console.log},"writeConsoleLogBasedOnLevel");var js=Object.defineProperty,Ns=y((t,e)=>js(t,"name",{value:e,configurable:!0}),"t");let Is=class{static{y(this,"a")}static{Ns(this,"RawReporter")}log(t){const{context:e=[],message:r,type:s}=t;Bs(s.level)(r,...e)}};var Ps=Object.defineProperty,Fs=y((t,e)=>Ps(t,"name",{value:e,configurable:!0}),"a");const De=Fs(t=>t===void 0?[]:Array.isArray(t)?t:[t],"arrayify");var Rs=Object.defineProperty,_s=y((t,e)=>Rs(t,"name",{value:e,configurable:!0}),"g$3");const qe=_s((t,e)=>{const r={...t};return Object.keys(e).forEach(s=>{r[s]={...r[s],...e[s]}}),r},"mergeTypes");var Cs=Object.defineProperty,Ve=y((t,e)=>Cs(t,"name",{value:e,configurable:!0}),"d");const Ws=Ve(t=>{let e=!1;return function(...r){if(!e){e=!0;try{const s=t.apply(this,r);return e=!1,s}catch(s){throw e=!1,s}}}},"preventLoop");class rt{static{y(this,"PailBrowserImpl")}static{Ve(this,"PailBrowserImpl")}timersMap;countMap;seqTimers;lastLog;logLevels;disabled;paused;messageQueue;scopeName;types;longestLabel;processors;generalLogLevel;reporters;throttle;throttleMin;stringify;groups;startTimerMessage;endTimerMessage;rawReporter;force={};constructor(e){this.throttle=e.throttle??1e3,this.throttleMin=e.throttleMin??5;const r=e.parentLongestLabel,s=e.parentTypes,i=e.parentStringify,o=e.parentLogLevels;this.stringify=i??Ls({strict:!0}),this.startTimerMessage=e.messages?.timerStart??"Initialized timer...",this.endTimerMessage=e.messages?.timerEnd??"Timer run for:",s&&r?(this.types=s,this.longestLabel=r):(this.types=qe(Ht,e.types??{}),this.longestLabel=xe(this.types)),this.logLevels=o&&!e.logLevels?o:{...Jt,...e.logLevels},this.generalLogLevel=this.#t(e.logLevel),this.reporters=new Set,this.processors=new Set,this.disabled=e.disabled??!1,this.paused=!1,this.messageQueue=[],this.scopeName=De(e.scope).filter(Boolean),this.timersMap=new Map,this.countMap=new Map,this.groups=[],this.seqTimers=new Set,this.lastLog={},this.logger=Ws(this.logger.bind(this)),this.#r(),Array.isArray(e.reporters)&&this.registerReporters(e.reporters),this.rawReporter=this.extendReporter(e.rawReporter??new Is),Array.isArray(e.processors)&&this.registerProcessors(e.processors)}#r(){for(const e in this.types)this[e]=this.logger.bind(this,e,!1,!1);for(const e in this.types)this.force[e]=this.logger.bind(this,e,!1,!0)}wrapConsole(){for(const e in this.types)console[`__${e}`]||(console[`__${e}`]=console[e]),console[e]=this[e]}restoreConsole(){for(const e in this.types)console[`__${e}`]&&(console[e]=console[`__${e}`],delete console[`__${e}`])}wrapException(){process.on("uncaughtException",e=>{this.error(e)}),process.on("unhandledRejection",e=>{this.error(e)})}disable(){this.disabled=!0}enable(){this.disabled=!1}isEnabled(){return!this.disabled}pause(){this.paused=!0}resume(){this.paused=!1;const e=this.messageQueue.splice(0);for(let r=0;r<e.length;r+=1){const{messageObject:s,raw:i,type:o}=e[r];this.logger(o,i,!1,...s)}}scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.scopeName=e.flat(),this}unscope(){this.scopeName=[]}child(e){const r=e?.types!==void 0,s=r?qe(this.types,e.types):this.types,i=e?.reporters??[],o=i.length>0?[...this.reporters,...i]:[...this.reporters],a=e?.processors??[],n=a.length>0?[...this.processors,...a]:[...this.processors],c=e?.logLevels?{...this.logLevels,...e.logLevels}:this.logLevels;let u;if(e?.scope){const p=De(e.scope).filter(Boolean);u=this.scopeName.length>0?[...this.scopeName,...p]:p}else u=this.scopeName.length>0?this.scopeName:[];const l=e?.messages?{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage,...e.messages}:{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage},h={disabled:e?.disabled??this.disabled,logLevel:e?.logLevel??this.generalLogLevel,logLevels:c,messages:l,processors:n,rawReporter:e?.rawReporter??this.rawReporter,reporters:o,scope:u,throttle:e?.throttle??this.throttle,throttleMin:e?.throttleMin??this.throttleMin};return r?(h.parentTypes=s,h.parentLongestLabel=xe(s)):(h.parentTypes=this.types,h.parentLongestLabel=this.longestLabel),e?.logLevels||(h.parentLogLevels=this.logLevels),e?.messages||(h.parentMessages={timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage}),h.parentStringify=this.stringify,new rt(h)}time(e="default"){this.seqTimers.has(e)?this.logger("warn",!1,!1,{message:`Timer '${e}' already exists`,prefix:e}):(this.seqTimers.add(e),this.timersMap.set(e,Date.now()),this.logger("start",!1,!1,{message:this.startTimerMessage,prefix:e}))}timeLog(e,...r){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){const s=Date.now()-this.timersMap.get(e);this.logger("info",!1,!1,{context:r,message:s<1e3?`${String(s)} ms`:`${(s/1e3).toFixed(2)} s`,prefix:e})}else this.logger("warn",!1,!1,{context:r,message:"Timer not found",prefix:e})}timeEnd(e){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){const r=Date.now()-this.timersMap.get(e);this.timersMap.delete(e),this.logger("stop",!1,!1,{message:`${this.endTimerMessage} ${r<1e3?`${String(r)} ms`:`${(r/1e3).toFixed(2)} s`}`,prefix:e})}else this.logger("warn",!1,!1,{message:"Timer not found",prefix:e})}group(e="console.group"){globalThis.window===void 0?this.groups.push(e):console.group(e)}groupEnd(){globalThis.window===void 0?this.groups.pop():console.groupEnd()}count(e="default"){const r=this.countMap.get(e)??0;this.countMap.set(e,r+1),this.logger("log",!1,!1,{message:`${e}: ${String(r+1)}`,prefix:e})}countReset(e="default"){this.countMap.has(e)?this.countMap.delete(e):this.logger("warn",!1,!1,{message:`Count for ${e} does not exist`,prefix:e})}clear(){console.clear()}raw(e,...r){this.disabled||this.logger("log",!0,!1,{context:r,message:e})}extendReporter(e){return typeof e.setLoggerTypes=="function"&&e.setLoggerTypes(this.types),typeof e.setStringify=="function"&&e.setStringify(this.stringify),e}registerReporters(e){for(let r=0;r<e.length;r+=1)this.reporters.add(this.extendReporter(e[r]))}registerProcessors(e){for(let r=0;r<e.length;r+=1){const s=e[r];typeof s.setStringify=="function"&&s.setStringify(this.stringify),this.processors.add(s)}}#e(e,r){if(r)this.rawReporter.log(Object.freeze(e));else for(const s of this.reporters)s.log(Object.freeze(e))}#t(e){return e&&this.logLevels[e]?e:"debug"}#s(e,r,...s){const i={badge:void 0,context:void 0,error:void 0,label:void 0,message:Je,prefix:void 0,repeated:void 0,scope:void 0,suffix:void 0};if(i.type={level:r.logLevel,name:e},i.groups=this.groups,i.scope=this.scopeName,i.date=new Date,s.length>0&&s[0]instanceof Error)i.error=s[0],s.length>1&&(i.context=s.slice(1));else if(s.length>0&&typeof s[0]=="object"&&s[0]!==null&&"message"in s[0]){const{context:o,message:a,prefix:n,suffix:c}=s[0];if(o&&(i.context=o),n&&(i.prefix=n),c&&(i.suffix=c),i.message=a,s.length>1){const u=s.slice(1);i.context?i.context=Array.isArray(i.context)?[...i.context,...u]:[i.context,...u]:i.context=u}}else s.length>1?(i.message=s[0],i.context=s.slice(1)):s.length===1?i.message=s[0]:i.message=void 0;return r.logLevel==="trace"&&(i.traceError=new Error("Trace")),r.badge&&(i.badge=r.badge),r.label&&(i.label=r.label),i}logger(e,r,s,...i){if(this.disabled)return;if(this.paused){this.messageQueue.push({messageObject:i,raw:r,type:e});return}const o=this.types[e],a=this.#t(o.logLevel);if(s||this.logLevels[a]>=this.logLevels[this.generalLogLevel]){let n=this.#s(e,o,...i);const c=Ve((l=!1)=>{const h=(this.lastLog.count??0)-this.throttleMin;if(this.lastLog.object&&h>0){const p={...this.lastLog.object};h>1&&(p.repeated=h),this.#e(p,r),this.lastLog.count=1}if(l){for(const p of this.processors)n={...p.process(n)};this.lastLog.object=n,this.#e(n,r)}},"resolveLog");clearTimeout(this.lastLog.timeout);const u=this.lastLog.time&&n.date?new Date(n.date).getTime()-this.lastLog.time.getTime():0;if(this.lastLog.time=new Date(n.date),u<this.throttle)try{if(this.lastLog.object&&JSON.stringify([n.label,n.scope,n.type,n.message,n.prefix,n.suffix,n.context])===JSON.stringify([this.lastLog.object.label,this.lastLog.object.scope,this.lastLog.object.type,this.lastLog.object.message,this.lastLog.object.prefix,this.lastLog.object.suffix,this.lastLog.object.context])&&(this.lastLog.count=(this.lastLog.count??0)+1,this.lastLog.count>this.throttleMin)){this.lastLog.timeout=setTimeout(c,this.throttle);return}}catch{}c(!0)}}}var Ds=Object.defineProperty,qs=y((t,e)=>Ds(t,"name",{value:e,configurable:!0}),"c$1");let Vs=class{static{y(this,"v")}static{qs(this,"RawReporter")}#r;#e;#t;#s=!1;#i;constructor(t={}){this.#r=Ze,this.#e=Xe,this.#i=t}setStdout(t){this.#r=t}setStderr(t){this.#e=t}setInteractiveManager(t){this.#t=t}setIsInteractive(t){this.#s=t}log(t){const{context:e,groups:r,message:s,type:i}=t,o=[];if(s!==Je){const u=typeof s=="string"?s:Se(s,this.#i);o.push(u)}e&&o.push(...e.map(u=>typeof u=="object"?` ${Se(u,this.#i)}`:` ${String(u)}`));const a=["error","trace","warn"].includes(i.level)?"stderr":"stdout",n=a==="stderr"?this.#e:this.#r,c=r.map(()=>" ").join("");this.#s&&this.#t!==void 0&&n.isTTY?this.#t.update(a,(c+o.join("")).split(`
|
|
34
|
+
`),0):yt(c+o.join(""),n)}};var Hs=Object.defineProperty,Js=y((t,e)=>Hs(t,"name",{value:e,configurable:!0}),"m$1");class st extends rt{static{y(this,"c")}constructor(e){const r=e.parentStderr,s=e.parentStdout,{interactive:i,processors:o,rawReporter:a,reporters:n,stderr:c,stdout:u}=e,l=r??c,h=s??u,p=e.parentLongestLabel,w=e.parentTypes,{parentLogLevels:N,parentMessages:k,parentStringify:v}=e,B={disabled:e.disabled,logLevel:e.logLevel,logLevels:e.logLevels,messages:e.messages,processors:[],rawReporter:e.rawReporter,reporters:[],scope:e.scope,throttle:e.throttle,throttleMin:e.throttleMin},V="types"in e;w&&p&&!V?(B.parentTypes=w,B.parentLongestLabel=p):V&&e.types!==void 0&&(B.types=e.types),v&&(B.parentStringify=v),N&&!e.logLevels&&(B.parentLogLevels=N),k&&!e.messages&&(B.parentMessages=k),super(B),this.options=e,this.interactive=i??!1,this.stdout=h,this.stderr=l,this.interactive&&(this.interactiveManager=new Dr(new Ee(this.stdout),new Ee(this.stderr))),Array.isArray(n)&&this.registerReporters(n),this.rawReporter=this.extendReporter(a??new Vs),Array.isArray(o)&&this.registerProcessors(o)}options;static{Js(this,"PailServerImpl")}stdout;stderr;interactiveManager;interactive;scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.scopeName=e.flat(),this}child(e){const r=e?.types!==void 0,s=r?qe(this.types,e.types):this.types,i=e?.reporters??[],o=i.length>0?[...this.reporters,...i]:[...this.reporters],a=e?.processors??[],n=a.length>0?[...this.processors,...a]:[...this.processors],c=e?.logLevels?{...this.logLevels,...e.logLevels}:this.logLevels;let u;if(e?.scope){const p=De(e.scope).filter(Boolean);u=this.scopeName.length>0?[...this.scopeName,...p]:p}else u=this.scopeName.length>0?this.scopeName:[];const l=e?.messages?{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage,...e.messages}:{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage},h={disabled:e?.disabled??this.disabled,interactive:e?.interactive??this.interactive,logLevel:e?.logLevel??this.generalLogLevel,logLevels:c,messages:l,processors:n,rawReporter:e?.rawReporter??this.rawReporter,reporters:o,scope:u,stderr:e?.stderr??this.stderr,stdout:e?.stdout??this.stdout,throttle:e?.throttle??this.throttle,throttleMin:e?.throttleMin??this.throttleMin};return this.#r(h,e,r,s),new st(h)}#r(e,r,s,i){s?(e.parentTypes=i,e.parentLongestLabel=xe(i)):(e.parentTypes=this.types,e.parentLongestLabel=this.longestLabel),r?.logLevels||(e.parentLogLevels=this.logLevels),r?.messages||(e.parentMessages={timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage}),e.parentStringify=this.stringify,r?.stdout||(e.parentStdout=this.stdout),r?.stderr||(e.parentStderr=this.stderr)}getInteractiveManager(){return this.interactiveManager}wrapStd(){this.#e(this.stdout,"log"),this.#e(this.stderr,"log")}restoreStd(){this.#t(this.stdout),this.#t(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout.write(ft),this.stderr.write(ft)}extendReporter(e){return typeof e.setStdout=="function"&&e.setStdout(this.stdout),typeof e.setStderr=="function"&&e.setStderr(this.stderr),typeof e.setLoggerTypes=="function"&&e.setLoggerTypes(this.types),typeof e.setStringify=="function"&&e.setStringify(this.stringify),typeof e.setIsInteractive=="function"&&e.setIsInteractive(this.interactive),this.interactive&&typeof e.setInteractiveManager=="function"&&e.setInteractiveManager(this.interactiveManager),e}#e(e,r){e&&(e.__write||(e.__write=e.write),e.write=s=>{this[r](String(s).trim())})}#t(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}}const Gs=st;var Us=Object.defineProperty,zs=y((t,e)=>Us(t,"name",{value:e,configurable:!0}),"x"),Ks=Object.defineProperty,Ct=zs((t,e)=>Ks(t,"name",{value:e,configurable:!0}),"h"),Ys=Object.defineProperty,pe=Ct((t,e)=>Ys(t,"name",{value:e,configurable:!0}),"g$1");const gt=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"]]),Qs=/^#([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})?$/i,Zs=/^#([\dA-F])([\dA-F])([\dA-F])([\dA-F])?$/i,Xs=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,ei=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,Wt=pe(()=>({__proto__:null,backgroundColor:null,color:null,fontStyle:null,fontWeight:null,textDecorationColor:null,textDecorationLine:[]}),"getDefaultCss"),dt=/\s+/,Te=pe(t=>{gt.has(t)&&(t=gt.get(t));const e=Qs.exec(t);if(e)return[Number.parseInt(e[1],16),Number.parseInt(e[2],16),Number.parseInt(e[3],16)];const r=Zs.exec(t);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 s=Xs.exec(t);if(s)return[Math.round(Math.max(0,Math.min(255,Number(s[1])))),Math.round(Math.max(0,Math.min(255,Number(s[2])))),Math.round(Math.max(0,Math.min(255,Number(s[3]))))];const i=ei.exec(t);if(i){let o=Number(i[1])%360;o<0&&(o+=360);const a=Math.max(0,Math.min(100,Number(i[2])))/100,n=Math.max(0,Math.min(100,Number(i[3])))/100,c=(1-Math.abs(2*n-1))*a,u=c*(1-Math.abs(o/60%2-1)),l=n-c/2;let h,p,w;return o<60?{0:h,1:p,2:w}=[c,u,0]:o<120?{0:h,1:p,2:w}=[u,c,0]:o<180?{0:h,1:p,2:w}=[0,c,u]:o<240?{0:h,1:p,2:w}=[0,u,c]:o<300?{0:h,1:p,2:w}=[u,0,c]:{0:h,1:p,2:w}=[c,0,u],[Math.round((h+l)*255),Math.round((p+l)*255),Math.round((w+l)*255)]}return null},"parseCssColor"),Fe=pe((t,e)=>t?.[0]===e?.[0]&&t?.[1]===e?.[1]&&t?.[2]===e?.[2],"colorEquals"),ti=pe(t=>{const e=Wt(),r=[];let s=!1,i=null,o=0,a="";for(const n of t){if(n==="(")o+=1;else if(o>0)n===")"&&(o-=1);else if(s){if(n===";"){const c=a.trim();c!==""&&r.push([i,c]),i=null,a="",s=!1;continue}}else if(n===":"){i=a.trim(),a="",s=!0;continue}a+=n}if(s&&o===0){const n=a.trim();n!==""&&r.push([i,n]),i=null,a=""}for(const{0:n,1:c}of r)switch(n){case"background-color":{c!=null&&(e.backgroundColor=c);break}case"color":{c!=null&&(e.color=c);break}case"font-style":{["italic","oblique","oblique 14deg"].includes(c)&&(e.fontStyle="italic");break}case"font-weight":{c==="bold"&&(e.fontWeight=c);break}case"text-decoration":{e.textDecorationColor=null,e.textDecorationLine=[];const u=c.split(dt);for(const l of u){const h=Te(l);h!=null?e.textDecorationColor=h:["line-through","overline","underline"].includes(l)&&e.textDecorationLine.push(l)}break}case"text-decoration-color":{const u=Te(c);u!=null&&(e.textDecorationColor=u);break}case"text-decoration-line":{e.textDecorationLine=[];const u=c.split(dt);for(const l of u)["line-through","overline","underline"].includes(l)&&e.textDecorationLine.push(l);break}}return e},"parseCss"),ri=pe((t,e)=>{e=e??Wt();let r="";if(!Fe(t.backgroundColor,e.backgroundColor))if(t.backgroundColor==null)r+="\x1B[49m";else switch(t.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(t.backgroundColor)){const{0:s,1:i,2:o}=t.backgroundColor;r+=`\x1B[48;2;${String(s)};${String(i)};${String(o)}m`}else{const s=Te(t.backgroundColor);if(s===null)r+="\x1B[49m";else{const{0:i,1:o,2:a}=s;r+=`\x1B[48;2;${String(i)};${String(o)};${String(a)}m`}}}if(!Fe(t.color,e.color))if(t.color==null)r+="\x1B[39m";else switch(t.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(t.color)){const{0:s,1:i,2:o}=t.color;r+=`\x1B[38;2;${String(s)};${String(i)};${String(o)}m`}else{const s=Te(t.color);if(s===null)r+="\x1B[39m";else{const{0:i,1:o,2:a}=s;r+=`\x1B[38;2;${String(i)};${String(o)};${String(a)}m`}}}if(t.fontWeight!==e.fontWeight&&(r+=t.fontWeight==="bold"?"\x1B[1m":"\x1B[22m"),t.fontStyle!==e.fontStyle&&(r+=t.fontStyle==="italic"?"\x1B[3m":"\x1B[23m"),!Fe(t.textDecorationColor,e.textDecorationColor))if(t.textDecorationColor==null)r+="\x1B[59m";else{const{0:s,1:i,2:o}=t.textDecorationColor;r+=`\x1B[58;2;${String(s)};${String(i)};${String(o)}m`}return t.textDecorationLine.includes("line-through")!==e.textDecorationLine.includes("line-through")&&(r+=t.textDecorationLine.includes("line-through")?"\x1B[9m":"\x1B[29m"),t.textDecorationLine.includes("overline")!==e.textDecorationLine.includes("overline")&&(r+=t.textDecorationLine.includes("overline")?"\x1B[53m":"\x1B[55m"),t.textDecorationLine.includes("underline")!==e.textDecorationLine.includes("underline")&&(r+=t.textDecorationLine.includes("underline")?"\x1B[4m":"\x1B[24m"),r},"cssToAnsi");var si=Object.defineProperty,it=Ct((t,e)=>si(t,"name",{value:e,configurable:!0}),"y");const ii=it(t=>{try{return JSON.stringify(t)}catch{return'"[Circular]"'}},"tryStringify"),pt="%".codePointAt(0),ni="s".codePointAt(0),oi="d".codePointAt(0),ai="f".codePointAt(0),li="i".codePointAt(0),ci="O".codePointAt(0),ui="o".codePointAt(0),fi="j".codePointAt(0),hi="c".codePointAt(0),gi=it((t,e=[],r={})=>{if(typeof t!="string"&&typeof t!="object"||t===null)throw new TypeError(`fmt must be a string or object, got ${t===null?"null":typeof t}`);const s=r.stringify??ii,i=1;if(typeof t=="object"){const l=e.length+i;if(l===1)return"{}";const h=Array.from({length:l});h[0]=s(t);for(let p=1;p<l;p+=1)h[p]=s(e[p-i]);return h.join(" ")}if(e.length===0)return t;let o="",a=1-i,n=-1,c=!1,u;for(let l=0;l<t.length;){if(t.codePointAt(l)===pt&&l+1<t.length){n=n>-1?n:0;const h=t.codePointAt(l+1);if(h===void 0){a+=1;break}switch(h){case hi:{if(globalThis.window===void 0){const p=ti(e[a]);n<l&&(o+=t.slice(n,l)),o+=ri(p,u),o!==""&&(c=!0,u=p)}n=l+2,l+=1;break}case oi:case ai:{if(a>=e.length||e[a]==null)break;n<l&&(o+=t.slice(n,l)),o+=Number(e[a]).toString(),n=l+2,l+=1;break}case li:{if(a>=e.length||e[a]==null)break;n<l&&(o+=t.slice(n,l)),o+=Math.floor(Number(e[a])).toString(),n=l+2,l+=1;break}case fi:case ci:case ui:{if(a>=e.length||e[a]===void 0)break;n<l&&(o+=t.slice(n,l));const p=e[a],w=typeof p;if(w==="string"){o+=`'${p}'`,n=l+2;break}if(w==="function"){o+=p.name?`[Function: ${p.name}]`:"[Function: <anonymous>]",n=l+2;break}o+=s(p),n=l+2,l+=1;break}case pt:{n<l&&(o+=t.slice(n,l)),o+="%",n=l+2,l+=1,a-=1;break}case ni:{if(a>=e.length)break;n<l&&(o+=t.slice(n,l)),o+=typeof e[a]=="object"?s(e[a]):String(e[a]),n=l+2,l+=1;break}default:typeof r.formatters?.[h]=="function"&&(n<l&&(o+=t.slice(n,l)),o+=r.formatters[h](e[a]),n=l+2,l+=1)}a+=1}l+=1}return n===-1?t:(n<t.length&&(o+=t.slice(n)),c&&(o+="\x1B[0m"),o)},"format"),di=it((t={})=>{const e={};return typeof t.formatters=="object"&&Object.entries(t.formatters).forEach(([r,s])=>{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 s!="function")throw new TypeError(`Formatter for %${r} is not a function`);const i=r.codePointAt(0);if(i===void 0)throw new Error(`${r}.codePointAt(0) failed to return a value, please report this issue`);e[i]=s}),(r,s=[],i={})=>gi(r,s,{...i,formatters:e})},"build");var pi=Object.defineProperty,mt=y((t,e)=>pi(t,"name",{value:e,configurable:!0}),"i$1");let mi=class{static{y(this,"g")}static{mt(this,"MessageFormatterProcessor")}#r;#e;constructor(t={}){this.#e=t.formatters}setStringify(t){this.#r=t}process(t){const e=di({formatters:this.#e,stringify:mt(r=>this.#r?this.#r(r):JSON.stringify(r),"stringify")});return t.message!==void 0&&(t.message=this.#t(e,t.message,t.context??[])),t}#t(t,e,r=[]){if(typeof e=="string")return t(e,r);if(typeof e=="object"&&e!==null){const s=e,i=Object.keys(s);for(let o=0;o<i.length;o+=1){const a=i[o],n=s[a];(typeof n=="string"||Array.isArray(n)||typeof n=="object")&&(s[a]=this.#t(t,n,r))}}return e}};var bi=Object.defineProperty,Dt=y((t,e)=>bi(t,"name",{value:e,configurable:!0}),"M");const{bgGrey:yi,cyan:wi,green:$i,greenBright:vi,grey:U,red:Re,underline:bt,white:xi}=wt,Si=/[\\/]pail[\\/]dist/,_e=Dt(t=>!Si.test(t),"pailFileFilter");class ki extends Gt{static{y(this,"PrettyReporter")}static{Dt(this,"PrettyReporter")}#r;#e;#t;#s=!1;#i;#n;constructor(e={}){const{error:r,inspect:s,...i}=e;super({uppercase:{label:!0,...i.uppercase},...i}),this.#i={...Ut,...s},this.#n={...r,color:{fileLine:$i,hint:wi,marker:Re,message:Re,method:vi,title:Re}},this.#r=Ze,this.#e=Xe}setStdout(e){this.#r=e}setStderr(e){this.#e=e}setInteractiveManager(e){this.#t=e}setIsInteractive(e){this.#s=e}log(e){this._log(this._formatMessage(e),e.type.level)}_formatMessage(e){const{columns:r}=zt();let s=r;typeof this.styles.messageLength=="number"&&(s=this.styles.messageLength);const{badge:i,context:o,date:a,error:n,file:c,groups:u,label:l,message:h,prefix:p,repeated:w,scope:N,suffix:k,traceError:v,type:B}=e,{color:V}=this.loggerTypes[B.name],H=V?wt[V]:xi,d=u.map(()=>" ").join(""),g=[];if(u.length>0&&g.push(`${d+U(`[${u.at(-1)??""}]`)} `),a&&g.push(`${U(this.styles.dateFormatter(typeof a=="string"?new Date(a):a))} `),i)g.push(H(i));else{const L=Kt(this.loggerTypes);L.length>0&&g.push(`${U(".".repeat(L.length))} `)}const $=xe(this.loggerTypes);if(l){const L=be($),R=be(l);g.push(`${H(Yt(l,this.styles))} `,U(".".repeat(Math.max(0,L-R))))}else g.push(U(".".repeat($.length+2)));w&&g.push(`${yi.white(`[${String(w)}x]`)} `),Array.isArray(N)&&N.length>0&&g.push(` ${U(`[${N.join(" > ")}]`)} `),p&&g.push(`${U(`${Array.isArray(N)&&N.length>0?". ":" "}[${this.styles.underline.prefix?bt(p):p}]`)} `);const I=be(g.join(" "));if(c){const L=(c.name??"")+(c.line?`:${String(c.line)}`:""),R=be(L);if(R+I+2>s)g.push(U(` ${L}`));else{const J=Math.max(0,s-I-R-2);g.push(U(`${".".repeat(J)} ${L}`))}}else g.push(U(".".repeat(Math.max(0,s-I-1))));if(g.length>0&&g.push(`
|
|
31
35
|
|
|
32
|
-
`),h!==
|
|
36
|
+
`),h!==Je){const L=typeof h=="string"?h:Se(h,this.#i);g.push(d+Qt(L,{trim:!1,width:s-3,wrapMode:Zt.STRICT_WIDTH}))}if(o){let L=!1;g.push(...o.map(R=>{if(R instanceof Error)return L=!0,`
|
|
33
37
|
|
|
34
|
-
${
|
|
38
|
+
${Be(R,{...this.#n,filterStacktrace:_e,prefix:d})}`;if(typeof R=="object")return` ${Se(R,this.#i)}`;const J=(L?`
|
|
35
39
|
|
|
36
|
-
`:" ")+String(
|
|
40
|
+
`:" ")+String(R);return L=!1,J}))}return n&&g.push(Be(n,{...this.#n,filterStacktrace:_e,prefix:d})),v&&g.push(`
|
|
37
41
|
|
|
38
|
-
${
|
|
39
|
-
`,d+
|
|
40
|
-
`),0):
|
|
41
|
-
`,i)}}var
|
|
42
|
+
${Be(v,{...this.#n,filterStacktrace:_e,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:d})}`),k&&g.push(`
|
|
43
|
+
`,d+U(this.styles.underline.suffix?bt(k):k)),g.join("")}_log(e,r){const s=["error","trace","warn"].includes(r)?"stderr":"stdout",i=s==="stderr"?this.#e:this.#r;this.#s&&this.#t!==void 0&&i.isTTY?this.#t.update(s,e.split(`
|
|
44
|
+
`),0):yt(`${e}
|
|
45
|
+
`,i)}}var Ei=Object.defineProperty,qt=y((t,e)=>Ei(t,"name",{value:e,configurable:!0}),"o");const Ti=qt(()=>he.NODE_ENV==="debug"||he.DEBUG!==void 0?"debug":he.NODE_ENV==="test"?"warning":"informational","getDefaultLogLevel"),Vt=qt(t=>{let e=Ti();return he.PAIL_LOG_LEVEL!==void 0&&(e=he.PAIL_LOG_LEVEL),new Gs({logLevel:e,processors:[new mi],reporters:[new ki],stderr:Xe,stdout:Ze,...t})},"createPail");Vt();const Bi=async(t,e={})=>{const{debug:r,environment:s,logger:i,mode:o,tsconfigPath:a,...n}={debug:!1,environment:"production",logger:{},mode:"build",tsconfigPath:void 0,...e},c={reporters:[new Xt({error:{hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0}})],scope:"packem",...i},u=Vt(c);await er(t,o,s,u,r,n,a)};export{Bi as packem};
|