Socket
Socket
Sign inDemoInstall

@visulima/boxen

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@visulima/boxen - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

21

CHANGELOG.md

@@ -0,1 +1,22 @@

## @visulima/boxen [1.0.2](https://github.com/visulima/visulima/compare/@visulima/boxen@1.0.1...@visulima/boxen@1.0.2) (2024-03-26)
### Bug Fixes
* **boxen:** adding cjs and esm package test ([#382](https://github.com/visulima/visulima/issues/382)) ([ac08502](https://github.com/visulima/visulima/commit/ac0850202a40db238358adf3f08c3b7ef3e842ba))
### Miscellaneous Chores
* better code-coverage ([51d8efb](https://github.com/visulima/visulima/commit/51d8efb36b20fb878e128cdbb25d3ac5c81f79f4))
* updated all devDependencies ([133b1ca](https://github.com/visulima/visulima/commit/133b1cac6783bc1ecf8140972ef16bd7b68976f1))
* updated dev dependencies ([5f0bcd6](https://github.com/visulima/visulima/commit/5f0bcd6e6ec6e86303eb7d28d029f062294f3464))
* updated dev dependencies ([130b82c](https://github.com/visulima/visulima/commit/130b82c07879326db4975c7073137a24fc8b5e7a))
* updated dev dependencies ([956b7b3](https://github.com/visulima/visulima/commit/956b7b3a18d9fac12b0ac3b87f99680f169f824e))
### Continuous Integration
* improved vitest and tsup config ([#367](https://github.com/visulima/visulima/issues/367)) ([82fb585](https://github.com/visulima/visulima/commit/82fb585da639c916b770afe6617d735d15a4195c))
## @visulima/boxen [1.0.1](https://github.com/visulima/visulima/compare/@visulima/boxen@1.0.0...@visulima/boxen@1.0.1) (2024-03-09)

@@ -2,0 +23,0 @@

28

dist/index.js

@@ -1,14 +0,22 @@

import N from 'cli-boxes';
import d from 'string-width';
import k from 'terminal-size';
import R from 'wrap-ansi';
import xD from 'cli-boxes';
import p from 'node:process';
import { execFileSync } from 'node:child_process';
import S from 'node:fs';
import aD from 'node:tty';
var E=(r,i)=>Math.floor((r-i)/2),j=(r,i)=>r-i,p=(r,i={})=>{let e=i.align??"center";if(e==="left")return r;let t=i.split??`
`,a=i.pad??" ",n=e==="right"?j:E,l=!1;Array.isArray(r)||(l=!0,r=String(r).split(t));let m,f=0;return r=r.map(s=>(s=String(s),m=d(s),f=Math.max(m,f),{str:s,width:m})).map(s=>Array.from({length:n(f,s.width)+1}).join(a)+s.str),l?r.join(t):r};var M=r=>{let i=0;for(let e of r.split(`
`))i=Math.max(i,d(e));return i};var u=`
`,c=" ",y="none",S=r=>typeof r=="number"?{bottom:r,left:r*3,right:r*3,top:r}:{bottom:0,left:0,right:0,top:0,...r},L=r=>r===y?0:2,P=r=>{let i=["topLeft","topRight","bottomRight","bottomLeft","left","right","top","bottom"],e;if(r===y){r={};for(let t of i)r[t]="";}if(typeof r=="string"){let t=N[r];if(t===void 0)throw new TypeError(`Invalid border style: ${r}`);e=t;}else {typeof r.vertical=="string"&&(r.left=r.vertical,r.right=r.vertical),typeof r.horizontal=="string"&&(r.top=r.horizontal,r.bottom=r.horizontal);for(let t of i)if(r[t]===null||typeof r[t]!="string")throw new TypeError(`Invalid border style: ${t}`);e=r;}return e},A=(r,i,e,t,a)=>{let n="";r=i(r);let l=d(r);switch(a){case"left":{n=r+t(e.slice(l),d(e.slice(l)));break}case"right":{n=t(e.slice(l+2),d(e.slice(l))+2)+" "+r+" ";break}default:{if(e=e.slice(l),e.length%2===1)e=e.slice(Math.floor(e.length/2)),n=t(e.slice(1),d(e.slice(1)))+r+t(e,d(e));else {e=e.slice(e.length/2);let m=d(e);n=t(e,m)+r+t(e,m);}break}}return n},I=(r,{height:i,padding:e,textAlignment:t,width:a})=>{r=p(r,{align:t});let n=r.split(u),l=M(r),m=a-e.left-e.right;if(l>m){let h=[];for(let T of n){let g=R(T,m,{hard:!0}),o=p(g,{align:t}).split(`
`),x=Math.max(...o.map(w=>d(w)));for(let w of o){let C;switch(t){case"center":{C=c.repeat((m-x)/2)+w;break}case"right":{C=c.repeat(m-x)+w;break}default:{C=w;break}}h.push(C);}}n=h;}t==="center"&&l<m?n=n.map(h=>c.repeat((m-l)/2)+h):t==="right"&&l<m&&(n=n.map(h=>c.repeat(m-l)+h));let f=c.repeat(e.left),s=c.repeat(e.right);return n=n.map(h=>{let T=f+h+s;return T+c.repeat(a-d(T))}),e.top>0&&(n=[...Array.from({length:e.top}).fill(c.repeat(a)),...n]),e.bottom>0&&(n=[...n,...Array.from({length:e.bottom}).fill(c.repeat(a))]),i&&n.length>i?n=n.slice(0,i):i&&n.length<i&&(n=[...n,...Array.from({length:i-n.length}).fill(c.repeat(a))]),n.join(u)},$=(r,i,e,t)=>{let a=(g,b,o)=>t.borderColor?t.borderColor(g,b,o):g,n=g=>t.headerTextColor?t.headerTextColor(g):g,l=g=>t.footerTextColor?t.footerTextColor(g):g,m=g=>t.textColor?t.textColor(g):g,f=P(t.borderStyle),s=c.repeat(t.margin.left);if(t.float==="center"){let g=Math.max((e-i-L(t.borderStyle))/2,0);s=c.repeat(g);}else if(t.float==="right"){let g=Math.max(e-i-t.margin.right-L(t.borderStyle),0);s=c.repeat(g);}let h="";if(t.margin.top&&(h+=u.repeat(t.margin.top)),t.borderStyle!==y||t.headerText){let g=a(f.top.repeat(i),"top",i);t.headerText&&(g=A(t.headerText,n,f.top.repeat(i),(o,x)=>a(o,"top",x),t.headerAlignment));let b=a(s+f.topLeft,"topLeft",d(s+f.topLeft));h+=b+g+a(f.topRight,"topRight",d(f.topRight))+u;}let T=r.split(u);if(h+=T.map(g=>s+a(f.left,"left",d(f.left))+m(g)+a(f.right,"right",d(f.right))).join(u),t.borderStyle!==y||t.footerText){let g=u+a(s+f.bottomLeft,"bottomLeft",d(s+f.bottomLeft)),b=a(f.bottom.repeat(i),"bottom",i);t.footerText&&(b=A(t.footerText,l,f.bottom.repeat(i),(o,x)=>a(o,"bottom",x),t.footerAlignment)),h+=g+b+a(f.bottomRight,"bottomRight",d(f.bottomRight));}return t.margin.bottom&&(h+=u.repeat(t.margin.bottom)),h},W=r=>{if(r.fullscreen){let i=k();typeof r.fullscreen=="function"&&(i=r.fullscreen(i.columns,i.rows)),r.width||(r.width=i.columns),r.height||(r.height=i.rows);}return r.width&&(r.width=Math.max(1,r.width-L(r.borderStyle))),r.height&&(r.height=Math.max(1,r.height-L(r.borderStyle))),r},D=(r,i)=>i===y?r:` ${r} `,q=(r,i,e)=>{e=W(e);let t=e.width!==void 0,a=L(e.borderStyle),n=i-e.margin.left-e.margin.right-a,l=M(R(r,i-a,{hard:!0,trim:!1}))+e.padding.left+e.padding.right;if(e.headerText&&t?(e.headerText=e.headerText.slice(0,Math.max(0,e.width-2)),e.headerText&&(e.headerText=D(e.headerText,e.borderStyle))):e.headerText&&(e.headerText=e.headerText.slice(0,Math.max(0,n-2)),e.headerText&&(e.headerText=D(e.headerText,e.borderStyle),d(e.headerText)>l&&(e.width=d(e.headerText)))),e.width=e.width||l,!t){if(e.margin.left&&e.margin.right&&e.width>n){let f=(i-e.width-a)/(e.margin.left+e.margin.right);e.margin.left=Math.max(0,Math.floor(e.margin.left*f)),e.margin.right=Math.max(0,Math.floor(e.margin.right*f));}e.width=Math.min(e.width,i-a-e.margin.left-e.margin.right);}return e.width-(e.padding.left+e.padding.right)<=0&&(e.padding.left=0,e.padding.right=0),e.height&&e.height-(e.padding.top+e.padding.bottom)<=0&&(e.padding.top=0,e.padding.bottom=0),e},ee=(r,i={})=>{if(i.borderColor!==void 0&&typeof i.borderColor!="function")throw new Error('"borderColor" is not a valid function');if(i.textColor!==void 0&&typeof i.textColor!="function")throw new Error('"backgroundColor" is not a valid function');let e={borderStyle:"single",dimBorder:!1,float:"left",footerAlignment:"right",headerAlignment:"left",textAlignment:"left",transformTabToSpace:4,...i};e.padding=S(i.padding??0),e.margin=S(i.margin),e.transformTabToSpace&&(r=r.replaceAll(" "," ".repeat(e.transformTabToSpace)));let{columns:t}=k();return e=q(r,t,e),$(I(r,e),e.width,t,e)};
function R({onlyFirst:D=!1}={}){let F=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(F,D?void 0:"g")}var ED=R();function x(D){if(typeof D!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(ED,"")}function G(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function K(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function P(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9800&&D<=9811||D===9855||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12771||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=19903||D>=19968&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D===94192||D===94193||D>=94208&&D<=100343||D>=100352&&D<=101589||D>=101632&&D<=101640||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128727||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129672||D>=129680&&D<=129725||D>=129727&&D<=129733||D>=129742&&D<=129755||D>=129760&&D<=129768||D>=129776&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}function nD(D){if(!Number.isSafeInteger(D))throw new TypeError(`Expected a code point, got \`${typeof D}\`.`)}function U(D,{ambiguousAsWide:F=!1}={}){return nD(D),K(D)||P(D)||F&&G(D)?2:1}var Z=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDF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EC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;var iD=new Intl.Segmenter;function B(D,F={}){if(typeof D!="string"||D.length===0)return 0;let{ambiguousIsNarrow:u=!0,countAnsiEscapeCodes:e=!1}=F;if(e||(D=x(D)),D.length===0)return 0;let t=0,r={ambiguousAsWide:!u};for(let{segment:E}of iD.segment(D)){let C=E.codePointAt(0);if(!(C<=31||C>=127&&C<=159)&&!(C>=768&&C<=879)){if(Z().test(E)){t+=2;continue}t+=U(C,r);}}return t}var Y=80,q=24,I=(D,F,{shell:u,env:e}={})=>execFileSync(D,F,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:u,env:e}).trim(),N=(D,F)=>({columns:Number.parseInt(D,10),rows:Number.parseInt(F,10)}),H=(D,F)=>{let{columns:u,rows:e}=N(D,F);if(!(Number.isNaN(u)||Number.isNaN(e))&&!(u===Y&&e===q))return {columns:u,rows:e}};function O(){let{env:D,stdout:F,stderr:u}=p;if(F?.columns&&F?.rows)return N(F.columns,F.rows);if(u?.columns&&u?.rows)return N(u.columns,u.rows);if(D.COLUMNS&&D.LINES)return N(D.COLUMNS,D.LINES);let e={columns:Y,rows:q};return p.platform==="win32"?k()??e:p.platform==="darwin"?V()??k()??e:V()??k()??sD()??e}var V=()=>{try{let D=p.platform==="darwin"?S.constants.O_EVTONLY|S.constants.O_NONBLOCK:S.constants.O_NONBLOCK,{columns:F,rows:u}=aD.WriteStream(S.openSync("/dev/tty",D));return {columns:F,rows:u}}catch{}},k=()=>{try{let D=I("tput",["cols"],{env:{TERM:"dumb",...p.env}}),F=I("tput",["lines"],{env:{TERM:"dumb",...p.env}});if(D&&F)return H(D,F)}catch{}},sD=()=>{try{let D=I("resize",["-u"]).match(/\d+/g);if(D.length===2)return H(D[0],D[1])}catch{}};var J=(D=0)=>F=>`\x1B[${F+D}m`,Q=(D=0)=>F=>`\x1B[${38+D};5;${F}m`,X=(D=0)=>(F,u,e)=>`\x1B[${38+D};2;${F};${u};${e}m`,a={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(a.modifier);var oD=Object.keys(a.color),fD=Object.keys(a.bgColor);[...oD,...fD];function lD(){let D=new Map;for(let[F,u]of Object.entries(a)){for(let[e,t]of Object.entries(u))a[e]={open:`\x1B[${t[0]}m`,close:`\x1B[${t[1]}m`},u[e]=a[e],D.set(t[0],t[1]);Object.defineProperty(a,F,{value:u,enumerable:!1});}return Object.defineProperty(a,"codes",{value:D,enumerable:!1}),a.color.close="\x1B[39m",a.bgColor.close="\x1B[49m",a.color.ansi=J(),a.color.ansi256=Q(),a.color.ansi16m=X(),a.bgColor.ansi=J(10),a.bgColor.ansi256=Q(10),a.bgColor.ansi16m=X(10),Object.defineProperties(a,{rgbToAnsi256:{value:(F,u,e)=>F===u&&u===e?F<8?16:F>248?231:Math.round((F-8)/247*24)+232:16+36*Math.round(F/255*5)+6*Math.round(u/255*5)+Math.round(e/255*5),enumerable:!1},hexToRgb:{value:F=>{let u=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!u)return [0,0,0];let[e]=u;e.length===3&&(e=[...e].map(r=>r+r).join(""));let t=Number.parseInt(e,16);return [t>>16&255,t>>8&255,t&255]},enumerable:!1},hexToAnsi256:{value:F=>a.rgbToAnsi256(...a.hexToRgb(F)),enumerable:!1},ansi256ToAnsi:{value:F=>{if(F<8)return 30+F;if(F<16)return 90+(F-8);let u,e,t;if(F>=232)u=((F-232)*10+8)/255,e=u,t=u;else {F-=16;let C=F%36;u=Math.floor(F/36)/5,e=Math.floor(C/6)/5,t=C%6/5;}let r=Math.max(u,e,t)*2;if(r===0)return 30;let E=30+(Math.round(t)<<2|Math.round(e)<<1|Math.round(u));return r===2&&(E+=60),E},enumerable:!1},rgbToAnsi:{value:(F,u,e)=>a.ansi256ToAnsi(a.rgbToAnsi256(F,u,e)),enumerable:!1},hexToAnsi:{value:F=>a.ansi256ToAnsi(a.hexToAnsi256(F)),enumerable:!1}}),a}var AD=lD(),z=AD;var M=new Set(["\x1B","\x9B"]),gD=39,_="\x07",FD="[",cD="]",eD="m",L=`${cD}8;;`,DD=D=>`${M.values().next().value}${FD}${D}${eD}`,uD=D=>`${M.values().next().value}${L}${D}${_}`,mD=D=>D.split(" ").map(F=>B(F)),$=(D,F,u)=>{let e=[...F],t=!1,r=!1,E=B(x(D.at(-1)));for(let[C,n]of e.entries()){let s=B(n);if(E+s<=u?D[D.length-1]+=n:(D.push(n),E=0),M.has(n)&&(t=!0,r=e.slice(C+1,C+1+L.length).join("")===L),t){r?n===_&&(t=!1,r=!1):n===eD&&(t=!1);continue}E+=s,E===u&&C<e.length-1&&(D.push(""),E=0);}!E&&D.at(-1).length>0&&D.length>1&&(D[D.length-2]+=D.pop());},dD=D=>{let F=D.split(" "),u=F.length;for(;u>0&&!(B(F[u-1])>0);)u--;return u===F.length?D:F.slice(0,u).join(" ")+F.slice(u).join("")},hD=(D,F,u={})=>{if(u.trim!==!1&&D.trim()==="")return "";let e="",t,r,E=mD(D),C=[""];for(let[l,i]of D.split(" ").entries()){u.trim!==!1&&(C[C.length-1]=C.at(-1).trimStart());let o=B(C.at(-1));if(l!==0&&(o>=F&&(u.wordWrap===!1||u.trim===!1)&&(C.push(""),o=0),(o>0||u.trim===!1)&&(C[C.length-1]+=" ",o++)),u.hard&&E[l]>F){let A=F-o,c=1+Math.floor((E[l]-A-1)/F);Math.floor((E[l]-1)/F)<c&&C.push(""),$(C,i,F);continue}if(o+E[l]>F&&o>0&&E[l]>0){if(u.wordWrap===!1&&o<F){$(C,i,F);continue}C.push("");}if(o+E[l]>F&&u.wordWrap===!1){$(C,i,F);continue}C[C.length-1]+=i;}u.trim!==!1&&(C=C.map(l=>dD(l)));let n=C.join(`
`),s=[...n],f=0;for(let[l,i]of s.entries()){if(e+=i,M.has(i)){let{groups:A}=new RegExp(`(?:\\${FD}(?<code>\\d+)m|\\${L}(?<uri>.*)${_})`).exec(n.slice(f))||{groups:{}};if(A.code!==void 0){let c=Number.parseFloat(A.code);t=c===gD?void 0:c;}else A.uri!==void 0&&(r=A.uri.length===0?void 0:A.uri);}let o=z.codes.get(Number(t));s[l+1]===`
`?(r&&(e+=uD("")),t&&o&&(e+=DD(o))):i===`
`&&(t&&o&&(e+=DD(t)),r&&(e+=uD(r))),f+=i.length;}return e};function v(D,F,u){return String(D).normalize().replaceAll(`\r
`,`
`).split(`
`).map(e=>hD(e,F,u)).join(`
`)}var bD=(D,F)=>Math.floor((D-F)/2),pD=(D,F)=>D-F,W=(D,F={})=>{let u=F.align??"center";if(u==="left")return D;let e=F.split??`
`,t=F.pad??" ",r=u==="right"?pD:bD,E=!1;Array.isArray(D)||(E=!0,D=String(D).split(e));let C,n=0;return D=D.map(s=>(s=String(s),C=B(s),n=Math.max(C,n),{str:s,width:C})).map(s=>Array.from({length:r(n,s.width)+1}).join(t)+s.str),E?D.join(e):D};var j=D=>{let F=0;for(let u of D.split(`
`))F=Math.max(F,B(u));return F};var h=`
`,g=" ",w="none",tD=D=>typeof D=="number"?{bottom:D,left:D*3,right:D*3,top:D}:{bottom:0,left:0,right:0,top:0,...D},y=D=>D===w?0:2,wD=D=>{let F=["topLeft","topRight","bottomRight","bottomLeft","left","right","top","bottom"],u;if(D===w){D={};for(let e of F)D[e]="";}if(typeof D=="string"){let e=xD[D];if(e===void 0)throw new TypeError(`Invalid border style: ${D}`);u=e;}else {typeof D.vertical=="string"&&(D.left=D.vertical,D.right=D.vertical),typeof D.horizontal=="string"&&(D.top=D.horizontal,D.bottom=D.horizontal);for(let e of F)if(D[e]===null||typeof D[e]!="string")throw new TypeError(`Invalid border style: ${e}`);u=D;}return u},rD=(D,F,u,e,t)=>{let r="";D=F(D);let E=B(D);switch(t){case"left":{r=D+e(u.slice(E),B(u.slice(E)));break}case"right":{r=e(u.slice(E+2),B(u.slice(E))+2)+" "+D+" ";break}default:{if(u=u.slice(E),u.length%2===1)u=u.slice(Math.floor(u.length/2)),r=e(u.slice(1),B(u.slice(1)))+D+e(u,B(u));else {u=u.slice(u.length/2);let C=B(u);r=e(u,C)+D+e(u,C);}break}}return r},yD=(D,{height:F,padding:u,textAlignment:e,width:t})=>{D=W(D,{align:e});let r=D.split(h),E=j(D),C=t-u.left-u.right;if(E>C){let f=[];for(let l of r){let i=v(l,C,{hard:!0}),A=W(i,{align:e}).split(`
`),c=Math.max(...A.map(b=>B(b)));for(let b of A){let T;switch(e){case"center":{T=g.repeat((C-c)/2)+b;break}case"right":{T=g.repeat(C-c)+b;break}default:{T=b;break}}f.push(T);}}r=f;}e==="center"&&E<C?r=r.map(f=>g.repeat((C-E)/2)+f):e==="right"&&E<C&&(r=r.map(f=>g.repeat(C-E)+f));let n=g.repeat(u.left),s=g.repeat(u.right);return r=r.map(f=>{let l=n+f+s;return l+g.repeat(t-B(l))}),u.top>0&&(r=[...Array.from({length:u.top}).fill(g.repeat(t)),...r]),u.bottom>0&&(r=[...r,...Array.from({length:u.bottom}).fill(g.repeat(t))]),F&&r.length>F?r=r.slice(0,F):F&&r.length<F&&(r=[...r,...Array.from({length:F-r.length}).fill(g.repeat(t))]),r.join(h)},TD=(D,F,u,e)=>{let t=(i,o,A)=>e.borderColor?e.borderColor(i,o,A):i,r=i=>e.headerTextColor?e.headerTextColor(i):i,E=i=>e.footerTextColor?e.footerTextColor(i):i,C=i=>e.textColor?e.textColor(i):i,n=wD(e.borderStyle),s=g.repeat(e.margin.left);if(e.float==="center"){let i=Math.max((u-F-y(e.borderStyle))/2,0);s=g.repeat(i);}else if(e.float==="right"){let i=Math.max(u-F-e.margin.right-y(e.borderStyle),0);s=g.repeat(i);}let f="";if(e.margin.top&&(f+=h.repeat(e.margin.top)),e.borderStyle!==w||e.headerText){let i=t(n.top.repeat(F),"top",F);e.headerText&&(i=rD(e.headerText,r,n.top.repeat(F),(A,c)=>t(A,"top",c),e.headerAlignment));let o=t(s+n.topLeft,"topLeft",B(s+n.topLeft));f+=o+i+t(n.topRight,"topRight",B(n.topRight))+h;}let l=D.split(h);if(f+=l.map(i=>s+t(n.left,"left",B(n.left))+C(i)+t(n.right,"right",B(n.right))).join(h),e.borderStyle!==w||e.footerText){let i=h+t(s+n.bottomLeft,"bottomLeft",B(s+n.bottomLeft)),o=t(n.bottom.repeat(F),"bottom",F);e.footerText&&(o=rD(e.footerText,E,n.bottom.repeat(F),(A,c)=>t(A,"bottom",c),e.footerAlignment)),f+=i+o+t(n.bottomRight,"bottomRight",B(n.bottomRight));}return e.margin.bottom&&(f+=h.repeat(e.margin.bottom)),f},SD=D=>{if(D.fullscreen){let F=O();typeof D.fullscreen=="function"&&(F=D.fullscreen(F.columns,F.rows)),D.width||(D.width=F.columns),D.height||(D.height=F.rows);}return D.width&&(D.width=Math.max(1,D.width-y(D.borderStyle))),D.height&&(D.height=Math.max(1,D.height-y(D.borderStyle))),D},CD=(D,F)=>F===w?D:` ${D} `,ND=(D,F,u)=>{u=SD(u);let e=u.width!==void 0,t=y(u.borderStyle),r=F-u.margin.left-u.margin.right-t,E=j(v(D,F-t,{hard:!0,trim:!1}))+u.padding.left+u.padding.right;if(u.headerText&&e?(u.headerText=u.headerText.slice(0,Math.max(0,u.width-2)),u.headerText&&(u.headerText=CD(u.headerText,u.borderStyle))):u.headerText&&(u.headerText=u.headerText.slice(0,Math.max(0,r-2)),u.headerText&&(u.headerText=CD(u.headerText,u.borderStyle),B(u.headerText)>E&&(u.width=B(u.headerText)))),u.width=u.width||E,!e){if(u.margin.left&&u.margin.right&&u.width>r){let n=(F-u.width-t)/(u.margin.left+u.margin.right);u.margin.left=Math.max(0,Math.floor(u.margin.left*n)),u.margin.right=Math.max(0,Math.floor(u.margin.right*n));}u.width=Math.min(u.width,F-t-u.margin.left-u.margin.right);}return u.width-(u.padding.left+u.padding.right)<=0&&(u.padding.left=0,u.padding.right=0),u.height&&u.height-(u.padding.top+u.padding.bottom)<=0&&(u.padding.top=0,u.padding.bottom=0),u},hu=(D,F={})=>{if(F.borderColor!==void 0&&typeof F.borderColor!="function")throw new Error('"borderColor" is not a valid function');if(F.textColor!==void 0&&typeof F.textColor!="function")throw new Error('"backgroundColor" is not a valid function');let u={borderStyle:"single",dimBorder:!1,float:"left",footerAlignment:"right",headerAlignment:"left",textAlignment:"left",transformTabToSpace:4,...F};u.padding=tD(F.padding??0),u.margin=tD(F.margin),u.transformTabToSpace&&(D=D.replaceAll(" "," ".repeat(u.transformTabToSpace)));let{columns:e}=O();return u=ND(D,e,u),TD(yD(D,u),u.width,e,u)};
export { ee as boxen };
export { hu as boxen };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.js.map
{
"name": "@visulima/boxen",
"version": "1.0.1",
"version": "1.0.2",
"description": "Util.format-like string formatting utility.",

@@ -86,6 +86,3 @@ "keywords": [

"dependencies": {
"cli-boxes": "^3.0.0",
"string-width": "^7.1.0",
"terminal-size": "^4.0.0",
"wrap-ansi": "^9.0.0"
"cli-boxes": "^3.0.0"
},

@@ -96,8 +93,8 @@ "devDependencies": {

"@anolilab/semantic-release-preset": "^8.0.3",
"@babel/core": "^7.24.0",
"@babel/core": "^7.24.3",
"@rushstack/eslint-plugin-security": "^0.8.1",
"@types/node": "18.18.14",
"@visulima/colorize": "1.3.0",
"@vitest/coverage-v8": "^1.3.1",
"@vitest/ui": "^1.3.1",
"@vitest/coverage-v8": "^1.4.0",
"@vitest/ui": "^1.4.0",
"cross-env": "^7.0.3",

@@ -109,12 +106,15 @@ "eslint": "^8.57.0",

"eslint-plugin-mdx": "^3.1.5",
"eslint-plugin-vitest": "^0.3.22",
"eslint-plugin-vitest-globals": "^1.4.0",
"eslint-plugin-vitest": "^0.3.26",
"eslint-plugin-vitest-globals": "^1.5.0",
"prettier": "^3.2.5",
"quick-format-unescaped": "^4.0.4",
"rimraf": "^5.0.5",
"semantic-release": "^23.0.2",
"semantic-release": "^23.0.5",
"sort-package-json": "^2.8.0",
"string-width": "^7.1.0",
"terminal-size": "^4.0.0",
"tsup": "^8.0.2",
"typescript": "^5.4.2",
"vitest": "^1.3.1"
"typescript": "^5.4.3",
"vitest": "^1.4.0",
"wrap-ansi": "^9.0.0"
},

@@ -124,2 +124,7 @@ "engines": {

},
"os": [
"darwin",
"linux",
"win32"
],
"publishConfig": {

@@ -126,0 +131,0 @@ "access": "public",

@@ -502,3 +502,3 @@ <div align="center">

If you would like to help take a look at the [list of issues](https://github.com/visulima/visulima/issues) and check our [Contributing](.github/CONTRIBUTING.md) guild.
If you would like to help take a look at the [list of issues](https://github.com/visulima/visulima/issues) and check our [Contributing](.github/CONTRIBUTING.md) guidelines.

@@ -505,0 +505,0 @@ > **Note:** please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc