UNPKG

string-kit

Version:

A string manipulation toolbox, featuring a string formatter (inspired by sprintf), a variable inspector (output featuring ANSI colors and HTML) and various escape functions (shell argument, regexp, html, etc).

1 lines 166 kB
(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.stringKit=e()}})(function(){var e,t,a;return function(){function u(i,o,s){function l(a,e){if(!o[a]){if(!i[a]){var t="function"==typeof require&&require;if(!e&&t)return t(a,!0);if(c)return c(a,!0);var r=new Error("Cannot find module '"+a+"'");throw r.code="MODULE_NOT_FOUND",r}var n=o[a]={exports:{}};i[a][0].call(n.exports,function(e){var t=i[a][1][e];return l(t||e)},n,n.exports,u,i,o,s)}return o[a].exports}for(var c="function"==typeof require&&require,e=0;e<s.length;e++)l(s[e]);return l}return u}()({1:[function(e,t,a){"use strict";const r=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];function n(e,t={}){this.sign=1;this.digits=[];this.exposant=0;this.special=null;this.decimalSeparator=t.decimalSeparator??".";this.forceDecimalSeparator=!!t.forceDecimalSeparator;this.groupSeparator=t.groupSeparator??"";this.numerals=t.numerals??r;this.numeralZero=t.numeralZero??null;this.placeNumerals=t.placeNumerals??null;this.set(e)}t.exports=n;n.prototype.set=function(e){var t,a,r,n,i,o,s;e=+e;this.sign=1;this.digits.length=0;this.exposant=0;this.special=null;if(!Number.isFinite(e)){this.special=e;return null}e=""+e;t=e.match(/(-)?([0-9]+)(?:.([0-9]+))?(?:e([+-][0-9]+))?/);if(!t){throw new Error("Unexpected error")}this.sign=t[1]?-1:1;this.exposant=t[2].length+(parseInt(t[4],10)||0);i=0;o=false;s=0;for(r=0,n=t[2].length;r<n;r++){a=+t[2][r];if(a!==0){o=true;this.digits[i]=a;i++;s=i}else if(o){this.digits[i]=a;i++}else{this.exposant--}}if(t[3]){for(r=0,n=t[3].length;r<n;r++){a=+t[3][r];if(a!==0){o=true;this.digits[i]=a;i++;s=i}else if(o){this.digits[i]=a;i++}else{this.exposant--}}}if(s!==i){this.digits.length=s}};n.prototype.toNumber=function(){if(this.special!==null){return this.special}return parseFloat((this.sign<0?"-":"")+"0."+this.digits.join("")+"e"+this.exposant)};n.prototype.toString=function(...e){if(this.special!==null){return""+this.special}if(this.exposant>20||this.exposant<-20){return this.toScientificString(...e)}return this.toNoExpString(...e)};n.prototype.toExponential=n.prototype.toExponentialString=function(){if(this.special!==null){return""+this.special}var e=this.sign<0?"-":"";if(!this.digits.length){return e+"0"}e+=this.digits[0];if(this.digits.length>1){e+=this.decimalSeparator+this.digits.join("").slice(1)}e+="e"+(this.exposant>0?"+":"")+(this.exposant-1);return e};const i=["⁰","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹"];const o="⁺";const s="⁻";const l="0".charCodeAt(0);n.prototype.toScientific=n.prototype.toScientificString=function(){if(this.special!==null){return""+this.special}var e=this.sign<0?"-":"";if(!this.digits.length){return e+"0"}e+=this.digits[0];if(this.digits.length>1){e+=this.decimalSeparator+this.digits.join("").slice(1)}var t=(this.exposant<=0?s:"")+(""+Math.abs(this.exposant-1)).split("").map(e=>i[e.charCodeAt(0)-l]).join("");e+=" × 10"+t;return e};n.prototype.toNoExp=n.prototype.toNoExpString=function(e=1,t=0,a=false,r=false,n=this.exposant){if(this.special!==null){return""+this.special}var i=[],o=[],s=this.sign<0?"-":r?"+":"";if(!this.digits.length){if(e>1){this.fillZeroes(i,e-1,e)}i.push(this.numeralZero??this.placeNumerals?.[0]?.[0]??this.numerals[0]);if(t&&!a){this.fillZeroes(o,t)}}else if(n<=0){this.fillZeroes(i,e);this.fillZeroes(o,-n,t-this.digits.length);this.appendNumerals(o,this.digits,undefined,undefined,-n-1);if(t&&this.digits.length-n<t){this.fillZeroes(o,t-this.digits.length+n)}}else if(n>=this.digits.length){if(n<e){this.fillZeroes(i,e-n,n-1)}this.appendNumerals(i,this.digits,undefined,undefined,n-1);this.fillZeroes(i,n-this.digits.length);if(t&&!a){this.fillZeroes(o,t)}}else{if(n<e){this.fillZeroes(i,e-n)}this.appendNumerals(i,this.digits,0,n,n-1);this.appendNumerals(o,this.digits,n,undefined,this.digits.length-n);if(t&&this.digits.length-n<t&&(!a||this.digits.length-n>0)){this.fillZeroes(o,t-this.digits.length+n)}}s+=this.groupSeparator?this.groupDigits(i,this.groupSeparator):i.join("");if(o.length){s+=this.decimalSeparator+(this.decimalGroupSeparator?this.groupDigits(o,this.decimalGroupSeparator):o.join(""))}else if(this.forceDecimalSeparator){s+=this.decimalSeparator}return s};const c=["","k","M","G","T","P","E","Z","Y"];const u=["","m","µ","n","p","f","a","z","y"];n.prototype.toMetric=n.prototype.toMetricString=function(e=1,t=0,a=false,r=false){if(this.special!==null){return""+this.special}if(!this.digits.length){return this.sign>0?"0":"-0"}var n="",i;if(this.exposant>0){i=1+(this.exposant-1)%3;n=c[Math.floor((this.exposant-1)/3)];if(n===undefined){return this.toScientificString()}}else{i=3- -this.exposant%3;n=u[1+Math.floor(-this.exposant/3)];if(n===undefined){return this.toScientificString()}}return this.toNoExpString(e,t,a,r,i)+n};n.prototype.precision=function(a,e=0){var t;if(this.special!==null||a>=this.digits.length){return this}if(a<0){this.digits.length=0;return this}e*=this.sign;if(e<0){t=this.digits.length>a+4&&this.digits[a]===9&&this.digits[a+1]===9&&this.digits[a+2]===9&&this.digits[a+3]===9&&this.digits[a+4]===9}else if(e>0){t=this.digits[a]>0||this.digits[a+1]>0||this.digits[a+2]>0||this.digits[a+3]>0||this.digits[a+4]>0}else{t=this.digits[a]>=5}if(t){let e=a-1,t=false;for(;e>=0;e--){if(this.digits[e]<9){this.digits[e]++;t=true;break}else{this.digits[e]=0}}if(!t){this.exposant++;this.digits[0]=1;this.digits.length=1}else{this.digits.length=e+1}}else{this.digits.length=a;this.removeTrailingZero()}return this};n.prototype.round=function(e=0,t=0){var a=this.exposant+e;return this.precision(a,t)};n.prototype.floor=function(e=0){var t=this.exposant+e;return this.precision(t,-1)};n.prototype.ceil=function(e=0){var t=this.exposant+e;return this.precision(t,1)};n.prototype.removeTrailingZero=function(){var e=this.digits.length-1;while(e>=0&&this.digits[e]===0){e--}this.digits.length=e+1};const g=3;n.prototype.groupDigits=function(e,t,a=false){var r="",n=a?0:g-e.length%g,i=0,o=e.length;for(;i<o;i++){r+=i&&(i+n)%g===0?t+e[i]:e[i]}return r};n.prototype.appendNumerals=function(r,n,e=0,i=n.length,o=i){for(let t=e,a=o;t<i;t++,a--){let e=this.placeNumerals?.[a]??this.numerals;r.push(e[n[t]]??n[t])}return r};n.prototype.fillZeroes=function(a,r,n=r-1){for(let e=0,t=n;e<r;e++,t--){let e=this.placeNumerals?.[t]??this.numerals;a.push(e[0]??0)}return a};const f={numeralZero:"N",placeNumerals:[["","I","II","III","IV","V","VI","VII","VIII","IX"],["","X","XX","XXX","XL","L","LX","LXX","LXXX","XC"],["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM"],["","M","MM","MMM","MMMM","ↁ","ↁↀ","ↁↀↀ","ↁↀↀↀ","ↁↀↀↀↀ"]]};const p={numeralZero:"N",placeNumerals:[["","I","II","III","IIII","V","VI","VII","VIII","VIIII"],["","X","XX","XXX","XXXX","L","LX","LXX","LXXX","LXXXX"],["","C","CC","CCC","CCCC","D","DC","DCC","DCCC","DCCCC"],["","M","MM","MMM","MMMM","ↁ","ↁↀ","ↁↀↀ","ↁↀↀↀ","ↁↀↀↀↀ"]]};const h={numeralZero:"N",placeNumerals:[["","I","II","III","IV","V","VI","VII","VIII","IX"],["","X","XX","XXX","XL","L","LX","LXX","LXXX","XC"],["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM"],["","M","MM","MMM","MMMM","IↃↃ","IↃↃCIↃ","IↃↃCIↃCIↃ","IↃↃCIↃCIↃCIↃ","IↃↃCIↃCIↃCIↃCIↃ"],["","CCIↃↃ","CCIↃↃCCIↃↃ","CCIↃↃCCIↃↃCCIↃↃ","CCIↃↃCCIↃↃCCIↃↃCCIↃↃ","IↃↃↃ","IↃↃↃCCIↃↃ","IↃↃↃCCIↃↃCCIↃↃ","IↃↃↃCCIↃↃCCIↃↃCCIↃↃ","IↃↃↃCCIↃↃCCIↃↃCCIↃↃCCIↃↃ"],["","CCCIↃↃↃ","CCCIↃↃↃCCCIↃↃↃ","CCCIↃↃↃCCCIↃↃↃCCCIↃↃↃ","CCCIↃↃↃCCCIↃↃↃCCCIↃↃↃCCCIↃↃↃ","IↃↃↃↃ","IↃↃↃↃCCCIↃↃↃ","IↃↃↃↃCCCIↃↃↃCCCIↃↃↃ","IↃↃↃↃCCCIↃↃↃCCCIↃↃↃCCCIↃↃↃ","IↃↃↃↃCCCIↃↃↃCCCIↃↃↃCCCIↃↃↃCCCIↃↃↃ"]]};n.roman=(e,t)=>{t=t?Object.assign({},t,f):f;return new n(e,t)};n.additiveRoman=(e,t)=>{t=t?Object.assign({},t,p):p;return new n(e,t)}},{}],2:[function(e,t,a){"use strict";const r={reset:"",bold:"",dim:"",italic:"",underline:"",inverse:"",defaultColor:"",black:"",red:"",green:"",yellow:"",blue:"",magenta:"",cyan:"",white:"",grey:"",gray:"",brightBlack:"",brightRed:"",brightGreen:"",brightYellow:"",brightBlue:"",brightMagenta:"",brightCyan:"",brightWhite:"",defaultBgColor:"",bgBlack:"",bgRed:"",bgGreen:"",bgYellow:"",bgBlue:"",bgMagenta:"",bgCyan:"",bgWhite:"",bgGrey:"",bgGray:"",bgBrightBlack:"",bgBrightRed:"",bgBrightGreen:"",bgBrightYellow:"",bgBrightBlue:"",bgBrightMagenta:"",bgBrightCyan:"",bgBrightWhite:""};t.exports=r;r.fgColor={defaultColor:r.defaultColor,black:r.black,red:r.red,green:r.green,yellow:r.yellow,blue:r.blue,magenta:r.magenta,cyan:r.cyan,white:r.white,grey:r.grey,gray:r.gray,brightBlack:r.brightBlack,brightRed:r.brightRed,brightGreen:r.brightGreen,brightYellow:r.brightYellow,brightBlue:r.brightBlue,brightMagenta:r.brightMagenta,brightCyan:r.brightCyan,brightWhite:r.brightWhite};r.bgColor={defaultColor:r.defaultBgColor,black:r.bgBlack,red:r.bgRed,green:r.bgGreen,yellow:r.bgYellow,blue:r.bgBlue,magenta:r.bgMagenta,cyan:r.bgCyan,white:r.bgWhite,grey:r.bgGrey,gray:r.bgGray,brightBlack:r.bgBrightBlack,brightRed:r.bgBrightRed,brightGreen:r.bgBrightGreen,brightYellow:r.bgBrightYellow,brightBlue:r.bgBrightBlue,brightMagenta:r.bgBrightMagenta,brightCyan:r.bgBrightCyan,brightWhite:r.bgBrightWhite};r.trueColor=(t,a,r)=>{if(a===undefined&&typeof t==="string"){let e=t;if(e[0]==="#"){e=e.slice(1)}if(e.length===3){e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]}t=parseInt(e.slice(0,2),16)||0;a=parseInt(e.slice(2,4),16)||0;r=parseInt(e.slice(4,6),16)||0}return"[38;2;"+t+";"+a+";"+r+"m"};r.bgTrueColor=(t,a,r)=>{if(a===undefined&&typeof t==="string"){let e=t;if(e[0]==="#"){e=e.slice(1)}if(e.length===3){e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]}t=parseInt(e.slice(0,2),16)||0;a=parseInt(e.slice(2,4),16)||0;r=parseInt(e.slice(4,6),16)||0}return"[48;2;"+t+";"+a+";"+r+"m"};const o={0:null,1:{bold:true},2:{dim:true},22:{bold:false,dim:false},3:{italic:true},23:{italic:false},4:{underline:true},24:{underline:false},5:{blink:true},25:{blink:false},7:{inverse:true},27:{inverse:false},8:{hidden:true},28:{hidden:false},9:{strike:true},29:{strike:false},30:{color:0},31:{color:1},32:{color:2},33:{color:3},34:{color:4},35:{color:5},36:{color:6},37:{color:7},39:{color:"default"},90:{color:8},91:{color:9},92:{color:10},93:{color:11},94:{color:12},95:{color:13},96:{color:14},97:{color:15},40:{bgColor:0},41:{bgColor:1},42:{bgColor:2},43:{bgColor:3},44:{bgColor:4},45:{bgColor:5},46:{bgColor:6},47:{bgColor:7},49:{bgColor:"default"},100:{bgColor:8},101:{bgColor:9},102:{bgColor:10},103:{bgColor:11},104:{bgColor:12},105:{bgColor:13},106:{bgColor:14},107:{bgColor:15}};r.parse=e=>{var t,a,r,n,i=[];for([,t,a]of e.matchAll(/\x1b\[([0-9;]+)m|(.[^\x1b]*)/g)){if(a){if(i.length){i[i.length-1].text+=a}else{i.push({text:a})}}else{t.split(";").forEach(e=>{n=o[e];if(n===undefined){return}if(!i.length||i[i.length-1].text){if(!n){r={text:""}}else{r=Object.assign({},r,n);r.text=""}i.push(r)}else{if(!n){i[i.length-1]={text:""}}else{Object.assign(r,n)}}})}}return i}},{}],3:[function(e,t,a){"use strict";var r={};t.exports=r;r.toCamelCase=function(e,i=false,o=false){if(!e||typeof e!=="string"){return""}return e.replace(/(?:^[\s_-]*|([\s_-]+))(([^\s_-]?)([^\s_-]*))/g,(e,t,a,r,n)=>{if(i){if(!t&&!o){return a}if(!r){return""}return r.toUpperCase()+n}if(!t&&!o){return a.toLowerCase()}if(!r){return""}return r.toUpperCase()+n.toLowerCase()})};r.camelCaseToSeparated=function(e,i=" ",t=true){if(!e||typeof e!=="string"){return""}if(!t){return e.replace(/^([A-Z])|([A-Z])/g,(e,t,a)=>{if(t){return t.toLowerCase()}return i+a.toLowerCase()})}return e.replace(/(?:(^)|)([A-Z]+)(?:($)|(?=[a-z]))/g,(e,t,a,r)=>{t=t==="";r=r==="";var n=t?"":i;return a.length===1?n+a.toLowerCase():r?n+a:a.length===2?n+a[0].toLowerCase()+i+a[1].toLowerCase():n+a.slice(0,-1)+i+a.slice(-1).toLowerCase()})};r.camelCaseToDash=r.camelCaseToDashed=e=>r.camelCaseToSeparated(e,"-",false)},{}],4:[function(e,t,a){"use strict";const r=e("./latinize.js");const n=e("./english.js");const s=e("./json-data/emoji-keyword-to-charlist.json");const l=e("./json-data/emoji-char-to-canonical-name.json");const c={};t.exports=c;c.getCanonicalName=e=>l[e];const i={};c.getKeywords=e=>{if(!l[e]){return}if(!i[e]){i[e]=c.splitIntoKeywords(l[e]);Object.freeze(i[e])}return i[e]};c.search=(e,t=false)=>{var a=c.splitIntoKeywords(e),r={},n,i=0;for(let t of a){if(!s[t]){continue}for(let e of s[t]){if(!r[e]){n=1;r[e]={emoji:e,score:n,canonical:l[e],keywords:c.getKeywords(e)}}else{n=r[e].score+1;r[e].score=n}if(n>i){i=n}}}var o=[...Object.values(r)];if(t){o=o.filter(e=>e.score===i)}o.sort((e,t)=>t.score-e.score||e.keywords.length-t.keywords.length);return o};c.searchBest=e=>c.search(e,true);c.get=e=>c.search(e,true)[0]?.emoji;c.simplifyName=e=>{e=e.toLowerCase().replace(/[“”().!]/g,"").replace(/[ ’',]/g,"-").replace(/-+/g,"-");e=r(e);return e};c.simplifyKeyword=e=>{var t=e;t=n.undoPresentParticiple(t);return t};const o=new Set(["with","of"]);c.splitIntoKeywords=(e,t=false)=>{if(!t){e=c.simplifyName(e)}var a=e.split(/-/g).filter(e=>e.length>=2&&!o.has(e));a=a.map(c.simplifyKeyword);a=[...new Set(a)];return a}},{"./english.js":5,"./json-data/emoji-char-to-canonical-name.json":10,"./json-data/emoji-keyword-to-charlist.json":11,"./latinize.js":14}],5:[function(e,t,a){"use strict";const r={};t.exports=r;const o=new Set(["a","e","i","o","u","y"]);const s=new Set(["a","i","o","u"]);const l=new Set(["s"]);const c=new Set(["v"]);const u=new Set(["w","x"]);const g=new Set(["cl","dl","gl","kl","nc","pl","tl"]);const f=new Set(["d","g","m","n","p"]);const p=new Set(["or"]);r.undoPresentParticiple=i=>{if(i.endsWith("ing")&&i.length>=6&&!i.endsWith("ghtning")){let e="ing";let t=e.length;let a=i[i.length-t-1],r=i[i.length-t-2],n=i[i.length-t-3];if(o.has(a)){i=i.slice(0,-t)}else if(o.has(r)){if(o.has(n)){if(l.has(a)&&!p.has(r+a)){i=i.slice(0,-t)+"e"}else{i=i.slice(0,-t)}}else if(s.has(r)&&!u.has(a)){i=i.slice(0,-t)+"e"}else{i=i.slice(0,-t)}}else if(a===r&&f.has(a)){i=i.slice(0,-t-1)}else if(c.has(a)||g.has(r+a)){i=i.slice(0,-t)+"e"}else{i=i.slice(0,-t)}}return i}},{}],6:[function(e,t,a){"use strict";a.regExp=a.regExpPattern=e=>e.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1");a.regExpReplacement=e=>e.replace(/\$/g,"$$$$");a.format=e=>e.replace(/%/g,"%%");a.jsSingleQuote=e=>a.control(e).replace(/'/g,"\\'");a.jsDoubleQuote=e=>a.control(e).replace(/"/g,'\\"');a.shellArg=e=>"'"+e.replace(/'/g,"'\\''")+"'";var r={"\r":"\\r","\n":"\\n","\t":"\\t","":"\\x7f"};a.control=(e,a=false)=>e.replace(/[\x00-\x1f\x7f]/g,e=>{if(a&&(e==="\n"||e==="\t")){return e}if(r[e]!==undefined){return r[e]}var t=e.charCodeAt(0).toString(16);if(t.length%2){t="0"+t}return"\\x"+t});var n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};a.html=e=>e.replace(/[&<>]/g,e=>n[e]);a.htmlAttr=e=>e.replace(/[&<>"]/g,e=>n[e]);a.htmlSpecialChars=e=>e.replace(/[&<>"']/g,e=>n[e]);a.unicodePercentEncode=e=>e.replace(/[\x00-\x1f\u0100-\uffff\x7f%]/g,e=>{try{return encodeURI(e)}catch(e){return""}});a.httpHeaderValue=e=>a.unicodePercentEncode(e)},{}],7:[function(B,e,E){(function(L){(function(){"use strict";const c=B("./inspect.js").inspect;const u=B("./inspect.js").inspectError;const t=B("./escape.js");const n=B("./ansi.js");const i=B("./unicode.js");const o=B("./naturalSort.js");const h=B("./StringNumber.js");E.formatMethod=function(...d){var m,e=d[0],b=1,y=d.length;if(typeof e!=="string"){if(!e){e=""}else if(typeof e.toString==="function"){e=e.toString()}else{e=""}}var w={hasMarkup:false,shift:null,markupStack:[]};if(this.markupReset&&this.startingMarkupReset){e=(typeof this.markupReset==="function"?this.markupReset(w.markupStack):this.markupReset)+e}e=e.replace(/\^\[([^\]]*)]?|\^(.)|(%%)|%([+-]?)([0-9]*)(?:\[([^\]]*)\])?([a-zA-Z])/g,(e,t,a,r,n,i,o,s)=>{var l,c,u,g,f,p,h=[];if(r){return"%"}if(t){a=t}if(a){if(this.noMarkup){return"^"+a}return k.call(this,w,e,a)}if(i){i=parseInt(i,10);if(n){if(n==="+"){i=b+i}else if(n==="-"){i=b-i}}}else{i=b}b++;if(i>=y||i<1){m=undefined}else{m=d[i]}if(v[s]){l=v[s](m,o,this);if(this.argumentSanitizer&&!v[s].noSanitize){l=this.argumentSanitizer(l)}if(this.escapeMarkup&&!v[s].noEscapeMarkup){l=E.escapeMarkup(l)}if(o&&!v[s].noCommonModeArg){l=C(l,o)}return l}if(s==="F"){b--;if(o===undefined){return""}u=o.split(":");g=u[0];f=u[1];if(!g){return""}if(f&&(p=f.match(/%([+-]?)([0-9]*)[a-zA-Z]/g))){for(c=0;c<p.length;c++){n=p[c][1];i=p[c][2];if(i){i=parseInt(i,10);if(n){if(n==="+"){i=b+i}else if(n==="-"){i=b-i}}}else{i=b}b++;if(i>=y||i<1){h[c]=undefined}else{h[c]=d[i]}}}if(!this||!this.fn||typeof this.fn[g]!=="function"){return""}return this.fn[g].apply(this,h)}return""});if(w.hasMarkup&&this.markupReset&&this.endingMarkupReset){e+=typeof this.markupReset==="function"?this.markupReset(w.markupStack):this.markupReset}if(this.extraArguments){for(;b<y;b++){m=d[b];if(m===null||m===undefined){continue}else if(typeof m==="string"){e+=m}else if(typeof m==="number"){e+=m}else if(typeof m.toString==="function"){e+=m.toString()}}}return e};E.markupMethod=function(l){if(typeof l!=="string"){if(!l){l=""}else if(typeof l.toString==="function"){l=l.toString()}else{l=""}}var c={hasMarkup:false,shift:null,markupStack:[]};if(this.parse){let e,t,a,r,n,i,o,s=[];for([a,r,n,i]of l.matchAll(/\^\[([^\]]*)]?|\^(.)|([^^]+)/g)){if(i){if(s.length){s[s.length-1].text+=i}else{s.push({text:i})}continue}if(r){n=r}e=k.call(this,c,a,n);if(!Array.isArray(e)){e=[e]}for(t of e){o=s.length?s[s.length-1]:null;if(typeof t==="string"){if(o){o.text+=t}else{s.push({text:t})}}else if(!t){if(o&&o.text.length&&Object.keys(o).length>1){s.push({text:""})}}else{if(o&&o.text.length){s.push(Object.assign({text:""},...c.markupStack))}else{if(o){Object.assign(o,t)}else{s.push(Object.assign({text:""},t))}}}}}return s}if(this.markupReset&&this.startingMarkupReset){l=(typeof this.markupReset==="function"?this.markupReset(c.markupStack):this.markupReset)+l}l=l.replace(/\^\[([^\]]*)]?|\^(.)/g,(e,t,a)=>k.call(this,c,e,t||a));if(c.hasMarkup&&this.markupReset&&this.endingMarkupReset){l+=typeof this.markupReset==="function"?this.markupReset(c.markupStack):this.markupReset}return l};function k(e,t,a){var r,n,i,o,s;if(a==="^"){return"^"}if(this.shiftMarkup&&this.shiftMarkup[a]){e.shift=this.shiftMarkup[a];return""}if(a.length>1&&this.dataMarkup&&(s=a.indexOf(":"))!==-1){n=a.slice(0,s);r=this.dataMarkup[n];if(r===undefined){if(this.markupCatchAll===undefined){return""}r=this.markupCatchAll}e.hasMarkup=true;i=a.slice(s+1);if(typeof r==="function"){o=r(e.markupStack,n,i)}else{o={[r]:i};l(e,o)}return o}if(e.shift){r=this.shiftedMarkup?.[e.shift]?.[a];e.shift=null}else{r=this.markup?.[a]}if(r===undefined){if(this.markupCatchAll===undefined){return""}r=this.markupCatchAll}e.hasMarkup=true;if(typeof r==="function"){o=r(e.markupStack,a)}else{o=r;l(e,o)}return o}function l(t,a){if(Array.isArray(a)){for(let e of a){if(e===null){t.markupStack.length=0}else{t.markupStack.push(e)}}}else{if(a===null){t.markupStack.length=0}else{t.markupStack.push(a)}}}E.stripMarkup=e=>e.replace(/\^\[[^\]]*]?|\^./g,e=>e==="^^"?"^":e==="^ "?" ":"");E.escapeMarkup=e=>e.replace(/\^/g,"^^");const a={argumentSanitizer:e=>t.control(e,true),extraArguments:true,color:false,noMarkup:false,escapeMarkup:false,endingMarkupReset:true,startingMarkupReset:false,markupReset:n.reset,shiftMarkup:{"#":"background"},markup:{":":n.reset," ":n.reset+" ","-":n.dim,"+":n.bold,_:n.underline,"/":n.italic,"!":n.inverse,b:n.blue,B:n.brightBlue,c:n.cyan,C:n.brightCyan,g:n.green,G:n.brightGreen,k:n.black,K:n.brightBlack,m:n.magenta,M:n.brightMagenta,r:n.red,R:n.brightRed,w:n.white,W:n.brightWhite,y:n.yellow,Y:n.brightYellow},shiftedMarkup:{background:{":":n.reset," ":n.reset+" ",b:n.bgBlue,B:n.bgBrightBlue,c:n.bgCyan,C:n.bgBrightCyan,g:n.bgGreen,G:n.bgBrightGreen,k:n.bgBlack,K:n.bgBrightBlack,m:n.bgMagenta,M:n.bgBrightMagenta,r:n.bgRed,R:n.bgBrightRed,w:n.bgWhite,W:n.bgBrightWhite,y:n.bgYellow,Y:n.bgBrightYellow}},dataMarkup:{fg:(e,t,a)=>{var r=n.fgColor[a]||n.trueColor(a);e.push(r);return r},bg:(e,t,a)=>{var r=n.bgColor[a]||n.bgTrueColor(a);e.push(r);return r}},markupCatchAll:(e,t,a)=>{var r="";if(a===undefined){if(t[0]==="#"){r=n.trueColor(t)}else if(typeof n[t]==="string"){r=n[t]}}e.push(r);return r}};a.dataMarkup.color=a.dataMarkup.c=a.dataMarkup.fgColor=a.dataMarkup.fg;a.dataMarkup.bgColor=a.dataMarkup.bg;E.createFormatter=e=>E.formatMethod.bind(Object.assign({},a,e));E.format=E.formatMethod.bind(a);E.format.default=a;E.formatNoMarkup=E.formatMethod.bind(Object.assign({},a,{noMarkup:true}));E.formatThirdPartyMarkup=E.formatMethod.bind(Object.assign({},a,{noMarkup:true,escapeMarkup:true}));E.createMarkup=e=>E.markupMethod.bind(Object.assign({},a,e));E.markup=E.markupMethod.bind(a);E.format.count=function(e,t=false){var a,r,n,i=1,o=0;if(typeof e!=="string"){return 0}var s=t?/%([+-]?)([0-9]*)(?:\[[^\]]*\])?[a-zA-EG-Z]/g:/%([+-]?)([0-9]*)(?:\[[^\]]*\])?[a-zA-EG-Z]|(\^\[[^\]]*]?|\^.)/g;for([,n,r,a]of e.matchAll(s)){if(a){continue}if(r){r=parseInt(r,10);if(n){if(n==="+"){r=i+r}else if(n==="-"){r=i-r}}}else{r=i}i++;if(o<r){o=r}}return o};E.format.hasFormatting=function(e){if(e.search(/\^(.?)|(%%)|%([+-]?)([0-9]*)(?:\[([^\]]*)\])?([a-zA-Z])/)!==-1){return true}return false};const v={};E.format.modes=v;v.s=(e,t)=>{var a=w(t);if(typeof e==="string"){return e}if(e===null||e===undefined||e===false){return a.empty?"":"("+e+")"}if(e===true){return"("+e+")"}if(typeof e==="number"){return""+e}if(typeof e.toString==="function"){return e.toString()}return"("+e+")"};v.r=e=>v.s(e);v.r.noSanitize=true;v.S=(e,t,a)=>{var r=w(t);var n=a.escapeMarkup?e=>a.argumentSanitizer?a.argumentSanitizer(e):e:e=>E.markupMethod.call(a,a.argumentSanitizer?a.argumentSanitizer(e):e);if(typeof e==="string"){return n(e)}if(e===null||e===undefined||e===false){return r.empty?"":"("+e+")"}if(e===true){return"("+e+")"}if(typeof e==="number"){return""+e}if(typeof e.toString==="function"){return n(e.toString())}return n("("+e+")")};v.S.noSanitize=true;v.S.noEscapeMarkup=true;v.S.noCommonModeArg=true;v.N=(e,t)=>M(e,t,false);v.n=(e,t)=>M(e,t,true);v.f=(e,t)=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e!=="number"){e=0}var a=b(t),r=new h(e,{decimalSeparator:".",groupSeparator:a.groupSeparator});if(a.rounding!==null){r.round(a.rounding)}if(a.precision){r.precision(a.precision)}return r.toString(a.leftPadding,a.rightPadding,a.rightPaddingOnlyIfDecimal)};v.f.noSanitize=true;v.v=(e,t)=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e!=="number"){e=0}var a=b(t),r=h.additiveRoman(e,{decimalSeparator:".",groupSeparator:a.groupSeparator});if(a.rounding!==null){r.round(a.rounding)}if(a.precision){r.precision(a.precision)}return r.toString(a.leftPadding,a.rightPadding,a.rightPaddingOnlyIfDecimal)};v.v.noSanitize=true;v.V=(e,t)=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e!=="number"){e=0}var a=b(t),r=h.roman(e,{decimalSeparator:".",groupSeparator:a.groupSeparator});if(a.rounding!==null){r.round(a.rounding)}if(a.precision){r.precision(a.precision)}return r.toString(a.leftPadding,a.rightPadding,a.rightPaddingOnlyIfDecimal)};v.V.noSanitize=true;v.P=(e,t)=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e!=="number"){e=0}e*=100;var a=b(t),r=new h(e,{decimalSeparator:".",groupSeparator:a.groupSeparator});if(a.rounding!==null||!a.precision){r.round(a.rounding||0)}if(a.precision){r.precision(a.precision)}return r.toNoExpString(a.leftPadding,a.rightPadding,a.rightPaddingOnlyIfDecimal)+"%"};v.P.noSanitize=true;v.p=(e,t)=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e!=="number"){e=0}e=(e-1)*100;var a=b(t),r=new h(e,{decimalSeparator:".",groupSeparator:a.groupSeparator});if(a.rounding!==null||!a.precision){r.round(a.rounding||0)}if(a.precision){r.precision(a.precision)}return r.toNoExpString(a.leftPadding,a.rightPadding,a.rightPaddingOnlyIfDecimal,true)+"%"};v.p.noSanitize=true;v.k=(e,t)=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e!=="number"){return"0"}var a=b(t),r=new h(e,{decimalSeparator:".",groupSeparator:a.groupSeparator});if(a.rounding!==null){r.round(a.rounding)}if(a.precision||a.rounding===null){r.precision(a.precision||3)}return r.toMetricString(a.leftPadding,a.rightPadding,a.rightPaddingOnlyIfDecimal)};v.k.noSanitize=true;v.e=(e,t)=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e!=="number"){e=0}var a=b(t),r=new h(e,{decimalSeparator:".",groupSeparator:a.groupSeparator});if(a.rounding!==null){r.round(a.rounding)}if(a.precision){r.precision(a.precision)}return r.toExponential()};v.e.noSanitize=true;v.K=(e,t)=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e!=="number"){e=0}var a=b(t),r=new h(e,{decimalSeparator:".",groupSeparator:a.groupSeparator});if(a.rounding!==null){r.round(a.rounding)}if(a.precision){r.precision(a.precision)}return r.toScientific()};v.K.noSanitize=true;v.d=v.i=e=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e==="number"){return""+Math.floor(e)}return"0"};v.i.noSanitize=true;v.u=e=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e==="number"){return""+Math.max(Math.floor(e),0)}return"0"};v.u.noSanitize=true;v.U=e=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e==="number"){return""+Math.max(Math.floor(e),1)}return"1"};v.U.noSanitize=true;v.m=e=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e!=="number"){return"(NaN)"}var t="";if(e<0){t="-";e=-e}var a=D(e),r=e-a;if(!r){return t+a+"°"}var n=D(r*60),i=D(r*3600-n*60);if(i){return t+a+"°"+(""+n).padStart(2,"0")+"′"+(""+i).padStart(2,"0")+"″"}return t+a+"°"+(""+n).padStart(2,"0")+"′"};v.m.noSanitize=true;v.T=(e,t)=>{try{e=new Date(e)}catch(e){return"(invalid)"}if(Number.isNaN(e.getTime())){return"(invalid)"}var a="",r="",n="",i=x(t),o=i.roundingType,s=i.useAbbreviation;if(i.years){if(a){a+="-"}a+=e.getFullYear()}if(i.months){if(a){a+="-"}a+=(""+(e.getMonth()+1)).padStart(2,"0")}if(i.days){if(a){a+="-"}a+=(""+e.getDate()).padStart(2,"0")}if(i.hours){if(r&&!i.useAbbreviation){r+=":"}r+=(""+e.getHours()).padStart(2,"0");if(i.useAbbreviation){r+="h"}}if(i.minutes){if(r&&!i.useAbbreviation){r+=":"}r+=(""+e.getMinutes()).padStart(2,"0");if(i.useAbbreviation){r+="min"}}if(i.seconds){if(r&&!i.useAbbreviation){r+=":"}r+=(""+e.getSeconds()).padStart(2,"0");if(i.useAbbreviation){r+="s"}}if(a){if(n){n+=" "}n+=a}if(r){if(n){n+=" "}n+=r}return n};v.T.noSanitize=true;v.t=(e,t)=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e!=="number"){return"(NaN)"}var a,r,n,i,o,s="",l=I(t),c=l.roundingType,u=l.useAbbreviation?"h":":",g=l.useAbbreviation?"min":":",f=l.useAbbreviation?"s":".",p=l.useAbbreviation;n=e/1e3;if(n<0){n=-n;c*=-1;s="-"}if(n<60&&!l.forceMinutes){i=new h(n,{decimalSeparator:f,forceDecimalSeparator:p});i.round(l.rounding,c);if(i.toNumber()<60){o=i.toString(1,l.rightPadding,l.rightPaddingOnlyIfDecimal);return s+o}n=60}r=Math.floor(n/60);n=n%60;i=new h(n,{decimalSeparator:f,forceDecimalSeparator:p});i.round(l.rounding,c);if(i.toNumber()<60){o=i.toString(2,l.rightPadding,l.rightPaddingOnlyIfDecimal)}else{r++;n=0;i.set(n);o=i.toString(2,l.rightPadding,l.rightPaddingOnlyIfDecimal)}if(r<60&&!l.forceHours){return s+r+g+o}a=Math.floor(r/60);r=r%60;return s+a+u+(""+r).padStart(2,"0")+g+o};v.t.noSanitize=true;v.h=e=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e==="number"){return""+Math.max(Math.floor(e),0).toString(16)}return"0"};v.h.noSanitize=true;v.x=e=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e!=="number"){return"00"}var t=""+Math.max(Math.floor(e),0).toString(16);if(t.length%2){t="0"+t}return t};v.x.noSanitize=true;v.o=e=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e==="number"){return""+Math.max(Math.floor(e),0).toString(8)}return"0"};v.o.noSanitize=true;v.b=e=>{if(typeof e==="string"){e=parseFloat(e)}if(typeof e==="number"){return""+Math.max(Math.floor(e),0).toString(2)}return"0"};v.b.noSanitize=true;v.X=e=>{if(typeof e==="string"){e=L.from(e)}else if(!L.isBuffer(e)){return""}return e.toString("hex")};v.X.noSanitize=true;v.z=e=>{if(typeof e==="string"){e=L.from(e)}else if(!L.isBuffer(e)){return""}return e.toString("base64")};v.Z=e=>{if(typeof e==="string"){e=L.from(e)}else if(!L.isBuffer(e)){return""}return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/[=]{1,2}$/g,"")};const r={};v.I=(e,t,a)=>A(e,t,a,r);v.I.noSanitize=true;const s={noFunc:true,enumOnly:true,noDescriptor:true,useInspect:true,useInspectPropertyBlackList:true};v.Y=(e,t,a)=>A(e,t,a,s);v.Y.noSanitize=true;const g={minimal:true,bulletIndex:true,noMarkup:true};v.O=(e,t,a)=>A(e,t,a,g);v.O.noSanitize=true;const f={};v.E=(e,t,a)=>A(e,t,a,f,true);v.E.noSanitize=true;v.J=e=>e===undefined?"null":JSON.stringify(e);v.D=()=>"";v.D.noSanitize=true;const p=/([a-zA-Z])(.[^a-zA-Z]*)/g;const d=/([a-zA-Z]|^)([^a-zA-Z]*)/g;function C(a,r){for(let[,e,t]of r.matchAll(p)){if(e==="L"){let e=i.width(a);t=+t||1;if(e>t){a=i.truncateWidth(a,t-1).trim()+"…";e=i.width(a)}if(e<t){a=" ".repeat(t-e)+a}}else if(e==="R"){let e=i.width(a);t=+t||1;if(e>t){a=i.truncateWidth(a,t-1).trim()+"…";e=i.width(a)}if(e<t){a=a+" ".repeat(t-e)}}}return a}const m={leftPadding:1,rightPadding:0,rightPaddingOnlyIfDecimal:false,rounding:null,precision:null,groupSeparator:""};function b(a){m.leftPadding=1;m.rightPadding=0;m.rightPaddingOnlyIfDecimal=false;m.rounding=null;m.precision=null;m.groupSeparator="";if(a){for(let[,e,t]of a.matchAll(d)){if(e==="z"){m.leftPadding=+t}else if(e==="g"){m.groupSeparator=t||" "}else if(!e){if(t[0]==="."){let e=t[t.length-1];if(e==="!"){m.rounding=m.rightPadding=parseInt(t.slice(1,-1),10)||0}else if(e==="?"){m.rounding=m.rightPadding=parseInt(t.slice(1,-1),10)||0;m.rightPaddingOnlyIfDecimal=true}else{m.rounding=parseInt(t.slice(1),10)||0}}else if(t[t.length-1]==="."){m.rounding=-parseInt(t.slice(0,-1),10)||0}else{m.precision=parseInt(t,10)||null}}}}return m}const y={empty:false};function w(a){y.empty=false;if(a){for(let[,e,t]of a.matchAll(d)){if(e==="e"){y.empty=true}}}return y}const S={useAbbreviation:false,rightPadding:0,rightPaddingOnlyIfDecimal:false,years:true,months:true,days:true,hours:true,minutes:true,seconds:true};function x(a){S.rightPadding=0;S.rightPaddingOnlyIfDecimal=false;S.rounding=0;S.roundingType=-1;S.years=S.months=S.days=false;S.hours=S.minutes=S.seconds=false;S.useAbbreviation=false;var r=false;if(a){for(let[,e,t]of a.matchAll(d)){if(e==="T"){S.years=S.months=S.days=false;S.hours=S.minutes=S.seconds=true;r=true}else if(e==="D"){S.years=S.months=S.days=true;S.hours=S.minutes=S.seconds=false;r=true}else if(e==="Y"){S.years=true;r=true}else if(e==="M"){S.months=true;r=true}else if(e==="d"){S.days=true;r=true}else if(e==="h"){S.hours=true;r=true}else if(e==="m"){S.minutes=true;r=true}else if(e==="s"){S.seconds=true;r=true}else if(e==="r"){S.roundingType=0}else if(e==="f"){S.roundingType=-1}else if(e==="c"){S.roundingType=1}else if(e==="a"){S.useAbbreviation=true}else if(!e){if(t[0]==="."){let e=t[t.length-1];if(e==="!"){S.rounding=S.rightPadding=parseInt(t.slice(1,-1),10)||0}else if(e==="?"){S.rounding=S.rightPadding=parseInt(t.slice(1,-1),10)||0;S.rightPaddingOnlyIfDecimal=true}else{S.rounding=parseInt(t.slice(1),10)||0}}}}}if(!r){S.years=S.months=S.days=true;S.hours=S.minutes=S.seconds=true}return S}const j={useAbbreviation:false,rightPadding:0,rightPaddingOnlyIfDecimal:false,rounding:0,roundingType:-1,forceHours:false,forceMinutes:false};function I(a){j.rightPadding=0;j.rightPaddingOnlyIfDecimal=false;j.rounding=0;j.roundingType=-1;j.useAbbreviation=j.forceHours=j.forceMinutes=false;if(a){for(let[,e,t]of a.matchAll(d)){if(e==="h"){j.forceHours=j.forceMinutes=true}else if(e==="m"){j.forceMinutes=true}else if(e==="r"){j.roundingType=0}else if(e==="f"){j.roundingType=-1}else if(e==="c"){j.roundingType=1}else if(e==="a"){j.useAbbreviation=true}else if(!e){if(t[0]==="."){let e=t[t.length-1];if(e==="!"){j.rounding=j.rightPadding=parseInt(t.slice(1,-1),10)||0}else if(e==="?"){j.rounding=j.rightPadding=parseInt(t.slice(1,-1),10)||0;j.rightPaddingOnlyIfDecimal=true}else{j.rounding=parseInt(t.slice(1),10)||0}}}}}return j}function M(e,a,t){var r=2;if(a){for(let[,e,t]of a.matchAll(d)){if(!e){r=parseInt(t,10)||1}}}return z(e,t,r,0)}function z(e,t,a,r){if(typeof e==="string"){return e}if(e===null||e===undefined||e===true||e===false){return""+e}if(typeof e==="number"){return v.f(e,".3g ")}if(e instanceof Set){e=[...e]}if(Array.isArray(e)){if(r>=a){return"[...]"}e=e.map(e=>z(e,true,a,r+1));if(t){return"["+e.join(",")+"]"}return e.join(", ")}if(L.isBuffer(e)){e=[...e].map(e=>{e=e.toString(16);if(e.length===1){e="0"+e}return e});return"<"+e.join(" ")+">"}var n=Object.getPrototypeOf(e);if(n===null||n===Object.prototype){if(r>=a){return"{...}"}e=Object.entries(e).sort(o).map(e=>e[0]+": "+z(e[1],true,a,r+1));if(t){return"{"+e.join(", ")+"}"}return e.join(", ")}if(typeof e.inspect==="function"){return e.inspect()}if(typeof e.toString==="function"){return e.toString()}return"("+e+")"}function A(e,a,t,r,n=false){var i,o,s=3,l=t&&t.color?"color":"none";if(a){for(let[,e,t]of a.matchAll(d)){if(e==="c"){if(t==="+"){l="color"}else if(t==="-"){l="none"}}else if(e==="i"){l="inline"}else if(e==="l"){i=parseInt(t,10)||undefined}else if(e==="s"){o=parseInt(t,10)||undefined}else if(!e){s=parseInt(t,10)||1}}}if(n){return u(Object.assign({depth:s,style:l,outputMaxLength:i,maxLength:o},r),e)}return c(Object.assign({depth:s,style:l,outputMaxLength:i,maxLength:o},r),e)}const P=1e-10;const O=Math.round(1/P);function T(e){return Math.round(e*O)/O}function D(e){return Math.floor(e+P)}function e(e,t){return T(t*Math.round(e*(1/t)))}}).call(this)}).call(this,B("buffer").Buffer)},{"./StringNumber.js":1,"./ansi.js":2,"./escape.js":6,"./inspect.js":9,"./naturalSort.js":16,"./unicode.js":20,buffer:22}],8:[function(e,t,a){"use strict";const C={};t.exports=C;C.score=(e,t)=>{if(e===t){return 1}if(e.length===0||t.length===0){return 0}return Math.max(0,1-C.levenshtein(e,t)/t.length)};const S=0;const x=.88;const v=.9;C.bestMatch=(e,t,a={})=>{var r=a.scoreLimit||S,n,i,o,s,l=-1,c=null;for(n=0,i=t.length;n<i;n++){s=t[n];o=C.score(e,s);if(o===1){return a.indexOf?n:s}if(o>r){r=o;c=s;l=n}}return a.indexOf?l:c};C.topMatch=(a,e,t={})=>{var r=t.scoreLimit||S,n=t.deltaRate||v,i,o,s;s=e.map((e,t)=>({pattern:e,index:t,score:C.score(a,e)}));s.sort((e,t)=>t.score-e.score);if(s[0].score<=r){return[]}r=Math.max(r,s[0].score*n);for(i=1,o=s.length;i<o;i++){if(s[i].score<r){s.length=i;break}}return t.indexOf?s.map(e=>e.index):s.map(e=>e.pattern)};const r=new Set(["a","an","the","this","that","those","some","of","in","on","at","my","your","her","his","its","our","their"]);function j(e,t=r){return e.split(/[ '"/|,:_-]+/g).filter(e=>e&&!t.has(e))}C.bestTokenMatch=(e,t,a={})=>{var r=a.scoreLimit||S,n=a.tokenDisparityPenalty||x,i,o,s,l,c,u,g,f,p,h,d=r,m,b,y=j(e),w,k=-1,v=null;if(!y.length||!t.length){return a.indexOf?k:v}for(i=0,o=t.length;i<o;i++){g=t[i];f=j(g);h=0;for(s=0,l=y.length;s<l;s++){m=y[s];w=0;for(c=0,u=f.length;c<u;c++){p=f[c];b=C.score(m,p);if(b>w){w=b;if(b===1){break}}}h+=w}h/=y.length;if(y.length!==f.length){h*=n**Math.abs(f.length-y.length)}if(h>d){d=h;v=g;k=i}}return a.indexOf?k:v};C.topTokenMatch=(e,t,a={})=>{var r=a.scoreLimit||S,n=a.tokenDisparityPenalty||x,i=a.deltaRate||v,o,s,l,c,u,g,f,p,h,d,m,b,y=j(e),w,k=[];if(!y.length||!t.length){return[]}for(o=0,s=t.length;o<s;o++){f=t[o];p=j(f);d=0;for(l=0,c=y.length;l<c;l++){m=y[l];w=0;for(u=0,g=p.length;u<g;u++){h=p[u];b=C.score(m,h);if(b>w){w=b;if(b===1){break}}}d+=w}d/=y.length;if(y.length!==p.length){d*=n**Math.abs(p.length-y.length)}k.push({pattern:f,index:o,score:d})}k.sort((e,t)=>t.score-e.score);if(k[0].score<=r){return[]}r=Math.max(r,k[0].score*i);for(o=1,s=k.length;o<s;o++){if(k[o].score<r){k.length=o;break}}return a.indexOf?k.map(e=>e.index):k.map(e=>e.pattern)};const g=[];const f=[];C.levenshtein=(t,a)=>{if(t===a){return 0}if(t.length>a.length){let e=t;t=a;a=e}let e=t.length;let r=a.length;while(e>0&&t.charCodeAt(e-1)===a.charCodeAt(r-1)){e--;r--}let n=0;while(n<e&&t.charCodeAt(n)===a.charCodeAt(n)){n++}e-=n;r-=n;if(e===0){return r}let i;let o;let s;let l;let c=0;let u=0;while(c<e){f[c]=t.charCodeAt(n+c);g[c]=++c}while(u<r){i=a.charCodeAt(n+u);s=u++;o=u;for(c=0;c<e;c++){l=i===f[c]?s:s+1;s=g[c];o=g[c]=s>o?l>o?o+1:l:l>s?s+1:l}}return o}},{}],9:[function(t,e,a){(function(z,g){(function(){"use strict";const C=t("./escape.js");const n=t("./ansi.js");const S={};const x=new Set([Object,Array]);function o(e,t){if(arguments.length<2){t=e;e={}}else if(!e||typeof e!=="object"){e={}}var a={depth:0,ancestors:[]};if(!e.style){e.style=u.none}else if(typeof e.style==="string"){e.style=u[e.style]}if(e.depth===undefined){e.depth=3}if(e.maxLength===undefined){e.maxLength=250}if(e.outputMaxLength===undefined){e.outputMaxLength=5e3}if(e.nofunc){e.noFunc=true}if(e.minimal){e.noFunc=true;e.noDescriptor=true;e.noType=true;e.noArrayProperty=true;e.enumOnly=true;e.proto=false;e.funcDetails=false}if(e.minimalPlusConstructor){e.noFunc=true;e.noDescriptor=true;e.noTypeButConstructor=true;e.noArrayProperty=true;e.enumOnly=true;e.proto=false;e.funcDetails=false}var r=j(a,e,t);if(r.length>e.outputMaxLength){r=e.style.truncate(r,e.outputMaxLength)}return r}a.inspect=o;function j(t,a,e){var r,n,i,o,s,l,c,u,g,f,p,h,d,m="",b="",y="",w="",k,v;g=typeof e;if(t.depth){w=(a.tab??a.style.tab).repeat(a.noMarkup?t.depth-1:t.depth)}if(g==="function"&&a.noFunc){return""}if(t.key!==undefined){if(t.descriptor){y=[];if(t.descriptor.error){y="["+t.descriptor.error+"]"}else{if(!t.descriptor.configurable){y.push("-conf")}if(!t.descriptor.enumerable){y.push("-enum")}if(!t.descriptor.writable){y.push("-w")}if(y.length){y=y.join(" ")}else{y=""}}}if(t.keyIsProperty){if(!a.noMarkup&&I(t.key)){b='"'+a.style.key(t.key)+'": '}else{b=a.style.key(t.key)+": "}}else if(a.bulletIndex){b=(typeof a.bulletIndex==="string"?a.bulletIndex:"*")+" "}else if(!a.noIndex){b=a.style.index(t.key)}if(y){y=" "+a.style.type(y)}}f=t.noPre?"":w+b;if(e===undefined){m+=f+a.style.constant("undefined")+y+a.style.newline}else if(e===S){m+=f+a.style.constant("[empty]")+y+a.style.newline}else if(e===null){m+=f+a.style.constant("null")+y+a.style.newline}else if(e===false){m+=f+a.style.constant("false")+y+a.style.newline}else if(e===true){m+=f+a.style.constant("true")+y+a.style.newline}else if(g==="number"){m+=f+a.style.number(e.toString())+(a.noType||a.noTypeButConstructor?"":" "+a.style.type("number"))+y+a.style.newline}else if(g==="string"){if(e.length>a.maxLength){m+=f+(a.noMarkup?"":'"')+a.style.string(C.control(e.slice(0,a.maxLength-1)))+"…"+(a.noMarkup?"":'"')+(a.noType||a.noTypeButConstructor?"":" "+a.style.type("string")+a.style.length("("+e.length+" - TRUNCATED)"))+y+a.style.newline}else{m+=f+(a.noMarkup?"":'"')+a.style.string(C.control(e))+(a.noMarkup?"":'"')+(a.noType||a.noTypeButConstructor?"":" "+a.style.type("string")+a.style.length("("+e.length+")"))+y+a.style.newline}}else if(z.isBuffer(e)){m+=f+a.style.inspect(e.inspect())+(a.noType?"":" "+a.style.type("Buffer")+a.style.length("("+e.length+")"))+y+a.style.newline}else if(g==="object"||g==="function"){n=i="";h=false;if(g==="function"){h=true;n=" "+a.style.funcName(e.name?e.name:"(anonymous)");i=a.style.length("("+e.length+")")}p=false;if(Array.isArray(e)){p=true;i=a.style.length("("+e.length+")")}if(!e.constructor){c="(no constructor)"}else if(!e.constructor.name){c="(anonymous)"}else{c=e.constructor.name}l=!e.constructor||x.has(e.constructor);c=a.style.constructorName(c);o=Object.getPrototypeOf(e);m+=f;if(!a.noType&&(!a.noTypeButConstructor||!l)){if(t.forceType&&!a.noType&&!a.noTypeButConstructor){m+=a.style.type(t.forceType)}else if(a.noTypeButConstructor){m+=c}else{m+=c+n+i+" "+a.style.type(g)+y}if(!h||a.funcDetails){m+=" "}}if(p&&a.noArrayProperty){s=[...Array(e.length).keys()]}else{s=Object.getOwnPropertyNames(e)}if(a.sort){s.sort()}d=M(e,t,a);if(a.protoBlackList&&a.protoBlackList.has(o)){m+=a.style.limit("[skip]")+a.style.newline}else if(d!==undefined){if(typeof d==="string"){m+="=> "+d+a.style.newline}else{m+="=> "+j({depth:t.depth,ancestors:t.ancestors,noPre:true},a,d)}}else if(h&&!a.funcDetails){m+=a.style.newline}else if(!s.length&&!a.proto){m+=(a.noMarkup?"":p?"[]":"{}")+a.style.newline}else if(t.depth>=a.depth){m+=a.style.limit("[depth limit]")+a.style.newline}else if(t.ancestors.indexOf(e)!==-1){m+=a.style.limit("[circular]")+a.style.newline}else{m+=(a.noMarkup?"":p?"[":"{")+a.style.newline;v=t.ancestors.slice();v.push(e);for(r=0;r<s.length&&m.length<a.outputMaxLength;r++){if(!p&&(a.propertyBlackList&&a.propertyBlackList.has(s[r])||a.useInspectPropertyBlackList&&e.inspectPropertyBlackList instanceof Set&&e.inspectPropertyBlackList.has(s[r]))){continue}if(p&&a.noArrayProperty&&!(s[r]in e)){m+=j({depth:t.depth+1,ancestors:v,key:s[r],keyIsProperty:false},a,S)}else{try{k=Object.getOwnPropertyDescriptor(e,s[r]);if(k&&!k.enumerable&&a.enumOnly){continue}u=!p||!k.enumerable||isNaN(s[r]);if(!a.noDescriptor&&k&&(k.get||k.set)){m+=j({depth:t.depth+1,ancestors:v,key:s[r],keyIsProperty:u,descriptor:k,forceType:"getter/setter"},a,{get:k.get,set:k.set})}else{m+=j({depth:t.depth+1,ancestors:v,key:s[r],keyIsProperty:u,descriptor:a.noDescriptor?undefined:k||{error:"Bad Proxy Descriptor"}},a,e[s[r]])}}catch(e){m+=j({depth:t.depth+1,ancestors:v,key:s[r],keyIsProperty:u,descriptor:a.noDescriptor?undefined:k},a,e)}}if(r<s.length-1){m+=a.style.comma}}if(a.proto){m+=j({depth:t.depth+1,ancestors:v,key:"__proto__",keyIsProperty:true},a,o)}m+=a.noMarkup?"":w+(p?"]":"}")+a.style.newline}}if(t.depth===0){if(a.style.trim){m=m.trim()}if(a.style==="html"){m=C.html(m)}}return m}function I(e){if(!e.length){return true}return false}var s=["pending","fulfilled","rejected"];function M(r,n,i){if(typeof r.constructor!=="function"){return}if(r instanceof String){return r.toString()}if(r instanceof RegExp){return r.toString()}if(r instanceof Date){return r.toString()+" ["+r.getTime()+"]"}if(typeof Set==="function"&&r instanceof Set){return Array.from(r)}if(typeof Map==="function"&&r instanceof Map){return Array.from(r)}if(r instanceof Promise){if(g&&g.binding&&g.binding("util")&&g.binding("util").getPromiseDetails){let e=g.binding("util").getPromiseDetails(r);let t=s[e[0]];let a="Promise <"+t+">";if(t==="fulfilled"){a+=" "+j({depth:n.depth,ancestors:n.ancestors,noPre:true},i,e[1])}else if(t==="rejected"){if(e[1]instanceof Error){a+=" "+l({style:i.style,noErrorStack:true},e[1])}else{a+=" "+j({depth:n.depth,ancestors:n.ancestors,noPre:true},i,e[1])}}return a}}if(r._bsontype){return r.toString()}if(i.useInspect&&typeof r.inspect==="function"){return r.inspect()}return}function l(t,a){var r="",e,n,i;if(arguments.length<2){a=t;t={}}else if(!t||typeof t!=="object"){t={}}if(!t.style){t.style=u.none}else if(typeof t.style==="string"){t.style=u[t.style]}if(!(a instanceof Error)){r+="[not an Error] ";if(typeof a==="string"){let e=5e3;if(a.length>e){r+=t.style.errorMessage(C.control(a.slice(0,e-1),true))+"…"+t.style.length("("+a.length+" - TRUNCATED)")+t.style.newline}else{r+=t.style.errorMessage(C.control(a,true))+t.style.newline}return r}else if(!a||typeof a!=="object"||!a.name||typeof a.name!=="string"||!a.message||typeof a.message!=="string"){r+=o(t,a);return r}}if(a.stack&&!t.noErrorStack){e=c(t,a.stack)}n=a.type||a.constructor.name;i=a.code||a.name||a.errno||a.number;r+=t.style.errorType(n)+(i?" ["+t.style.errorType(i)+"]":"")+": ";r+=t.style.errorMessage(a.message)+"\n";if(e){r+=t.style.errorStack(e)+"\n"}if(a.from){r+=t.style.newline+t.style.errorFromMessage("From error:")+t.style.newline+l(t,a.from)}return r}a.inspectError=l;function c(l,e){if(arguments.length<2){e=l;l={}}else if(!l||typeof l!=="object"){l={}}if(!l.style){l.style=u.none}else if(typeof l.style==="string"){l.style=u[l.style]}if(!e){return}if((l.browser||g.browser)&&e.indexOf("@")!==-1){e=e.replace(/[</]*(?=@)/g,"").replace(/^\s*([^@]*)\s*@\s*([^\n]*)(?::([0-9]+):([0-9]+))?$/gm,(e,t,a,r,n)=>{return l.style.errorStack(" at ")+(t?l.style.errorStackMethod(t)+" ":"")+l.style.errorStack("(")+(a?l.style.errorStackFile(a):l.style.errorStack("unknown"))+(r?l.style.errorStack(":")+l.style.errorStackLine(r):"")+(n?l.style.errorStack(":")+l.style.errorStackColumn(n):"")+l.style.errorStack(")")})}else{e=e.replace(/^[^\n]*\n/,"");e=e.replace(/^\s*(at)\s+(?:(?:(async|new)\s+)?([^\s:()[\]\n]+(?:\([^)]+\))?)\s)?(?:\[as ([^\s:()[\]\n]+)\]\s)?(?:\(?([^:()[\]\n]+):([0-9]+):([0-9]+)\)?)?$/gm,(e,t,a,r,n,i,o,s)=>{return l.style.errorStack(" at ")+(a?l.style.errorStackKeyword(a)+" ":"")+(r?l.style.errorStackMethod(r)+" ":"")+(n?l.style.errorStack("[as ")+l.style.errorStackMethodAs(n)+l.style.errorStack("] "):"")+l.style.errorStack("(")+(i?l.style.errorStackFile(i):l.style.errorStack("unknown"))+(o?l.style.errorStack(":")+l.style.errorStackLine(o):"")+(s?l.style.errorStack(":")+l.style.errorStackColumn(s):"")+l.style.errorStack(")")})}return e}a.inspectStack=c;var u={};var e=e=>e;u.none={trim:false,tab:" ",newline:"\n",comma:"",limit:e,type:e=>"<"+e+">",constant:e,funcName:e,constructorName:e=>"<"+e+">",length:e,key:e,index:e=>"["+e+"] ",number:e,inspect:e,string:e,errorType:e,errorMessage:e,errorStack:e,errorStackKeyword:e,errorStackMethod:e,errorStackMethodAs:e,errorStackFile:e,errorStackLine:e,errorStackColumn:e,errorFromMessage:e,truncate:(e,t)=>e.slice(0,t-1)+"…"};u.inline=Object.assign({},u.none,{trim:true,tab:"",newline:" ",comma:", ",length:()=>"",index:()=>""});u.color=Object.assign({},u.none,{limit:e=>n.bold+n.brightRed+e+n.reset,type:e=>n.italic+n.brightBlack+e+n.reset,constant:e=>n.cyan+e+n.reset,funcName:e=>n.italic+n.magenta+e+n.reset,constructorName:e=>n.magenta+e+n.reset,length:e=>n.italic+n.brightBlack+e+n.reset,key:e=>n.green+e+n.reset,index:e=>n.blue+"["+e+"]"+n.reset+" ",number:e=>n.cyan+e+n.reset,inspect:e=>n.cyan+e+n.reset,string:e=>n.blue+e+n.reset,errorType:e=>n.red+n.bold+e+n.reset,errorMessage:e=>n.red+n.italic+e+n.reset,errorStack:e=>n.brightBlack+e+n.reset,errorStackKeyword:e=>n.italic+n.bold+e+n.reset,errorStackMethod:e=>n.brightYellow+e+n.reset,errorStackMethodAs:e=>n.yellow+e+n.reset,errorStackFile:e=>n.brightCyan+e+n.reset,errorStackLine:e=>n.blue+e+n.reset,errorStackColumn:e=>n.magenta+e+n.reset,errorFromMessage:e=>n.yellow+n.underline+e+n.reset,truncate:(e,t)=>{var a=n.gray+"…"+n.reset;e=e.slice(0,t-a.length);var r=e.lastIndexOf("");if(r>=e.length-6){e=e.slice(0,r)}return e+a}});u.html=Object.assign({},u.none,{tab:"&nbsp;&nbsp;&nbsp;&nbsp;",newline:"<br />",limit:e=>'<span style="color:red">'+e+"</span>",type:e=>'<i style="color:gray">'+e+"</i>",constant:e=>'<span style="color:cyan">'+e+"</span>",funcName:e=>'<i style="color:magenta">'+e+"</i>",constructorName:e=>'<span style="color:magenta">'+e+"</span>",length:e=>'<i style="color:gray">'+e+"</i>",key:e=>'<span style="color:green">'+e+"</span>",index:e=>'<span style="color:blue">['+e+"]</span> ",number:e=>'<span style="color:cyan">'+e+"</span>",inspect:e=>'<span style="color:cyan">'+e+"</span>",string:e=>'<span style="color:blue">'+e+"</span>",errorType:e=>'<span style="color:red">'+e+"</span>",errorMessage:e=>'<span style="color:red">'+e+"</span>",errorStack:e=>'<span style="color:gray">'+e+"</span>",errorStackKeyword:e=>"<i>"+e+"</i>",errorStackMethod:e=>'<span style="color:yellow">'+e+"</span>",errorStackMethodAs:e=>'<span style="color:yellow">'+e+"</span>",errorStackFile:e=>'<span style="color:cyan">'+e+"</span>",errorStackLine:e=>'<span style="color:blue">'+e+"</span>",errorStackColumn:e=>'<span style="color:gray">'+e+"</span>",errorFromMessage:e=>'<span style="color:yellow">'+e+"</span>"})}).call(this)}).call(this,{isBuffer:t("../../../../../../opt/node-v20.11.0/lib/node_modules/browserify/node_modules/is-buffer/index.js")},t("_process"))},{"../../../../../../opt/node-v20.11.0/lib/node_modules/browserify/node_modules/is-buffer/index.js":23,"./ansi.js":2,"./escape.js":6,_process:24}],10:[function(e,t,a){t.exports={"😀":"grinning-face","😃":"grinning-face-with-big-eyes","😄":"grinning-face-with-smiling-eyes","😁":"beaming-face-with-smiling-eyes","😆":"grinning-squinting-face","😅":"grinning-face-with-sweat","🤣":"rolling-on-the-floor-laughing","😂":"face-with-tears-of-joy","🙂":"slightly-smiling-face","🙃":"upside-down-face","🫠":"melting-face","😉":"winking-face","😊":"smiling-face-with-smiling-eyes","😇":"smiling-face-with-halo","🥰":"smiling-face-with-hearts","😍":"smiling-face-with-heart-eyes","🤩":"star-struck","😘":"face-blowing-a-kiss","😗":"kissing-face","☺️":"smiling-face","😚":"kissing-face-with-closed-eyes","😙":"kissing-face-with-smiling-eyes","🥲":"smiling-face-with-tear","😋":"face-savoring-food","😛":"face-with-tongue","😜":"winking-face-with-tongue","🤪":"zany-face","😝":"squinting-face-with-tongue","🤑":"money-mouth-face","🤗":"smiling-face-with-open-hands","🤭":"face-with-hand-over-mouth","🫢":"face-with-open-eyes-and-hand-over-mouth","🫣":"face-with-peeking-eye","🤫":"shushing-face","🤔":"thinking-face","🫡":"saluting-face","🤐":"zipper-mouth-face","🤨":"face-with-raised-eyebrow","😐":"neutral-face","😑":"expressionless-face","😶":"face-without-mouth","🫥":"dotted-line-face","😶‍🌫️":"face-in-clouds","😏":"smirking-face","😒":"unamused-face","🙄":"face-with-rolling-eyes","😬":"grimacing-face","😮‍💨":"face-exhaling","🤥":"lying-face","🫨":"shaking-face","😌":"relieved-face","😔":"pensive-face","😪":"sleepy-face","🤤":"drooling-face","😴":"sleeping-face","😷":"face-with-medical-mask","🤒":"face-with-thermometer","🤕":"face-with-head-bandage","🤢":"nauseated-face","🤮":"face-vomiting","🤧":"sneezing-face","🥵":"hot-face","🥶":"cold-face","🥴":"woozy-face","😵":"face-with-crossed-out-eyes","😵‍💫":"face-with-spiral-eyes","🤯":"exploding-head","🤠":"cowboy-hat-face","🥳":"partying-face","🥸":"disguised-face","😎":"smiling-face-with-sunglasses","🤓":"nerd-face","🧐":"face-with-monocle","😕":"confused-face","🫤":"face-with-diagonal-mouth","😟":"worried-face","🙁":"slightly-frowning-face","☹️":"frowning-face","😮":"face-w