chrome-tools 1.2.2 → 1.2.3

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/dist/cli.js CHANGED
@@ -1,111 +1,113 @@
1
1
  #!/usr/bin/env node
2
- var Ti=Object.create;var Jt=Object.defineProperty;var Li=Object.getOwnPropertyDescriptor;var Pi=Object.getOwnPropertyNames;var Ii=Object.getPrototypeOf,Ni=Object.prototype.hasOwnProperty;var Xt=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var A=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Mi=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Pi(e))!Ni.call(n,i)&&i!==t&&Jt(n,i,{get:()=>e[i],enumerable:!(r=Li(e,i))||r.enumerable});return n};var $i=(n,e,t)=>(t=n!=null?Ti(Ii(n)):{},Mi(e||!n||!n.__esModule?Jt(t,"default",{value:n,enumerable:!0}):t,n));var Ye=A((La,hr)=>{"use strict";var bt=[],pr=0,M=(n,e)=>{pr>=e&&bt.push(n)};M.WARN=1;M.INFO=2;M.DEBUG=3;M.reset=()=>{bt=[]};M.setDebugLevel=n=>{pr=n};M.warn=n=>M(n,M.WARN);M.info=n=>M(n,M.INFO);M.debug=n=>M(n,M.DEBUG);M.debugMessages=()=>bt;hr.exports=M});var Dr=A((Pa,mr)=>{"use strict";mr.exports=({onlyFirst:n=!1}={})=>{let e=["[\\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(e,n?void 0:"g")}});var yr=A((Ia,gr)=>{"use strict";var lo=Dr();gr.exports=n=>typeof n=="string"?n.replace(lo(),""):n});var Er=A((Na,wt)=>{"use strict";var Cr=n=>Number.isNaN(n)?!1:n>=4352&&(n<=4447||n===9001||n===9002||11904<=n&&n<=12871&&n!==12351||12880<=n&&n<=19903||19968<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65131||65281<=n&&n<=65376||65504<=n&&n<=65510||110592<=n&&n<=110593||127488<=n&&n<=127569||131072<=n&&n<=262141);wt.exports=Cr;wt.exports.default=Cr});var wr=A((Ma,br)=>{"use strict";br.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var Fr=A(($a,_t)=>{"use strict";var co=yr(),fo=Er(),po=wr(),_r=n=>{if(typeof n!="string"||n.length===0||(n=co(n),n.length===0))return 0;n=n.replace(po()," ");let e=0;for(let t=0;t<n.length;t++){let r=n.codePointAt(t);r<=31||r>=127&&r<=159||r>=768&&r<=879||(r>65535&&t++,e+=fo(r)?2:1)}return e};_t.exports=_r;_t.exports.default=_r});var Ft=A((ja,Ar)=>{"use strict";var Br=Fr();function Je(n){return n?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function Y(n){let e=Je();return(""+n).replace(e,"").split(`
3
- `).reduce(function(i,o){return Br(o)>i?Br(o):i},0)}function Re(n,e){return Array(e+1).join(n)}function ho(n,e,t,r){let i=Y(n);if(e+1>=i){let o=e-i;switch(r){case"right":{n=Re(t,o)+n;break}case"center":{let s=Math.ceil(o/2),a=o-s;n=Re(t,a)+n+Re(t,s);break}default:{n=n+Re(t,o);break}}}return n}var de={};function Te(n,e,t){e="\x1B["+e+"m",t="\x1B["+t+"m",de[e]={set:n,to:!0},de[t]={set:n,to:!1},de[n]={on:e,off:t}}Te("bold",1,22);Te("italics",3,23);Te("underline",4,24);Te("inverse",7,27);Te("strikethrough",9,29);function xr(n,e){let t=e[1]?parseInt(e[1].split(";")[0]):0;if(t>=30&&t<=39||t>=90&&t<=97){n.lastForegroundAdded=e[0];return}if(t>=40&&t<=49||t>=100&&t<=107){n.lastBackgroundAdded=e[0];return}if(t===0){for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&delete n[i];return}let r=de[e[0]];r&&(n[r.set]=r.to)}function mo(n){let e=Je(!0),t=e.exec(n),r={};for(;t!==null;)xr(r,t),t=e.exec(n);return r}function Sr(n,e){let t=n.lastBackgroundAdded,r=n.lastForegroundAdded;return delete n.lastBackgroundAdded,delete n.lastForegroundAdded,Object.keys(n).forEach(function(i){n[i]&&(e+=de[i].off)}),t&&t!="\x1B[49m"&&(e+="\x1B[49m"),r&&r!="\x1B[39m"&&(e+="\x1B[39m"),e}function Do(n,e){let t=n.lastBackgroundAdded,r=n.lastForegroundAdded;return delete n.lastBackgroundAdded,delete n.lastForegroundAdded,Object.keys(n).forEach(function(i){n[i]&&(e=de[i].on+e)}),t&&t!="\x1B[49m"&&(e=t+e),r&&r!="\x1B[39m"&&(e=r+e),e}function go(n,e){if(n.length===Y(n))return n.substr(0,e);for(;Y(n)>e;)n=n.slice(0,-1);return n}function yo(n,e){let t=Je(!0),r=n.split(Je()),i=0,o=0,s="",a,u={};for(;o<e;){a=t.exec(n);let c=r[i];if(i++,o+Y(c)>e&&(c=go(c,e-o)),s+=c,o+=Y(c),o<e){if(!a)break;s+=a[0],xr(u,a)}}return Sr(u,s)}function Co(n,e,t){if(t=t||"\u2026",Y(n)<=e)return n;e-=Y(t);let i=yo(n,e);i+=t;let o="\x1B]8;;\x07";return n.includes(o)&&!i.includes(o)&&(i+=o),i}function Eo(){return{chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function bo(n,e){n=n||{},e=e||Eo();let t=Object.assign({},e,n);return t.chars=Object.assign({},e.chars,n.chars),t.style=Object.assign({},e.style,n.style),t}function wo(n,e){let t=[],r=e.split(/(\s+)/g),i=[],o=0,s;for(let a=0;a<r.length;a+=2){let u=r[a],c=o+Y(u);o>0&&s&&(c+=s.length),c>n?(o!==0&&t.push(i.join("")),i=[u],o=Y(u)):(i.push(s||"",u),o=c),s=r[a+1]}return o&&t.push(i.join("")),t}function _o(n,e){let t=[],r="";function i(s,a){for(r.length&&a&&(r+=a),r+=s;r.length>n;)t.push(r.slice(0,n)),r=r.slice(n)}let o=e.split(/(\s+)/g);for(let s=0;s<o.length;s+=2)i(o[s],s&&o[s-1]);return r.length&&t.push(r),t}function Fo(n,e,t=!0){let r=[];e=e.split(`
4
- `);let i=t?wo:_o;for(let o=0;o<e.length;o++)r.push.apply(r,i(n,e[o]));return r}function Bo(n){let e={},t=[];for(let r=0;r<n.length;r++){let i=Do(e,n[r]);e=mo(i);let o=Object.assign({},e);t.push(Sr(o,i))}return t}function xo(n,e){return["\x1B]","8",";",";",n||e,"\x07",e,"\x1B]","8",";",";","\x07"].join("")}Ar.exports={strlen:Y,repeat:Re,pad:ho,truncate:Co,mergeOptions:bo,wordWrap:Fo,colorizeLines:Bo,hyperlink:xo}});var Rr=A((Ha,kr)=>{"use strict";var vr={};kr.exports=vr;var Or={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(Or).forEach(function(n){var e=Or[n],t=vr[n]=[];t.open="\x1B["+e[0]+"m",t.close="\x1B["+e[1]+"m"})});var Lr=A((Wa,Tr)=>{"use strict";Tr.exports=function(n,e){e=e||process.argv;var t=e.indexOf("--"),r=/^-{1,2}/.test(n)?"":"--",i=e.indexOf(r+n);return i!==-1&&(t===-1?!0:i<t)}});var Ir=A((Va,Pr)=>{"use strict";var So=Xt("os"),K=Lr(),j=process.env,pe=void 0;K("no-color")||K("no-colors")||K("color=false")?pe=!1:(K("color")||K("colors")||K("color=true")||K("color=always"))&&(pe=!0);"FORCE_COLOR"in j&&(pe=j.FORCE_COLOR.length===0||parseInt(j.FORCE_COLOR,10)!==0);function Ao(n){return n===0?!1:{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function Oo(n){if(pe===!1)return 0;if(K("color=16m")||K("color=full")||K("color=truecolor"))return 3;if(K("color=256"))return 2;if(n&&!n.isTTY&&pe!==!0)return 0;var e=pe?1:0;if(process.platform==="win32"){var t=So.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in j)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in j})||j.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in j)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(j.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in j){var r=parseInt((j.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(j.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(j.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(j.TERM)||"COLORTERM"in j?1:(j.TERM==="dumb",e)}function Bt(n){var e=Oo(n);return Ao(e)}Pr.exports={supportsColor:Bt,stdout:Bt(process.stdout),stderr:Bt(process.stderr)}});var Mr=A((Ga,Nr)=>{"use strict";Nr.exports=function(e,t){var r="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(o){o=o.toLowerCase();var s=i[o]||[" "],a=Math.floor(Math.random()*s.length);typeof i[o]<"u"?r+=i[o][a]:r+=o}),r}});var jr=A((Ua,$r)=>{"use strict";$r.exports=function(e,t){e=e||" he is here ";var r={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(r.up,r.down,r.mid);function o(u){var c=Math.floor(Math.random()*u);return c}function s(u){var c=!1;return i.filter(function(l){c=l===u}),c}function a(u,c){var l="",f,d;c=c||{},c.up=typeof c.up<"u"?c.up:!0,c.mid=typeof c.mid<"u"?c.mid:!0,c.down=typeof c.down<"u"?c.down:!0,c.size=typeof c.size<"u"?c.size:"maxi",u=u.split("");for(d in u)if(!s(d)){switch(l=l+u[d],f={up:0,down:0,mid:0},c.size){case"mini":f.up=o(8),f.mid=o(2),f.down=o(8);break;case"maxi":f.up=o(16)+3,f.mid=o(4)+1,f.down=o(64)+3;break;default:f.up=o(8)+1,f.mid=o(6)/2,f.down=o(8)+1;break}var D=["up","mid","down"];for(var p in D)for(var h=D[p],g=0;g<=f[h];g++)c[h]&&(l=l+r[h][o(r[h].length)])}return l}return a(e,t)}});var Wr=A((Ka,Hr)=>{"use strict";Hr.exports=function(n){return function(e,t,r){if(e===" ")return e;switch(t%3){case 0:return n.red(e);case 1:return n.white(e);case 2:return n.blue(e)}}}});var Gr=A((qa,Vr)=>{"use strict";Vr.exports=function(n){return function(e,t,r){return t%2===0?e:n.inverse(e)}}});var Kr=A((za,Ur)=>{"use strict";Ur.exports=function(n){var e=["red","yellow","green","blue","magenta"];return function(t,r,i){return t===" "?t:n[e[r++%e.length]](t)}}});var zr=A((Ya,qr)=>{"use strict";qr.exports=function(n){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(t,r,i){return t===" "?t:n[e[Math.round(Math.random()*(e.length-2))]](t)}}});var en=A((Xa,Zr)=>{"use strict";var E={};Zr.exports=E;E.themes={};var vo=Xt("util"),ue=E.styles=Rr(),Jr=Object.defineProperties,ko=new RegExp(/[\r\n]+/g);E.supportsColor=Ir().supportsColor;typeof E.enabled>"u"&&(E.enabled=E.supportsColor()!==!1);E.enable=function(){E.enabled=!0};E.disable=function(){E.enabled=!1};E.stripColors=E.strip=function(n){return(""+n).replace(/\x1B\[\d+m/g,"")};var Ja=E.stylize=function(e,t){if(!E.enabled)return e+"";var r=ue[t];return!r&&t in E?E[t](e):r.open+e+r.close},Ro=/[|\\{}()[\]^$+*?.]/g,To=function(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(Ro,"\\$&")};function Xr(n){var e=function t(){return Po.apply(t,arguments)};return e._styles=n,e.__proto__=Lo,e}var Qr=(function(){var n={};return ue.grey=ue.gray,Object.keys(ue).forEach(function(e){ue[e].closeRe=new RegExp(To(ue[e].close),"g"),n[e]={get:function(){return Xr(this._styles.concat(e))}}}),n})(),Lo=Jr(function(){},Qr);function Po(){var n=Array.prototype.slice.call(arguments),e=n.map(function(s){return s!=null&&s.constructor===String?s:vo.inspect(s)}).join(" ");if(!E.enabled||!e)return e;for(var t=e.indexOf(`
5
- `)!=-1,r=this._styles,i=r.length;i--;){var o=ue[r[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,t&&(e=e.replace(ko,function(s){return o.close+s+o.open}))}return e}E.setTheme=function(n){if(typeof n=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in n)(function(t){E[t]=function(r){if(typeof n[t]=="object"){var i=r;for(var o in n[t])i=E[n[t][o]](i);return i}return E[n[t]](r)}})(e)};function Io(){var n={};return Object.keys(Qr).forEach(function(e){n[e]={get:function(){return Xr([e])}}}),n}var No=function(e,t){var r=t.split("");return r=r.map(e),r.join("")};E.trap=Mr();E.zalgo=jr();E.maps={};E.maps.america=Wr()(E);E.maps.zebra=Gr()(E);E.maps.rainbow=Kr()(E);E.maps.random=zr()(E);for(Yr in E.maps)(function(n){E[n]=function(e){return No(E.maps[n],e)}})(Yr);var Yr;Jr(E,Io())});var rn=A((Qa,tn)=>{"use strict";var Mo=en();tn.exports=Mo});var un=A((Za,Xe)=>{"use strict";var{info:$o,debug:sn}=Ye(),W=Ft(),St=class n{constructor(e){this.setOptions(e),this.x=null,this.y=null}setOptions(e){["boolean","number","bigint","string"].indexOf(typeof e)!==-1&&(e={content:""+e}),e=e||{},this.options=e;let t=e.content;if(["boolean","number","bigint","string"].indexOf(typeof t)!==-1)this.content=String(t);else if(!t)this.content=this.options.href||"";else throw new Error("Content needs to be a primitive, got: "+typeof t);this.colSpan=e.colSpan||1,this.rowSpan=e.rowSpan||1,this.options.href&&Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(e,t){this.cells=t;let r=this.options.chars||{},i=e.chars,o=this.chars={};Ho.forEach(function(u){xt(r,i,u,o)}),this.truncate=this.options.truncate||e.truncate;let s=this.options.style=this.options.style||{},a=e.style;xt(s,a,"padding-left",this),xt(s,a,"padding-right",this),this.head=s.head||a.head,this.border=s.border||a.border,this.fixedWidth=e.colWidths[this.x],this.lines=this.computeLines(e),this.desiredWidth=W.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(e){let t=e.wordWrap||e.textWrap,{wordWrap:r=t}=this.options;if(this.fixedWidth&&r){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let s=1;for(;s<this.colSpan;)this.fixedWidth+=e.colWidths[this.x+s],s++}let{wrapOnWordBoundary:i=!0}=e,{wrapOnWordBoundary:o=i}=this.options;return this.wrapLines(W.wordWrap(this.fixedWidth,this.content,o))}return this.wrapLines(this.content.split(`
6
- `))}wrapLines(e){let t=W.colorizeLines(e);return this.href?t.map(r=>W.hyperlink(this.href,r)):t}init(e){let t=this.x,r=this.y;this.widths=e.colWidths.slice(t,t+this.colSpan),this.heights=e.rowHeights.slice(r,r+this.rowSpan),this.width=this.widths.reduce(on,-1),this.height=this.heights.reduce(on,-1),this.hAlign=this.options.hAlign||e.colAligns[t],this.vAlign=this.options.vAlign||e.rowAligns[r],this.drawRight=t+this.colSpan==e.colWidths.length}draw(e,t){if(e=="top")return this.drawTop(this.drawRight);if(e=="bottom")return this.drawBottom(this.drawRight);let r=W.truncate(this.content,10,this.truncate);e||$o(`${this.y}-${this.x}: ${this.rowSpan-e}x${this.colSpan} Cell ${r}`);let i=Math.max(this.height-this.lines.length,0),o;switch(this.vAlign){case"center":o=Math.ceil(i/2);break;case"bottom":o=i;break;default:o=0}if(e<o||e>=o+this.lines.length)return this.drawEmpty(this.drawRight,t);let s=this.lines.length>this.height&&e+1>=this.height;return this.drawLine(e-o,this.drawRight,s,t)}drawTop(e){let t=[];return this.cells?this.widths.forEach(function(r,i){t.push(this._topLeftChar(i)),t.push(W.repeat(this.chars[this.y==0?"top":"mid"],r))},this):(t.push(this._topLeftChar(0)),t.push(W.repeat(this.chars[this.y==0?"top":"mid"],this.width))),e&&t.push(this.chars[this.y==0?"topRight":"rightMid"]),this.wrapWithStyleColors("border",t.join(""))}_topLeftChar(e){let t=this.x+e,r;if(this.y==0)r=t==0?"topLeft":e==0?"topMid":"top";else if(t==0)r="leftMid";else if(r=e==0?"midMid":"bottomMid",this.cells&&(this.cells[this.y-1][t]instanceof n.ColSpanCell&&(r=e==0?"topMid":"mid"),e==0)){let o=1;for(;this.cells[this.y][t-o]instanceof n.ColSpanCell;)o++;this.cells[this.y][t-o]instanceof n.RowSpanCell&&(r="leftMid")}return this.chars[r]}wrapWithStyleColors(e,t){if(this[e]&&this[e].length)try{let r=rn();for(let i=this[e].length-1;i>=0;i--)r=r[this[e][i]];return r(t)}catch{return t}else return t}drawLine(e,t,r,i){let o=this.chars[this.x==0?"left":"middle"];if(this.x&&i&&this.cells){let d=this.cells[this.y+i][this.x-1];for(;d instanceof Le;)d=this.cells[d.y][d.x-1];d instanceof Pe||(o=this.chars.rightMid)}let s=W.repeat(" ",this.paddingLeft),a=t?this.chars.right:"",u=W.repeat(" ",this.paddingRight),c=this.lines[e],l=this.width-(this.paddingLeft+this.paddingRight);r&&(c+=this.truncate||"\u2026");let f=W.truncate(c,l,this.truncate);return f=W.pad(f,l," ",this.hAlign),f=s+f+u,this.stylizeLine(o,f,a)}stylizeLine(e,t,r){return e=this.wrapWithStyleColors("border",e),r=this.wrapWithStyleColors("border",r),this.y===0&&(t=this.wrapWithStyleColors("head",t)),e+t+r}drawBottom(e){let t=this.chars[this.x==0?"bottomLeft":"bottomMid"],r=W.repeat(this.chars.bottom,this.width),i=e?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",t+r+i)}drawEmpty(e,t){let r=this.chars[this.x==0?"left":"middle"];if(this.x&&t&&this.cells){let s=this.cells[this.y+t][this.x-1];for(;s instanceof Le;)s=this.cells[s.y][s.x-1];s instanceof Pe||(r=this.chars.rightMid)}let i=e?this.chars.right:"",o=W.repeat(" ",this.width);return this.stylizeLine(r,o,i)}},Le=class{constructor(){}draw(e){return typeof e=="number"&&sn(`${this.y}-${this.x}: 1x1 ColSpanCell`),""}init(){}mergeTableOptions(){}},Pe=class{constructor(e){this.originalCell=e}init(e){let t=this.y,r=this.originalCell.y;this.cellOffset=t-r,this.offset=jo(e.rowHeights,r,this.cellOffset)}draw(e){return e=="top"?this.originalCell.draw(this.offset,this.cellOffset):e=="bottom"?this.originalCell.draw("bottom"):(sn(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+e))}mergeTableOptions(){}};function nn(...n){return n.filter(e=>e!=null).shift()}function xt(n,e,t,r){let i=t.split("-");i.length>1?(i[1]=i[1].charAt(0).toUpperCase()+i[1].substr(1),i=i.join(""),r[i]=nn(n[i],n[t],e[i],e[t])):r[t]=nn(n[t],e[t])}function jo(n,e,t){let r=n[e];for(let i=1;i<t;i++)r+=1+n[e+i];return r}function on(n,e){return n+e+1}var Ho=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];Xe.exports=St;Xe.exports.ColSpanCell=Le;Xe.exports.RowSpanCell=Pe});var cn=A((el,ln)=>{"use strict";var{warn:Wo,debug:Vo}=Ye(),At=un(),{ColSpanCell:Go,RowSpanCell:Uo}=At;(function(){function n(D,p){return D[p]>0?n(D,p+1):p}function e(D){let p={};D.forEach(function(h,g){let y=0;h.forEach(function(C){C.y=g,C.x=g?n(p,y):y;let T=C.rowSpan||1,_=C.colSpan||1;if(T>1)for(let k=0;k<_;k++)p[C.x+k]=T;y=C.x+_}),Object.keys(p).forEach(C=>{p[C]--,p[C]<1&&delete p[C]})})}function t(D){let p=0;return D.forEach(function(h){h.forEach(function(g){p=Math.max(p,g.x+(g.colSpan||1))})}),p}function r(D){return D.length}function i(D,p){let h=D.y,g=D.y-1+(D.rowSpan||1),y=p.y,C=p.y-1+(p.rowSpan||1),T=!(h>C||y>g),_=D.x,k=D.x-1+(D.colSpan||1),Q=p.x,pt=p.x-1+(p.colSpan||1),v=!(_>pt||Q>k);return T&&v}function o(D,p,h){let g=Math.min(D.length-1,h),y={x:p,y:h};for(let C=0;C<=g;C++){let T=D[C];for(let _=0;_<T.length;_++)if(i(y,T[_]))return!0}return!1}function s(D,p,h,g){for(let y=h;y<g;y++)if(o(D,y,p))return!1;return!0}function a(D){D.forEach(function(p,h){p.forEach(function(g){for(let y=1;y<g.rowSpan;y++){let C=new Uo(g);C.x=g.x,C.y=g.y+y,C.colSpan=g.colSpan,c(C,D[h+y])}})})}function u(D){for(let p=D.length-1;p>=0;p--){let h=D[p];for(let g=0;g<h.length;g++){let y=h[g];for(let C=1;C<y.colSpan;C++){let T=new Go;T.x=y.x+C,T.y=y.y,h.splice(g+1,0,T)}}}}function c(D,p){let h=0;for(;h<p.length&&p[h].x<D.x;)h++;p.splice(h,0,D)}function l(D){let p=r(D),h=t(D);Vo(`Max rows: ${p}; Max cols: ${h}`);for(let g=0;g<p;g++)for(let y=0;y<h;y++)if(!o(D,y,g)){let C={x:y,y:g,colSpan:1,rowSpan:1};for(y++;y<h&&!o(D,y,g);)C.colSpan++,y++;let T=g+1;for(;T<p&&s(D,T,C.x,C.x+C.colSpan);)C.rowSpan++,T++;let _=new At(C);_.x=C.x,_.y=C.y,Wo(`Missing cell at ${_.y}-${_.x}.`),c(_,D[g])}}function f(D){return D.map(function(p){if(!Array.isArray(p)){let h=Object.keys(p)[0];p=p[h],Array.isArray(p)?(p=p.slice(),p.unshift(h)):p=[h,p]}return p.map(function(h){return new At(h)})})}function d(D){let p=f(D);return e(p),l(p),a(p),u(p),p}ln.exports={makeTableLayout:d,layoutTable:e,addRowSpanCells:a,maxWidth:t,fillInTable:l,computeWidths:an("colSpan","desiredWidth","x",1),computeHeights:an("rowSpan","desiredHeight","y",1)}})();function an(n,e,t,r){return function(i,o){let s=[],a=[],u={};o.forEach(function(c){c.forEach(function(l){(l[n]||1)>1?a.push(l):s[l[t]]=Math.max(s[l[t]]||0,l[e]||0,r)})}),i.forEach(function(c,l){typeof c=="number"&&(s[l]=c)});for(let c=a.length-1;c>=0;c--){let l=a[c],f=l[n],d=l[t],D=s[d],p=typeof i[d]=="number"?0:1;if(typeof D=="number")for(let h=1;h<f;h++)D+=1+s[d+h],typeof i[d+h]!="number"&&p++;else D=e==="desiredWidth"?l.desiredWidth-1:1,(!u[d]||u[d]<D)&&(u[d]=D);if(l[e]>D){let h=0;for(;p>0&&l[e]>D;){if(typeof i[d+h]!="number"){let g=Math.round((l[e]-D)/p);D+=g,s[d+h]+=g,p--}h++}}}Object.assign(i,s,u);for(let c=0;c<i.length;c++)i[c]=Math.max(r,i[c]||0)}}});var dn=A((tl,fn)=>{"use strict";var te=Ye(),Ko=Ft(),Ot=cn(),Qe=class extends Array{constructor(e){super();let t=Ko.mergeOptions(e);if(Object.defineProperty(this,"options",{value:t,enumerable:t.debug}),t.debug){switch(typeof t.debug){case"boolean":te.setDebugLevel(te.WARN);break;case"number":te.setDebugLevel(t.debug);break;case"string":te.setDebugLevel(parseInt(t.debug,10));break;default:te.setDebugLevel(te.WARN),te.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof t.debug}`)}Object.defineProperty(this,"messages",{get(){return te.debugMessages()}})}}toString(){let e=this,t=this.options.head&&this.options.head.length;t?(e=[this.options.head],this.length&&e.push.apply(e,this)):this.options.style.head=[];let r=Ot.makeTableLayout(e);r.forEach(function(o){o.forEach(function(s){s.mergeTableOptions(this.options,r)},this)},this),Ot.computeWidths(this.options.colWidths,r),Ot.computeHeights(this.options.rowHeights,r),r.forEach(function(o){o.forEach(function(s){s.init(this.options)},this)},this);let i=[];for(let o=0;o<r.length;o++){let s=r[o],a=this.options.rowHeights[o];(o===0||!this.options.style.compact||o==1&&t)&&vt(s,"top",i);for(let u=0;u<a;u++)vt(s,u,i);o+1==r.length&&vt(s,"bottom",i)}return i.join(`
2
+ var $i=Object.create;var rr=Object.defineProperty;var Ii=Object.getOwnPropertyDescriptor;var Ni=Object.getOwnPropertyNames;var Mi=Object.getPrototypeOf,Wi=Object.prototype.hasOwnProperty;var nr=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var O=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var ji=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ni(e))!Wi.call(r,i)&&i!==t&&rr(r,i,{get:()=>e[i],enumerable:!(n=Ii(e,i))||n.enumerable});return r};var Hi=(r,e,t)=>(t=r!=null?$i(Mi(r)):{},ji(e||!r||!r.__esModule?rr(t,"default",{value:r,enumerable:!0}):t,r));var Je=O((ja,Er)=>{"use strict";var _t=[],Cr=0,N=(r,e)=>{Cr>=e&&_t.push(r)};N.WARN=1;N.INFO=2;N.DEBUG=3;N.reset=()=>{_t=[]};N.setDebugLevel=r=>{Cr=r};N.warn=r=>N(r,N.WARN);N.info=r=>N(r,N.INFO);N.debug=r=>N(r,N.DEBUG);N.debugMessages=()=>_t;Er.exports=N});var wr=O((Ha,br)=>{"use strict";br.exports=({onlyFirst:r=!1}={})=>{let e=["[\\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(e,r?void 0:"g")}});var Fr=O((Va,_r)=>{"use strict";var po=wr();_r.exports=r=>typeof r=="string"?r.replace(po(),""):r});var Sr=O((Ga,Ft)=>{"use strict";var Br=r=>Number.isNaN(r)?!1:r>=4352&&(r<=4447||r===9001||r===9002||11904<=r&&r<=12871&&r!==12351||12880<=r&&r<=19903||19968<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65131||65281<=r&&r<=65376||65504<=r&&r<=65510||110592<=r&&r<=110593||127488<=r&&r<=127569||131072<=r&&r<=262141);Ft.exports=Br;Ft.exports.default=Br});var Ar=O((Ua,xr)=>{"use strict";xr.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var vr=O((Ka,Bt)=>{"use strict";var ho=Fr(),mo=Sr(),Do=Ar(),Or=r=>{if(typeof r!="string"||r.length===0||(r=ho(r),r.length===0))return 0;r=r.replace(Do()," ");let e=0;for(let t=0;t<r.length;t++){let n=r.codePointAt(t);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&t++,e+=mo(n)?2:1)}return e};Bt.exports=Or;Bt.exports.default=Or});var St=O((qa,Lr)=>{"use strict";var kr=vr();function Xe(r){return r?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function Y(r){let e=Xe();return(""+r).replace(e,"").split(`
3
+ `).reduce(function(i,o){return kr(o)>i?kr(o):i},0)}function Re(r,e){return Array(e+1).join(r)}function go(r,e,t,n){let i=Y(r);if(e+1>=i){let o=e-i;switch(n){case"right":{r=Re(t,o)+r;break}case"center":{let s=Math.ceil(o/2),a=o-s;r=Re(t,a)+r+Re(t,s);break}default:{r=r+Re(t,o);break}}}return r}var de={};function Te(r,e,t){e="\x1B["+e+"m",t="\x1B["+t+"m",de[e]={set:r,to:!0},de[t]={set:r,to:!1},de[r]={on:e,off:t}}Te("bold",1,22);Te("italics",3,23);Te("underline",4,24);Te("inverse",7,27);Te("strikethrough",9,29);function Rr(r,e){let t=e[1]?parseInt(e[1].split(";")[0]):0;if(t>=30&&t<=39||t>=90&&t<=97){r.lastForegroundAdded=e[0];return}if(t>=40&&t<=49||t>=100&&t<=107){r.lastBackgroundAdded=e[0];return}if(t===0){for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&delete r[i];return}let n=de[e[0]];n&&(r[n.set]=n.to)}function yo(r){let e=Xe(!0),t=e.exec(r),n={};for(;t!==null;)Rr(n,t),t=e.exec(r);return n}function Tr(r,e){let t=r.lastBackgroundAdded,n=r.lastForegroundAdded;return delete r.lastBackgroundAdded,delete r.lastForegroundAdded,Object.keys(r).forEach(function(i){r[i]&&(e+=de[i].off)}),t&&t!="\x1B[49m"&&(e+="\x1B[49m"),n&&n!="\x1B[39m"&&(e+="\x1B[39m"),e}function Co(r,e){let t=r.lastBackgroundAdded,n=r.lastForegroundAdded;return delete r.lastBackgroundAdded,delete r.lastForegroundAdded,Object.keys(r).forEach(function(i){r[i]&&(e=de[i].on+e)}),t&&t!="\x1B[49m"&&(e=t+e),n&&n!="\x1B[39m"&&(e=n+e),e}function Eo(r,e){if(r.length===Y(r))return r.substr(0,e);for(;Y(r)>e;)r=r.slice(0,-1);return r}function bo(r,e){let t=Xe(!0),n=r.split(Xe()),i=0,o=0,s="",a,u={};for(;o<e;){a=t.exec(r);let c=n[i];if(i++,o+Y(c)>e&&(c=Eo(c,e-o)),s+=c,o+=Y(c),o<e){if(!a)break;s+=a[0],Rr(u,a)}}return Tr(u,s)}function wo(r,e,t){if(t=t||"\u2026",Y(r)<=e)return r;e-=Y(t);let i=bo(r,e);i+=t;let o="\x1B]8;;\x07";return r.includes(o)&&!i.includes(o)&&(i+=o),i}function _o(){return{chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function Fo(r,e){r=r||{},e=e||_o();let t=Object.assign({},e,r);return t.chars=Object.assign({},e.chars,r.chars),t.style=Object.assign({},e.style,r.style),t}function Bo(r,e){let t=[],n=e.split(/(\s+)/g),i=[],o=0,s;for(let a=0;a<n.length;a+=2){let u=n[a],c=o+Y(u);o>0&&s&&(c+=s.length),c>r?(o!==0&&t.push(i.join("")),i=[u],o=Y(u)):(i.push(s||"",u),o=c),s=n[a+1]}return o&&t.push(i.join("")),t}function So(r,e){let t=[],n="";function i(s,a){for(n.length&&a&&(n+=a),n+=s;n.length>r;)t.push(n.slice(0,r)),n=n.slice(r)}let o=e.split(/(\s+)/g);for(let s=0;s<o.length;s+=2)i(o[s],s&&o[s-1]);return n.length&&t.push(n),t}function xo(r,e,t=!0){let n=[];e=e.split(`
4
+ `);let i=t?Bo:So;for(let o=0;o<e.length;o++)n.push.apply(n,i(r,e[o]));return n}function Ao(r){let e={},t=[];for(let n=0;n<r.length;n++){let i=Co(e,r[n]);e=yo(i);let o=Object.assign({},e);t.push(Tr(o,i))}return t}function Oo(r,e){return["\x1B]","8",";",";",r||e,"\x07",e,"\x1B]","8",";",";","\x07"].join("")}Lr.exports={strlen:Y,repeat:Re,pad:go,truncate:wo,mergeOptions:Fo,wordWrap:xo,colorizeLines:Ao,hyperlink:Oo}});var Nr=O((za,Ir)=>{"use strict";var $r={};Ir.exports=$r;var Pr={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(Pr).forEach(function(r){var e=Pr[r],t=$r[r]=[];t.open="\x1B["+e[0]+"m",t.close="\x1B["+e[1]+"m"})});var Wr=O((Ya,Mr)=>{"use strict";Mr.exports=function(r,e){e=e||process.argv;var t=e.indexOf("--"),n=/^-{1,2}/.test(r)?"":"--",i=e.indexOf(n+r);return i!==-1&&(t===-1?!0:i<t)}});var Hr=O((Ja,jr)=>{"use strict";var vo=nr("os"),K=Wr(),W=process.env,pe=void 0;K("no-color")||K("no-colors")||K("color=false")?pe=!1:(K("color")||K("colors")||K("color=true")||K("color=always"))&&(pe=!0);"FORCE_COLOR"in W&&(pe=W.FORCE_COLOR.length===0||parseInt(W.FORCE_COLOR,10)!==0);function ko(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Ro(r){if(pe===!1)return 0;if(K("color=16m")||K("color=full")||K("color=truecolor"))return 3;if(K("color=256"))return 2;if(r&&!r.isTTY&&pe!==!0)return 0;var e=pe?1:0;if(process.platform==="win32"){var t=vo.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in W)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in W})||W.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in W)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(W.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in W){var n=parseInt((W.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(W.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(W.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(W.TERM)||"COLORTERM"in W?1:(W.TERM==="dumb",e)}function xt(r){var e=Ro(r);return ko(e)}jr.exports={supportsColor:xt,stdout:xt(process.stdout),stderr:xt(process.stderr)}});var Gr=O((Xa,Vr)=>{"use strict";Vr.exports=function(e,t){var n="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(o){o=o.toLowerCase();var s=i[o]||[" "],a=Math.floor(Math.random()*s.length);typeof i[o]<"u"?n+=i[o][a]:n+=o}),n}});var Kr=O((Qa,Ur)=>{"use strict";Ur.exports=function(e,t){e=e||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function o(u){var c=Math.floor(Math.random()*u);return c}function s(u){var c=!1;return i.filter(function(l){c=l===u}),c}function a(u,c){var l="",f,d;c=c||{},c.up=typeof c.up<"u"?c.up:!0,c.mid=typeof c.mid<"u"?c.mid:!0,c.down=typeof c.down<"u"?c.down:!0,c.size=typeof c.size<"u"?c.size:"maxi",u=u.split("");for(d in u)if(!s(d)){switch(l=l+u[d],f={up:0,down:0,mid:0},c.size){case"mini":f.up=o(8),f.mid=o(2),f.down=o(8);break;case"maxi":f.up=o(16)+3,f.mid=o(4)+1,f.down=o(64)+3;break;default:f.up=o(8)+1,f.mid=o(6)/2,f.down=o(8)+1;break}var m=["up","mid","down"];for(var p in m)for(var h=m[p],g=0;g<=f[h];g++)c[h]&&(l=l+n[h][o(n[h].length)])}return l}return a(e,t)}});var zr=O((Za,qr)=>{"use strict";qr.exports=function(r){return function(e,t,n){if(e===" ")return e;switch(t%3){case 0:return r.red(e);case 1:return r.white(e);case 2:return r.blue(e)}}}});var Jr=O((el,Yr)=>{"use strict";Yr.exports=function(r){return function(e,t,n){return t%2===0?e:r.inverse(e)}}});var Qr=O((tl,Xr)=>{"use strict";Xr.exports=function(r){var e=["red","yellow","green","blue","magenta"];return function(t,n,i){return t===" "?t:r[e[n++%e.length]](t)}}});var en=O((rl,Zr)=>{"use strict";Zr.exports=function(r){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(t,n,i){return t===" "?t:r[e[Math.round(Math.random()*(e.length-2))]](t)}}});var un=O((il,sn)=>{"use strict";var E={};sn.exports=E;E.themes={};var To=nr("util"),ue=E.styles=Nr(),rn=Object.defineProperties,Lo=new RegExp(/[\r\n]+/g);E.supportsColor=Hr().supportsColor;typeof E.enabled>"u"&&(E.enabled=E.supportsColor()!==!1);E.enable=function(){E.enabled=!0};E.disable=function(){E.enabled=!1};E.stripColors=E.strip=function(r){return(""+r).replace(/\x1B\[\d+m/g,"")};var nl=E.stylize=function(e,t){if(!E.enabled)return e+"";var n=ue[t];return!n&&t in E?E[t](e):n.open+e+n.close},Po=/[|\\{}()[\]^$+*?.]/g,$o=function(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replace(Po,"\\$&")};function nn(r){var e=function t(){return No.apply(t,arguments)};return e._styles=r,e.__proto__=Io,e}var on=(function(){var r={};return ue.grey=ue.gray,Object.keys(ue).forEach(function(e){ue[e].closeRe=new RegExp($o(ue[e].close),"g"),r[e]={get:function(){return nn(this._styles.concat(e))}}}),r})(),Io=rn(function(){},on);function No(){var r=Array.prototype.slice.call(arguments),e=r.map(function(s){return s!=null&&s.constructor===String?s:To.inspect(s)}).join(" ");if(!E.enabled||!e)return e;for(var t=e.indexOf(`
5
+ `)!=-1,n=this._styles,i=n.length;i--;){var o=ue[n[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,t&&(e=e.replace(Lo,function(s){return o.close+s+o.open}))}return e}E.setTheme=function(r){if(typeof r=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in r)(function(t){E[t]=function(n){if(typeof r[t]=="object"){var i=n;for(var o in r[t])i=E[r[t][o]](i);return i}return E[r[t]](n)}})(e)};function Mo(){var r={};return Object.keys(on).forEach(function(e){r[e]={get:function(){return nn([e])}}}),r}var Wo=function(e,t){var n=t.split("");return n=n.map(e),n.join("")};E.trap=Gr();E.zalgo=Kr();E.maps={};E.maps.america=zr()(E);E.maps.zebra=Jr()(E);E.maps.rainbow=Qr()(E);E.maps.random=en()(E);for(tn in E.maps)(function(r){E[r]=function(e){return Wo(E.maps[r],e)}})(tn);var tn;rn(E,Mo())});var ln=O((ol,an)=>{"use strict";var jo=un();an.exports=jo});var pn=O((sl,Qe)=>{"use strict";var{info:Ho,debug:dn}=Je(),V=St(),Ot=class r{constructor(e){this.setOptions(e),this.x=null,this.y=null}setOptions(e){["boolean","number","bigint","string"].indexOf(typeof e)!==-1&&(e={content:""+e}),e=e||{},this.options=e;let t=e.content;if(["boolean","number","bigint","string"].indexOf(typeof t)!==-1)this.content=String(t);else if(!t)this.content=this.options.href||"";else throw new Error("Content needs to be a primitive, got: "+typeof t);this.colSpan=e.colSpan||1,this.rowSpan=e.rowSpan||1,this.options.href&&Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(e,t){this.cells=t;let n=this.options.chars||{},i=e.chars,o=this.chars={};Go.forEach(function(u){At(n,i,u,o)}),this.truncate=this.options.truncate||e.truncate;let s=this.options.style=this.options.style||{},a=e.style;At(s,a,"padding-left",this),At(s,a,"padding-right",this),this.head=s.head||a.head,this.border=s.border||a.border,this.fixedWidth=e.colWidths[this.x],this.lines=this.computeLines(e),this.desiredWidth=V.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(e){let t=e.wordWrap||e.textWrap,{wordWrap:n=t}=this.options;if(this.fixedWidth&&n){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let s=1;for(;s<this.colSpan;)this.fixedWidth+=e.colWidths[this.x+s],s++}let{wrapOnWordBoundary:i=!0}=e,{wrapOnWordBoundary:o=i}=this.options;return this.wrapLines(V.wordWrap(this.fixedWidth,this.content,o))}return this.wrapLines(this.content.split(`
6
+ `))}wrapLines(e){let t=V.colorizeLines(e);return this.href?t.map(n=>V.hyperlink(this.href,n)):t}init(e){let t=this.x,n=this.y;this.widths=e.colWidths.slice(t,t+this.colSpan),this.heights=e.rowHeights.slice(n,n+this.rowSpan),this.width=this.widths.reduce(fn,-1),this.height=this.heights.reduce(fn,-1),this.hAlign=this.options.hAlign||e.colAligns[t],this.vAlign=this.options.vAlign||e.rowAligns[n],this.drawRight=t+this.colSpan==e.colWidths.length}draw(e,t){if(e=="top")return this.drawTop(this.drawRight);if(e=="bottom")return this.drawBottom(this.drawRight);let n=V.truncate(this.content,10,this.truncate);e||Ho(`${this.y}-${this.x}: ${this.rowSpan-e}x${this.colSpan} Cell ${n}`);let i=Math.max(this.height-this.lines.length,0),o;switch(this.vAlign){case"center":o=Math.ceil(i/2);break;case"bottom":o=i;break;default:o=0}if(e<o||e>=o+this.lines.length)return this.drawEmpty(this.drawRight,t);let s=this.lines.length>this.height&&e+1>=this.height;return this.drawLine(e-o,this.drawRight,s,t)}drawTop(e){let t=[];return this.cells?this.widths.forEach(function(n,i){t.push(this._topLeftChar(i)),t.push(V.repeat(this.chars[this.y==0?"top":"mid"],n))},this):(t.push(this._topLeftChar(0)),t.push(V.repeat(this.chars[this.y==0?"top":"mid"],this.width))),e&&t.push(this.chars[this.y==0?"topRight":"rightMid"]),this.wrapWithStyleColors("border",t.join(""))}_topLeftChar(e){let t=this.x+e,n;if(this.y==0)n=t==0?"topLeft":e==0?"topMid":"top";else if(t==0)n="leftMid";else if(n=e==0?"midMid":"bottomMid",this.cells&&(this.cells[this.y-1][t]instanceof r.ColSpanCell&&(n=e==0?"topMid":"mid"),e==0)){let o=1;for(;this.cells[this.y][t-o]instanceof r.ColSpanCell;)o++;this.cells[this.y][t-o]instanceof r.RowSpanCell&&(n="leftMid")}return this.chars[n]}wrapWithStyleColors(e,t){if(this[e]&&this[e].length)try{let n=ln();for(let i=this[e].length-1;i>=0;i--)n=n[this[e][i]];return n(t)}catch{return t}else return t}drawLine(e,t,n,i){let o=this.chars[this.x==0?"left":"middle"];if(this.x&&i&&this.cells){let d=this.cells[this.y+i][this.x-1];for(;d instanceof Le;)d=this.cells[d.y][d.x-1];d instanceof Pe||(o=this.chars.rightMid)}let s=V.repeat(" ",this.paddingLeft),a=t?this.chars.right:"",u=V.repeat(" ",this.paddingRight),c=this.lines[e],l=this.width-(this.paddingLeft+this.paddingRight);n&&(c+=this.truncate||"\u2026");let f=V.truncate(c,l,this.truncate);return f=V.pad(f,l," ",this.hAlign),f=s+f+u,this.stylizeLine(o,f,a)}stylizeLine(e,t,n){return e=this.wrapWithStyleColors("border",e),n=this.wrapWithStyleColors("border",n),this.y===0&&(t=this.wrapWithStyleColors("head",t)),e+t+n}drawBottom(e){let t=this.chars[this.x==0?"bottomLeft":"bottomMid"],n=V.repeat(this.chars.bottom,this.width),i=e?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",t+n+i)}drawEmpty(e,t){let n=this.chars[this.x==0?"left":"middle"];if(this.x&&t&&this.cells){let s=this.cells[this.y+t][this.x-1];for(;s instanceof Le;)s=this.cells[s.y][s.x-1];s instanceof Pe||(n=this.chars.rightMid)}let i=e?this.chars.right:"",o=V.repeat(" ",this.width);return this.stylizeLine(n,o,i)}},Le=class{constructor(){}draw(e){return typeof e=="number"&&dn(`${this.y}-${this.x}: 1x1 ColSpanCell`),""}init(){}mergeTableOptions(){}},Pe=class{constructor(e){this.originalCell=e}init(e){let t=this.y,n=this.originalCell.y;this.cellOffset=t-n,this.offset=Vo(e.rowHeights,n,this.cellOffset)}draw(e){return e=="top"?this.originalCell.draw(this.offset,this.cellOffset):e=="bottom"?this.originalCell.draw("bottom"):(dn(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+e))}mergeTableOptions(){}};function cn(...r){return r.filter(e=>e!=null).shift()}function At(r,e,t,n){let i=t.split("-");i.length>1?(i[1]=i[1].charAt(0).toUpperCase()+i[1].substr(1),i=i.join(""),n[i]=cn(r[i],r[t],e[i],e[t])):n[t]=cn(r[t],e[t])}function Vo(r,e,t){let n=r[e];for(let i=1;i<t;i++)n+=1+r[e+i];return n}function fn(r,e){return r+e+1}var Go=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];Qe.exports=Ot;Qe.exports.ColSpanCell=Le;Qe.exports.RowSpanCell=Pe});var Dn=O((ul,mn)=>{"use strict";var{warn:Uo,debug:Ko}=Je(),vt=pn(),{ColSpanCell:qo,RowSpanCell:zo}=vt;(function(){function r(m,p){return m[p]>0?r(m,p+1):p}function e(m){let p={};m.forEach(function(h,g){let y=0;h.forEach(function(C){C.y=g,C.x=g?r(p,y):y;let T=C.rowSpan||1,_=C.colSpan||1;if(T>1)for(let k=0;k<_;k++)p[C.x+k]=T;y=C.x+_}),Object.keys(p).forEach(C=>{p[C]--,p[C]<1&&delete p[C]})})}function t(m){let p=0;return m.forEach(function(h){h.forEach(function(g){p=Math.max(p,g.x+(g.colSpan||1))})}),p}function n(m){return m.length}function i(m,p){let h=m.y,g=m.y-1+(m.rowSpan||1),y=p.y,C=p.y-1+(p.rowSpan||1),T=!(h>C||y>g),_=m.x,k=m.x-1+(m.colSpan||1),Q=p.x,mt=p.x-1+(p.colSpan||1),v=!(_>mt||Q>k);return T&&v}function o(m,p,h){let g=Math.min(m.length-1,h),y={x:p,y:h};for(let C=0;C<=g;C++){let T=m[C];for(let _=0;_<T.length;_++)if(i(y,T[_]))return!0}return!1}function s(m,p,h,g){for(let y=h;y<g;y++)if(o(m,y,p))return!1;return!0}function a(m){m.forEach(function(p,h){p.forEach(function(g){for(let y=1;y<g.rowSpan;y++){let C=new zo(g);C.x=g.x,C.y=g.y+y,C.colSpan=g.colSpan,c(C,m[h+y])}})})}function u(m){for(let p=m.length-1;p>=0;p--){let h=m[p];for(let g=0;g<h.length;g++){let y=h[g];for(let C=1;C<y.colSpan;C++){let T=new qo;T.x=y.x+C,T.y=y.y,h.splice(g+1,0,T)}}}}function c(m,p){let h=0;for(;h<p.length&&p[h].x<m.x;)h++;p.splice(h,0,m)}function l(m){let p=n(m),h=t(m);Ko(`Max rows: ${p}; Max cols: ${h}`);for(let g=0;g<p;g++)for(let y=0;y<h;y++)if(!o(m,y,g)){let C={x:y,y:g,colSpan:1,rowSpan:1};for(y++;y<h&&!o(m,y,g);)C.colSpan++,y++;let T=g+1;for(;T<p&&s(m,T,C.x,C.x+C.colSpan);)C.rowSpan++,T++;let _=new vt(C);_.x=C.x,_.y=C.y,Uo(`Missing cell at ${_.y}-${_.x}.`),c(_,m[g])}}function f(m){return m.map(function(p){if(!Array.isArray(p)){let h=Object.keys(p)[0];p=p[h],Array.isArray(p)?(p=p.slice(),p.unshift(h)):p=[h,p]}return p.map(function(h){return new vt(h)})})}function d(m){let p=f(m);return e(p),l(p),a(p),u(p),p}mn.exports={makeTableLayout:d,layoutTable:e,addRowSpanCells:a,maxWidth:t,fillInTable:l,computeWidths:hn("colSpan","desiredWidth","x",1),computeHeights:hn("rowSpan","desiredHeight","y",1)}})();function hn(r,e,t,n){return function(i,o){let s=[],a=[],u={};o.forEach(function(c){c.forEach(function(l){(l[r]||1)>1?a.push(l):s[l[t]]=Math.max(s[l[t]]||0,l[e]||0,n)})}),i.forEach(function(c,l){typeof c=="number"&&(s[l]=c)});for(let c=a.length-1;c>=0;c--){let l=a[c],f=l[r],d=l[t],m=s[d],p=typeof i[d]=="number"?0:1;if(typeof m=="number")for(let h=1;h<f;h++)m+=1+s[d+h],typeof i[d+h]!="number"&&p++;else m=e==="desiredWidth"?l.desiredWidth-1:1,(!u[d]||u[d]<m)&&(u[d]=m);if(l[e]>m){let h=0;for(;p>0&&l[e]>m;){if(typeof i[d+h]!="number"){let g=Math.round((l[e]-m)/p);m+=g,s[d+h]+=g,p--}h++}}}Object.assign(i,s,u);for(let c=0;c<i.length;c++)i[c]=Math.max(n,i[c]||0)}}});var yn=O((al,gn)=>{"use strict";var te=Je(),Yo=St(),kt=Dn(),Ze=class extends Array{constructor(e){super();let t=Yo.mergeOptions(e);if(Object.defineProperty(this,"options",{value:t,enumerable:t.debug}),t.debug){switch(typeof t.debug){case"boolean":te.setDebugLevel(te.WARN);break;case"number":te.setDebugLevel(t.debug);break;case"string":te.setDebugLevel(parseInt(t.debug,10));break;default:te.setDebugLevel(te.WARN),te.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof t.debug}`)}Object.defineProperty(this,"messages",{get(){return te.debugMessages()}})}}toString(){let e=this,t=this.options.head&&this.options.head.length;t?(e=[this.options.head],this.length&&e.push.apply(e,this)):this.options.style.head=[];let n=kt.makeTableLayout(e);n.forEach(function(o){o.forEach(function(s){s.mergeTableOptions(this.options,n)},this)},this),kt.computeWidths(this.options.colWidths,n),kt.computeHeights(this.options.rowHeights,n),n.forEach(function(o){o.forEach(function(s){s.init(this.options)},this)},this);let i=[];for(let o=0;o<n.length;o++){let s=n[o],a=this.options.rowHeights[o];(o===0||!this.options.style.compact||o==1&&t)&&Rt(s,"top",i);for(let u=0;u<a;u++)Rt(s,u,i);o+1==n.length&&Rt(s,"bottom",i)}return i.join(`
7
7
  `)}get width(){return this.toString().split(`
8
- `)[0].length}};Qe.reset=()=>te.reset();function vt(n,e,t){let r=[];n.forEach(function(o){r.push(o.draw(e))});let i=r.join("");i.length&&t.push(i)}fn.exports=Qe});var hn=A((rl,pn)=>{"use strict";pn.exports=dn()});var Qt={name:"chrome-tools",version:"1.2.2",description:"CLI & Node.js library for chrome",type:"module",main:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./passwords":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./bookmarks":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./history":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./cookies":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./local-storage":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./autofill":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./downloads":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./extensions":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./search-engines":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./top-sites":{types:"./dist/index.d.ts",import:"./dist/index.js"}},bin:{"chrome-tools":"dist/cli.js"},files:["dist"],scripts:{build:"node scripts/clean.mjs && tsup && tsc -p tsconfig.types.json && node scripts/finalize.mjs && node scripts/verify-dist.mjs",typecheck:"tsc --noEmit",lint:"oxlint --deny-warnings .",start:"node dist/cli.js",test:"npm run build && npm run typecheck && node scripts/test-unit.mjs && node dist/cli.js --help","test:chrome":"node test/compatibility/chrome.mjs","test:package":"node test/compatibility/package.mjs",release:"node scripts/release.mjs"},keywords:["chrome","bookmarks","history","cookies","autofill","browser","macos","windows","linux","cross-platform","keychain","dpapi","cli"],author:"",license:"MIT",packageManager:"pnpm@11.9.0",engines:{node:">=22.16.0"},devDependencies:{"@types/node":"^26.6.6",chalk:"^6.0.1","cli-table3":"^0.6.5",commander:"^15.1.0",oxlint:"1.77.0",tsup:"^8.5.1",tsx:"^4.23.15",typescript:"^7.0.2"}};var ne=class extends Error{constructor(e,t,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},Z=class extends ne{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var xe=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new Z(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,r):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Ve(n){let e=n.name()+(n.variadic===!0?"...":"");return n.required?"<"+e+">":"["+e+"]"}import{EventEmitter as Gi}from"node:events";import mt from"node:child_process";import ee from"node:path";import Ue from"node:fs";import b from"node:process";import{stripVTControlCharacters as Ui}from"node:util";import{stripVTControlCharacters as Hi}from"node:util";var Se=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(i=>!i._hidden),r=e._getHelpCommand();return r&&!r._hidden&&t.push(r),this.sortSubcommands&&t.sort((i,o)=>i.name().localeCompare(o.name())),t}compareOptions(e,t){let r=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return r(e).localeCompare(r(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),r=e._getHelpOption();if(r&&!r.hidden){let i=r.short&&e._findOption(r.short),o=r.long&&e._findOption(r.long);!i&&!o?t.push(r):r.long&&!o?t.push(e.createOption(r.long,r.description).helpGroup(r.helpGroupHeading)):r.short&&!i&&t.push(e.createOption(r.short,r.description).helpGroup(r.helpGroupHeading))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let r=e.parent;r;r=r.parent){let i=r.options.filter(o=>!o.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(r=>Ve(r)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(i)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(i)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let r="";for(let i=e.parent;i;i=i.parent)r=i.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatItemList(e,t,r){return t.length===0?[]:[r.styleTitle(e),...t,""]}groupItems(e,t,r){let i=new Map;return e.forEach(o=>{let s=r(o);i.has(s)||i.set(s,[])}),t.forEach(o=>{let s=r(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(e,t){let r=t.padWidth(e,t),i=t.helpWidth??80;function o(f,d){return t.formatItem(f,r,d,t)}let s=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],a=t.commandDescription(e);a.length>0&&(s=s.concat([t.boxWrap(t.styleCommandDescription(a),i),""]));let u=t.visibleArguments(e).map(f=>o(t.styleArgumentTerm(t.argumentTerm(f)),t.styleArgumentDescription(t.argumentDescription(f))));if(s=s.concat(this.formatItemList("Arguments:",u,t)),this.groupItems(e.options,t.visibleOptions(e),f=>f.helpGroupHeading??"Options:").forEach((f,d)=>{let D=f.map(p=>o(t.styleOptionTerm(t.optionTerm(p)),t.styleOptionDescription(t.optionDescription(p))));s=s.concat(this.formatItemList(d,D,t))}),t.showGlobalOptions){let f=t.visibleGlobalOptions(e).map(d=>o(t.styleOptionTerm(t.optionTerm(d)),t.styleOptionDescription(t.optionDescription(d))));s=s.concat(this.formatItemList("Global Options:",f,t))}return this.groupItems(e.commands,t.visibleCommands(e),f=>f.helpGroup()||"Commands:").forEach((f,d)=>{let D=f.map(p=>o(t.styleSubcommandTerm(t.subcommandTerm(p)),t.styleSubcommandDescription(t.subcommandDescription(p))));s=s.concat(this.formatItemList(d,D,t))}),s.join(`
9
- `)}displayWidth(e){return Hi(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleSubcommandText(t)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,r,i){let s=" ".repeat(2);if(!r)return s+e;let a=e.padEnd(t+e.length-i.displayWidth(e)),u=2,l=(this.helpWidth??80)-t-u-2,f;return l<this.minWidthToWrap||i.preformatted(r)?f=r:f=i.boxWrap(r,l).replace(/\n/g,`
8
+ `)[0].length}};Ze.reset=()=>te.reset();function Rt(r,e,t){let n=[];r.forEach(function(o){n.push(o.draw(e))});let i=n.join("");i.length&&t.push(i)}gn.exports=Ze});var En=O((ll,Cn)=>{"use strict";Cn.exports=yn()});var ir={name:"chrome-tools",version:"1.2.3",description:"CLI & Node.js library for chrome",type:"module",main:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./passwords":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./bookmarks":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./history":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./cookies":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./local-storage":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./autofill":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./downloads":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./extensions":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./search-engines":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./top-sites":{types:"./dist/index.d.ts",import:"./dist/index.js"}},bin:{"chrome-tools":"dist/cli.js"},files:["dist"],scripts:{build:"node scripts/clean.mjs && tsup && tsc -p tsconfig.types.json && node scripts/finalize.mjs && node scripts/verify-dist.mjs",typecheck:"tsc --noEmit",lint:"oxlint --deny-warnings .",start:"node dist/cli.js",test:"npm run build && npm run typecheck && node scripts/test-unit.mjs && node dist/cli.js --help","test:chrome":"node test/compatibility/chrome.mjs","test:package":"node test/compatibility/package.mjs",release:"node scripts/release.mjs"},keywords:["chrome","bookmarks","history","cookies","autofill","browser","macos","windows","linux","cross-platform","keychain","dpapi","cli"],author:"",license:"MIT",packageManager:"pnpm@11.9.0",engines:{node:">=22.16.0"},devDependencies:{"@types/node":"^26.6.6",chalk:"^6.0.1","cli-table3":"^0.6.5",commander:"^15.1.0",oxlint:"1.77.0",tsup:"^8.5.1",tsx:"^4.23.15",typescript:"^7.0.2"}};var ne=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},Z=class extends ne{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var Se=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new Z(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Ge(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}import{EventEmitter as qi}from"node:events";import gt from"node:child_process";import ee from"node:path";import Ke from"node:fs";import b from"node:process";import{stripVTControlCharacters as zi}from"node:util";import{stripVTControlCharacters as Gi}from"node:util";var xe=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((i,o)=>i.name().localeCompare(o.name())),t}compareOptions(e,t){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?t.push(n):n.long&&!o?t.push(e.createOption(n.long,n.description).helpGroup(n.helpGroupHeading)):n.short&&!i&&t.push(e.createOption(n.short,n.description).helpGroup(n.helpGroupHeading))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>Ge(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(i)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(i)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,""]}groupItems(e,t,n){let i=new Map;return e.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[])}),t.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(e,t){let n=t.padWidth(e,t),i=t.helpWidth??80;function o(f,d){return t.formatItem(f,n,d,t)}let s=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],a=t.commandDescription(e);a.length>0&&(s=s.concat([t.boxWrap(t.styleCommandDescription(a),i),""]));let u=t.visibleArguments(e).map(f=>o(t.styleArgumentTerm(t.argumentTerm(f)),t.styleArgumentDescription(t.argumentDescription(f))));if(s=s.concat(this.formatItemList("Arguments:",u,t)),this.groupItems(e.options,t.visibleOptions(e),f=>f.helpGroupHeading??"Options:").forEach((f,d)=>{let m=f.map(p=>o(t.styleOptionTerm(t.optionTerm(p)),t.styleOptionDescription(t.optionDescription(p))));s=s.concat(this.formatItemList(d,m,t))}),t.showGlobalOptions){let f=t.visibleGlobalOptions(e).map(d=>o(t.styleOptionTerm(t.optionTerm(d)),t.styleOptionDescription(t.optionDescription(d))));s=s.concat(this.formatItemList("Global Options:",f,t))}return this.groupItems(e.commands,t.visibleCommands(e),f=>f.helpGroup()||"Commands:").forEach((f,d)=>{let m=f.map(p=>o(t.styleSubcommandTerm(t.subcommandTerm(p)),t.styleSubcommandDescription(t.subcommandDescription(p))));s=s.concat(this.formatItemList(d,m,t))}),s.join(`
9
+ `)}displayWidth(e){return Gi(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleSubcommandText(t)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,i){let s=" ".repeat(2);if(!n)return s+e;let a=e.padEnd(t+e.length-i.displayWidth(e)),u=2,l=(this.helpWidth??80)-t-u-2,f;return l<this.minWidthToWrap||i.preformatted(n)?f=n:f=i.boxWrap(n,l).replace(/\n/g,`
10
10
  `+" ".repeat(t+u)),s+a+" ".repeat(u)+f.replace(/\n/g,`
11
- ${s}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let r=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,o=[];return r.forEach(s=>{let a=s.match(i);if(a===null){o.push("");return}let u=[a.shift()],c=this.displayWidth(u[0]);a.forEach(l=>{let f=this.displayWidth(l);if(c+f<=t){u.push(l),c+=f;return}o.push(u.join(""));let d=l.trimStart();u=[d],c=this.displayWidth(d)}),o.push(u.join(""))}),o.join(`
12
- `)}};var ce=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=new RegExp("\\p{ID_Continue}\\.\\.\\.[>\\]]$","u").test(e),this.mandatory=!1;let r=Wi(e);this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new Z(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,r):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Zt(this.name().replace(/^no-/,"")):Zt(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Ge=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,r)=>{this.positiveOptions.has(r)&&this.dualOptions.add(r)})}valueFromOption(e,t){let r=t.attributeName();if(!this.dualOptions.has(r))return!0;let i=this.negativeOptions.get(r).presetArg,o=i!==void 0?i:!1;return t.negate===(o===e)}};function Zt(n){return n.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function Wi(n){let e,t,r=/^-[^-]$/,i=/^--[^-]/,o=n.split(/[ |,]+/).concat("guard");if(r.test(o[0])&&(e=o.shift()),i.test(o[0])&&(t=o.shift()),!e&&r.test(o[0])&&(e=o.shift()),!e&&i.test(o[0])&&(e=t,t=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${n}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
11
+ ${s}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,o=[];return n.forEach(s=>{let a=s.match(i);if(a===null){o.push("");return}let u=[a.shift()],c=this.displayWidth(u[0]);a.forEach(l=>{let f=this.displayWidth(l);if(c+f<=t){u.push(l),c+=f;return}o.push(u.join(""));let d=l.trimStart();u=[d],c=this.displayWidth(d)}),o.push(u.join(""))}),o.join(`
12
+ `)}};var ce=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=new RegExp("\\p{ID_Continue}\\.\\.\\.[>\\]]$","u").test(e),this.mandatory=!1;let n=Ui(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new Z(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,n):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?or(this.name().replace(/^no-/,"")):or(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Ue=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return t.negate===(o===e)}};function or(r){return r.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function Ui(r){let e,t,n=/^-[^-]$/,i=/^--[^-]/,o=r.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(t=o.shift()),!e&&n.test(o[0])&&(e=o.shift()),!e&&i.test(o[0])&&(e=t,t=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${r}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
13
13
  - a short flag is a single dash and a single character
14
14
  - either use a single dash and a single character (for a short flag)
15
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(s)?new Error(`${a}
15
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a}
16
16
  - too many short flags`):i.test(s)?new Error(`${a}
17
17
  - too many long flags`):new Error(`${a}
18
- - unrecognised flag format`)}if(e===void 0&&t===void 0)throw new Error(`option creation failed due to no flags found in '${n}'.`);return{shortFlag:e,longFlag:t}}function Vi(n,e){if(Math.abs(n.length-e.length)>3)return Math.max(n.length,e.length);let t=[];for(let r=0;r<=n.length;r++)t[r]=[r];for(let r=0;r<=e.length;r++)t[0][r]=r;for(let r=1;r<=e.length;r++)for(let i=1;i<=n.length;i++){let o;n[i-1]===e[r-1]?o=0:o=1,t[i][r]=Math.min(t[i-1][r]+1,t[i][r-1]+1,t[i-1][r-1]+o),i>1&&r>1&&n[i-1]===e[r-2]&&n[i-2]===e[r-1]&&(t[i][r]=Math.min(t[i][r],t[i-2][r-2]+1))}return t[n.length][e.length]}function ht(n,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=n.startsWith("--");t&&(n=n.slice(2),e=e.map(s=>s.slice(2)));let r=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=Vi(n,s),u=Math.max(n.length,s.length);(u-a)/u>o&&(a<i?(i=a,r=[s]):a===i&&r.push(s))}),r.sort((s,a)=>s.localeCompare(a)),t&&(r=r.map(s=>`--${s}`)),r.length>1?`
19
- (Did you mean one of ${r.join(", ")}?)`:r.length===1?`
20
- (Did you mean ${r[0]}?)`:""}var fe=class n extends Gi{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:t=>b.stdout.write(t),writeErr:t=>b.stderr.write(t),outputError:(t,r)=>r(t),getOutHelpWidth:()=>b.stdout.isTTY?b.stdout.columns:void 0,getErrHelpWidth:()=>b.stderr.isTTY?b.stderr.columns:void 0,getOutHasColors:()=>tr()??(b.stdout.isTTY&&b.stdout.hasColors?.()),getErrHasColors:()=>tr()??(b.stderr.isTTY&&b.stderr.hasColors?.()),stripColor:t=>Ui(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,r){let i=t,o=r;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return i&&(u.description(i),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),i?this:u}createCommand(e){return new n(e)}createHelp(){return Object.assign(new Se,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
21
- - specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new xe(e,t)}argument(e,t,r,i){let o=this.createArgument(e,t);return typeof r=="function"?o.default(i).argParser(r):o.default(r),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let r=e??"help [command]",[,i,o]=r.match(/([^ ]+) *(.*)/),s=t??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let r=["preSubcommand","preAction","postAction"];if(!r.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
22
- Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,r){this._exitCallback&&this._exitCallback(new ne(e,t,r)),b.exit(e)}action(e){let t=r=>{let i=this.registeredArguments.length,o=r.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=t,this}createOption(e,t){return new ce(e,t)}_callParseArg(e,t,r,i){try{return e.parseArg(t,r)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let r=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${r}'
23
- - already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=i=>[i.name()].concat(i.aliases()),r=t(e).find(i=>this._findCommand(i));if(r){let i=t(this._findCommand(r)).join("|"),o=t(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),r=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(r,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let u=this.getOptionValue(r);o!==null&&e.parseArg?o=this._callParseArg(e,o,u,s):o!==null&&e.variadic&&(o=e._collectValue(o,u)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(r,o,a)};return this.on("option:"+t,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+t,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,t,r,i,o){if(typeof t=="object"&&t instanceof ce)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(t,r);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(u,c)=>{let l=a.exec(u);return l?l[0]:c},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,t,r,i){return this._optionEx({},e,t,r,i)}requiredOption(e,t,r,i){return this._optionEx({mandatory:!0},e,t,r,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,r){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(r=>{Object.hasOwn(r._optionValueSources,e)&&(t=r.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){b.versions?.electron&&(t.from="electron");let i=b.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(t.from="eval")}e===void 0&&(e=b.argv),this.rawArgs=e.slice();let r;switch(t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":b.defaultApp?(this._scriptPath=e[1],r=e.slice(2)):r=e.slice(1);break;case"user":r=e.slice(0);break;case"eval":r=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return this._parseCommand([],r),this}async parseAsync(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return await this._parseCommand([],r),this}_prepareForParse(){this._savedState===null?(this.options.filter(e=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach(e=>{let t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(e.attributeName(),!0,"default")}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
24
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,r){if(Ue.existsSync(e))return;let i=t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
25
- - if '${r}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
18
+ - unrecognised flag format`)}if(e===void 0&&t===void 0)throw new Error(`option creation failed due to no flags found in '${r}'.`);return{shortFlag:e,longFlag:t}}function Ki(r,e){if(Math.abs(r.length-e.length)>3)return Math.max(r.length,e.length);let t=[];for(let n=0;n<=r.length;n++)t[n]=[n];for(let n=0;n<=e.length;n++)t[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=r.length;i++){let o;r[i-1]===e[n-1]?o=0:o=1,t[i][n]=Math.min(t[i-1][n]+1,t[i][n-1]+1,t[i-1][n-1]+o),i>1&&n>1&&r[i-1]===e[n-2]&&r[i-2]===e[n-1]&&(t[i][n]=Math.min(t[i][n],t[i-2][n-2]+1))}return t[r.length][e.length]}function Dt(r,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=r.startsWith("--");t&&(r=r.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=Ki(r,s),u=Math.max(r.length,s.length);(u-a)/u>o&&(a<i?(i=a,n=[s]):a===i&&n.push(s))}),n.sort((s,a)=>s.localeCompare(a)),t&&(n=n.map(s=>`--${s}`)),n.length>1?`
19
+ (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
20
+ (Did you mean ${n[0]}?)`:""}var fe=class r extends qi{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:t=>b.stdout.write(t),writeErr:t=>b.stderr.write(t),outputError:(t,n)=>n(t),getOutHelpWidth:()=>b.stdout.isTTY?b.stdout.columns:void 0,getErrHelpWidth:()=>b.stderr.isTTY?b.stderr.columns:void 0,getOutHasColors:()=>ur()??(b.stdout.isTTY&&b.stdout.hasColors?.()),getErrHasColors:()=>ur()??(b.stderr.isTTY&&b.stderr.hasColors?.()),stripColor:t=>zi(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let i=t,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return i&&(u.description(i),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),i?this:u}createCommand(e){return new r(e)}createHelp(){return Object.assign(new xe,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
21
+ - specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new Se(e,t)}argument(e,t,n,i){let o=this.createArgument(e,t);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=e??"help [command]",[,i,o]=n.match(/([^ ]+) *(.*)/),s=t??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
22
+ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new ne(e,t,n)),b.exit(e)}action(e){let t=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=t,this}createOption(e,t){return new ce(e,t)}_callParseArg(e,t,n,i){try{return e.parseArg(t,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
23
+ - already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=i=>[i.name()].concat(i.aliases()),n=t(e).find(i=>this._findCommand(i));if(n){let i=t(this._findCommand(n)).join("|"),o=t(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let u=this.getOptionValue(n);o!==null&&e.parseArg?o=this._callParseArg(e,o,u,s):o!==null&&e.variadic&&(o=e._collectValue(o,u)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+t,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+t,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,t,n,i,o){if(typeof t=="object"&&t instanceof ce)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(t,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(u,c)=>{let l=a.exec(u);return l?l[0]:c},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,t,n,i){return this._optionEx({},e,t,n,i)}requiredOption(e,t,n,i){return this._optionEx({mandatory:!0},e,t,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{Object.hasOwn(n._optionValueSources,e)&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){b.versions?.electron&&(t.from="electron");let i=b.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(t.from="eval")}e===void 0&&(e=b.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":b.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?(this.options.filter(e=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach(e=>{let t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(e.attributeName(),!0,"default")}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
24
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,n){if(Ke.existsSync(e))return;let i=t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
25
+ - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
26
26
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
27
- - ${i}`;throw new Error(o)}_executeSubCommand(e,t){t=t.slice();let r=[".js",".ts",".tsx",".mjs",".cjs"];function i(l,f){let d=ee.resolve(l,f);if(Ue.existsSync(d))return d;if(r.includes(ee.extname(f)))return;let D=r.find(p=>Ue.existsSync(`${d}${p}`));if(D)return`${d}${D}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,s=this._executableDir||"";if(this._scriptPath){let l;try{l=Ue.realpathSync(this._scriptPath)}catch{l=this._scriptPath}s=ee.resolve(ee.dirname(l),s)}if(s){let l=i(s,o);if(!l&&!e._executableFile&&this._scriptPath){let f=ee.basename(this._scriptPath,ee.extname(this._scriptPath));f!==this._name&&(l=i(s,`${f}-${e._name}`))}o=l||o}let a=r.includes(ee.extname(o)),u;b.platform!=="win32"?a?(t.unshift(o),t=er(b.execArgv).concat(t),u=mt.spawn(b.argv[0],t,{stdio:"inherit"})):u=mt.spawn(o,t,{stdio:"inherit"}):(this._checkForMissingExecutable(o,s,e._name),t.unshift(o),t=er(b.execArgv).concat(t),u=mt.spawn(b.execPath,t,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{b.on(f,()=>{u.killed===!1&&u.exitCode===null&&u.kill(f)})});let c=this._exitCallback;u.on("close",l=>{l=l??1,c?c(new ne(l,"commander.executeSubCommandAsync","(close)")):b.exit(l)}),u.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(o,s,e._name);else if(l.code==="EACCES")throw new Error(`'${o}' not executable`);if(!c)b.exit(1);else{let f=new ne(1,"commander.executeSubCommandAsync","(error)");f.nestedError=l,c(f)}}),this.runningCommand=u}_dispatchSubcommand(e,t,r){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,t.concat(r));else return i._parseCommand(t,r)}),o}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(r,i,o)=>{let s=i;if(i!==null&&r.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${r.name()}'.`;s=this._callParseArg(r,i,o,a)}return s};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((r,i)=>{let o=r.defaultValue;r.variadic?i<this.args.length?(o=this.args.slice(i),r.parseArg&&(o=o.reduce((s,a)=>e(r,a,s),r.defaultValue))):o===void 0&&(o=[]):i<this.args.length&&(o=this.args[i],r.parseArg&&(o=e(r,o,r.defaultValue))),t[i]=o}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let r=e,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[t]!==void 0).forEach(o=>{o._lifeCycleHooks[t].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),t==="postAction"&&i.reverse(),i.forEach(o=>{r=this._chainOrCall(r,()=>o.callback(o.hookedCommand,this))}),r}_chainOrCallSubCommandHook(e,t,r){let i=e;return this._lifeCycleHooks[r]!==void 0&&this._lifeCycleHooks[r].forEach(o=>{i=this._chainOrCall(i,()=>o(this,t))}),i}_parseCommand(e,t){let r=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(r.operands),t=r.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{r.unknown.length>0&&this.unknownOption(r.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,t)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(r=>{let i=r.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(r=>r.conflictsWith.length>0).forEach(r=>{let i=e.find(o=>r.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(r,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],r=[],i=t;function o(l){return l.length>1&&l[0]==="-"}let s=l=>/^-(\d+|\d*\.\d+)([eE][+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(f=>f.options.map(d=>d.short).some(d=>/^-\d$/.test(d))):!1,a=null,u=null,c=0;for(;c<e.length||u;){let l=u??e[c++];if(u=null,l==="--"){i===r&&i.push(l),i.push(...e.slice(c));break}if(a&&(!o(l)||s(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,o(l)){let f=this._findOption(l);if(f){if(f.required){let d=e[c++];d===void 0&&this.optionMissingArgument(f),this.emit(`option:${f.name()}`,d)}else if(f.optional){let d=null;c<e.length&&(!o(e[c])||s(e[c]))&&(d=e[c++]),this.emit(`option:${f.name()}`,d)}else this.emit(`option:${f.name()}`);a=f.variadic?f:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let f=this._findOption(`-${l[1]}`);if(f){f.required||f.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${f.name()}`,l.slice(2)):(this.emit(`option:${f.name()}`),u=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let f=l.indexOf("="),d=this._findOption(l.slice(0,f));if(d&&(d.required||d.optional)){this.emit(`option:${d.name()}`,l.slice(f+1));continue}}if(i===t&&o(l)&&!(this.commands.length===0&&s(l))&&(i=r),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&r.length===0){if(this._findCommand(l)){t.push(l),r.push(...e.slice(c));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}else if(this._defaultCommandName){r.push(l,...e.slice(c));break}}if(this._passThroughOptions){i.push(l,...e.slice(c));break}i.push(l)}return{operands:t,unknown:r}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let r=0;r<t;r++){let i=this.options[r].attributeName();e[i]=i===this._versionOptionName?this._version:this[i]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
27
+ - ${i}`;throw new Error(o)}_executeSubCommand(e,t){t=t.slice();let n=[".js",".ts",".tsx",".mjs",".cjs"];function i(l,f){let d=ee.resolve(l,f);if(Ke.existsSync(d))return d;if(n.includes(ee.extname(f)))return;let m=n.find(p=>Ke.existsSync(`${d}${p}`));if(m)return`${d}${m}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,s=this._executableDir||"";if(this._scriptPath){let l;try{l=Ke.realpathSync(this._scriptPath)}catch{l=this._scriptPath}s=ee.resolve(ee.dirname(l),s)}if(s){let l=i(s,o);if(!l&&!e._executableFile&&this._scriptPath){let f=ee.basename(this._scriptPath,ee.extname(this._scriptPath));f!==this._name&&(l=i(s,`${f}-${e._name}`))}o=l||o}let a=n.includes(ee.extname(o)),u;b.platform!=="win32"?a?(t.unshift(o),t=sr(b.execArgv).concat(t),u=gt.spawn(b.argv[0],t,{stdio:"inherit"})):u=gt.spawn(o,t,{stdio:"inherit"}):(this._checkForMissingExecutable(o,s,e._name),t.unshift(o),t=sr(b.execArgv).concat(t),u=gt.spawn(b.execPath,t,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{b.on(f,()=>{u.killed===!1&&u.exitCode===null&&u.kill(f)})});let c=this._exitCallback;u.on("close",l=>{l=l??1,c?c(new ne(l,"commander.executeSubCommandAsync","(close)")):b.exit(l)}),u.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(o,s,e._name);else if(l.code==="EACCES")throw new Error(`'${o}' not executable`);if(!c)b.exit(1);else{let f=new ne(1,"commander.executeSubCommandAsync","(error)");f.nestedError=l,c(f)}}),this.runningCommand=u}_dispatchSubcommand(e,t,n){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,t.concat(n));else return i._parseCommand(t,n)}),o}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,o)=>{let s=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,i,o,a)}return s};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,i)=>{let o=n.defaultValue;n.variadic?i<this.args.length?(o=this.args.slice(i),n.parseArg&&(o=o.reduce((s,a)=>e(n,a,s),n.defaultValue))):o===void 0&&(o=[]):i<this.args.length&&(o=this.args[i],n.parseArg&&(o=e(n,o,n.defaultValue))),t[i]=o}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[t]!==void 0).forEach(o=>{o._lifeCycleHooks[t].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),t==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{i=this._chainOrCall(i,()=>o(this,t))}),i}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,t)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(o=>n.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],i=t;function o(l){return l.length>1&&l[0]==="-"}let s=l=>/^-(\d+|\d*\.\d+)([eE][+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(f=>f.options.map(d=>d.short).some(d=>/^-\d$/.test(d))):!1,a=null,u=null,c=0;for(;c<e.length||u;){let l=u??e[c++];if(u=null,l==="--"){i===n&&i.push(l),i.push(...e.slice(c));break}if(a&&(!o(l)||s(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,o(l)){let f=this._findOption(l);if(f){if(f.required){let d=e[c++];d===void 0&&this.optionMissingArgument(f),this.emit(`option:${f.name()}`,d)}else if(f.optional){let d=null;c<e.length&&(!o(e[c])||s(e[c]))&&(d=e[c++]),this.emit(`option:${f.name()}`,d)}else this.emit(`option:${f.name()}`);a=f.variadic?f:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let f=this._findOption(`-${l[1]}`);if(f){f.required||f.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${f.name()}`,l.slice(2)):(this.emit(`option:${f.name()}`),u=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let f=l.indexOf("="),d=this._findOption(l.slice(0,f));if(d&&(d.required||d.optional)){this.emit(`option:${d.name()}`,l.slice(f+1));continue}}if(i===t&&o(l)&&!(this.commands.length===0&&s(l))&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}else if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){i.push(l,...e.slice(c));break}i.push(l)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let i=this.options[n].attributeName();e[i]=i===this._versionOptionName?this._version:this[i]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
28
28
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
29
29
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
30
- `),this.outputHelp({error:!0}));let r=t||{},i=r.exitCode||1,o=r.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in b.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,b.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Ge(this.options),t=r=>this.getOptionValue(r)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(r));this.options.filter(r=>r.implied!==void 0&&t(r.attributeName())&&e.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach(r=>{Object.keys(r.implied).filter(i=>!t(i)).forEach(i=>{this.setOptionValueWithSource(i,r.implied[i],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let r=s=>{let a=s.attributeName(),u=this.getOptionValue(a),c=this.options.find(f=>f.negate&&a===f.attributeName()),l=this.options.find(f=>!f.negate&&a===f.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||s},i=s=>{let a=r(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(t)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);t=ht(e,i)}let r=`error: unknown option '${e}'${t}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,r=t===1?"":"s",i=e.length,o=this.parent?` for '${this.name()}'`:"",s=e.join(", "),a=`error: too many arguments${o}. Expected ${t} argument${r} but got ${i}: ${s}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),t=ht(e,i)}let r=`error: unknown command '${e}'${t}`;this.error(r,{code:"commander.unknownCommand"})}version(e,t,r){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",r=r||"output the version number";let i=this.createOption(t,r);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
31
- `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(e);if(r){let i=[r.name()].concat(r.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(r=>Ve(r));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=ee.basename(e,ee.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),r=this._getOutputContext(e);t.prepareContext({error:r.error,helpWidth:r.helpWidth,outputHasColors:r.hasColors});let i=t.formatHelp(this,t);return r.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let t=!!e.error,r,i,o;return t?(r=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(r=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:t,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),r(a)),hasColors:i,helpWidth:o}}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let r=this._getOutputContext(e),i={error:r.error,write:r.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:r.error});if(t&&(o=t(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,t){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",t??"display help for command"),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(b.exitCode??0);t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw new Error(`Unexpected value for position to addHelpText.
32
- Expecting one of '${r.join("', '")}'`);let i=`${e}Help`;return this.on(i,o=>{let s;typeof t=="function"?s=t({error:o.error,command:o.command}):s=t,s&&o.write(`${s}
33
- `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function er(n){return n.map(e=>{if(!e.startsWith("--inspect"))return e;let t,r="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk|-wait)?)$/))!==null?t=o[1]:(o=e.match(/^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+)$/))!==null?(t=o[1],/^\d+$/.test(o[3])?i=o[3]:r=o[3]):(o=e.match(/^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+):(\d+)$/))!==null&&(t=o[1],r=o[3],i=o[4]),t&&i!=="0"?`${t}=${r}:${parseInt(i)+1}`:e})}function tr(){if(b.env.NO_COLOR||b.env.FORCE_COLOR==="0"||b.env.FORCE_COLOR==="false")return!1;if(b.env.FORCE_COLOR||b.env.CLICOLOR_FORCE!==void 0)return!0}var ya=new fe;function rr(n,e,t){let r=n.indexOf(e);if(r===-1)return n;let i=e.length,o=0,s="";do s+=n.slice(o,r)+e+t,o=r+i,r=n.indexOf(e,o);while(r!==-1);return s+=n.slice(o),s}function nr(n,e,t,r){let i=0,o="";do{let s=n[r-1]==="\r";o+=n.slice(i,s?r-1:r)+e+(s?`\r
30
+ `),this.outputHelp({error:!0}));let n=t||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in b.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,b.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Ue(this.options),t=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!t(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let n=s=>{let a=s.attributeName(),u=this.getOptionValue(a),c=this.options.find(f=>f.negate&&a===f.attributeName()),l=this.options.find(f=>!f.negate&&a===f.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||s},i=s=>{let a=n(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(t)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);t=Dt(e,i)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?"":"s",i=e.length,o=this.parent?` for '${this.name()}'`:"",s=e.join(", "),a=`error: too many arguments${o}. Expected ${t} argument${n} but got ${i}: ${s}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),t=Dt(e,i)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";let i=this.createOption(t,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
31
+ `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(n=>Ge(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=ee.basename(e,ee.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=t.formatHelp(this,t);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let t=!!e.error,n,i,o;return t?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:t,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(t&&(o=t(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,t){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",t??"display help for command"),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(b.exitCode??0);t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
32
+ Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,o=>{let s;typeof t=="function"?s=t({error:o.error,command:o.command}):s=t,s&&o.write(`${s}
33
+ `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function sr(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk|-wait)?)$/))!==null?t=o[1]:(o=e.match(/^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+)$/))!==null?(t=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+):(\d+)$/))!==null&&(t=o[1],n=o[3],i=o[4]),t&&i!=="0"?`${t}=${n}:${parseInt(i)+1}`:e})}function ur(){if(b.env.NO_COLOR||b.env.FORCE_COLOR==="0"||b.env.FORCE_COLOR==="false")return!1;if(b.env.FORCE_COLOR||b.env.CLICOLOR_FORCE!==void 0)return!0}var Ba=new fe;function ar(r,e,t){let n=r.indexOf(e);if(n===-1)return r;let i=e.length,o=0,s="";do s+=r.slice(o,n)+e+t,o=n+i,n=r.indexOf(e,o);while(n!==-1);return s+=r.slice(o),s}function lr(r,e,t,n){let i=0,o="";do{let s=r[n-1]==="\r";o+=r.slice(i,s?n-1:n)+e+(s?`\r
34
34
  `:`
35
- `)+t,i=r+1,r=n.indexOf(`
36
- `,i)}while(r!==-1);return o+=n.slice(i),o}var ir=(n=0)=>e=>`\x1B[${e+n}m`,Dt=(n=0)=>e=>`\x1B[${38+n};5;${e}m`,gt=(n=0)=>(e,t,r)=>`\x1B[${38+n};2;${e};${t};${r}m`,Ki=n=>`\x1B[58;5;${n<90?n-30:n-90+8}m`,w={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],underlineDouble:["4:2",24],underlineCurly:["4:3",24],underlineDotted:["4:4",24],underlineDashed:["4:5",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]},underlineColor:{underlineBlack:["58;5;0",59],underlineRed:["58;5;1",59],underlineGreen:["58;5;2",59],underlineYellow:["58;5;3",59],underlineBlue:["58;5;4",59],underlineMagenta:["58;5;5",59],underlineCyan:["58;5;6",59],underlineWhite:["58;5;7",59],underlineBlackBright:["58;5;8",59],underlineGray:["58;5;8",59],underlineGrey:["58;5;8",59],underlineRedBright:["58;5;9",59],underlineGreenBright:["58;5;10",59],underlineYellowBright:["58;5;11",59],underlineBlueBright:["58;5;12",59],underlineMagentaBright:["58;5;13",59],underlineCyanBright:["58;5;14",59],underlineWhiteBright:["58;5;15",59]}},ba=Object.keys(w.modifier),qi=Object.keys(w.color),zi=Object.keys(w.bgColor),wa=Object.keys(w.underlineColor),_a=[...qi,...zi];function Yi(){let n=new Map;for(let[e,t]of Object.entries(w)){for(let[r,i]of Object.entries(t))w[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[r]=w[r],n.set(Number.parseInt(i[0],10),i[1]);Object.defineProperty(w,e,{value:t,enumerable:!1})}return Object.defineProperty(w,"codes",{value:n,enumerable:!1}),w.color.close="\x1B[39m",w.bgColor.close="\x1B[49m",w.underlineColor.close="\x1B[59m",w.color.ansi=ir(),w.color.ansi256=Dt(),w.color.ansi16m=gt(),w.bgColor.ansi=ir(10),w.bgColor.ansi256=Dt(10),w.bgColor.ansi16m=gt(10),w.underlineColor.ansi=Ki,w.underlineColor.ansi256=Dt(20),w.underlineColor.ansi16m=gt(20),Object.defineProperties(w,{rgbToAnsi256:{value(e,t,r){return e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[\da-f]{6}|[\da-f]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(o=>o+o).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>w.rgbToAnsi256(...w.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,r,i;if(e>=232)t=((e-232)*10+8)/255,r=t,i=t;else{e-=16;let a=e%36;t=Math.floor(e/36)/5,r=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(t,r,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(t));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>w.ansi256ToAnsi(w.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>w.ansi256ToAnsi(w.hexToAnsi256(e)),enumerable:!1}}),w}var Ji=Yi(),z=Ji;import yt from"node:process";import Xi from"node:os";import or from"node:tty";function G(n,e=globalThis.Deno?globalThis.Deno.args:yt.argv){let t=n.startsWith("-")?"":n.length===1?"-":"--",r=e.indexOf(t+n),i=e.indexOf("--");return r!==-1&&(i===-1||r<i)}var{env:x}=yt,Ke;G("no-color")||G("no-colors")||G("color=false")||G("color=never")?Ke=0:(G("color")||G("colors")||G("color=true")||G("color=always"))&&(Ke=1);function ur(){return/^\d+$/.test(x.FORCE_COLOR)}function Qi(){if("FORCE_COLOR"in x){if(x.FORCE_COLOR==="false")return 0;if(x.FORCE_COLOR==="true"||x.FORCE_COLOR.length===0)return 1;if(ur())return Math.min(Number.parseInt(x.FORCE_COLOR,10),3)}}function Zi(n){return n===0?!1:{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function eo(n,{streamIsTTY:e,sniffFlags:t=!0}={}){let r=Qi();r!==void 0&&(Ke=r);let i=t?Ke:r;if(i===0)return 0;if(t){if(G("color=16m")||G("color=full")||G("color=truecolor"))return 3;if(G("color=256"))return 2}if(i!==void 0&&ur())return i;if("TF_BUILD"in x&&"AGENT_NAME"in x)return 1;if(n&&!e&&i===void 0)return 0;let o=i||0;if(x.TERM==="dumb")return o;if(yt.platform==="win32"){let s=Xi.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in x)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in x)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in x)||x.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in x)return/^(?:9\.0*[1-9]\d*\.|\d{2,}\.)/.test(x.TEAMCITY_VERSION)?1:0;if(x.COLORTERM==="truecolor"||x.TERM==="xterm-kitty"||x.TERM==="xterm-ghostty"||x.TERM==="wezterm")return 3;if("TERM_PROGRAM"in x){let s=Number.parseInt((x.TERM_PROGRAM_VERSION||"").split(".",1)[0],10);switch(x.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(?:color)?$/i.test(x.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(x.TERM)||"COLORTERM"in x?1:o}function sr(n,e={}){let t=eo(n,{streamIsTTY:n&&n.isTTY,...e});return Zi(t)}var to={stdout:sr({isTTY:or.isatty(1)}),stderr:sr({isTTY:or.isatty(2)})},ar=to;var{stdout:lr,stderr:cr}=ar,Ae=Symbol("GENERATOR"),Oe=Symbol("STYLER"),ze=Symbol("IS_EMPTY"),qe=Symbol("LEVEL"),ve=Object.create(null),fr=n=>{if(!Number.isSafeInteger(n)||n<0||n>3)throw new Error("The `level` should be an integer from 0 to 3")},ro={enumerable:!0,get(){return this[qe]},set(n){fr(n),this[qe]=n}},no=(n,e={})=>{e.level!==void 0&&fr(e.level);let t=lr?lr.level:0;n[qe]=e.level===void 0?t:e.level};var io=n=>{let e=(...t)=>t.join(" ");return no(e,n),Object.setPrototypeOf(e,ke.prototype),e};function ke(n){return io(n)}Object.setPrototypeOf(ke.prototype,Function.prototype);for(let[n,e]of Object.entries(z))ve[n]={get(){let t=Et(this,dr(e.open,e.close,this[Oe]),this[ze]);return Object.defineProperty(this,n,{value:t}),t}};ve.visible={get(){let n=Et(this,this[Oe],!0);return Object.defineProperty(this,"visible",{value:n}),n}};var oo=(n,e)=>{let t=z[e];if(n==="rgb"){let i=(s,a,u)=>t.ansi(z.rgbToAnsi(s,a,u));return[i,i,(s,a,u)=>t.ansi256(z.rgbToAnsi256(s,a,u)),t.ansi16m]}if(n==="hex"){let i=s=>t.ansi(z.hexToAnsi(s));return[i,i,s=>t.ansi256(z.hexToAnsi256(s)),s=>t.ansi16m(...z.hexToRgb(s))]}let r=i=>t.ansi(z.ansi256ToAnsi(i));return[r,r,t.ansi256,t.ansi256]},so=["rgb","hex","ansi256"];for(let n of so){let e=n[0].toUpperCase()+n.slice(1);for(let[t,r]of[[n,"color"],["bg"+e,"bgColor"],["underline"+e,"underlineColor"]]){let{close:i}=z[r],o=oo(n,r);ve[t]={get(){let s=function(a,u,c){let l=o[this.level](a,u,c);return Et(this,dr(l,i,this[Oe]),this[ze])};return Object.defineProperty(this,t,{value:s}),s}}}}var uo=Object.defineProperties(()=>{},{...ve,level:{enumerable:!0,get(){return this[Ae].level},set(n){this[Ae].level=n}}}),dr=(n,e,t)=>{let r,i;return t===void 0?(r=n,i=e):(r=t.openAll+n,i=e+t.closeAll),{open:n,close:e,openAll:r,closeAll:i,parent:t}},Et=(n,e,t)=>{let r=(...i)=>i.length===1?Ct(r,""+i[0]):i.length===2?Ct(r,`${i[0]??""} ${i[1]??""}`):Ct(r,i.join(" "));return Object.setPrototypeOf(r,uo),r[Ae]=n[Ae]??n,r[Oe]=e,r[ze]=t,r},Ct=(n,e)=>{if(n[Ae][qe]<=0||!e)return n[ze]?"":e;let t=n[Oe];if(t===void 0)return e;let{openAll:r,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=rr(e,t.close,t.open),t=t.parent;let o=e.indexOf(`
37
- `);return o!==-1&&(e=nr(e,i,r,o)),r+e+i};Object.defineProperties(ke.prototype,{...ve,level:ro});var ao=ke(),Ra=ke({level:cr?cr.level:0});var m=ao;var Fi=$i(hn(),1);import{existsSync as J,readdirSync as Pn,readFileSync as _s,statSync as Fs}from"node:fs";import{basename as Bs,join as re}from"node:path";import{createDecipheriv as kt}from"node:crypto";var qo=Buffer.alloc(16," "),he=12,me=16;function Ze(n,e){if(!n||n.length===0)return Buffer.alloc(0);let t=Buffer.isBuffer(n)?n:Buffer.from(n),r=t.subarray(0,3).toString("utf-8");if(r!=="v10"&&r!=="v11")return"<unsupported encryption format>";let i=t.subarray(3);try{let o=kt("aes-128-cbc",e,qo),s=o.update(i);return s=Buffer.concat([s,o.final()]),s}catch{return"<decryption failed>"}}function mn(n,e){if(!n||n.length===0)return Buffer.alloc(0);let t=Buffer.isBuffer(n)?n:Buffer.from(n),r=t.subarray(0,3).toString("utf-8");if(r!=="v10"&&r!=="v11")return"<unsupported encryption format>";if(t.length<3+he+me)return"<decryption failed>";let i=t.subarray(3,3+he),o=t.subarray(t.length-me),s=t.subarray(3+he,t.length-me);try{let a=kt("aes-256-gcm",e,i);return a.setAuthTag(o),Buffer.concat([a.update(s),a.final()])}catch{return"<decryption failed>"}}function et(n,e){if(!n||n.length===0)return Buffer.alloc(0);let t=Buffer.isBuffer(n)?n:Buffer.from(n);if(t.subarray(0,3).toString("utf-8")!=="v20")return"<unsupported encryption format>";if(t.length<3+he+me)return"<decryption failed>";let i=t.subarray(3,3+he),o=t.subarray(t.length-me),s=t.subarray(3+he,t.length-me);try{let a=kt("aes-256-gcm",e,i);return a.setAuthTag(o),Buffer.concat([a.update(s),a.final()])}catch{return"<decryption failed>"}}function R(n){if(n==null)return"N/A";try{let e=BigInt(n);if(e===0n)return"N/A";let t=e-11644473600000000n,r=Number(t/1000n),i=new Date(r);return isNaN(i.getTime())?"N/A":i.toLocaleString()}catch{return"N/A"}}var F=class extends Error{constructor(t,r,i){super(r,i);this.code=t}code};function B(n,e,t,r){if(!n)return;let i=r instanceof F?r.code:r?.code==="ENOENT"?"missing_store":"unreadable";n({profile:e,store:t,code:i,message:r instanceof Error?r.message:String(r)})}import{homedir as ns}from"node:os";import{join as is}from"node:path";import{execFileSync as zo}from"node:child_process";import{pbkdf2Sync as Yo}from"node:crypto";var Jo=1003,Xo=16,Qo=Buffer.from("saltysalt"),Dn="Chrome Safe Storage",Rt={ITEM_NOT_FOUND:44,INTERACTION_NOT_ALLOWED:36,AUTH_FAILED:45,USER_CANCELED:128},De=class extends Error{service;kind;constructor(e,t,r){super(e),this.name="KeychainAccessError",this.service=t,this.kind=r}get isAccessDenied(){return this.kind==="access-denied"}};function tt(n){return n instanceof De&&n.isAccessDenied}var Tt=new Map,Lt=new Map;function Zo(){return!!(process.env.SSH_CONNECTION||process.env.SSH_TTY)||!process.env.TERM_PROGRAM}function es(n){let e=n;return{status:typeof e?.status=="number"?e.status:null,stderr:(e?.stderr??"").toString().trim()}}function ts(n,e,t){let r="See docs/remote-keychain-access.md for non-interactive / SSH setup.",i,o;e===Rt.ITEM_NOT_FOUND||/could not be found/i.test(t)?(i="not-found",o=`No '${n}' item found in the Keychain.
38
- Run this browser at least once on this machine so it creates the key.`):e===Rt.INTERACTION_NOT_ALLOWED||/interaction.*not allowed/i.test(t)?(i="access-denied",o="The Keychain needs a GUI authorization prompt that can't be shown here "+(Zo()?`(you appear to be on a remote/SSH session).
35
+ `)+t,i=n+1,n=r.indexOf(`
36
+ `,i)}while(n!==-1);return o+=r.slice(i),o}var cr=(r=0)=>e=>`\x1B[${e+r}m`,yt=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,Ct=(r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`,Yi=r=>`\x1B[58;5;${r<90?r-30:r-90+8}m`,w={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],underlineDouble:["4:2",24],underlineCurly:["4:3",24],underlineDotted:["4:4",24],underlineDashed:["4:5",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]},underlineColor:{underlineBlack:["58;5;0",59],underlineRed:["58;5;1",59],underlineGreen:["58;5;2",59],underlineYellow:["58;5;3",59],underlineBlue:["58;5;4",59],underlineMagenta:["58;5;5",59],underlineCyan:["58;5;6",59],underlineWhite:["58;5;7",59],underlineBlackBright:["58;5;8",59],underlineGray:["58;5;8",59],underlineGrey:["58;5;8",59],underlineRedBright:["58;5;9",59],underlineGreenBright:["58;5;10",59],underlineYellowBright:["58;5;11",59],underlineBlueBright:["58;5;12",59],underlineMagentaBright:["58;5;13",59],underlineCyanBright:["58;5;14",59],underlineWhiteBright:["58;5;15",59]}},Aa=Object.keys(w.modifier),Ji=Object.keys(w.color),Xi=Object.keys(w.bgColor),Oa=Object.keys(w.underlineColor),va=[...Ji,...Xi];function Qi(){let r=new Map;for(let[e,t]of Object.entries(w)){for(let[n,i]of Object.entries(t))w[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=w[n],r.set(Number.parseInt(i[0],10),i[1]);Object.defineProperty(w,e,{value:t,enumerable:!1})}return Object.defineProperty(w,"codes",{value:r,enumerable:!1}),w.color.close="\x1B[39m",w.bgColor.close="\x1B[49m",w.underlineColor.close="\x1B[59m",w.color.ansi=cr(),w.color.ansi256=yt(),w.color.ansi16m=Ct(),w.bgColor.ansi=cr(10),w.bgColor.ansi256=yt(10),w.bgColor.ansi16m=Ct(10),w.underlineColor.ansi=Yi,w.underlineColor.ansi256=yt(20),w.underlineColor.ansi16m=Ct(20),Object.defineProperties(w,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[\da-f]{6}|[\da-f]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>w.rgbToAnsi256(...w.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,i;if(e>=232)t=((e-232)*10+8)/255,n=t,i=t;else{e-=16;let a=e%36;t=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(t,n,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(t));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>w.ansi256ToAnsi(w.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>w.ansi256ToAnsi(w.hexToAnsi256(e)),enumerable:!1}}),w}var Zi=Qi(),z=Zi;import Et from"node:process";import eo from"node:os";import fr from"node:tty";function G(r,e=globalThis.Deno?globalThis.Deno.args:Et.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:S}=Et,qe;G("no-color")||G("no-colors")||G("color=false")||G("color=never")?qe=0:(G("color")||G("colors")||G("color=true")||G("color=always"))&&(qe=1);function pr(){return/^\d+$/.test(S.FORCE_COLOR)}function to(){if("FORCE_COLOR"in S){if(S.FORCE_COLOR==="false")return 0;if(S.FORCE_COLOR==="true"||S.FORCE_COLOR.length===0)return 1;if(pr())return Math.min(Number.parseInt(S.FORCE_COLOR,10),3)}}function ro(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function no(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let n=to();n!==void 0&&(qe=n);let i=t?qe:n;if(i===0)return 0;if(t){if(G("color=16m")||G("color=full")||G("color=truecolor"))return 3;if(G("color=256"))return 2}if(i!==void 0&&pr())return i;if("TF_BUILD"in S&&"AGENT_NAME"in S)return 1;if(r&&!e&&i===void 0)return 0;let o=i||0;if(S.TERM==="dumb")return o;if(Et.platform==="win32"){let s=eo.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in S)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in S)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in S)||S.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in S)return/^(?:9\.0*[1-9]\d*\.|\d{2,}\.)/.test(S.TEAMCITY_VERSION)?1:0;if(S.COLORTERM==="truecolor"||S.TERM==="xterm-kitty"||S.TERM==="xterm-ghostty"||S.TERM==="wezterm")return 3;if("TERM_PROGRAM"in S){let s=Number.parseInt((S.TERM_PROGRAM_VERSION||"").split(".",1)[0],10);switch(S.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(?:color)?$/i.test(S.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(S.TERM)||"COLORTERM"in S?1:o}function dr(r,e={}){let t=no(r,{streamIsTTY:r&&r.isTTY,...e});return ro(t)}var io={stdout:dr({isTTY:fr.isatty(1)}),stderr:dr({isTTY:fr.isatty(2)})},hr=io;var{stdout:mr,stderr:Dr}=hr,Ae=Symbol("GENERATOR"),Oe=Symbol("STYLER"),Ye=Symbol("IS_EMPTY"),ze=Symbol("LEVEL"),ve=Object.create(null),gr=r=>{if(!Number.isSafeInteger(r)||r<0||r>3)throw new Error("The `level` should be an integer from 0 to 3")},oo={enumerable:!0,get(){return this[ze]},set(r){gr(r),this[ze]=r}},so=(r,e={})=>{e.level!==void 0&&gr(e.level);let t=mr?mr.level:0;r[ze]=e.level===void 0?t:e.level};var uo=r=>{let e=(...t)=>t.join(" ");return so(e,r),Object.setPrototypeOf(e,ke.prototype),e};function ke(r){return uo(r)}Object.setPrototypeOf(ke.prototype,Function.prototype);for(let[r,e]of Object.entries(z))ve[r]={get(){let t=wt(this,yr(e.open,e.close,this[Oe]),this[Ye]);return Object.defineProperty(this,r,{value:t}),t}};ve.visible={get(){let r=wt(this,this[Oe],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var ao=(r,e)=>{let t=z[e];if(r==="rgb"){let i=(s,a,u)=>t.ansi(z.rgbToAnsi(s,a,u));return[i,i,(s,a,u)=>t.ansi256(z.rgbToAnsi256(s,a,u)),t.ansi16m]}if(r==="hex"){let i=s=>t.ansi(z.hexToAnsi(s));return[i,i,s=>t.ansi256(z.hexToAnsi256(s)),s=>t.ansi16m(...z.hexToRgb(s))]}let n=i=>t.ansi(z.ansi256ToAnsi(i));return[n,n,t.ansi256,t.ansi256]},lo=["rgb","hex","ansi256"];for(let r of lo){let e=r[0].toUpperCase()+r.slice(1);for(let[t,n]of[[r,"color"],["bg"+e,"bgColor"],["underline"+e,"underlineColor"]]){let{close:i}=z[n],o=ao(r,n);ve[t]={get(){let s=function(a,u,c){let l=o[this.level](a,u,c);return wt(this,yr(l,i,this[Oe]),this[Ye])};return Object.defineProperty(this,t,{value:s}),s}}}}var co=Object.defineProperties(()=>{},{...ve,level:{enumerable:!0,get(){return this[Ae].level},set(r){this[Ae].level=r}}}),yr=(r,e,t)=>{let n,i;return t===void 0?(n=r,i=e):(n=t.openAll+r,i=e+t.closeAll),{open:r,close:e,openAll:n,closeAll:i,parent:t}},wt=(r,e,t)=>{let n=(...i)=>i.length===1?bt(n,""+i[0]):i.length===2?bt(n,`${i[0]??""} ${i[1]??""}`):bt(n,i.join(" "));return Object.setPrototypeOf(n,co),n[Ae]=r[Ae]??r,n[Oe]=e,n[Ye]=t,n},bt=(r,e)=>{if(r[Ae][ze]<=0||!e)return r[Ye]?"":e;let t=r[Oe];if(t===void 0)return e;let{openAll:n,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=ar(e,t.close,t.open),t=t.parent;let o=e.indexOf(`
37
+ `);return o!==-1&&(e=lr(e,i,n,o)),n+e+i};Object.defineProperties(ke.prototype,{...ve,level:oo});var fo=ke(),Ma=ke({level:Dr?Dr.level:0});var D=fo;var xi=Hi(En(),1);import{existsSync as J,readdirSync as Nn,readFileSync as vs,statSync as ks}from"node:fs";import{basename as Rs,join as re}from"node:path";import{createDecipheriv as Tt}from"node:crypto";var Jo=Buffer.alloc(16," "),he=12,me=16;function et(r,e){if(!r||r.length===0)return Buffer.alloc(0);let t=Buffer.isBuffer(r)?r:Buffer.from(r),n=t.subarray(0,3).toString("utf-8");if(n!=="v10"&&n!=="v11")return"<unsupported encryption format>";let i=t.subarray(3);try{let o=Tt("aes-128-cbc",e,Jo),s=o.update(i);return s=Buffer.concat([s,o.final()]),s}catch{return"<decryption failed>"}}function bn(r,e){if(!r||r.length===0)return Buffer.alloc(0);let t=Buffer.isBuffer(r)?r:Buffer.from(r),n=t.subarray(0,3).toString("utf-8");if(n!=="v10"&&n!=="v11")return"<unsupported encryption format>";if(t.length<3+he+me)return"<decryption failed>";let i=t.subarray(3,3+he),o=t.subarray(t.length-me),s=t.subarray(3+he,t.length-me);try{let a=Tt("aes-256-gcm",e,i);return a.setAuthTag(o),Buffer.concat([a.update(s),a.final()])}catch{return"<decryption failed>"}}function tt(r,e){if(!r||r.length===0)return Buffer.alloc(0);let t=Buffer.isBuffer(r)?r:Buffer.from(r);if(t.subarray(0,3).toString("utf-8")!=="v20")return"<unsupported encryption format>";if(t.length<3+he+me)return"<decryption failed>";let i=t.subarray(3,3+he),o=t.subarray(t.length-me),s=t.subarray(3+he,t.length-me);try{let a=Tt("aes-256-gcm",e,i);return a.setAuthTag(o),Buffer.concat([a.update(s),a.final()])}catch{return"<decryption failed>"}}function R(r){if(r==null)return"N/A";try{let e=BigInt(r);if(e===0n)return"N/A";let t=e-11644473600000000n,n=Number(t/1000n),i=new Date(n);return isNaN(i.getTime())?"N/A":i.toLocaleString()}catch{return"N/A"}}var F=class extends Error{constructor(t,n,i){super(n,i);this.code=t}code};function B(r,e,t,n){if(!r)return;let i=n instanceof F?n.code:n?.code==="ENOENT"?"missing_store":"unreadable";r({profile:e,store:t,code:i,message:n instanceof Error?n.message:String(n)})}import{homedir as ss}from"node:os";import{join as us}from"node:path";import{execFileSync as Xo}from"node:child_process";import{pbkdf2Sync as Qo}from"node:crypto";var Zo=1003,es=16,ts=Buffer.from("saltysalt"),wn="Chrome Safe Storage",Lt={ITEM_NOT_FOUND:44,INTERACTION_NOT_ALLOWED:36,AUTH_FAILED:45,USER_CANCELED:128},De=class extends Error{service;kind;constructor(e,t,n){super(e),this.name="KeychainAccessError",this.service=t,this.kind=n}get isAccessDenied(){return this.kind==="access-denied"}};function rt(r){return r instanceof De&&r.isAccessDenied}var Pt=new Map,$t=new Map;function rs(){return!!(process.env.SSH_CONNECTION||process.env.SSH_TTY)||!process.env.TERM_PROGRAM}function ns(r){let e=r;return{status:typeof e?.status=="number"?e.status:null,stderr:(e?.stderr??"").toString().trim()}}function is(r,e,t){let n="See docs/remote-keychain-access.md for non-interactive / SSH setup.",i,o;e===Lt.ITEM_NOT_FOUND||/could not be found/i.test(t)?(i="not-found",o=`No '${r}' item found in the Keychain.
38
+ Run this browser at least once on this machine so it creates the key.`):e===Lt.INTERACTION_NOT_ALLOWED||/interaction.*not allowed/i.test(t)?(i="access-denied",o="The Keychain needs a GUI authorization prompt that can't be shown here "+(rs()?`(you appear to be on a remote/SSH session).
39
39
  `:`.
40
40
  `)+`Authorize once from a GUI Terminal (click "Always Allow"), then unlock the
41
41
  keychain in this session:
42
42
  security unlock-keychain ~/Library/Keychains/login.keychain-db
43
- `+r):e===Rt.AUTH_FAILED?(i="access-denied",o=`Keychain authorization failed (wrong password or denied).
43
+ `+n):e===Lt.AUTH_FAILED?(i="access-denied",o=`Keychain authorization failed (wrong password or denied).
44
44
  Try: security unlock-keychain ~/Library/Keychains/login.keychain-db
45
- ${r}`):(i="access-denied",o=`macOS showed a Keychain access prompt that was denied or dismissed.
45
+ ${n}`):(i="access-denied",o=`macOS showed a Keychain access prompt that was denied or dismissed.
46
46
  Re-run the command and click "Allow" (or "Always Allow"), or authorize once with:
47
- security find-generic-password -w -s "${n}"
48
- ${r}`);let s=[e!==null?`exit ${e}`:null,t||null].filter(Boolean).join(": ");return new De(`Could not retrieve ${n} key from macOS Keychain.
47
+ security find-generic-password -w -s "${r}"
48
+ ${n}`);let s=[e!==null?`exit ${e}`:null,t||null].filter(Boolean).join(": ");return new De(`Could not retrieve ${r} key from macOS Keychain.
49
49
  ${o}`+(s?`
50
- (security: ${s})`:""),n,i)}var Pt=null;function gn(){return Pt}function rs(n=Dn){let e=Tt.get(n);if(e!==void 0)return e;let t;if(Pt)t=Pt(n);else try{t=zo("security",["find-generic-password","-w","-s",n],{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim()}catch(r){let{status:i,stderr:o}=es(r);throw ts(n,i,o)}if(!t)throw new De(`Keychain returned an empty ${n} key.
51
- The item may exist with no password. Re-run the browser to recreate it.`,n,"empty");return Tt.set(n,t),t}function yn(n=Dn,e){let t=Lt.get(n);if(t!==void 0)return t;let r=e||rs(n);if(!r)throw new Error("Keychain password cannot be empty for key derivation.");let i=Yo(r,Qo,Jo,Xo,"sha1");return Lt.set(n,i),i}function Cn(){Tt.clear(),Lt.clear()}var rt={chrome:{id:"chrome",name:"Google Chrome",aliases:["google-chrome","google chrome"],safeStorageLabel:"Chrome Safe Storage",linuxSecretApp:"chrome",dirs:{darwin:"Google/Chrome",win32:"Google/Chrome/User Data",linux:"google-chrome"}},"chrome-beta":{id:"chrome-beta",name:"Google Chrome Beta",safeStorageLabel:"Chrome Safe Storage",linuxSecretApp:"chrome",dirs:{darwin:"Google/Chrome Beta",win32:"Google/Chrome Beta/User Data",linux:"google-chrome-beta"}},"chrome-canary":{id:"chrome-canary",name:"Google Chrome Canary",aliases:["canary"],safeStorageLabel:"Chrome Safe Storage",linuxSecretApp:"chrome",dirs:{darwin:"Google/Chrome Canary",win32:"Google/Chrome SxS/User Data",linux:"google-chrome-unstable"}},chromium:{id:"chromium",name:"Chromium",safeStorageLabel:"Chromium Safe Storage",linuxSecretApp:"chromium",dirs:{darwin:"Chromium",win32:"Chromium/User Data",linux:"chromium"}},edge:{id:"edge",name:"Microsoft Edge",aliases:["msedge","microsoft-edge","microsoft edge"],safeStorageLabel:"Microsoft Edge Safe Storage",linuxSecretApp:"chromium",dirs:{darwin:"Microsoft Edge",win32:"Microsoft/Edge/User Data",linux:"microsoft-edge"}},brave:{id:"brave",name:"Brave",aliases:["brave-browser"],safeStorageLabel:"Brave Safe Storage",linuxSecretApp:"chrome",dirs:{darwin:"BraveSoftware/Brave-Browser",win32:"BraveSoftware/Brave-Browser/User Data",linux:"BraveSoftware/Brave-Browser"}},comet:{id:"comet",name:"Comet",aliases:["perplexity","perplexity-comet"],safeStorageLabel:"Comet Safe Storage",linuxSecretApp:"chromium",dirs:{darwin:"Comet",win32:"Perplexity/Comet/User Data",linux:"comet"}},vivaldi:{id:"vivaldi",name:"Vivaldi",safeStorageLabel:"Chrome Safe Storage",linuxSecretApp:"chrome",dirs:{darwin:"Vivaldi",win32:"Vivaldi/User Data",linux:"vivaldi"}},opera:{id:"opera",name:"Opera",safeStorageLabel:"Opera Safe Storage",linuxSecretApp:"chromium",dirs:{darwin:"com.operasoftware.Opera",win32:"Opera Software/Opera Stable",win32Base:"roaming",linux:"opera"}}},En="chrome";function Ne(){return Object.values(rt)}function bn(n){if(!n)return null;let e=n.trim().toLowerCase();for(let t of Ne())if(t.id.toLowerCase()===e||t.name.toLowerCase()===e||t.aliases?.some(r=>r.toLowerCase()===e))return t;return null}function ge(n){let e=bn(n);if(e)return e;throw new Error(`Unknown browser "${n}". Supported: ${Ne().map(t=>t.id).join(", ")}.`)}var Ie=rt[En];function O(){return Ie}function Me(n){return!n||!n.trim()?(Ie=rt[En],Ie):(Ie=ge(n),Ie)}var wn={name:"darwin",getDefaultChromeDir(n=O()){return is(ns(),"Library","Application Support",...n.dirs.darwin.split("/"))},getDecryptionKey(n,e=O()){return yn(e.safeStorageLabel)},decrypt(n,e){return Ze(n,e)},clearCache(){Cn()}};import{execFileSync as xn}from"node:child_process";import{randomUUID as os}from"node:crypto";import{constants as ss,copyFileSync as us,existsSync as ye,mkdirSync as as,readFileSync as _n,rmSync as ls,rmdirSync as cs}from"node:fs";import{dirname as Sn,join as V,resolve as fs}from"node:path";var It=Buffer.from("DPAPI","ascii"),Nt=Buffer.from("APPB","ascii"),Mt=new Map,$t=new Map,jt=new WeakMap,ds=new Set(["chrome","chrome-beta","brave","edge"]);function ps(n){let e=["$ErrorActionPreference='Stop';","Add-Type -AssemblyName System.Security;","$b=[Console]::In.ReadToEnd().Trim();","$enc=[Convert]::FromBase64String($b);","$dec=[System.Security.Cryptography.ProtectedData]::Unprotect($enc,$null,[System.Security.Cryptography.DataProtectionScope]::CurrentUser);","[Console]::Out.Write([Convert]::ToBase64String($dec));"].join(" "),t;try{t=xn("powershell.exe",["-NoProfile","-NonInteractive","-Command",e],{input:n.toString("base64"),encoding:"utf-8"})}catch(r){throw new Error(`DPAPI decryption via PowerShell failed.
50
+ (security: ${s})`:""),r,i)}var It=null;function _n(){return It}function os(r=wn){let e=Pt.get(r);if(e!==void 0)return e;let t;if(It)t=It(r);else try{t=Xo("security",["find-generic-password","-w","-s",r],{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim()}catch(n){let{status:i,stderr:o}=ns(n);throw is(r,i,o)}if(!t)throw new De(`Keychain returned an empty ${r} key.
51
+ The item may exist with no password. Re-run the browser to recreate it.`,r,"empty");return Pt.set(r,t),t}function Fn(r=wn,e){let t=$t.get(r);if(t!==void 0)return t;let n=e||os(r);if(!n)throw new Error("Keychain password cannot be empty for key derivation.");let i=Qo(n,ts,Zo,es,"sha1");return $t.set(r,i),i}function Bn(){Pt.clear(),$t.clear()}var nt={chrome:{id:"chrome",name:"Google Chrome",aliases:["google-chrome","google chrome"],safeStorageLabel:"Chrome Safe Storage",linuxSecretApp:"chrome",dirs:{darwin:"Google/Chrome",win32:"Google/Chrome/User Data",linux:"google-chrome"}},"chrome-beta":{id:"chrome-beta",name:"Google Chrome Beta",safeStorageLabel:"Chrome Safe Storage",linuxSecretApp:"chrome",dirs:{darwin:"Google/Chrome Beta",win32:"Google/Chrome Beta/User Data",linux:"google-chrome-beta"}},"chrome-canary":{id:"chrome-canary",name:"Google Chrome Canary",aliases:["canary"],safeStorageLabel:"Chrome Safe Storage",linuxSecretApp:"chrome",dirs:{darwin:"Google/Chrome Canary",win32:"Google/Chrome SxS/User Data",linux:"google-chrome-unstable"}},chromium:{id:"chromium",name:"Chromium",safeStorageLabel:"Chromium Safe Storage",linuxSecretApp:"chromium",dirs:{darwin:"Chromium",win32:"Chromium/User Data",linux:"chromium"}},edge:{id:"edge",name:"Microsoft Edge",aliases:["msedge","microsoft-edge","microsoft edge"],safeStorageLabel:"Microsoft Edge Safe Storage",linuxSecretApp:"chromium",dirs:{darwin:"Microsoft Edge",win32:"Microsoft/Edge/User Data",linux:"microsoft-edge"}},brave:{id:"brave",name:"Brave",aliases:["brave-browser"],safeStorageLabel:"Brave Safe Storage",linuxSecretApp:"chrome",dirs:{darwin:"BraveSoftware/Brave-Browser",win32:"BraveSoftware/Brave-Browser/User Data",linux:"BraveSoftware/Brave-Browser"}},comet:{id:"comet",name:"Comet",aliases:["perplexity","perplexity-comet"],safeStorageLabel:"Comet Safe Storage",linuxSecretApp:"chromium",dirs:{darwin:"Comet",win32:"Perplexity/Comet/User Data",linux:"comet"}},vivaldi:{id:"vivaldi",name:"Vivaldi",safeStorageLabel:"Chrome Safe Storage",linuxSecretApp:"chrome",dirs:{darwin:"Vivaldi",win32:"Vivaldi/User Data",linux:"vivaldi"}},opera:{id:"opera",name:"Opera",safeStorageLabel:"Opera Safe Storage",linuxSecretApp:"chromium",dirs:{darwin:"com.operasoftware.Opera",win32:"Opera Software/Opera Stable",win32Base:"roaming",linux:"opera"}}},Sn="chrome";function Ie(){return Object.values(nt)}function xn(r){if(!r)return null;let e=r.trim().toLowerCase();for(let t of Ie())if(t.id.toLowerCase()===e||t.name.toLowerCase()===e||t.aliases?.some(n=>n.toLowerCase()===e))return t;return null}function ge(r){let e=xn(r);if(e)return e;throw new Error(`Unknown browser "${r}". Supported: ${Ie().map(t=>t.id).join(", ")}.`)}var $e=nt[Sn];function A(){return $e}function Ne(r){return!r||!r.trim()?($e=nt[Sn],$e):($e=ge(r),$e)}var An={name:"darwin",getDefaultChromeDir(r=A()){return us(ss(),"Library","Application Support",...r.dirs.darwin.split("/"))},getDecryptionKey(r,e=A()){return Fn(e.safeStorageLabel)},decrypt(r,e){return et(r,e)},clearCache(){Bn()}};import{execFileSync as Gt}from"node:child_process";import{randomUUID as as}from"node:crypto";import{constants as ls,copyFileSync as cs,existsSync as ye,mkdirSync as fs,readFileSync as On,rmSync as ds,rmdirSync as ps}from"node:fs";import{dirname as kn,join as j,resolve as hs}from"node:path";var Nt=Buffer.from("DPAPI","ascii"),Mt=Buffer.from("APPB","ascii"),Wt=new Map,jt=new Map,Me=new Map,Ht=new WeakMap,ms=new Set(["chrome","chrome-beta","brave","edge"]),Ds=new Set(["EPERM","EACCES"]),gs=['const fs = require("node:fs");','const net = require("node:net");','const crypto = require("node:crypto");','const { spawn } = require("node:child_process");',"const [helper, dir, browserId] = process.argv.slice(1);",'const encB64 = fs.readFileSync(0, "utf8").trim();','const pipeName = "chrome-tools-abe-" + crypto.randomUUID();','const pipePath = "\\\\\\\\.\\\\pipe\\\\" + pipeName;',"const token = crypto.randomUUID();",'const cfgB64 = Buffer.from(JSON.stringify({ helper, dir, browserId, pipeName, token }), "utf8").toString("base64");',"const ps = [",` "$ErrorActionPreference = 'Stop'",`,` "$ProgressPreference = 'SilentlyContinue'",`,` "$cfg = [System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('" + cfgB64 + "')) | ConvertFrom-Json",`,` "$staged = Join-Path $cfg.dir ('chrome-tools-' + [guid]::NewGuid().ToString() + '.exe')",`,' "$created = $false",',' "$copied = $false",',' "$pipe = $null",',' "try {",',` " $pipe = [System.IO.Pipes.NamedPipeClientStream]::new('.', $cfg.pipeName, [System.IO.Pipes.PipeDirection]::InOut)",`,' " $pipe.Connect(15000)",',' " $reader = [System.IO.StreamReader]::new($pipe, [System.Text.Encoding]::ASCII, $false, 1024, $true)",',' " $writer = [System.IO.StreamWriter]::new($pipe, [System.Text.Encoding]::ASCII, 1024, $true)",',' " $writer.AutoFlush = $true",',' " $writer.WriteLine($cfg.token)",',' " $encB64 = $reader.ReadLine()",',' " if (-not (Test-Path -LiteralPath $cfg.dir)) {",',' " [void](New-Item -ItemType Directory -Path $cfg.dir -Force)",',' " $created = $true",',' " }",',' " [System.IO.File]::Copy($cfg.helper, $staged, $false)",',' " $copied = $true",',' " $psi = [System.Diagnostics.ProcessStartInfo]::new($staged, $cfg.browserId)",',' " $psi.WorkingDirectory = $cfg.dir",',' " $psi.UseShellExecute = $false",',' " $psi.CreateNoWindow = $true",',' " $psi.RedirectStandardInput = $true",',' " $psi.RedirectStandardOutput = $true",',' " $psi.RedirectStandardError = $true",',' " $proc = [System.Diagnostics.Process]::Start($psi)",',' " $proc.StandardInput.Write($encB64)",',' " $proc.StandardInput.Close()",',' " $out = $proc.StandardOutput.ReadToEnd()",',' " $err = $proc.StandardError.ReadToEnd()",',' " $proc.WaitForExit(10000) | Out-Null",',' " if ($proc.ExitCode -eq 0 -and $out) {",',` " $writer.WriteLine('OK:' + $out.Trim())",`,' " } else {",',` " $msg = if ($err) { $err.Trim() -replace '[\\\\r\\\\n]+', ' ' } else { 'exit ' + $proc.ExitCode }",`,` " $writer.WriteLine('ERR:' + $msg)",`,' " }",',' "} finally {",',' " if ($pipe) { try { $pipe.Dispose() } catch {} }",',' " if ($copied) { try { Remove-Item -LiteralPath $staged -Force -ErrorAction SilentlyContinue } catch {} }",',' " if ($created) {",',' " try {",',' " if ((Get-ChildItem -LiteralPath $cfg.dir -Force | Measure-Object).Count -eq 0) {",',' " Remove-Item -LiteralPath $cfg.dir -Force -ErrorAction SilentlyContinue",',' " }",',' " } catch {}",',' " }",',' "}",','].join("\\n");','const psEncoded = Buffer.from(ps, "utf16le").toString("base64");','let keyOut = "";','let errOut = "";','let psStderr = "";',"let done = false;","const finish = (code, msg) => {"," if (done) return;"," done = true;"," try { server.close(); } catch {}"," if (code === 0) process.stdout.write(msg);"," else process.stderr.write(msg);"," process.exit(code);","};","const server = net.createServer((socket) => {",' let buf = "";'," let authed = false;",' socket.on("data", (chunk) => {',' buf += chunk.toString("utf8");'," let nl;",' while ((nl = buf.indexOf("\\n")) !== -1) {'," const line = buf.slice(0, nl).trim();"," buf = buf.slice(nl + 1);"," if (!authed) {"," if (line !== token) { socket.destroy(); return; }"," authed = true;",' socket.write(encB64 + "\\n");'," } else {",' if (line.startsWith("OK:")) keyOut = line.slice(3);',' else if (line.startsWith("ERR:")) errOut = line.slice(4);'," socket.end();"," }"," }"," });",' socket.on("error", () => {});',"});","server.listen(pipePath, () => {",` const cmd = "$ProgressPreference='SilentlyContinue'; Start-Process -FilePath 'powershell.exe' -ArgumentList @('-NoProfile','-NonInteractive','-WindowStyle','Hidden','-EncodedCommand','" + psEncoded + "') -Verb RunAs -Wait";`,' const child = spawn("powershell.exe", ["-NoProfile", "-NonInteractive", "-WindowStyle", "Hidden", "-Command", cmd], { windowsHide: true, stdio: ["ignore", "ignore", "pipe"] });',' child.stderr.on("data", (d) => { psStderr += d.toString("utf8"); });',' child.on("error", (err) => finish(1, err.message));',' child.on("close", () => {'," if (keyOut) finish(0, keyOut);",' else finish(1, errOut || psStderr.trim() || "Elevation cancelled or failed.");'," });","});"].join(`
52
+ `);function ys(r){let e=["$ErrorActionPreference='Stop';","Add-Type -AssemblyName System.Security;","$b=[Console]::In.ReadToEnd().Trim();","$enc=[Convert]::FromBase64String($b);","$dec=[System.Security.Cryptography.ProtectedData]::Unprotect($enc,$null,[System.Security.Cryptography.DataProtectionScope]::CurrentUser);","[Console]::Out.Write([Convert]::ToBase64String($dec));"].join(" "),t;try{t=Gt("powershell.exe",["-NoProfile","-NonInteractive","-Command",e],{input:r.toString("base64"),encoding:"utf-8"})}catch(n){throw new Error(`DPAPI decryption via PowerShell failed.
52
53
  The encrypted_key can only be unprotected by the same Windows user that created it. Run as that user on the same machine.
53
- (powershell: ${r?.message??r})`)}return Buffer.from(t.trim(),"base64")}function Fn(n){let e=fs(n),t=Sn(e);return ye(V(e,"Local State"))?e:t!==e&&ye(V(t,"Local State"))?t:e}function Bn(n,e,t){try{let r=xn(n,[t],{input:e.toString("base64"),encoding:"utf8",timeout:1e4,windowsHide:!0,stdio:["pipe","pipe","pipe"],cwd:Sn(n)}),i=Buffer.from(r.trim(),"base64");return i.length===32?i:void 0}catch{return}}function hs(n,e){if(!ds.has(e.id))return;let t=import.meta.dirname,r=[V(t,"chrome_abe_decrypt.exe"),V(t,"../../native/windows/chrome_abe_decrypt.exe")].find(ye);if(!r)return;let i=Bn(r,n,e.id);if(i)return i;let o=e.dirs.win32.split("/").slice(0,-1),s=e.id==="edge"?"msedge.exe":e.id==="brave"?"brave.exe":"chrome.exe",a=new Set([process.env.ProgramW6432,process.env.ProgramFiles,process.env["ProgramFiles(x86)"],process.env.LOCALAPPDATA]);for(let u of a){if(!u)continue;let c=V(u,...o);if(!ye(V(c,"Application",s)))continue;let l=V(c,"Temp"),f=V(l,`chrome-tools-${os()}.exe`),d=!1,D=!1;try{d=as(l,{recursive:!0})!==void 0,us(r,f,ss.COPYFILE_EXCL),D=!0;let p=Bn(f,n,e.id);if(p)return p}catch{}finally{if(D)try{ls(f)}catch{}if(d)try{cs(l)}catch{}}}}var An={name:"win32",getDefaultChromeDir(n=O()){let t=n.dirs.win32Base==="roaming"?process.env.APPDATA||(process.env.USERPROFILE?V(process.env.USERPROFILE,"AppData","Roaming"):""):process.env.LOCALAPPDATA||(process.env.USERPROFILE?V(process.env.USERPROFILE,"AppData","Local"):"");if(!t)throw new Error("Could not resolve the Windows application-data directory.");return V(t,...n.dirs.win32.split("/"))},getDecryptionKey(n,e=O()){let t=n||this.getDefaultChromeDir(e),r=Fn(t),i=JSON.stringify([r,e.id]),o=Mt.get(i);if(o)return o;let s=V(r,"Local State");if(!ye(s))throw new Error(`Could not find Chrome's "Local State" at ${s}.
54
- Run Google Chrome at least once so it creates the encryption key.`);let a;try{let l=_n(s,"utf-8");a=JSON.parse(l)?.os_crypt?.encrypted_key}catch(l){throw new Error(`Failed to read os_crypt.encrypted_key from Local State: ${l.message}`)}if(!a)throw new Error(`No os_crypt.encrypted_key found in Local State.
55
- This profile may predate Chrome's encrypted-key scheme.`);let u=Buffer.from(a,"base64");if(!u.subarray(0,It.length).equals(It))throw new Error('Unexpected encrypted_key format (missing "DPAPI" prefix).');let c=ps(u.subarray(It.length));return Mt.set(i,c),jt.set(c,{chromeDir:r,browser:e}),c},getAppBoundKey(n,e=O()){let t=Fn(n||this.getDefaultChromeDir(e)),r=JSON.stringify([t,e.id]),i=$t.get(r);if(i)return i;let o=V(t,"Local State");if(!ye(o))return;let s;try{let c=_n(o,"utf-8");s=JSON.parse(c)?.os_crypt?.app_bound_encrypted_key}catch{return}if(!s)return;let a=Buffer.from(s,"base64");if(!a.subarray(0,Nt.length).equals(Nt))return;let u=hs(a.subarray(Nt.length),e);if(u)return $t.set(r,u),u},decrypt(n,e){if(n.subarray(0,3).toString()==="v20"){let t=jt.get(e),r=t&&this.getAppBoundKey?.(t.chromeDir,t.browser);return r?et(n,r):"<app-bound encryption unavailable>"}return mn(n,e)},clearCache(){Mt.clear(),$t.clear(),jt=new WeakMap}};import{execFileSync as ms}from"node:child_process";import{homedir as Ds}from"node:os";import{join as On}from"node:path";import{pbkdf2Sync as gs}from"node:crypto";var ys=1,Cs=16,Es=Buffer.from("saltysalt"),bs="peanuts",Ht=new Map;function ws(n){let e=gn();if(e)return e(n);try{let t=ms("secret-tool",["lookup","application",n],{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(t)return t}catch{}return bs}var vn={name:"linux",getDefaultChromeDir(n=O()){let e=process.env.XDG_CONFIG_HOME||On(Ds(),".config");return On(e,...n.dirs.linux.split("/"))},getDecryptionKey(n,e=O()){let t=e.linuxSecretApp||"chrome",r=Ht.get(t);if(r!==void 0)return r;let i=gs(ws(t),Es,ys,Cs,"sha1");return Ht.set(t,i),i},decrypt(n,e){return Ze(n,e)},clearCache(){Ht.clear()}};var Ce=null;function kn(){if(Ce)return Ce;switch(process.platform){case"darwin":Ce=wn;break;case"win32":Ce=An;break;case"linux":Ce=vn;break;default:throw new Error(`Unsupported platform: ${process.platform}. chrome-tools supports macOS, Windows, and Linux.`)}return Ce}function Rn(n){return kn().getDefaultChromeDir(Tn(n))}function Tn(n){return n?typeof n=="string"?ge(n):n:O()}function Ee(n,e,t,r,i,o){let s=Tn(e),a=t,u,c=new Set;return l=>{let f;try{let d=kn();d.getAppBoundKey&&l.subarray(0,3).toString()==="v20"?(u===void 0&&(u=d.getAppBoundKey(n,s)??null),f=u?et(l,u):"<app-bound encryption unavailable>"):(a??=d.getDecryptionKey(n,s),f=d.decrypt(l,a))}catch(d){throw new F("decryption_unavailable",d instanceof Error?d.message:String(d),{cause:d})}return typeof f=="string"&&!c.has(f)&&(c.add(f),B(r,i,o,new F("decryption_unavailable",f))),f}}var In=["Login Data","History","Bookmarks","Cookies","Web Data","Local Storage","LocalStorage","Preferences"];function nt(n){let e=re(n,"Network","Cookies");return J(e)?e:re(n,"Cookies")}function Ln(n){return In.some(e=>J(re(n,e)))||J(nt(n))}function $e(n){return Rn(n)}function Wt({includeMissing:n=!1}={}){let e=[];for(let t of Ne()){let r=$e(t),i=J(r);!i&&!n||e.push({browser:t,chromeDir:r,installed:i,profileCount:i?ae(r).length:0})}return e}function ae(n,{reportAccessDenied:e=!1}={}){let t=n||$e();if(!t)return[];try{let r=Pn(t,{withFileTypes:!0}),i=[];for(let o of r){if(!o.isDirectory()||o.name==="Network")continue;let s=re(t,o.name);Ln(s)&&i.push({name:o.name,path:s})}if(i.length===0&&Ln(t)){let o=Bs(t)||"Default";i.push({name:o,path:t})}return i}catch(r){let i=r.code;if(e&&(i==="EACCES"||i==="EPERM")){let o=process.platform==="darwin"?" Try Terminal.app if it already has access, or review the current app's permissions in System Settings \u2192 Privacy & Security.":" Check that your user has permission to read this directory.";throw new Error(`Permission denied reading the browser profile directory "${t}" (${i}).${o}`,{cause:r})}return[]}}function Vt(n){let e=n||$e(),t=re(e,"Local State");if(!J(t))return[];try{let r=_s(t,"utf-8"),o=JSON.parse(r)?.profile?.info_cache;return!o||typeof o!="object"?[]:Object.entries(o).map(([s,a])=>{let u=a;return{directory:s,name:u.name||s,gaiaName:u.gaia_name||"",userName:u.user_name||"",email:u.user_name||"",avatarIcon:u.avatar_icon||"",isUsingDefaultName:u.is_using_default_name??!0,isEphemeral:u.is_ephemeral??!1,activeTime:u.active_time||0}})}catch{return[]}}function Nn(n){let e=n||$e(),t=ae(e),r=Vt(e),i=new Map;for(let o of r)i.set(o.directory,o);return t.map(o=>{let s=i.get(o.name),a=o.path,u={};for(let c of In)u[c.replace(/\s+/g,"_").toLowerCase()]=J(re(a,c));return u.cookies=J(nt(a)),u.top_sites=J(re(a,"Top Sites")),u.extensions=J(re(a,"Extensions")),{directory:o.name,path:a,displayName:s?.name||o.name,gaiaName:s?.gaiaName||"",email:s?.email||"",avatarIcon:s?.avatarIcon||"",isEphemeral:s?.isEphemeral??!1,activeTime:s?.activeTime||0,dataFiles:u}})}function it(n){if(!n||!J(n))return 0;let e=0,t;try{t=Pn(n,{withFileTypes:!0})}catch{return 0}for(let r of t){let i=re(n,r.name);try{if(r.isSymbolicLink())continue;r.isDirectory()?e+=it(i):r.isFile()&&(e+=Fs(i).size)}catch{}}return e}function S({profilePath:n,chromeDir:e,profile:t,browser:r,onDiagnostic:i}={}){let o=r?ge(r):void 0,s=n||e||$e(o),a;try{a=ae(s,{reportAccessDenied:!!i})}catch(u){i?.({profile:t??"",store:"User Data",code:"unreadable",message:u instanceof Error?u.message:String(u)}),a=[]}if(t){let u=a.filter(c=>c.name===t);if(u.length===0)throw new Error(`Profile "${t}" not found in ${s}`);return u}return a}import{existsSync as $s,readFileSync as js}from"node:fs";import{homedir as jn}from"node:os";import{join as at}from"node:path";import{copyFileSync as Ts,rmSync as Ls}from"node:fs";import{basename as ut,dirname as $n,join as Ps}from"node:path";import{DatabaseSync as Is}from"node:sqlite";import{lstatSync as xs,mkdtempSync as Ss,realpathSync as Mn}from"node:fs";import{tmpdir as As}from"node:os";import{isAbsolute as Os,join as vs,relative as ks,sep as Rs}from"node:path";function ie(n){try{let e=xs(n,{bigint:!0});if(!e.isFile())throw new F("unreadable",`Expected a regular store file: ${n}`);return e}catch(e){if(e.code==="ENOENT")return;throw e}}function ot(n,e){return!n||!e?n===e:n.dev===e.dev&&n.ino===e.ino&&n.size===e.size&&n.mtimeNs===e.mtimeNs&&n.ctimeNs===e.ctimeNs}function st(n,e){let t=Mn(As()),r=Mn(n),i=ks(r,t);if(!Os(i)&&i!==".."&&!i.startsWith(".."+Rs))throw new F("snapshot_unavailable","The temporary directory is inside the source profile. Set it to a directory outside the profile.");return Ss(vs(t,e))}function Ns(n){return n.map(e=>{let t={};for(let r of Object.keys(e)){let i=e[r];typeof i=="bigint"?t[r]=Number(i):i instanceof Uint8Array&&!Buffer.isBuffer(i)?t[r]=Buffer.from(i.buffer,i.byteOffset,i.byteLength):t[r]=i}return t})}function Ms(n,e){let t=["","-wal","-journal"],r=t.map(i=>ie(n+i));if(!r[0])throw new F("missing_store",`Database file not found: ${n}`);try{for(let[i,o]of t.entries())r[i]&&Ts(n+o,e+o)}catch(i){let o=i.code;throw["EBUSY","EPERM","EACCES","ENOENT"].includes(o??"")?new F("snapshot_unavailable",`Could not copy ${ut(n)} and its journals. Close the browser and retry if it is open.`,{cause:i}):i}if(t.some((i,o)=>!ot(r[o],ie(n+i))))throw new F("snapshot_unavailable",`${ut(n)} changed during the copy. Close the browser and retry.`)}function Gt(n,e){let t=$n(n),r=ut(t)==="Network"?$n(t):t,i=st(r,"chrome-tools-"),o=Ps(i,"snapshot.sqlite"),s;try{Ms(n,o),s=new Is(o,{timeout:0}),s.exec("PRAGMA trusted_schema = OFF; PRAGMA query_only = ON;");let a=s;return e((u,c=[])=>{let l=u.replace(/^(?:\s+|--[^\n]*(?:\n|$)|\/\*[\s\S]*?\*\/)+/,"");if(!/^(SELECT|WITH|VALUES|EXPLAIN|PRAGMA)\b/i.test(l))throw new F("unreadable","Only read queries are supported.");let f=a.prepare(l);return f.setReadBigInts(!0),Ns(f.all(...c))})}catch(a){if(a instanceof F)throw a;let u=a instanceof Error?a.message:String(a),c=/no such (table|column)/i.test(u)?"unsupported_schema":"unreadable";throw new F(c,`Database query failed on '${ut(n)}': ${u}`,{cause:a})}finally{try{s?.close()}finally{Ls(i,{recursive:!0,force:!0,maxRetries:3})}}}function L(n,e,t=[]){return Gt(n,r=>r(e,t))}var Hn=[{file:"Login Data",source:"device"},{file:"Login Data For Account",source:"account"}],Hs=at(jn(),".chrome_cdp_profile"),Ws=at(jn(),".config","chrome-cdp-manager","config.json"),Vs=["0","off","none","false"];function Gs(){let n=process.env.CHROME_AUTOMATION_DIR?.trim();if(n&&Vs.includes(n.toLowerCase()))return;let e=n||Us()||Hs;return ae(e).length>0?e:void 0}function Us(){try{let n=JSON.parse(js(Ws,"utf-8"));return typeof n.profileDir=="string"&&n.profileDir?n.profileDir:void 0}catch{return}}function Wn(n,e){let t=[],r=n||e?void 0:Gs();return r&&t.push(r),t.push(n),t}function Vn({chromeDir:n,profilePath:e,profile:t,browser:r}={}){let i=e||n,o=[];for(let s of Wn(i,r)){let a;try{a=S({chromeDir:s,profile:t,browser:r})}catch(u){o.push({root:s??"default",profile:t??"*",file:"*",source:"device",exists:!1,rows:null,error:u instanceof Error?u.message:String(u)});continue}for(let u of a)for(let c of Hn){let l=at(u.path,c.file),f={root:s??"default",profile:u.name,file:c.file,source:c.source,exists:$s(l),rows:null};try{f.rows=L(l,"SELECT COUNT(*) AS n FROM logins")[0]?.n??0}catch(d){f.error=d instanceof Error?d.message:String(d)}o.push(f)}}return o}function Gn({chromeDir:n,profilePath:e,profile:t,search:r,browser:i,decryptionKey:o,onDiagnostic:s}={}){let a=e||n,u=i??O().id,c=Wn(a,i),l=[],f=r?.toLowerCase(),d,D=!1;for(let p of c){let h;try{h=S({chromeDir:p,profile:t,browser:u,onDiagnostic:s})}catch(g){d??=g;continue}D=!0;for(let g of h)for(let y of Hn){let C=at(g.path,y.file),T=Ee(p??g.path,u,o,s,g.name,y.file);try{let _=L(C,`SELECT origin_url, username_value, password_value, date_last_used
56
- FROM logins ORDER BY origin_url`);for(let k of _){if(f&&!(k.origin_url&&k.origin_url.toLowerCase().includes(f))&&!(k.username_value&&k.username_value.toLowerCase().includes(f)))continue;let Q=k.password_value?.length>0?T(k.password_value):"";l.push({profile:g.name,source:y.source,url:k.origin_url,username:k.username_value,password:Buffer.isBuffer(Q)?Q.toString("utf8"):Q,lastUsed:R(k.date_last_used||0)})}}catch(_){B(s,g.name,y.file,_)}}}if(!D&&d)throw d;return l}import{readFileSync as Ks}from"node:fs";import{join as qs}from"node:path";function Un(n,e=""){let t=[];if(!n)return t;let r=e?`${e}/${n.name||""}`:n.name||"";if(n.type==="url"&&t.push({title:n.name||"",url:n.url||"",folder:e,dateAdded:R(n.date_added),dateLastUsed:R(n.date_last_used),id:n.id,guid:n.guid||""}),n.children&&Array.isArray(n.children))for(let i of n.children)t.push(...Un(i,r));return t}function Kn({chromeDir:n,profilePath:e,profile:t,folder:r,search:i,browser:o,onDiagnostic:s}={}){let a=S({chromeDir:n,profilePath:e,profile:t,browser:o,onDiagnostic:s}),u=[];for(let l of a){let f=qs(l.path,"Bookmarks");try{let d=Ks(f,"utf-8"),p=JSON.parse(d).roots;if(!p)continue;let h=["bookmark_bar","other","synced"];for(let g of h)if(p[g]){let y=Un(p[g],"");for(let C of y)C.profile=l.name,u.push(C)}}catch(d){B(s,l.name,"Bookmarks",d instanceof SyntaxError?new Error("Invalid Bookmarks JSON."):d)}}let c=u;if(r){let l=r.toLowerCase();c=c.filter(f=>f.folder.toLowerCase().includes(l))}if(i){let l=i.toLowerCase();c=c.filter(f=>f.title.toLowerCase().includes(l)||f.url.toLowerCase().includes(l))}return c}import{join as qn}from"node:path";function X(n){if(n===void 0)return;let e=Math.trunc(Number(n));return Number.isFinite(e)&&e>0?e:void 0}function q(n,e){let t=X(e);return t===void 0?n:n.slice(0,t)}function be(n){return`%${n.replace(/([%_\\])/g,"\\$1")}%`}function zn({chromeDir:n,profilePath:e,profile:t,search:r,limit:i=100,browser:o,onDiagnostic:s}={}){let a=S({chromeDir:n,profilePath:e,profile:t,browser:o,onDiagnostic:s}),u=[],c=X(i);for(let l of a){let f=qn(l.path,"History");try{let d="SELECT url, title, visit_count, last_visit_time FROM urls",D=[];if(r){d+=" WHERE url LIKE ? ESCAPE '\\' OR IFNULL(title, '') LIKE ? ESCAPE '\\'";let h=be(r);D.push(h,h)}d+=" ORDER BY last_visit_time DESC",c&&(d+=` LIMIT ${c}`);let p=L(f,d,D);for(let h of p)u.push({profile:l.name,url:h.url,title:h.title||"",visitCount:h.visit_count||0,lastVisit:R(h.last_visit_time||0)})}catch(d){B(s,l.name,"History",d)}}return q(u,i)}function Yn({chromeDir:n,profilePath:e,profile:t,limit:r=100,browser:i,onDiagnostic:o}={}){let s=S({chromeDir:n,profilePath:e,profile:t,browser:i,onDiagnostic:o}),a=[],u=X(r);for(let c of s){let l=qn(c.path,"History");try{let f=`SELECT kst.term, u.url
54
+ (powershell: ${n?.message??n})`)}return Buffer.from(t.trim(),"base64")}function Vt(r){let e=hs(r),t=kn(e);return ye(j(e,"Local State"))?e:t!==e&&ye(j(t,"Local State"))?t:e}function vn(r,e,t){try{let n=Gt(r,[t],{input:e.toString("base64"),encoding:"utf8",timeout:1e4,windowsHide:!0,stdio:["pipe","pipe","pipe"],cwd:kn(r)}),i=Buffer.from(n.trim(),"base64");return i.length===32?{key:i}:{error:"Unexpected App-Bound Encryption key length."}}catch(n){return{error:n?.stderr?.toString?.("utf8")?.trim()||n?.message||"App-Bound Encryption helper failed."}}}function Cs(){return process.platform==="win32"&&process.env.CHROME_TOOLS_NO_ELEVATE!=="1"&&!!(process.stdin.isTTY||process.stdout.isTTY)}function Es(r,e,t,n){try{let i=Gt(process.execPath,["--input-type=commonjs","-e",gs,r,j(e,"Temp"),n],{input:t.toString("base64"),encoding:"utf8",timeout:65e3,windowsHide:!0,stdio:["pipe","pipe","pipe"]}),o=Buffer.from(i.trim(),"base64");return o.length===32?{key:o}:{error:"Unexpected App-Bound Encryption key length."}}catch(i){return{error:i?.stderr?.toString?.("utf8")?.trim()||i?.message||"Elevated App-Bound Encryption failed."}}}function bs(r,e){if(!ms.has(e.id))return{error:`App-Bound Encryption is not supported for ${e.name}.`};let t=import.meta.dirname,n=[j(t,"chrome_abe_decrypt.exe"),j(t,"../../native/windows/chrome_abe_decrypt.exe")].find(ye);if(!n)return{error:"Bundled chrome_abe_decrypt.exe helper was not found."};let i=vn(n,r,e.id);if(i.key)return i;let o=e.dirs.win32.split("/").slice(0,-1),s=e.id==="edge"?"msedge.exe":e.id==="brave"?"brave.exe":"chrome.exe",a=new Set([process.env.ProgramW6432,process.env.ProgramFiles,process.env["ProgramFiles(x86)"],process.env.LOCALAPPDATA]),u=[],c=i.error;for(let l of a){if(!l)continue;let f=j(l,...o);if(!ye(j(f,"Application",s)))continue;let d=j(f,"Temp"),m=j(d,`chrome-tools-${as()}.exe`),p=!1,h=!1;try{p=fs(d,{recursive:!0})!==void 0,cs(n,m,ls.COPYFILE_EXCL),h=!0;let g=vn(m,r,e.id);if(g.key)return g;c=g.error}catch(g){Ds.has(g?.code)?u.push(f):g?.message&&(c=g.message)}finally{if(h)try{ds(m)}catch{}if(p)try{ps(d)}catch{}}}if(u.length>0){if(Cs())for(let d of u){let m=Es(n,d,r,e.id);if(m.key)return m;c=m.error}let l=j(u[0],"Temp"),f=c?` (${c})`:"";return{error:`Administrator privileges are required to stage the App-Bound Encryption helper under ${l}. Run from an elevated Administrator terminal or approve the UAC prompt${f}.`}}return{error:c}}var Rn={name:"win32",getDefaultChromeDir(r=A()){let t=r.dirs.win32Base==="roaming"?process.env.APPDATA||(process.env.USERPROFILE?j(process.env.USERPROFILE,"AppData","Roaming"):""):process.env.LOCALAPPDATA||(process.env.USERPROFILE?j(process.env.USERPROFILE,"AppData","Local"):"");if(!t)throw new Error("Could not resolve the Windows application-data directory.");return j(t,...r.dirs.win32.split("/"))},getDecryptionKey(r,e=A()){let t=r||this.getDefaultChromeDir(e),n=Vt(t),i=JSON.stringify([n,e.id]),o=Wt.get(i);if(o)return o;let s=j(n,"Local State");if(!ye(s))throw new Error(`Could not find Chrome's "Local State" at ${s}.
55
+ Run Google Chrome at least once so it creates the encryption key.`);let a;try{let l=On(s,"utf-8");a=JSON.parse(l)?.os_crypt?.encrypted_key}catch(l){throw new Error(`Failed to read os_crypt.encrypted_key from Local State: ${l.message}`)}if(!a)throw new Error(`No os_crypt.encrypted_key found in Local State.
56
+ This profile may predate Chrome's encrypted-key scheme.`);let u=Buffer.from(a,"base64");if(!u.subarray(0,Nt.length).equals(Nt))throw new Error('Unexpected encrypted_key format (missing "DPAPI" prefix).');let c=ys(u.subarray(Nt.length));return Wt.set(i,c),Ht.set(c,{chromeDir:n,browser:e}),c},getAppBoundKey(r,e=A()){let t=Vt(r||this.getDefaultChromeDir(e)),n=JSON.stringify([t,e.id]),i=jt.get(n);if(i)return i;if(Me.has(n))return;let o=j(t,"Local State");if(!ye(o))return;let s;try{let c=On(o,"utf-8");s=JSON.parse(c)?.os_crypt?.app_bound_encrypted_key}catch{return}if(!s)return;let a=Buffer.from(s,"base64");if(!a.subarray(0,Mt.length).equals(Mt))return;let u=bs(a.subarray(Mt.length),e);if(!u.key){u.error&&Me.set(n,u.error);return}return Me.delete(n),jt.set(n,u.key),u.key},getAppBoundError(r,e=A()){let t=Vt(r||this.getDefaultChromeDir(e));return Me.get(JSON.stringify([t,e.id]))},decrypt(r,e){if(r.subarray(0,3).toString()==="v20"){let t=Ht.get(e),n=t&&this.getAppBoundKey?.(t.chromeDir,t.browser);return n?tt(r,n):"<app-bound encryption unavailable>"}return bn(r,e)},clearCache(){Wt.clear(),jt.clear(),Me.clear(),Ht=new WeakMap}};import{execFileSync as ws}from"node:child_process";import{homedir as _s}from"node:os";import{join as Tn}from"node:path";import{pbkdf2Sync as Fs}from"node:crypto";var Bs=1,Ss=16,xs=Buffer.from("saltysalt"),As="peanuts",Ut=new Map;function Os(r){let e=_n();if(e)return e(r);try{let t=ws("secret-tool",["lookup","application",r],{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(t)return t}catch{}return As}var Ln={name:"linux",getDefaultChromeDir(r=A()){let e=process.env.XDG_CONFIG_HOME||Tn(_s(),".config");return Tn(e,...r.dirs.linux.split("/"))},getDecryptionKey(r,e=A()){let t=e.linuxSecretApp||"chrome",n=Ut.get(t);if(n!==void 0)return n;let i=Fs(Os(t),xs,Bs,Ss,"sha1");return Ut.set(t,i),i},decrypt(r,e){return et(r,e)},clearCache(){Ut.clear()}};var Ce=null;function it(){if(Ce)return Ce;switch(process.platform){case"darwin":Ce=An;break;case"win32":Ce=Rn;break;case"linux":Ce=Ln;break;default:throw new Error(`Unsupported platform: ${process.platform}. chrome-tools supports macOS, Windows, and Linux.`)}return Ce}function Pn(r){return it().getDefaultChromeDir(Kt(r))}function $n(r,e){return it().getAppBoundError?.(r,Kt(e))}function Kt(r){return r?typeof r=="string"?ge(r):r:A()}function Ee(r,e,t,n,i,o){let s=Kt(e),a=t,u,c=new Set;return l=>{let f;try{let d=it();d.getAppBoundKey&&l.subarray(0,3).toString()==="v20"?(u===void 0&&(u=d.getAppBoundKey(r,s)??null),f=u?tt(l,u):"<app-bound encryption unavailable>"):(a??=d.getDecryptionKey(r,s),f=d.decrypt(l,a))}catch(d){throw new F("decryption_unavailable",d instanceof Error?d.message:String(d),{cause:d})}if(typeof f=="string"&&!c.has(f)){c.add(f);let d=f==="<app-bound encryption unavailable>"?it().getAppBoundError?.(r,s):void 0;B(n,i,o,new F("decryption_unavailable",d||f))}return f}}var Mn=["Login Data","History","Bookmarks","Cookies","Web Data","Local Storage","LocalStorage","Preferences"];function ot(r){let e=re(r,"Network","Cookies");return J(e)?e:re(r,"Cookies")}function In(r){return Mn.some(e=>J(re(r,e)))||J(ot(r))}function We(r){return Pn(r)}function qt({includeMissing:r=!1}={}){let e=[];for(let t of Ie()){let n=We(t),i=J(n);!i&&!r||e.push({browser:t,chromeDir:n,installed:i,profileCount:i?ae(n).length:0})}return e}function ae(r,{reportAccessDenied:e=!1}={}){let t=r||We();if(!t)return[];try{let n=Nn(t,{withFileTypes:!0}),i=[];for(let o of n){if(!o.isDirectory()||o.name==="Network")continue;let s=re(t,o.name);In(s)&&i.push({name:o.name,path:s})}if(i.length===0&&In(t)){let o=Rs(t)||"Default";i.push({name:o,path:t})}return i}catch(n){let i=n.code;if(e&&(i==="EACCES"||i==="EPERM")){let o=process.platform==="darwin"?" Try Terminal.app if it already has access, or review the current app's permissions in System Settings \u2192 Privacy & Security.":" Check that your user has permission to read this directory.";throw new Error(`Permission denied reading the browser profile directory "${t}" (${i}).${o}`,{cause:n})}return[]}}function zt(r){let e=r||We(),t=re(e,"Local State");if(!J(t))return[];try{let n=vs(t,"utf-8"),o=JSON.parse(n)?.profile?.info_cache;return!o||typeof o!="object"?[]:Object.entries(o).map(([s,a])=>{let u=a;return{directory:s,name:u.name||s,gaiaName:u.gaia_name||"",userName:u.user_name||"",email:u.user_name||"",avatarIcon:u.avatar_icon||"",isUsingDefaultName:u.is_using_default_name??!0,isEphemeral:u.is_ephemeral??!1,activeTime:u.active_time||0}})}catch{return[]}}function Wn(r){let e=r||We(),t=ae(e),n=zt(e),i=new Map;for(let o of n)i.set(o.directory,o);return t.map(o=>{let s=i.get(o.name),a=o.path,u={};for(let c of Mn)u[c.replace(/\s+/g,"_").toLowerCase()]=J(re(a,c));return u.cookies=J(ot(a)),u.top_sites=J(re(a,"Top Sites")),u.extensions=J(re(a,"Extensions")),{directory:o.name,path:a,displayName:s?.name||o.name,gaiaName:s?.gaiaName||"",email:s?.email||"",avatarIcon:s?.avatarIcon||"",isEphemeral:s?.isEphemeral??!1,activeTime:s?.activeTime||0,dataFiles:u}})}function st(r){if(!r||!J(r))return 0;let e=0,t;try{t=Nn(r,{withFileTypes:!0})}catch{return 0}for(let n of t){let i=re(r,n.name);try{if(n.isSymbolicLink())continue;n.isDirectory()?e+=st(i):n.isFile()&&(e+=ks(i).size)}catch{}}return e}function x({profilePath:r,chromeDir:e,profile:t,browser:n,onDiagnostic:i}={}){let o=n?ge(n):void 0,s=r||e||We(o),a;try{a=ae(s,{reportAccessDenied:!!i})}catch(u){i?.({profile:t??"",store:"User Data",code:"unreadable",message:u instanceof Error?u.message:String(u)}),a=[]}if(t){let u=a.filter(c=>c.name===t);if(u.length===0)throw new Error(`Profile "${t}" not found in ${s}`);return u}return a}import{existsSync as Ks,readFileSync as qs}from"node:fs";import{homedir as Vn}from"node:os";import{join as ct}from"node:path";import{copyFileSync as Ws,rmSync as js}from"node:fs";import{basename as lt,dirname as Hn,join as Hs}from"node:path";import{DatabaseSync as Vs}from"node:sqlite";import{lstatSync as Ts,mkdtempSync as Ls,realpathSync as jn}from"node:fs";import{tmpdir as Ps}from"node:os";import{isAbsolute as $s,join as Is,relative as Ns,sep as Ms}from"node:path";function ie(r){try{let e=Ts(r,{bigint:!0});if(!e.isFile())throw new F("unreadable",`Expected a regular store file: ${r}`);return e}catch(e){if(e.code==="ENOENT")return;throw e}}function ut(r,e){return!r||!e?r===e:r.dev===e.dev&&r.ino===e.ino&&r.size===e.size&&r.mtimeNs===e.mtimeNs&&r.ctimeNs===e.ctimeNs}function at(r,e){let t=jn(Ps()),n=jn(r),i=Ns(n,t);if(!$s(i)&&i!==".."&&!i.startsWith(".."+Ms))throw new F("snapshot_unavailable","The temporary directory is inside the source profile. Set it to a directory outside the profile.");return Ls(Is(t,e))}function Gs(r){return r.map(e=>{let t={};for(let n of Object.keys(e)){let i=e[n];typeof i=="bigint"?t[n]=Number(i):i instanceof Uint8Array&&!Buffer.isBuffer(i)?t[n]=Buffer.from(i.buffer,i.byteOffset,i.byteLength):t[n]=i}return t})}function Us(r,e){let t=["","-wal","-journal"],n=t.map(i=>ie(r+i));if(!n[0])throw new F("missing_store",`Database file not found: ${r}`);try{for(let[i,o]of t.entries())n[i]&&Ws(r+o,e+o)}catch(i){let o=i.code;throw["EBUSY","EPERM","EACCES","ENOENT"].includes(o??"")?new F("snapshot_unavailable",`Could not copy ${lt(r)} and its journals. Close the browser and retry if it is open.`,{cause:i}):i}if(t.some((i,o)=>!ut(n[o],ie(r+i))))throw new F("snapshot_unavailable",`${lt(r)} changed during the copy. Close the browser and retry.`)}function Yt(r,e){let t=Hn(r),n=lt(t)==="Network"?Hn(t):t,i=at(n,"chrome-tools-"),o=Hs(i,"snapshot.sqlite"),s;try{Us(r,o),s=new Vs(o,{timeout:0}),s.exec("PRAGMA trusted_schema = OFF; PRAGMA query_only = ON;");let a=s;return e((u,c=[])=>{let l=u.replace(/^(?:\s+|--[^\n]*(?:\n|$)|\/\*[\s\S]*?\*\/)+/,"");if(!/^(SELECT|WITH|VALUES|EXPLAIN|PRAGMA)\b/i.test(l))throw new F("unreadable","Only read queries are supported.");let f=a.prepare(l);return f.setReadBigInts(!0),Gs(f.all(...c))})}catch(a){if(a instanceof F)throw a;let u=a instanceof Error?a.message:String(a),c=/no such (table|column)/i.test(u)?"unsupported_schema":"unreadable";throw new F(c,`Database query failed on '${lt(r)}': ${u}`,{cause:a})}finally{try{s?.close()}finally{js(i,{recursive:!0,force:!0,maxRetries:3})}}}function L(r,e,t=[]){return Yt(r,n=>n(e,t))}var Gn=[{file:"Login Data",source:"device"},{file:"Login Data For Account",source:"account"}],zs=ct(Vn(),".chrome_cdp_profile"),Ys=ct(Vn(),".config","chrome-cdp-manager","config.json"),Js=["0","off","none","false"];function Xs(){let r=process.env.CHROME_AUTOMATION_DIR?.trim();if(r&&Js.includes(r.toLowerCase()))return;let e=r||Qs()||zs;return ae(e).length>0?e:void 0}function Qs(){try{let r=JSON.parse(qs(Ys,"utf-8"));return typeof r.profileDir=="string"&&r.profileDir?r.profileDir:void 0}catch{return}}function Un(r,e){let t=[],n=r||e?void 0:Xs();return n&&t.push(n),t.push(r),t}function Kn({chromeDir:r,profilePath:e,profile:t,browser:n}={}){let i=e||r,o=[];for(let s of Un(i,n)){let a;try{a=x({chromeDir:s,profile:t,browser:n})}catch(u){o.push({root:s??"default",profile:t??"*",file:"*",source:"device",exists:!1,rows:null,error:u instanceof Error?u.message:String(u)});continue}for(let u of a)for(let c of Gn){let l=ct(u.path,c.file),f={root:s??"default",profile:u.name,file:c.file,source:c.source,exists:Ks(l),rows:null};try{f.rows=L(l,"SELECT COUNT(*) AS n FROM logins")[0]?.n??0}catch(d){f.error=d instanceof Error?d.message:String(d)}o.push(f)}}return o}function qn({chromeDir:r,profilePath:e,profile:t,search:n,browser:i,decryptionKey:o,onDiagnostic:s}={}){let a=e||r,u=i??A().id,c=Un(a,i),l=[],f=n?.toLowerCase(),d,m=!1;for(let p of c){let h;try{h=x({chromeDir:p,profile:t,browser:u,onDiagnostic:s})}catch(g){d??=g;continue}m=!0;for(let g of h)for(let y of Gn){let C=ct(g.path,y.file),T=Ee(p??g.path,u,o,s,g.name,y.file);try{let _=L(C,`SELECT origin_url, username_value, password_value, date_last_used
57
+ FROM logins ORDER BY origin_url`);for(let k of _){if(f&&!(k.origin_url&&k.origin_url.toLowerCase().includes(f))&&!(k.username_value&&k.username_value.toLowerCase().includes(f)))continue;let Q=k.password_value?.length>0?T(k.password_value):"";l.push({profile:g.name,source:y.source,url:k.origin_url,username:k.username_value,password:Buffer.isBuffer(Q)?Q.toString("utf8"):Q,lastUsed:R(k.date_last_used||0)})}}catch(_){B(s,g.name,y.file,_)}}}if(!m&&d)throw d;return l}import{readFileSync as Zs}from"node:fs";import{join as eu}from"node:path";function zn(r,e=""){let t=[];if(!r)return t;let n=e?`${e}/${r.name||""}`:r.name||"";if(r.type==="url"&&t.push({title:r.name||"",url:r.url||"",folder:e,dateAdded:R(r.date_added),dateLastUsed:R(r.date_last_used),id:r.id,guid:r.guid||""}),r.children&&Array.isArray(r.children))for(let i of r.children)t.push(...zn(i,n));return t}function Yn({chromeDir:r,profilePath:e,profile:t,folder:n,search:i,browser:o,onDiagnostic:s}={}){let a=x({chromeDir:r,profilePath:e,profile:t,browser:o,onDiagnostic:s}),u=[];for(let l of a){let f=eu(l.path,"Bookmarks");try{let d=Zs(f,"utf-8"),p=JSON.parse(d).roots;if(!p)continue;let h=["bookmark_bar","other","synced"];for(let g of h)if(p[g]){let y=zn(p[g],"");for(let C of y)C.profile=l.name,u.push(C)}}catch(d){B(s,l.name,"Bookmarks",d instanceof SyntaxError?new Error("Invalid Bookmarks JSON."):d)}}let c=u;if(n){let l=n.toLowerCase();c=c.filter(f=>f.folder.toLowerCase().includes(l))}if(i){let l=i.toLowerCase();c=c.filter(f=>f.title.toLowerCase().includes(l)||f.url.toLowerCase().includes(l))}return c}import{join as Jn}from"node:path";function X(r){if(r===void 0)return;let e=Math.trunc(Number(r));return Number.isFinite(e)&&e>0?e:void 0}function q(r,e){let t=X(e);return t===void 0?r:r.slice(0,t)}function be(r){return`%${r.replace(/([%_\\])/g,"\\$1")}%`}function Xn({chromeDir:r,profilePath:e,profile:t,search:n,limit:i=100,browser:o,onDiagnostic:s}={}){let a=x({chromeDir:r,profilePath:e,profile:t,browser:o,onDiagnostic:s}),u=[],c=X(i);for(let l of a){let f=Jn(l.path,"History");try{let d="SELECT url, title, visit_count, last_visit_time FROM urls",m=[];if(n){d+=" WHERE url LIKE ? ESCAPE '\\' OR IFNULL(title, '') LIKE ? ESCAPE '\\'";let h=be(n);m.push(h,h)}d+=" ORDER BY last_visit_time DESC",c&&(d+=` LIMIT ${c}`);let p=L(f,d,m);for(let h of p)u.push({profile:l.name,url:h.url,title:h.title||"",visitCount:h.visit_count||0,lastVisit:R(h.last_visit_time||0)})}catch(d){B(s,l.name,"History",d)}}return q(u,i)}function Qn({chromeDir:r,profilePath:e,profile:t,limit:n=100,browser:i,onDiagnostic:o}={}){let s=x({chromeDir:r,profilePath:e,profile:t,browser:i,onDiagnostic:o}),a=[],u=X(n);for(let c of s){let l=Jn(c.path,"History");try{let f=`SELECT kst.term, u.url
57
58
  FROM keyword_search_terms kst
58
59
  JOIN urls u ON kst.url_id = u.id
59
- ORDER BY u.last_visit_time DESC`;u&&(f+=` LIMIT ${u}`);let d=L(l,f);for(let D of d)a.push({profile:c.name,term:D.term||"",url:D.url||""})}catch(f){B(o,c.name,"History",f)}}return q(a,r)}import{existsSync as zs}from"node:fs";import{createHash as Ys}from"node:crypto";function Js(n,e){if(!Buffer.isBuffer(n))return n;let t=Ys("sha256").update(e).digest();return(n.length>=t.length&&n.subarray(0,t.length).equals(t)?n.subarray(t.length):n).toString("utf-8")}function Xs(n){if(!n)return null;try{return new URL(n)}catch{try{if(!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(n))return new URL("https://"+n)}catch{}}return null}function Qs(n){let e=new Set;e.add(n),e.add("."+n);let t=n.split(".");for(let r=1;r<t.length;r++){let i=t.slice(r).join(".");e.add(i),e.add("."+i)}return Array.from(e)}function Zs(n,e){return!!(n===e||e.startsWith(".")&&(n===e.slice(1)||n.endsWith(e)))}function eu(n,e){let t=n||"/",r=e||"/";return!!(r==="/"||t===r||t.startsWith(r)&&(r.endsWith("/")||t[r.length]==="/"))}function Jn({chromeDir:n,profilePath:e,profile:t,browser:r,onDiagnostic:i,domain:o,url:s,decrypt:a=!0,limit:u=100,decryptionKey:c}={}){let l=e||n,f=r??O().id,d=S({chromeDir:n,profilePath:e,profile:t,browser:f,onDiagnostic:i}),D=[],p=Xs(s),h=X(u),g;for(let y of d){let C=nt(y.path);if(!zs(C)){B(i,y.name,"Cookies",new F("missing_store","Cookies database file not found."));continue}let T=Ee(l??y.path,f,c,i,y.name,"Cookies");try{let _=`SELECT host_key, name, value, encrypted_value, path,
60
+ ORDER BY u.last_visit_time DESC`;u&&(f+=` LIMIT ${u}`);let d=L(l,f);for(let m of d)a.push({profile:c.name,term:m.term||"",url:m.url||""})}catch(f){B(o,c.name,"History",f)}}return q(a,n)}import{existsSync as tu}from"node:fs";import{createHash as ru}from"node:crypto";function nu(r,e){if(!Buffer.isBuffer(r))return r;let t=ru("sha256").update(e).digest();return(r.length>=t.length&&r.subarray(0,t.length).equals(t)?r.subarray(t.length):r).toString("utf-8")}function iu(r){if(!r)return null;try{return new URL(r)}catch{try{if(!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(r))return new URL("https://"+r)}catch{}}return null}function ou(r){let e=new Set;e.add(r),e.add("."+r);let t=r.split(".");for(let n=1;n<t.length;n++){let i=t.slice(n).join(".");e.add(i),e.add("."+i)}return Array.from(e)}function su(r,e){return!!(r===e||e.startsWith(".")&&(r===e.slice(1)||r.endsWith(e)))}function uu(r,e){let t=r||"/",n=e||"/";return!!(n==="/"||t===n||t.startsWith(n)&&(n.endsWith("/")||t[n.length]==="/"))}function Zn({chromeDir:r,profilePath:e,profile:t,browser:n,onDiagnostic:i,domain:o,url:s,decrypt:a=!0,limit:u=100,decryptionKey:c}={}){let l=e||r,f=n??A().id,d=x({chromeDir:r,profilePath:e,profile:t,browser:f,onDiagnostic:i}),m=[],p=iu(s),h=X(u),g;for(let y of d){let C=ot(y.path);if(!tu(C)){B(i,y.name,"Cookies",new F("missing_store","Cookies database file not found."));continue}let T=Ee(l??y.path,f,c,i,y.name,"Cookies");try{let _=`SELECT host_key, name, value, encrypted_value, path,
60
61
  expires_utc, is_secure, is_httponly, samesite,
61
62
  creation_utc, last_access_utc
62
- FROM cookies`,k=[],Q=[];if(o)k.push("host_key LIKE ?"),Q.push(`%${o}%`);else if(p){let v=Qs(p.hostname),Be=v.map(()=>"?").join(", ");k.push(`host_key IN (${Be})`),Q.push(...v)}k.length>0&&(_+=` WHERE ${k.join(" AND ")}`),_+=" ORDER BY host_key, name",h&&!s&&(_+=` LIMIT ${h}`);let pt=L(C,_,Q);for(let v of pt){if(p&&(!Zs(p.hostname,v.host_key||"")||!eu(p.pathname||"/",v.path||"/")||v.is_secure&&p.protocol!=="https:"))continue;let Be=v.value||"";!Be&&v.encrypted_value?.length>0&&a&&(Be=Js(T(v.encrypted_value),v.host_key||"")),D.push({profile:y.name,domain:v.host_key||"",name:v.name||"",value:Be,path:v.path||"/",expires:R(v.expires_utc||0),secure:!!v.is_secure,httpOnly:!!v.is_httponly,sameSite:["unspecified","lax","strict","none"][v.samesite]||"unspecified",created:R(v.creation_utc||0),lastAccessed:R(v.last_access_utc||0)})}}catch(_){B(i,y.name,"Cookies",_),g??=new Error(`Could not read cookies for profile "${y.name}" at ${C}: `+(_ instanceof Error?_.message:String(_)))}}if(!i&&D.length===0&&g)throw g;return q(D,u)}import{join as ai}from"node:path";import{zstdDecompressSync as cu}from"node:zlib";function we(n,e){let t=0,r=0;for(let i=e;i<n.length&&i<e+5;i++){let o=n[i];if(t|=(o&127)<<r,(o&128)===0)return{value:t>>>0,nextOffset:i+1};r+=7}return null}var Ut=64*1024*1024;function lt(n){let e=we(n,0);if(!e||e.value>Ut)throw new Error("Invalid Snappy length");let t=Buffer.alloc(e.value),r=e.nextOffset,i=0;for(;r<n.length&&i<t.length;){let o=n[r++],s=o&3;if(s===0){let c=o>>2;if(c<60)c+=1;else{let l=c-59;if(r+l>n.length)throw new Error("Invalid Snappy literal");c=1;for(let f=0;f<l;f++)c+=n[r++]<<f*8}if(r+c>n.length||i+c>t.length)throw new Error("Invalid Snappy literal length");n.copy(t,i,r,r+c),r+=c,i+=c;continue}let a,u;if(s===1){if(r>=n.length)throw new Error("Invalid Snappy copy");a=(o>>2&7)+4,u=(o&224)<<3|n[r++]}else if(s===2){if(r+2>n.length)throw new Error("Invalid Snappy copy");a=(o>>2)+1,u=n.readUInt16LE(r),r+=2}else{if(r+4>n.length)throw new Error("Invalid Snappy copy");a=(o>>2)+1,u=n.readUInt32LE(r),r+=4}if(u<=0||u>i||i+a>t.length)throw new Error("Invalid Snappy offset");for(let c=0;c<a;c++)t[i]=t[i-u],i++}if(i!==t.length)throw new Error("Truncated Snappy stream");return t}import{copyFileSync as tu,readFileSync as Xn,readdirSync as ru,rmSync as nu}from"node:fs";import{join as _e}from"node:path";function qt(n){return ru(n).filter(e=>/\.(log|ldb|sst)$/i.test(e)).sort()}function oi(n,e){let t=st(e,"chrome-local-storage-");try{let r=qt(n),i=r.map(s=>ie(_e(n,s)));try{for(let s of r)tu(_e(n,s),_e(t,s))}catch(s){throw new F("snapshot_unavailable","Could not copy Local Storage. Close the browser and retry if it is open.",{cause:s})}let o=qt(n);if(o.length!==r.length||r.some((s,a)=>s!==o[a]||!ot(i[a],ie(_e(n,s)))))throw new F("snapshot_unavailable","Local Storage changed during the copy. Close the browser and retry.");return ou(t).values()}finally{nu(t,{recursive:!0,force:!0,maxRetries:3})}}var iu=0xdb4775248b80fb57n,Qn=32768,si=0,ui=1;function ou(n){let e=new Map,t=qt(n);for(let r of t){let i=_e(n,r),o=Xn(i);if(/\.(ldb|sst)$/i.test(r))for(let s of uu(o))Zn(e,s)}for(let r of t){if(!/\.log$/i.test(r))continue;let i=_e(n,r),o=Xn(i);for(let s of su(o))Zn(e,s)}return e}function Zn(n,e){let t=e.key.toString("hex"),r=n.get(t);r&&r.sequence>e.sequence||n.set(t,e)}function su(n){let e=[],t=0,r=[];for(;t+7<=n.length;){let i=Qn-t%Qn;if(i<7){t+=i;continue}let o=n.readUInt16LE(t+4),s=n[t+6];if(t+=7,s===0&&o===0){t+=o;continue}if(o>n.length-t||o>i-7)break;let a=n.subarray(t,t+o);t+=o,s===1?(e.push(...ei(a)),r=[]):s===2?r=[Buffer.from(a)]:s===3&&r.length>0?r.push(Buffer.from(a)):s===4&&r.length>0&&(r.push(Buffer.from(a)),e.push(...ei(Buffer.concat(r))),r=[])}return e}function ei(n){if(n.length<12)return[];let e=[],t=au(n,0),r=n.readUInt32LE(8),i=12,o=0;for(;i<n.length&&o<r;){let s=n[i++],a=ni(n,i);if(!a)break;i=a.nextOffset;let u=t+BigInt(o);if(s===ui){let c=ni(n,i);if(!c)break;i=c.nextOffset,e.push({key:a.value,value:c.value,sequence:u,deleted:!1})}else if(s===si)e.push({key:a.value,sequence:u,deleted:!0});else break;o++}return e}function uu(n){let e=[];if(n.length<48||n.readBigUInt64LE(n.length-8)!==iu)return e;let r=n.subarray(n.length-48,n.length-8),i=Kt(r,0);if(!i)return e;let o=Kt(r,i.bytesRead);if(!o)return e;let s=ti(n,o);if(!s)return e;for(let a of ri(s)){let u=Kt(a.value,0);if(!u)continue;let c=ti(n,u);if(c)for(let l of ri(c)){if(l.key.length<8)continue;let f=l.key,d=f.length-8,D=f[d],p=lu(f.subarray(d)),h=f.subarray(0,d);D===ui?e.push({key:h,value:l.value,sequence:p,deleted:!1}):D===si&&e.push({key:h,sequence:p,deleted:!0})}}return e}function ti(n,e){let t=e.offset+e.size;if(e.offset<0||e.size<0||t+5>n.length)return null;let r=n.subarray(e.offset,t),i=n[t];if(i===0)return r;if(i===1)try{return lt(r)}catch{return null}return null}function ri(n){if(n.length<4)return[];let e=n.readUInt32LE(n.length-4),t=e*4+4;if(e<1||t>n.length)return[];let r=n.length-t,i=[],o=0,s=Buffer.alloc(0);for(;o<r;){let a=we(n,o);if(!a)break;o=a.nextOffset;let u=we(n,o);if(!u)break;o=u.nextOffset;let c=we(n,o);if(!c||(o=c.nextOffset,a.value>s.length||o+u.value+c.value>r))break;let l=Buffer.concat([s.subarray(0,a.value),n.subarray(o,o+u.value)]);o+=u.value;let f=Buffer.from(n.subarray(o,o+c.value));o+=c.value,i.push({key:l,value:f}),s=l}return i}function Kt(n,e){let t=ii(n,e);if(!t)return null;let r=ii(n,t.nextOffset);return!r||t.value>BigInt(Number.MAX_SAFE_INTEGER)||r.value>BigInt(Number.MAX_SAFE_INTEGER)?null:{offset:Number(t.value),size:Number(r.value),bytesRead:r.nextOffset-e}}function ni(n,e){let t=we(n,e);if(!t)return null;let r=t.nextOffset+t.value;return r>n.length?null:{value:Buffer.from(n.subarray(t.nextOffset,r)),nextOffset:r}}function ii(n,e){let t=0n,r=0n;for(let i=e;i<n.length&&i<e+10;i++){let o=n[i];if(t|=BigInt(o&127)<<r,(o&128)===0)return{value:t,nextOffset:i+1};r+=7n}return null}function au(n,e){let t=0n;for(let r=0;r<8;r++)t|=BigInt(n[e+r]||0)<<BigInt(r*8);return t}function lu(n){let e=0n;for(let t=1;t<8;t++)e|=BigInt(n[t]||0)<<BigInt((t-1)*8);return e}function*li(n){let e=ai(n,"LocalStorage");if(ie(e)){let t=L(e,`SELECT maps.storage_key, map_entries.key,
63
+ FROM cookies`,k=[],Q=[];if(o)k.push("host_key LIKE ?"),Q.push(`%${o}%`);else if(p){let v=ou(p.hostname),Be=v.map(()=>"?").join(", ");k.push(`host_key IN (${Be})`),Q.push(...v)}k.length>0&&(_+=` WHERE ${k.join(" AND ")}`),_+=" ORDER BY host_key, name",h&&!s&&(_+=` LIMIT ${h}`);let mt=L(C,_,Q);for(let v of mt){if(p&&(!su(p.hostname,v.host_key||"")||!uu(p.pathname||"/",v.path||"/")||v.is_secure&&p.protocol!=="https:"))continue;let Be=v.value||"";!Be&&v.encrypted_value?.length>0&&a&&(Be=nu(T(v.encrypted_value),v.host_key||"")),m.push({profile:y.name,domain:v.host_key||"",name:v.name||"",value:Be,path:v.path||"/",expires:R(v.expires_utc||0),secure:!!v.is_secure,httpOnly:!!v.is_httponly,sameSite:["unspecified","lax","strict","none"][v.samesite]||"unspecified",created:R(v.creation_utc||0),lastAccessed:R(v.last_access_utc||0)})}}catch(_){B(i,y.name,"Cookies",_),g??=new Error(`Could not read cookies for profile "${y.name}" at ${C}: `+(_ instanceof Error?_.message:String(_)))}}if(!i&&m.length===0&&g)throw g;return q(m,u)}import{join as fi}from"node:path";import{zstdDecompressSync as gu}from"node:zlib";function we(r,e){let t=0,n=0;for(let i=e;i<r.length&&i<e+5;i++){let o=r[i];if(t|=(o&127)<<n,(o&128)===0)return{value:t>>>0,nextOffset:i+1};n+=7}return null}var Jt=64*1024*1024;function ft(r){let e=we(r,0);if(!e||e.value>Jt)throw new Error("Invalid Snappy length");let t=Buffer.alloc(e.value),n=e.nextOffset,i=0;for(;n<r.length&&i<t.length;){let o=r[n++],s=o&3;if(s===0){let c=o>>2;if(c<60)c+=1;else{let l=c-59;if(n+l>r.length)throw new Error("Invalid Snappy literal");c=1;for(let f=0;f<l;f++)c+=r[n++]<<f*8}if(n+c>r.length||i+c>t.length)throw new Error("Invalid Snappy literal length");r.copy(t,i,n,n+c),n+=c,i+=c;continue}let a,u;if(s===1){if(n>=r.length)throw new Error("Invalid Snappy copy");a=(o>>2&7)+4,u=(o&224)<<3|r[n++]}else if(s===2){if(n+2>r.length)throw new Error("Invalid Snappy copy");a=(o>>2)+1,u=r.readUInt16LE(n),n+=2}else{if(n+4>r.length)throw new Error("Invalid Snappy copy");a=(o>>2)+1,u=r.readUInt32LE(n),n+=4}if(u<=0||u>i||i+a>t.length)throw new Error("Invalid Snappy offset");for(let c=0;c<a;c++)t[i]=t[i-u],i++}if(i!==t.length)throw new Error("Truncated Snappy stream");return t}import{copyFileSync as au,readFileSync as ei,readdirSync as lu,rmSync as cu}from"node:fs";import{join as _e}from"node:path";function Qt(r){return lu(r).filter(e=>/\.(log|ldb|sst)$/i.test(e)).sort()}function ai(r,e){let t=at(e,"chrome-local-storage-");try{let n=Qt(r),i=n.map(s=>ie(_e(r,s)));try{for(let s of n)au(_e(r,s),_e(t,s))}catch(s){throw new F("snapshot_unavailable","Could not copy Local Storage. Close the browser and retry if it is open.",{cause:s})}let o=Qt(r);if(o.length!==n.length||n.some((s,a)=>s!==o[a]||!ut(i[a],ie(_e(r,s)))))throw new F("snapshot_unavailable","Local Storage changed during the copy. Close the browser and retry.");return du(t).values()}finally{cu(t,{recursive:!0,force:!0,maxRetries:3})}}var fu=0xdb4775248b80fb57n,ti=32768,li=0,ci=1;function du(r){let e=new Map,t=Qt(r);for(let n of t){let i=_e(r,n),o=ei(i);if(/\.(ldb|sst)$/i.test(n))for(let s of hu(o))ri(e,s)}for(let n of t){if(!/\.log$/i.test(n))continue;let i=_e(r,n),o=ei(i);for(let s of pu(o))ri(e,s)}return e}function ri(r,e){let t=e.key.toString("hex"),n=r.get(t);n&&n.sequence>e.sequence||r.set(t,e)}function pu(r){let e=[],t=0,n=[];for(;t+7<=r.length;){let i=ti-t%ti;if(i<7){t+=i;continue}let o=r.readUInt16LE(t+4),s=r[t+6];if(t+=7,s===0&&o===0){t+=o;continue}if(o>r.length-t||o>i-7)break;let a=r.subarray(t,t+o);t+=o,s===1?(e.push(...ni(a)),n=[]):s===2?n=[Buffer.from(a)]:s===3&&n.length>0?n.push(Buffer.from(a)):s===4&&n.length>0&&(n.push(Buffer.from(a)),e.push(...ni(Buffer.concat(n))),n=[])}return e}function ni(r){if(r.length<12)return[];let e=[],t=mu(r,0),n=r.readUInt32LE(8),i=12,o=0;for(;i<r.length&&o<n;){let s=r[i++],a=si(r,i);if(!a)break;i=a.nextOffset;let u=t+BigInt(o);if(s===ci){let c=si(r,i);if(!c)break;i=c.nextOffset,e.push({key:a.value,value:c.value,sequence:u,deleted:!1})}else if(s===li)e.push({key:a.value,sequence:u,deleted:!0});else break;o++}return e}function hu(r){let e=[];if(r.length<48||r.readBigUInt64LE(r.length-8)!==fu)return e;let n=r.subarray(r.length-48,r.length-8),i=Xt(n,0);if(!i)return e;let o=Xt(n,i.bytesRead);if(!o)return e;let s=ii(r,o);if(!s)return e;for(let a of oi(s)){let u=Xt(a.value,0);if(!u)continue;let c=ii(r,u);if(c)for(let l of oi(c)){if(l.key.length<8)continue;let f=l.key,d=f.length-8,m=f[d],p=Du(f.subarray(d)),h=f.subarray(0,d);m===ci?e.push({key:h,value:l.value,sequence:p,deleted:!1}):m===li&&e.push({key:h,sequence:p,deleted:!0})}}return e}function ii(r,e){let t=e.offset+e.size;if(e.offset<0||e.size<0||t+5>r.length)return null;let n=r.subarray(e.offset,t),i=r[t];if(i===0)return n;if(i===1)try{return ft(n)}catch{return null}return null}function oi(r){if(r.length<4)return[];let e=r.readUInt32LE(r.length-4),t=e*4+4;if(e<1||t>r.length)return[];let n=r.length-t,i=[],o=0,s=Buffer.alloc(0);for(;o<n;){let a=we(r,o);if(!a)break;o=a.nextOffset;let u=we(r,o);if(!u)break;o=u.nextOffset;let c=we(r,o);if(!c||(o=c.nextOffset,a.value>s.length||o+u.value+c.value>n))break;let l=Buffer.concat([s.subarray(0,a.value),r.subarray(o,o+u.value)]);o+=u.value;let f=Buffer.from(r.subarray(o,o+c.value));o+=c.value,i.push({key:l,value:f}),s=l}return i}function Xt(r,e){let t=ui(r,e);if(!t)return null;let n=ui(r,t.nextOffset);return!n||t.value>BigInt(Number.MAX_SAFE_INTEGER)||n.value>BigInt(Number.MAX_SAFE_INTEGER)?null:{offset:Number(t.value),size:Number(n.value),bytesRead:n.nextOffset-e}}function si(r,e){let t=we(r,e);if(!t)return null;let n=t.nextOffset+t.value;return n>r.length?null:{value:Buffer.from(r.subarray(t.nextOffset,n)),nextOffset:n}}function ui(r,e){let t=0n,n=0n;for(let i=e;i<r.length&&i<e+10;i++){let o=r[i];if(t|=BigInt(o&127)<<n,(o&128)===0)return{value:t,nextOffset:i+1};n+=7n}return null}function mu(r,e){let t=0n;for(let n=0;n<8;n++)t|=BigInt(r[e+n]||0)<<BigInt(n*8);return t}function Du(r){let e=0n;for(let t=1;t<8;t++)e|=BigInt(r[t]||0)<<BigInt((t-1)*8);return e}function*di(r){let e=fi(r,"LocalStorage");if(ie(e)){let t=L(e,`SELECT maps.storage_key, map_entries.key,
63
64
  map_entries.value, map_entries.value_compression_type
64
- FROM map_entries JOIN maps ON maps.row_id = map_entries.map_id`);for(let r of t){if(!Buffer.isBuffer(r.storage_key)||!Buffer.isBuffer(r.key)||!Buffer.isBuffer(r.value))throw new F("unsupported_schema","Unexpected LocalStorage record encoding.");let i=r.storage_key.toString("utf8");yield{origin:i.includes("^")||i==="file:///"?i:i.replace(/\/$/,""),key:ct(r.key),value:ct(fu(r.value,r.value_compression_type))}}return}for(let t of oi(ai(n,"Local Storage","leveldb"),n)){if(t.deleted||!t.value)continue;let r=du(t.key,t.value);r&&(yield r)}}function fu(n,e){switch(e){case 0:return n;case 1:return cu(n,{maxOutputLength:Ut});case 2:return lt(n);default:throw new F("unsupported_schema","Unknown LocalStorage value compression type.")}}function du(n,e){if(n.length<3||n[0]!==95)return null;let t=n.indexOf(0,1);if(t===-1)return null;let r=n.subarray(1,t).toString("utf8"),i=ct(n.subarray(t+1)),o=ct(e);return r?{origin:r,key:i,value:o}:null}function ct(n){if(n.length===0)return"";let e=n[0],t=n.subarray(1);return e===0&&t.length%2===0?t.toString("utf16le"):e===1?t.toString("latin1"):n.toString("utf8")}function ci({chromeDir:n,profilePath:e,profile:t,browser:r,onDiagnostic:i,origin:o,url:s,key:a,search:u,limit:c=100}={}){let l=S({chromeDir:n,profilePath:e,profile:t,browser:r,onDiagnostic:i}),f=[],d=pu(s||o),D=a?.toLowerCase(),p=u?.toLowerCase();for(let h of l)try{for(let g of li(h.path)){let y={profile:h.name,...g};d&&!y.origin.toLowerCase().includes(d)||D&&!y.key.toLowerCase().includes(D)||p&&!`${y.origin}
65
+ FROM map_entries JOIN maps ON maps.row_id = map_entries.map_id`);for(let n of t){if(!Buffer.isBuffer(n.storage_key)||!Buffer.isBuffer(n.key)||!Buffer.isBuffer(n.value))throw new F("unsupported_schema","Unexpected LocalStorage record encoding.");let i=n.storage_key.toString("utf8");yield{origin:i.includes("^")||i==="file:///"?i:i.replace(/\/$/,""),key:dt(n.key),value:dt(yu(n.value,n.value_compression_type))}}return}for(let t of ai(fi(r,"Local Storage","leveldb"),r)){if(t.deleted||!t.value)continue;let n=Cu(t.key,t.value);n&&(yield n)}}function yu(r,e){switch(e){case 0:return r;case 1:return gu(r,{maxOutputLength:Jt});case 2:return ft(r);default:throw new F("unsupported_schema","Unknown LocalStorage value compression type.")}}function Cu(r,e){if(r.length<3||r[0]!==95)return null;let t=r.indexOf(0,1);if(t===-1)return null;let n=r.subarray(1,t).toString("utf8"),i=dt(r.subarray(t+1)),o=dt(e);return n?{origin:n,key:i,value:o}:null}function dt(r){if(r.length===0)return"";let e=r[0],t=r.subarray(1);return e===0&&t.length%2===0?t.toString("utf16le"):e===1?t.toString("latin1"):r.toString("utf8")}function pi({chromeDir:r,profilePath:e,profile:t,browser:n,onDiagnostic:i,origin:o,url:s,key:a,search:u,limit:c=100}={}){let l=x({chromeDir:r,profilePath:e,profile:t,browser:n,onDiagnostic:i}),f=[],d=Eu(s||o),m=a?.toLowerCase(),p=u?.toLowerCase();for(let h of l)try{for(let g of di(h.path)){let y={profile:h.name,...g};d&&!y.origin.toLowerCase().includes(d)||m&&!y.key.toLowerCase().includes(m)||p&&!`${y.origin}
65
66
  ${y.key}
66
- ${y.value}`.toLowerCase().includes(p)||f.push(y)}}catch(g){B(i,h.name,"Local Storage",g)}return f.sort((h,g)=>h.profile.localeCompare(g.profile)||h.origin.localeCompare(g.origin)||h.key.localeCompare(g.key)),q(f,c)}function pu(n){if(n)try{return new URL(n).origin.toLowerCase()}catch{return n.toLowerCase()}}var H={firstName:3,middleName:4,lastName:5,fullName:7,email:9,phone:14,line1:30,line2:31,city:33,state:34,zipcode:35,countryCode:36,companyName:60,streetAddress:77},fi=["guid","use_count","use_date","date_modified"],di=["guid","type","value"];function oe(n,e,t){let r=new Set(n("SELECT name FROM pragma_table_info(?)",[e]).map(i=>i.name));return t.every(i=>r.has(i))}function hi(n){return R(n?BigInt(n)*1000000n+11644473600000000n:0)}function pi(n,e,t,r){let i=new Map;for(let o of n("SELECT guid, type, value FROM "+r)){let s=i.get(o.guid);s||(s=new Map,i.set(o.guid,s)),s.set(o.type,o.value)}return n("SELECT guid, use_count, use_date, date_modified FROM "+t).map(o=>{let s=a=>i.get(o.guid)?.get(a)||"";return{useDate:o.use_date,entry:{profile:e,guid:o.guid,fullName:s(H.fullName)||[H.firstName,H.middleName,H.lastName].map(s).filter(Boolean).join(" "),email:s(H.email),phone:s(H.phone),companyName:s(H.companyName),streetAddress:s(H.streetAddress)||[H.line1,H.line2].map(s).filter(Boolean).join(`
67
- `),city:s(H.city),state:s(H.state),zipcode:s(H.zipcode),countryCode:s(H.countryCode),origin:"",useCount:o.use_count||0,dateModified:hi(o.date_modified)}}})}function hu(n,e){let t=oe(n,"autofill_profile_names",["guid","first_name","middle_name","last_name","full_name"])?n("SELECT guid, first_name, middle_name, last_name, full_name FROM autofill_profile_names"):[],r=oe(n,"autofill_profile_emails",["guid","email"])?n("SELECT guid, email FROM autofill_profile_emails"):[],i=oe(n,"autofill_profile_phones",["guid","number"])?n("SELECT guid, number FROM autofill_profile_phones"):[],o=new Map(t.map(u=>[u.guid,u.full_name||[u.first_name,u.middle_name,u.last_name].filter(Boolean).join(" ")])),s=new Map(r.map(u=>[u.guid,u.email])),a=new Map(i.map(u=>[u.guid,u.number]));return n("SELECT * FROM autofill_profiles ORDER BY use_date DESC").map(u=>({profile:e,guid:u.guid||"",fullName:o.get(u.guid)||"",email:s.get(u.guid)||"",phone:a.get(u.guid)||"",companyName:u.company_name||"",streetAddress:u.street_address||"",city:u.city||"",state:u.state||"",zipcode:u.zipcode||"",countryCode:u.country_code||"",origin:u.origin||"",useCount:u.use_count||0,dateModified:hi(u.date_modified)}))}function mi(n,e){return Gt(n,t=>{if(oe(t,"addresses",fi)&&oe(t,"address_type_tokens",di))return pi(t,e,"addresses","address_type_tokens").sort((o,s)=>s.useDate-o.useDate).map(({entry:o})=>o);let i=[["local_addresses","local_addresses_type_tokens"],["contact_info","contact_info_type_tokens"]].filter(([o,s])=>oe(t,o,fi)&&oe(t,s,di));if(i.length)return i.flatMap(([o,s])=>pi(t,e,o,s)).sort((o,s)=>s.useDate-o.useDate).map(({entry:o})=>o);if(oe(t,"autofill_profiles",["guid","use_date"]))return hu(t,e);throw new F("unsupported_schema","Unrecognized saved-address schema in Web Data.")})}import{join as zt}from"node:path";function Di({chromeDir:n,profilePath:e,profile:t,browser:r,onDiagnostic:i,search:o,limit:s=100}={}){let a=S({chromeDir:n,profilePath:e,profile:t,browser:r,onDiagnostic:i}),u=[],c=X(s);for(let l of a){let f=zt(l.path,"Web Data");try{let d="SELECT name, value, date_created, date_last_used, count FROM autofill",D=[];if(o){d+=" WHERE IFNULL(name, '') LIKE ? ESCAPE '\\' OR IFNULL(value, '') LIKE ? ESCAPE '\\'";let h=be(o);D.push(h,h)}d+=" ORDER BY date_last_used DESC",c&&(d+=` LIMIT ${c}`);let p=L(f,d,D);for(let h of p)u.push({profile:l.name,name:h.name||"",value:h.value||"",dateCreated:R(h.date_created?BigInt(h.date_created)*1000000n+11644473600000000n:0),dateLastUsed:R(h.date_last_used?BigInt(h.date_last_used)*1000000n+11644473600000000n:0),count:h.count||0})}catch(d){B(i,l.name,"Web Data",d)}}return q(u,s)}function gi({chromeDir:n,profilePath:e,profile:t,browser:r,onDiagnostic:i,decryptionKey:o}={}){let s=e||n,a=r??O().id,u=S({chromeDir:n,profilePath:e,profile:t,browser:a,onDiagnostic:i}),c=[];for(let l of u){let f=zt(l.path,"Web Data"),d=Ee(s??l.path,a,o,i,l.name,"Web Data");try{let D=L(f,`SELECT guid, name_on_card, expiration_month, expiration_year,
67
+ ${y.value}`.toLowerCase().includes(p)||f.push(y)}}catch(g){B(i,h.name,"Local Storage",g)}return f.sort((h,g)=>h.profile.localeCompare(g.profile)||h.origin.localeCompare(g.origin)||h.key.localeCompare(g.key)),q(f,c)}function Eu(r){if(r)try{return new URL(r).origin.toLowerCase()}catch{return r.toLowerCase()}}var H={firstName:3,middleName:4,lastName:5,fullName:7,email:9,phone:14,line1:30,line2:31,city:33,state:34,zipcode:35,countryCode:36,companyName:60,streetAddress:77},hi=["guid","use_count","use_date","date_modified"],mi=["guid","type","value"];function oe(r,e,t){let n=new Set(r("SELECT name FROM pragma_table_info(?)",[e]).map(i=>i.name));return t.every(i=>n.has(i))}function gi(r){return R(r?BigInt(r)*1000000n+11644473600000000n:0)}function Di(r,e,t,n){let i=new Map;for(let o of r("SELECT guid, type, value FROM "+n)){let s=i.get(o.guid);s||(s=new Map,i.set(o.guid,s)),s.set(o.type,o.value)}return r("SELECT guid, use_count, use_date, date_modified FROM "+t).map(o=>{let s=a=>i.get(o.guid)?.get(a)||"";return{useDate:o.use_date,entry:{profile:e,guid:o.guid,fullName:s(H.fullName)||[H.firstName,H.middleName,H.lastName].map(s).filter(Boolean).join(" "),email:s(H.email),phone:s(H.phone),companyName:s(H.companyName),streetAddress:s(H.streetAddress)||[H.line1,H.line2].map(s).filter(Boolean).join(`
68
+ `),city:s(H.city),state:s(H.state),zipcode:s(H.zipcode),countryCode:s(H.countryCode),origin:"",useCount:o.use_count||0,dateModified:gi(o.date_modified)}}})}function bu(r,e){let t=oe(r,"autofill_profile_names",["guid","first_name","middle_name","last_name","full_name"])?r("SELECT guid, first_name, middle_name, last_name, full_name FROM autofill_profile_names"):[],n=oe(r,"autofill_profile_emails",["guid","email"])?r("SELECT guid, email FROM autofill_profile_emails"):[],i=oe(r,"autofill_profile_phones",["guid","number"])?r("SELECT guid, number FROM autofill_profile_phones"):[],o=new Map(t.map(u=>[u.guid,u.full_name||[u.first_name,u.middle_name,u.last_name].filter(Boolean).join(" ")])),s=new Map(n.map(u=>[u.guid,u.email])),a=new Map(i.map(u=>[u.guid,u.number]));return r("SELECT * FROM autofill_profiles ORDER BY use_date DESC").map(u=>({profile:e,guid:u.guid||"",fullName:o.get(u.guid)||"",email:s.get(u.guid)||"",phone:a.get(u.guid)||"",companyName:u.company_name||"",streetAddress:u.street_address||"",city:u.city||"",state:u.state||"",zipcode:u.zipcode||"",countryCode:u.country_code||"",origin:u.origin||"",useCount:u.use_count||0,dateModified:gi(u.date_modified)}))}function yi(r,e){return Yt(r,t=>{if(oe(t,"addresses",hi)&&oe(t,"address_type_tokens",mi))return Di(t,e,"addresses","address_type_tokens").sort((o,s)=>s.useDate-o.useDate).map(({entry:o})=>o);let i=[["local_addresses","local_addresses_type_tokens"],["contact_info","contact_info_type_tokens"]].filter(([o,s])=>oe(t,o,hi)&&oe(t,s,mi));if(i.length)return i.flatMap(([o,s])=>Di(t,e,o,s)).sort((o,s)=>s.useDate-o.useDate).map(({entry:o})=>o);if(oe(t,"autofill_profiles",["guid","use_date"]))return bu(t,e);throw new F("unsupported_schema","Unrecognized saved-address schema in Web Data.")})}import{join as Zt}from"node:path";function Ci({chromeDir:r,profilePath:e,profile:t,browser:n,onDiagnostic:i,search:o,limit:s=100}={}){let a=x({chromeDir:r,profilePath:e,profile:t,browser:n,onDiagnostic:i}),u=[],c=X(s);for(let l of a){let f=Zt(l.path,"Web Data");try{let d="SELECT name, value, date_created, date_last_used, count FROM autofill",m=[];if(o){d+=" WHERE IFNULL(name, '') LIKE ? ESCAPE '\\' OR IFNULL(value, '') LIKE ? ESCAPE '\\'";let h=be(o);m.push(h,h)}d+=" ORDER BY date_last_used DESC",c&&(d+=` LIMIT ${c}`);let p=L(f,d,m);for(let h of p)u.push({profile:l.name,name:h.name||"",value:h.value||"",dateCreated:R(h.date_created?BigInt(h.date_created)*1000000n+11644473600000000n:0),dateLastUsed:R(h.date_last_used?BigInt(h.date_last_used)*1000000n+11644473600000000n:0),count:h.count||0})}catch(d){B(i,l.name,"Web Data",d)}}return q(u,s)}function Ei({chromeDir:r,profilePath:e,profile:t,browser:n,onDiagnostic:i,decryptionKey:o}={}){let s=e||r,a=n??A().id,u=x({chromeDir:r,profilePath:e,profile:t,browser:a,onDiagnostic:i}),c=[];for(let l of u){let f=Zt(l.path,"Web Data"),d=Ee(s??l.path,a,o,i,l.name,"Web Data");try{let m=L(f,`SELECT guid, name_on_card, expiration_month, expiration_year,
68
69
  card_number_encrypted, date_modified, origin, use_count,
69
70
  nickname
70
- FROM credit_cards ORDER BY use_date DESC`);for(let p of D){let h="";if(p.card_number_encrypted?.length>0){let g=d(p.card_number_encrypted);h=Buffer.isBuffer(g)?g.toString("utf8"):g}c.push({profile:l.name,guid:p.guid||"",nameOnCard:p.name_on_card||"",expirationMonth:p.expiration_month||0,expirationYear:p.expiration_year||0,cardNumber:h,nickname:p.nickname||"",origin:p.origin||"",useCount:p.use_count||0,dateModified:R(p.date_modified?BigInt(p.date_modified)*1000000n+11644473600000000n:0)})}}catch(D){B(i,l.name,"Web Data",D)}}return c}function yi(n={}){let e=[];for(let t of S(n))try{for(let r of mi(zt(t.path,"Web Data"),t.name))e.push(r)}catch(r){B(n.onDiagnostic,t.name,"Web Data",r)}return e}import{join as mu}from"node:path";var Du={0:"in_progress",1:"complete",2:"cancelled",3:"interrupted"},gu={0:"not_dangerous",1:"dangerous_file",2:"dangerous_url",3:"dangerous_content",4:"maybe_dangerous_content",5:"uncommon_content",6:"user_validated",7:"dangerous_host",8:"potentially_unwanted",9:"allowlisted_by_policy"};function Ci({chromeDir:n,profilePath:e,profile:t,browser:r,onDiagnostic:i,search:o,limit:s=100}={}){let a=S({chromeDir:n,profilePath:e,profile:t,browser:r,onDiagnostic:i}),u=[],c=X(s);for(let l of a){let f=mu(l.path,"History");try{let d=`SELECT target_path, tab_url, total_bytes, received_bytes,
71
+ FROM credit_cards ORDER BY use_date DESC`);for(let p of m){let h="";if(p.card_number_encrypted?.length>0){let g=d(p.card_number_encrypted);h=Buffer.isBuffer(g)?g.toString("utf8"):g}c.push({profile:l.name,guid:p.guid||"",nameOnCard:p.name_on_card||"",expirationMonth:p.expiration_month||0,expirationYear:p.expiration_year||0,cardNumber:h,nickname:p.nickname||"",origin:p.origin||"",useCount:p.use_count||0,dateModified:R(p.date_modified?BigInt(p.date_modified)*1000000n+11644473600000000n:0)})}}catch(m){B(i,l.name,"Web Data",m)}}return c}function bi(r={}){let e=[];for(let t of x(r))try{for(let n of yi(Zt(t.path,"Web Data"),t.name))e.push(n)}catch(n){B(r.onDiagnostic,t.name,"Web Data",n)}return e}import{join as wu}from"node:path";var _u={0:"in_progress",1:"complete",2:"cancelled",3:"interrupted"},Fu={0:"not_dangerous",1:"dangerous_file",2:"dangerous_url",3:"dangerous_content",4:"maybe_dangerous_content",5:"uncommon_content",6:"user_validated",7:"dangerous_host",8:"potentially_unwanted",9:"allowlisted_by_policy"};function wi({chromeDir:r,profilePath:e,profile:t,browser:n,onDiagnostic:i,search:o,limit:s=100}={}){let a=x({chromeDir:r,profilePath:e,profile:t,browser:n,onDiagnostic:i}),u=[],c=X(s);for(let l of a){let f=wu(l.path,"History");try{let d=`SELECT target_path, tab_url, total_bytes, received_bytes,
71
72
  start_time, end_time, mime_type, original_mime_type,
72
73
  state, danger_type, opened, referrer, site_url
73
- FROM downloads`,D=[];if(o){d+=` WHERE IFNULL(target_path, '') LIKE ? ESCAPE '\\'
74
- OR IFNULL(tab_url, '') LIKE ? ESCAPE '\\'`;let h=be(o);D.push(h,h)}d+=" ORDER BY start_time DESC",c&&(d+=` LIMIT ${c}`);let p=L(f,d,D);for(let h of p)u.push({profile:l.name,targetPath:h.target_path||"",url:h.tab_url||"",siteUrl:h.site_url||"",referrer:h.referrer||"",totalBytes:h.total_bytes||0,receivedBytes:h.received_bytes||0,mimeType:h.mime_type||h.original_mime_type||"",state:Du[h.state]||`unknown(${h.state})`,dangerType:gu[h.danger_type]||`unknown(${h.danger_type})`,opened:!!h.opened,startTime:R(h.start_time||0),endTime:R(h.end_time||0)})}catch(d){B(i,l.name,"History",d)}}return q(u,s)}import{existsSync as yu,readFileSync as Cu}from"node:fs";import{join as Eu}from"node:path";function Ei({chromeDir:n,profilePath:e,profile:t,search:r,browser:i,onDiagnostic:o}={}){let s=S({chromeDir:n,profilePath:e,profile:t,browser:i,onDiagnostic:o}),a=[];for(let u of s){let c=null;for(let l of["Secure Preferences","Preferences"]){let f=Eu(u.path,l);if(yu(f))try{let D=JSON.parse(Cu(f,"utf-8"))?.extensions?.settings;if(D&&typeof D=="object"){c=D;break}}catch(d){B(o,u.name,l,d instanceof SyntaxError?new Error("Invalid preferences JSON."):d)}}if(c)for(let[l,f]of Object.entries(c)){let d=f;if(d.location===5||d.location===10)continue;let D=d.manifest||{},p={profile:u.name,id:l,name:D.name||d.name||l,version:D.version||d.version||"unknown",description:D.description||"",enabled:d.state===1,homepageUrl:D.homepage_url||"",updateUrl:D.update_url||"",installTime:d.install_time||"",fromWebstore:d.from_webstore||!1,location:d.location||0};if(p.name.startsWith("__MSG_")&&(p.name=l),p.description.startsWith("__MSG_")&&(p.description=""),r){let h=r.toLowerCase();if(!(p.name&&p.name.toLowerCase().includes(h))&&!(p.id&&p.id.toLowerCase().includes(h)))continue}a.push(p)}}return a}import{join as bu}from"node:path";function bi({chromeDir:n,profilePath:e,profile:t,browser:r,onDiagnostic:i}={}){let o=S({chromeDir:n,profilePath:e,profile:t,browser:r,onDiagnostic:i}),s=[];for(let a of o){let u=bu(a.path,"Web Data");try{let c=L(u,`SELECT id, short_name, keyword, url, suggestions_url,
74
+ FROM downloads`,m=[];if(o){d+=` WHERE IFNULL(target_path, '') LIKE ? ESCAPE '\\'
75
+ OR IFNULL(tab_url, '') LIKE ? ESCAPE '\\'`;let h=be(o);m.push(h,h)}d+=" ORDER BY start_time DESC",c&&(d+=` LIMIT ${c}`);let p=L(f,d,m);for(let h of p)u.push({profile:l.name,targetPath:h.target_path||"",url:h.tab_url||"",siteUrl:h.site_url||"",referrer:h.referrer||"",totalBytes:h.total_bytes||0,receivedBytes:h.received_bytes||0,mimeType:h.mime_type||h.original_mime_type||"",state:_u[h.state]||`unknown(${h.state})`,dangerType:Fu[h.danger_type]||`unknown(${h.danger_type})`,opened:!!h.opened,startTime:R(h.start_time||0),endTime:R(h.end_time||0)})}catch(d){B(i,l.name,"History",d)}}return q(u,s)}import{existsSync as Bu,readFileSync as Su}from"node:fs";import{join as xu}from"node:path";function _i({chromeDir:r,profilePath:e,profile:t,search:n,browser:i,onDiagnostic:o}={}){let s=x({chromeDir:r,profilePath:e,profile:t,browser:i,onDiagnostic:o}),a=[];for(let u of s){let c=null;for(let l of["Secure Preferences","Preferences"]){let f=xu(u.path,l);if(Bu(f))try{let m=JSON.parse(Su(f,"utf-8"))?.extensions?.settings;if(m&&typeof m=="object"){c=m;break}}catch(d){B(o,u.name,l,d instanceof SyntaxError?new Error("Invalid preferences JSON."):d)}}if(c)for(let[l,f]of Object.entries(c)){let d=f;if(d.location===5||d.location===10)continue;let m=d.manifest||{},p={profile:u.name,id:l,name:m.name||d.name||l,version:m.version||d.version||"unknown",description:m.description||"",enabled:d.state===1,homepageUrl:m.homepage_url||"",updateUrl:m.update_url||"",installTime:d.install_time||"",fromWebstore:d.from_webstore||!1,location:d.location||0};if(p.name.startsWith("__MSG_")&&(p.name=l),p.description.startsWith("__MSG_")&&(p.description=""),n){let h=n.toLowerCase();if(!(p.name&&p.name.toLowerCase().includes(h))&&!(p.id&&p.id.toLowerCase().includes(h)))continue}a.push(p)}}return a}import{join as Au}from"node:path";function Fi({chromeDir:r,profilePath:e,profile:t,browser:n,onDiagnostic:i}={}){let o=x({chromeDir:r,profilePath:e,profile:t,browser:n,onDiagnostic:i}),s=[];for(let a of o){let u=Au(a.path,"Web Data");try{let c=L(u,`SELECT id, short_name, keyword, url, suggestions_url,
75
76
  favicon_url, prepopulate_id, is_active
76
- FROM keywords ORDER BY short_name`);for(let l of c)s.push({profile:a.name,id:l.id,name:l.short_name||"",keyword:l.keyword||"",url:l.url||"",suggestionsUrl:l.suggestions_url||"",faviconUrl:l.favicon_url||"",isDefault:l.prepopulate_id===1,isActive:l.is_active===1})}catch(c){B(i,a.name,"Web Data",c)}}return s}import{join as wu}from"node:path";function wi({chromeDir:n,profilePath:e,profile:t,browser:r,onDiagnostic:i}={}){let o=S({chromeDir:n,profilePath:e,profile:t,browser:r,onDiagnostic:i}),s=[];for(let a of o){let u=wu(a.path,"Top Sites");try{let c=L(u,`SELECT url, url_rank, title, redirects
77
- FROM top_sites ORDER BY url_rank ASC`);for(let l of c)s.push({profile:a.name,url:l.url||"",title:l.title||"",rank:l.url_rank??0,redirects:l.redirects||""})}catch(c){B(i,a.name,"Top Sites",c)}}return s}var _u=process.env.PROFILE_PATH||void 0,Fu=process.env.PROFILE_NAME||void 0,_i=process.env.BROWSER||process.env.CHROME_BROWSER||void 0;function ft(n){console.log(JSON.stringify(n,null,2))}function He(n,e){return new Fi.default({head:n.map(t=>m.bold.white(t)),colWidths:e,wordWrap:!0,style:{border:["grey"],head:[]}})}function Bu(n){return tt(n)?(console.error(m.red.bold(`
77
+ FROM keywords ORDER BY short_name`);for(let l of c)s.push({profile:a.name,id:l.id,name:l.short_name||"",keyword:l.keyword||"",url:l.url||"",suggestionsUrl:l.suggestions_url||"",faviconUrl:l.favicon_url||"",isDefault:l.prepopulate_id===1,isActive:l.is_active===1})}catch(c){B(i,a.name,"Web Data",c)}}return s}import{join as Ou}from"node:path";function Bi({chromeDir:r,profilePath:e,profile:t,browser:n,onDiagnostic:i}={}){let o=x({chromeDir:r,profilePath:e,profile:t,browser:n,onDiagnostic:i}),s=[];for(let a of o){let u=Ou(a.path,"Top Sites");try{let c=L(u,`SELECT url, url_rank, title, redirects
78
+ FROM top_sites ORDER BY url_rank ASC`);for(let l of c)s.push({profile:a.name,url:l.url||"",title:l.title||"",rank:l.url_rank??0,redirects:l.redirects||""})}catch(c){B(i,a.name,"Top Sites",c)}}return s}var vu=process.env.PROFILE_PATH||void 0,ku=process.env.PROFILE_NAME||void 0,Si=process.env.BROWSER||process.env.CHROME_BROWSER||void 0;function pt(r){console.log(JSON.stringify(r,null,2))}function He(r,e){return new xi.default({head:r.map(t=>D.bold.white(t)),colWidths:e,wordWrap:!0,style:{border:["grey"],head:[]}})}function Ru(r){return rt(r)?(console.error(D.red.bold(`
78
79
  \u{1F511} No keychain access
79
- `)),console.error(m.yellow(`chrome-tools couldn't read the browser's encryption key from your macOS
80
- Keychain, so passwords and other encrypted data can't be decrypted.`)),console.error(m.dim(`
81
- `+n.message+`
82
- `)),!0):!1}function je(n,e){console.log(e===0?m.yellow(`
83
- \u26A0 No ${n} found.
84
- `):m.green(`
85
- \u2714 Found ${e} ${n}.
86
- `))}function U(n,e,t,r,i,o,s){if(We(n,e))return;if(e.length===0)return je(r,0);console.log(m.bold(`
80
+ `)),console.error(D.yellow(`chrome-tools couldn't read the browser's encryption key from your macOS
81
+ Keychain, so passwords and other encrypted data can't be decrypted.`)),console.error(D.dim(`
82
+ `+r.message+`
83
+ `)),!0):!1}function je(r,e){console.log(e===0?D.yellow(`
84
+ \u26A0 No ${r} found.
85
+ `):D.green(`
86
+ \u2714 Found ${e} ${r}.
87
+ `))}function tr(r,e){if(!e||r.diagnostics)return;let t=$n(r.profilePath,r.browser);t&&console.error(D.yellow(`\u26A0 ${t}
88
+ `))}function U(r,e,t,n,i,o,s){if(Ve(r,e))return;if(e.length===0)return je(n,0);console.log(D.bold(`
87
89
  ${t}:
88
- `));let a=He(i,o);for(let u of e)a.push(s(u));console.log(a.toString()),je(r,e.length)}function Yt(n){return n instanceof Error?n.message:String(n)}var se=null;function We(n,e){return se?(se.push({browser:O().name,results:e}),!0):n.json?(ft(e),!0):!1}function xu(n,e){let t=Wt();if(t.length===0){if(e.json)return ft([]);console.log(m.yellow(`
90
+ `));let a=He(i,o);for(let u of e)a.push(s(u));console.log(a.toString()),je(n,e.length)}function er(r){return r instanceof Error?r.message:String(r)}var se=null;function Ve(r,e){return se?(se.push({browser:A().name,results:e}),!0):r.json?(pt(e),!0):!1}function Tu(r,e){let t=qt();if(t.length===0){if(e.json)return pt([]);console.log(D.yellow(`
89
91
  \u26A0 No supported Chromium browsers found on this machine.
90
- `));return}let r={...e,browser:void 0,profilePath:void 0},i=O();se=e.json?[]:null;try{for(let o of t){Me(o.browser.id),e.json||console.log(m.bold.magenta(`
91
- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 ${o.browser.name} \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`));try{n(r)}catch(s){se?se.push({browser:o.browser.name,results:{error:Yt(s)}}):tt(s)?(console.log(m.red(` \u{1F511} No keychain access \u2014 skipped (${s.service}).`)),console.log(m.dim(` ${s.message.split(`
92
+ `));return}let n={...e,browser:void 0,profilePath:void 0},i=A();se=e.json?[]:null;try{for(let o of t){Ne(o.browser.id),e.json||console.log(D.bold.magenta(`
93
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 ${o.browser.name} \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`));try{r(n)}catch(s){se?se.push({browser:o.browser.name,results:{error:er(s)}}):rt(s)?(console.log(D.red(` \u{1F511} No keychain access \u2014 skipped (${s.service}).`)),console.log(D.dim(` ${s.message.split(`
92
94
  `).join(`
93
- `)}`))):console.log(m.red(` \u26A0 Skipped: ${Yt(s)}`))}}se&&ft(se)}finally{se=null,Me(i.id)}}function N(n){let e=n.optsWithGlobals(),t=!!e.browser||!!e.allBrowsers||!!_i;return e.browser=e.browser||_i||void 0,e.profilePath||(e.profilePath=t?void 0:_u),e.profile||(e.profile=t?void 0:Fu),e.diagnostics&&(e.onDiagnostic=({profile:r,store:i,code:o,message:s})=>{console.error(`[${o}] ${r?r+"/":""}${i} \u2014 ${s}`)}),e}function P(n,e){if(e.allBrowsers){xu(n,e);return}Me(e.browser),n(e)}function Bi(n){let e=Wt({includeMissing:!0});if(n.json)return ft(e.map(i=>({id:i.browser.id,name:i.browser.name,installed:i.installed,profileCount:i.profileCount,path:i.chromeDir,safeStorageLabel:i.browser.safeStorageLabel})));let t=e.filter(i=>i.installed);console.log(m.bold(`
95
+ `)}`))):console.log(D.red(` \u26A0 Skipped: ${er(s)}`))}}se&&pt(se)}finally{se=null,Ne(i.id)}}function I(r){let e=r.optsWithGlobals(),t=!!e.browser||!!e.allBrowsers||!!Si;return e.browser=e.browser||Si||void 0,e.profilePath||(e.profilePath=t?void 0:vu),e.profile||(e.profile=t?void 0:ku),e.diagnostics&&(e.onDiagnostic=({profile:n,store:i,code:o,message:s})=>{console.error(`[${o}] ${n?n+"/":""}${i} \u2014 ${s}`)}),e}function P(r,e){if(e.allBrowsers){Tu(r,e);return}Ne(e.browser),r(e)}function Ai(r){let e=qt({includeMissing:!0});if(r.json)return pt(e.map(i=>({id:i.browser.id,name:i.browser.name,installed:i.installed,profileCount:i.profileCount,path:i.chromeDir,safeStorageLabel:i.browser.safeStorageLabel})));let t=e.filter(i=>i.installed);console.log(D.bold(`
94
96
  \u{1F310} Supported browsers (${t.length} installed):
95
- `));let r=He(["Browser","Id","Installed","Profiles","Path"],[20,14,11,9,50]);for(let i of e)r.push([m.white(i.browser.name),m.cyan(i.browser.id),i.installed?m.green("\u2713"):m.dim("\u2717"),i.installed?m.yellow(String(i.profileCount)):m.dim("\u2014"),m.dim(i.chromeDir)]);console.log(r.toString())}function $(n){return n.option("--profile-path <path>","Custom browser User Data Path (overrides --browser)").option("--profile <name>","Target a specific profile").option("--browser <name>","Browser to read (chrome, edge, brave, comet, vivaldi, opera, chromium\u2026)").option("--all-browsers","Read from every installed Chromium browser").option("--diagnostics","Report profile read failures on stderr").option("--json","Output as JSON")}function le(n){return n.option("--search <term>","Filter results (case-insensitive)")}function Fe(n,e=100){return n.option("--limit <n>","Limit number of results",xi,e)}function xi(n){let e=Number(n);if(!Number.isSafeInteger(e)||e<0)throw new Z("Limit must be a non-negative integer.");return e}var I=new fe;I.name("chrome-tools").description(m.bold.cyan("Chrome Data Toolkit")+m.dim(" \u2014 Extract passwords, bookmarks, history, cookies, and more from Chrome on macOS, Windows, and Linux")).version(Qt.version).option("--passwords","Shortcut: list saved passwords").option("--bookmarks","Shortcut: list bookmarks").option("--local-storage","Shortcut: list localStorage entries").option("--profiles","Shortcut: list profiles").option("--browsers","Shortcut: list supported / installed browsers").option("--size","Show each profile's size on disk when listing profiles (slower)");$(I).option("--search <term>","Filter results (for shortcut flags)").option("--limit <n>","Limit results (for shortcut flags)",xi).action((n,e)=>{let t=N(e);t.browsers?Bi(t):t.passwords?P(Oi,t):t.bookmarks?P(vi,t):t.localStorage?P(ki,t):P(Ai,t)});var Si=I.command("profiles").description("List Chrome profiles");$(Si).option("--size","Compute and show each profile's size on disk (slower)").action((n,e)=>{P(Ai,N(e))});var Su=Si.command("states").description("Show detailed profile states with available data files");$(Su).action((n,e)=>P(Ou,N(e)));var Au=I.command("browsers").description("List supported browsers and detect which are installed");Au.option("--json","Output as JSON").action((n,e)=>Bi(N(e)));function Ai(n){let e=ae(n.profilePath,{reportAccessDenied:!0}),t=Vt(n.profilePath),r=!!n.size;if(n.json){let u=new Map(t.map(l=>[l.directory,l])),c=e.map(l=>({...l,...u.get(l.name),...r?{sizeBytes:it(l.path)}:{}}));We(n,c);return}if(e.length===0){console.log(m.yellow(`
97
+ `));let n=He(["Browser","Id","Installed","Profiles","Path"],[20,14,11,9,50]);for(let i of e)n.push([D.white(i.browser.name),D.cyan(i.browser.id),i.installed?D.green("\u2713"):D.dim("\u2717"),i.installed?D.yellow(String(i.profileCount)):D.dim("\u2014"),D.dim(i.chromeDir)]);console.log(n.toString())}function M(r){return r.option("--profile-path <path>","Custom browser User Data Path (overrides --browser)").option("--profile <name>","Target a specific profile").option("--browser <name>","Browser to read (chrome, edge, brave, comet, vivaldi, opera, chromium\u2026)").option("--all-browsers","Read from every installed Chromium browser").option("--diagnostics","Report profile read failures on stderr").option("--json","Output as JSON")}function le(r){return r.option("--search <term>","Filter results (case-insensitive)")}function Fe(r,e=100){return r.option("--limit <n>","Limit number of results",Oi,e)}function Oi(r){let e=Number(r);if(!Number.isSafeInteger(e)||e<0)throw new Z("Limit must be a non-negative integer.");return e}var $=new fe;$.name("chrome-tools").description(D.bold.cyan("Chrome Data Toolkit")+D.dim(" \u2014 Extract passwords, bookmarks, history, cookies, and more from Chrome on macOS, Windows, and Linux")).version(ir.version).option("--passwords","Shortcut: list saved passwords").option("--bookmarks","Shortcut: list bookmarks").option("--local-storage","Shortcut: list localStorage entries").option("--profiles","Shortcut: list profiles").option("--browsers","Shortcut: list supported / installed browsers").option("--size","Show each profile's size on disk when listing profiles (slower)");M($).option("--search <term>","Filter results (for shortcut flags)").option("--limit <n>","Limit results (for shortcut flags)",Oi).action((r,e)=>{let t=I(e);t.browsers?Ai(t):t.passwords?P(Ri,t):t.bookmarks?P(Ti,t):t.localStorage?P(Li,t):P(ki,t)});var vi=$.command("profiles").description("List Chrome profiles");M(vi).option("--size","Compute and show each profile's size on disk (slower)").action((r,e)=>{P(ki,I(e))});var Lu=vi.command("states").description("Show detailed profile states with available data files");M(Lu).action((r,e)=>P($u,I(e)));var Pu=$.command("browsers").description("List supported browsers and detect which are installed");Pu.option("--json","Output as JSON").action((r,e)=>Ai(I(e)));function ki(r){let e=ae(r.profilePath,{reportAccessDenied:!0}),t=zt(r.profilePath),n=!!r.size;if(r.json){let u=new Map(t.map(l=>[l.directory,l])),c=e.map(l=>({...l,...u.get(l.name),...n?{sizeBytes:st(l.path)}:{}}));Ve(r,c);return}if(e.length===0){console.log(D.yellow(`
96
98
  \u26A0 No Chrome profiles found.
97
- `));return}let i=new Map(t.map(u=>[u.directory,u]));console.log(m.bold(`
99
+ `));return}let i=new Map(t.map(u=>[u.directory,u]));console.log(D.bold(`
98
100
  \u{1F4C1} Discovered ${e.length} profile(s):
99
- `));let a=He(r?["Directory","Display Name","Email","Size","Path"]:["Directory","Display Name","Email","Path"],r?[16,22,30,10,42]:[16,22,30,50]);for(let u of e){let c=i.get(u.name),l=[m.cyan(u.name),m.white(c?.name||u.name),m.dim(c?.email||"\u2014")];r&&l.push(m.yellow(Ri(it(u.path)))),l.push(m.dim(u.path)),a.push(l)}console.log(a.toString()),je("profile(s)",e.length)}function Ou(n){let e=Nn(n.profilePath);if(n.json){We(n,e);return}if(e.length===0){console.log(m.yellow(`
101
+ `));let a=He(n?["Directory","Display Name","Email","Size","Path"]:["Directory","Display Name","Email","Path"],n?[16,22,30,10,42]:[16,22,30,50]);for(let u of e){let c=i.get(u.name),l=[D.cyan(u.name),D.white(c?.name||u.name),D.dim(c?.email||"\u2014")];n&&l.push(D.yellow(Pi(st(u.path)))),l.push(D.dim(u.path)),a.push(l)}console.log(a.toString()),je("profile(s)",e.length)}function $u(r){let e=Wn(r.profilePath);if(r.json){Ve(r,e);return}if(e.length===0){console.log(D.yellow(`
100
102
  \u26A0 No Chrome profiles found.
101
- `));return}console.log(m.bold(`
103
+ `));return}console.log(D.bold(`
102
104
  \u{1F4CA} Profile States (${e.length} profile(s)):
103
- `));for(let t of e){console.log(m.bold.cyan(` ${t.displayName}`)+m.dim(` (${t.directory})`)),t.email&&console.log(m.dim(` Email: ${t.email}`)),console.log(m.dim(` Path: ${t.path}`));let r=t.dataFiles,i=Object.entries(r).filter(([,s])=>s).map(([s])=>s),o=Object.entries(r).filter(([,s])=>!s).map(([s])=>s);console.log(` Available: ${i.map(s=>m.green(s)).join(", ")||m.dim("none")}`),o.length>0&&console.log(` Missing: ${o.map(s=>m.dim(s)).join(", ")}`),console.log()}}var vu=I.command("passwords").description("List saved passwords");le($(vu)).option("--diagnose","Report the stores that would be read \u2014 profile, file, row count, and any read error \u2014 instead of the passwords themselves").action((n,e)=>P(Oi,N(e)));function Oi(n){if(n.diagnose)return ku(n);let e=Gn(n);if(We(n,e))return;if(e.length===0)return je("passwords",0);console.log(m.bold(`
105
+ `));for(let t of e){console.log(D.bold.cyan(` ${t.displayName}`)+D.dim(` (${t.directory})`)),t.email&&console.log(D.dim(` Email: ${t.email}`)),console.log(D.dim(` Path: ${t.path}`));let n=t.dataFiles,i=Object.entries(n).filter(([,s])=>s).map(([s])=>s),o=Object.entries(n).filter(([,s])=>!s).map(([s])=>s);console.log(` Available: ${i.map(s=>D.green(s)).join(", ")||D.dim("none")}`),o.length>0&&console.log(` Missing: ${o.map(s=>D.dim(s)).join(", ")}`),console.log()}}var Iu=$.command("passwords").description("List saved passwords");le(M(Iu)).option("--diagnose","Report the stores that would be read \u2014 profile, file, row count, and any read error \u2014 instead of the passwords themselves").action((r,e)=>P(Ri,I(e)));function Ri(r){if(r.diagnose)return Nu(r);let e=qn(r);if(Ve(r,e))return;if(e.length===0)return je("passwords",0);console.log(D.bold(`
104
106
  \u{1F511} Saved Passwords:
105
- `));let t=new Set(e.map(s=>s.profile)).size>1,r=["Source","URL","Username","Password","Last Used"],i=[9,42,24,22,20];t&&(r.unshift("Profile"),i.unshift(12));let o=He(r,i);for(let s of e){let a=[m.blue(s.source??"?"),m.cyan(s.url),m.green(s.username||"<empty>"),m.yellow(s.password||"<empty>"),m.dim(s.lastUsed)];t&&a.unshift(m.magenta(s.profile)),o.push(a)}console.log(o.toString()),je("password(s)",e.length)}function ku(n){let e=Vn(n);if(We(n,e))return;if(e.length===0){console.log(m.yellow(`
107
+ `));let t=new Set(e.map(s=>s.profile)).size>1,n=["Source","URL","Username","Password","Last Used"],i=[9,42,24,22,20];t&&(n.unshift("Profile"),i.unshift(12));let o=He(n,i);for(let s of e){let a=[D.blue(s.source??"?"),D.cyan(s.url),D.green(s.username||"<empty>"),D.yellow(s.password||"<empty>"),D.dim(s.lastUsed)];t&&a.unshift(D.magenta(s.profile)),o.push(a)}console.log(o.toString()),je("password(s)",e.length),tr(r,e.some(s=>s.password==="<app-bound encryption unavailable>"))}function Nu(r){let e=Kn(r);if(Ve(r,e))return;if(e.length===0){console.log(D.yellow(`
106
108
  \u26A0 No profiles found to read.
107
- `));return}console.log(m.bold(`
109
+ `));return}console.log(D.bold(`
108
110
  \u{1F50E} Password stores:
109
- `));let t=He(["Root","Profile","Store","Exists","Rows","Error"],[34,12,24,7,6,40]);for(let r of e)t.push([m.dim(r.root),r.profile,m.blue(r.file),r.exists?"yes":m.yellow("no"),r.rows===null?m.red("?"):String(r.rows),r.error?m.red(r.error):""]);console.log(t.toString()),console.log()}var Ru=I.command("bookmarks").description("List bookmarks");le($(Ru)).option("--folder <name>","Filter by folder name").action((n,e)=>P(vi,N(e)));function vi(n){U(n,Kn(n),"\u{1F4DA} Bookmarks","bookmark(s)",["Title","URL","Folder","Date Added"],[30,50,25,20],e=>[m.white(e.title),m.cyan(e.url),m.dim(e.folder||"/"),m.dim(e.dateAdded)])}var Tu=I.command("history").description("List browsing history");le(Fe($(Tu))).action((n,e)=>P(t=>{U(t,zn(t),"\u{1F550} Browsing History","history entry(ies)",["URL","Title","Visits","Last Visit"],[50,30,8,22],r=>[m.cyan(r.url),m.white(r.title||"\u2014"),m.yellow(String(r.visitCount)),m.dim(r.lastVisit)])},N(e)));var Lu=I.command("search-terms").description("List search terms from history");Fe($(Lu)).action((n,e)=>P(t=>{U(t,Yn(t),"\u{1F50D} Search Terms","search term(s)",["Term","URL"],[40,80],r=>[m.white(r.term),m.dim(r.url)])},N(e)));var Pu=I.command("cookies").description("List cookies (encrypted values decrypted)");Fe($(Pu)).option("--domain <domain>","Filter by domain").option("--url <url>","Filter by URL with path").option("--no-decrypt","Skip decryption of encrypted values").action((n,e)=>P(t=>{U(t,Jn(t),"\u{1F36A} Cookies","cookie(s)",["Domain","Name","Value","Secure","Expires"],[30,25,30,8,22],r=>[m.cyan(r.domain),m.white(r.name),m.dim(dt(r.value,50)),r.secure?m.green("\u2713"):m.dim("\u2717"),m.dim(r.expires)])},N(e)));var Iu=I.command("local-storage").description("List localStorage entries");le(Fe($(Iu))).option("--origin <origin>","Filter by origin").option("--url <url>","Filter by URL origin").option("--key <key>","Filter by localStorage key").action((n,e)=>P(ki,N(e)));function ki(n){U(n,ci(n),"\u{1F4BE} localStorage","localStorage entries",["Origin","Key","Value"],[36,28,46],e=>[m.cyan(e.origin),m.white(e.key),m.dim(dt(e.value,80))])}var Nu=I.command("autofill").description("List autofill entries");le(Fe($(Nu))).action((n,e)=>P(t=>{U(t,Di(t),"\u{1F4DD} Autofill Entries","autofill entry(ies)",["Field Name","Value","Count","Last Used"],[25,40,8,22],r=>[m.cyan(r.name),m.white(r.value),m.yellow(String(r.count)),m.dim(r.dateLastUsed)])},N(e)));var Mu=I.command("credit-cards").description("List saved credit cards");$(Mu).action((n,e)=>P(t=>{U(t,gi(t),"\u{1F4B3} Saved Credit Cards","credit card(s)",["Name on Card","Card Number","Expires","Nickname"],[25,25,14,20],r=>[m.white(r.nameOnCard||"\u2014"),m.yellow(r.cardNumber||"\u2014"),m.dim(`${r.expirationMonth}/${r.expirationYear}`),m.dim(r.nickname||"\u2014")])},N(e)));var $u=I.command("addresses").description("List saved addresses");$($u).action((n,e)=>P(t=>{U(t,yi(t),"\u{1F3E0} Saved Addresses","address(es)",["Name","Email","Phone","Address","City/State/Zip"],[20,25,16,30,25],r=>[m.white(r.fullName||"\u2014"),m.cyan(r.email||"\u2014"),m.dim(r.phone||"\u2014"),m.white(r.streetAddress||"\u2014"),m.dim([r.city,r.state,r.zipcode].filter(Boolean).join(", ")||"\u2014")])},N(e)));var ju=I.command("downloads").description("List download history");le(Fe($(ju))).action((n,e)=>P(t=>{U(t,Ci(t),"\u2B07\uFE0F Download History","download(s)",["File","URL","Size","State","Date"],[35,40,12,12,20],r=>[m.white(r.targetPath?r.targetPath.split(/[\\/]/).pop()||"":"\u2014"),m.cyan(dt(r.url,60)),m.dim(r.totalBytes>0?Ri(r.totalBytes):"\u2014"),r.state==="complete"?m.green(r.state):m.yellow(r.state),m.dim(r.startTime)])},N(e)));var Hu=I.command("extensions").description("List installed extensions");le($(Hu)).action((n,e)=>P(t=>{U(t,Ei(t),"\u{1F9E9} Installed Extensions","extension(s)",["Name","Version","ID","Enabled","Webstore"],[30,12,36,9,9],r=>[m.white(r.name),m.dim(r.version),m.dim(r.id),r.enabled?m.green("\u2713"):m.red("\u2717"),r.fromWebstore?m.green("\u2713"):m.dim("\u2717")])},N(e)));var Wu=I.command("search-engines").description("List configured search engines");$(Wu).action((n,e)=>P(t=>{U(t,bi(t),"\u{1F50E} Search Engines","search engine(s)",["Name","Keyword","URL","Active"],[20,16,60,8],r=>[m.white(r.name),m.cyan(r.keyword),m.dim(dt(r.url,80)),r.isActive?m.green("\u2713"):m.dim("\u2717")])},N(e)));var Vu=I.command("top-sites").description("List top sites");$(Vu).action((n,e)=>P(t=>{U(t,wi(t),"\u2B50 Top Sites","top site(s)",["Rank","Title","URL"],[8,30,80],r=>[m.yellow(String(r.rank+1)),m.white(r.title||"\u2014"),m.cyan(r.url)])},N(e)));function Ri(n){if(n===0)return"0 B";let e=["B","KB","MB","GB","TB"],t=Math.floor(Math.log(n)/Math.log(1024));return`${(n/Math.pow(1024,t)).toFixed(1)} ${e[t]}`}function dt(n,e){return n?n.length>e?n.slice(0,e)+"\u2026":n:"\u2014"}try{I.parse()}catch(n){Bu(n)||console.error(m.red(`
110
- \u2716 ${Yt(n)}
111
- `)),process.env.DEBUG&&console.error(n),process.exit(1)}
111
+ `));let t=He(["Root","Profile","Store","Exists","Rows","Error"],[34,12,24,7,6,40]);for(let n of e)t.push([D.dim(n.root),n.profile,D.blue(n.file),n.exists?"yes":D.yellow("no"),n.rows===null?D.red("?"):String(n.rows),n.error?D.red(n.error):""]);console.log(t.toString()),console.log()}var Mu=$.command("bookmarks").description("List bookmarks");le(M(Mu)).option("--folder <name>","Filter by folder name").action((r,e)=>P(Ti,I(e)));function Ti(r){U(r,Yn(r),"\u{1F4DA} Bookmarks","bookmark(s)",["Title","URL","Folder","Date Added"],[30,50,25,20],e=>[D.white(e.title),D.cyan(e.url),D.dim(e.folder||"/"),D.dim(e.dateAdded)])}var Wu=$.command("history").description("List browsing history");le(Fe(M(Wu))).action((r,e)=>P(t=>{U(t,Xn(t),"\u{1F550} Browsing History","history entry(ies)",["URL","Title","Visits","Last Visit"],[50,30,8,22],n=>[D.cyan(n.url),D.white(n.title||"\u2014"),D.yellow(String(n.visitCount)),D.dim(n.lastVisit)])},I(e)));var ju=$.command("search-terms").description("List search terms from history");Fe(M(ju)).action((r,e)=>P(t=>{U(t,Qn(t),"\u{1F50D} Search Terms","search term(s)",["Term","URL"],[40,80],n=>[D.white(n.term),D.dim(n.url)])},I(e)));var Hu=$.command("cookies").description("List cookies (encrypted values decrypted)");Fe(M(Hu)).option("--domain <domain>","Filter by domain").option("--url <url>","Filter by URL with path").option("--no-decrypt","Skip decryption of encrypted values").action((r,e)=>P(t=>{let n=Zn(t);U(t,n,"\u{1F36A} Cookies","cookie(s)",["Domain","Name","Value","Secure","Expires"],[30,25,30,8,22],i=>[D.cyan(i.domain),D.white(i.name),D.dim(ht(i.value,50)),i.secure?D.green("\u2713"):D.dim("\u2717"),D.dim(i.expires)]),t.json||tr(t,n.some(i=>i.value==="<app-bound encryption unavailable>"))},I(e)));var Vu=$.command("local-storage").description("List localStorage entries");le(Fe(M(Vu))).option("--origin <origin>","Filter by origin").option("--url <url>","Filter by URL origin").option("--key <key>","Filter by localStorage key").action((r,e)=>P(Li,I(e)));function Li(r){U(r,pi(r),"\u{1F4BE} localStorage","localStorage entries",["Origin","Key","Value"],[36,28,46],e=>[D.cyan(e.origin),D.white(e.key),D.dim(ht(e.value,80))])}var Gu=$.command("autofill").description("List autofill entries");le(Fe(M(Gu))).action((r,e)=>P(t=>{U(t,Ci(t),"\u{1F4DD} Autofill Entries","autofill entry(ies)",["Field Name","Value","Count","Last Used"],[25,40,8,22],n=>[D.cyan(n.name),D.white(n.value),D.yellow(String(n.count)),D.dim(n.dateLastUsed)])},I(e)));var Uu=$.command("credit-cards").description("List saved credit cards");M(Uu).action((r,e)=>P(t=>{let n=Ei(t);U(t,n,"\u{1F4B3} Saved Credit Cards","credit card(s)",["Name on Card","Card Number","Expires","Nickname"],[25,25,14,20],i=>[D.white(i.nameOnCard||"\u2014"),D.yellow(i.cardNumber||"\u2014"),D.dim(`${i.expirationMonth}/${i.expirationYear}`),D.dim(i.nickname||"\u2014")]),t.json||tr(t,n.some(i=>i.cardNumber==="<app-bound encryption unavailable>"))},I(e)));var Ku=$.command("addresses").description("List saved addresses");M(Ku).action((r,e)=>P(t=>{U(t,bi(t),"\u{1F3E0} Saved Addresses","address(es)",["Name","Email","Phone","Address","City/State/Zip"],[20,25,16,30,25],n=>[D.white(n.fullName||"\u2014"),D.cyan(n.email||"\u2014"),D.dim(n.phone||"\u2014"),D.white(n.streetAddress||"\u2014"),D.dim([n.city,n.state,n.zipcode].filter(Boolean).join(", ")||"\u2014")])},I(e)));var qu=$.command("downloads").description("List download history");le(Fe(M(qu))).action((r,e)=>P(t=>{U(t,wi(t),"\u2B07\uFE0F Download History","download(s)",["File","URL","Size","State","Date"],[35,40,12,12,20],n=>[D.white(n.targetPath?n.targetPath.split(/[\\/]/).pop()||"":"\u2014"),D.cyan(ht(n.url,60)),D.dim(n.totalBytes>0?Pi(n.totalBytes):"\u2014"),n.state==="complete"?D.green(n.state):D.yellow(n.state),D.dim(n.startTime)])},I(e)));var zu=$.command("extensions").description("List installed extensions");le(M(zu)).action((r,e)=>P(t=>{U(t,_i(t),"\u{1F9E9} Installed Extensions","extension(s)",["Name","Version","ID","Enabled","Webstore"],[30,12,36,9,9],n=>[D.white(n.name),D.dim(n.version),D.dim(n.id),n.enabled?D.green("\u2713"):D.red("\u2717"),n.fromWebstore?D.green("\u2713"):D.dim("\u2717")])},I(e)));var Yu=$.command("search-engines").description("List configured search engines");M(Yu).action((r,e)=>P(t=>{U(t,Fi(t),"\u{1F50E} Search Engines","search engine(s)",["Name","Keyword","URL","Active"],[20,16,60,8],n=>[D.white(n.name),D.cyan(n.keyword),D.dim(ht(n.url,80)),n.isActive?D.green("\u2713"):D.dim("\u2717")])},I(e)));var Ju=$.command("top-sites").description("List top sites");M(Ju).action((r,e)=>P(t=>{U(t,Bi(t),"\u2B50 Top Sites","top site(s)",["Rank","Title","URL"],[8,30,80],n=>[D.yellow(String(n.rank+1)),D.white(n.title||"\u2014"),D.cyan(n.url)])},I(e)));function Pi(r){if(r===0)return"0 B";let e=["B","KB","MB","GB","TB"],t=Math.floor(Math.log(r)/Math.log(1024));return`${(r/Math.pow(1024,t)).toFixed(1)} ${e[t]}`}function ht(r,e){return r?r.length>e?r.slice(0,e)+"\u2026":r:"\u2014"}try{$.parse()}catch(r){Ru(r)||console.error(D.red(`
112
+ \u2716 ${er(r)}
113
+ `)),process.env.DEBUG&&console.error(r),process.exit(1)}