@libp2p/daemon 6.0.38-d91797b55 → 6.0.38-fb139d1c8

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/index.min.js CHANGED
@@ -1,21 +1,21 @@
1
1
  #! /usr/bin/env node
2
2
  (function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PDaemon = factory()}(typeof self !== 'undefined' ? self : this, function () {
3
- "use strict";var Libp2PDaemon=(()=>{var yo=Object.create;var Jt=Object.defineProperty;var Ao=Object.getOwnPropertyDescriptor;var _o=Object.getOwnPropertyNames;var Bo=Object.getPrototypeOf,Oo=Object.prototype.hasOwnProperty;var J=(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 On=(n,e)=>()=>{try{return e||n((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},Ee=(n,e)=>{for(var t in e)Jt(n,t,{get:e[t],enumerable:!0})},Zr=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _o(e))!Oo.call(n,i)&&i!==t&&Jt(n,i,{get:()=>e[i],enumerable:!(r=Ao(e,i))||r.enumerable});return n};var Ct=(n,e,t)=>(t=n!=null?yo(Bo(n)):{},Zr(e||!n||!n.__esModule?Jt(t,"default",{value:n,enumerable:!0}):t,n)),So=n=>Zr(Jt({},"__esModule",{value:!0}),n);var ki=On((OD,Xi)=>{Xi.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var vs=On((lh,Ss)=>{"use strict";Ss.exports=function(e){if(e===void 0&&(e=2),e>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+e+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var t=Error.prepareStackTrace;Error.prepareStackTrace=function(i,s){return s};var r=new Error().stack;if(Error.prepareStackTrace=t,r!==null&&typeof r=="object")return r[e]?r[e].getFileName():void 0}});var Eo=On((Ed,Co)=>{var Kr=class{constructor(e,t){this.ctx=t||{},this.yargs=e,this.parse=this.parse.bind(this),this.command=this.yargs.command,this.commandDir=this.yargs.commandDir}parse(e){let t=this.yargs,r;return new Promise((i,s)=>{let o=Object.assign({},this.ctx,{resolve:i,reject:s});t.parse(e,o,function(a,f,m){return r=f,a?f.reject(a):f.resolve(m)})}).then(i=>Promise.resolve(i)).then(i=>i&&i.argv?i:{data:i,argv:r}).catch(i=>Promise.resolve(i).then(s=>s&&s.argv?Promise.reject(s):Promise.reject({error:s,argv:r})))}};Co.exports=Kr});var Xc={};Ee(Xc,{createLibp2pServer:()=>wo,default:()=>Qr});function Sn(n,e){if(n===e)return!0;if(n.byteLength!==e.byteLength)return!1;for(let t=0;t<n.byteLength;t++)if(n[t]!==e[t])return!1;return!0}var Xr=J("node:buffer");function tt(n){if(n.buffer instanceof ArrayBuffer)return new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let e=n.slice();return new Uint8Array(e.buffer,0,e.byteLength)}function $t(n=0){return tt(Xr.Buffer.allocUnsafe(n))}var vo=Math.pow(2,7),Po=Math.pow(2,14),Io=Math.pow(2,21),vn=Math.pow(2,28),Pn=Math.pow(2,35),In=Math.pow(2,42),jn=Math.pow(2,49),ee=128,pe=127;function Et(n){if(n<vo)return 1;if(n<Po)return 2;if(n<Io)return 3;if(n<vn)return 4;if(n<Pn)return 5;if(n<In)return 6;if(n<jn)return 7;if(Number.MAX_SAFE_INTEGER!=null&&n>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Mn(n,e,t=0){switch(Et(n)){case 8:e[t++]=n&255|ee,n/=128;case 7:e[t++]=n&255|ee,n/=128;case 6:e[t++]=n&255|ee,n/=128;case 5:e[t++]=n&255|ee,n/=128;case 4:e[t++]=n&255|ee,n>>>=7;case 3:e[t++]=n&255|ee,n>>>=7;case 2:e[t++]=n&255|ee,n>>>=7;case 1:{e[t++]=n&255,n>>>=7;break}default:throw new Error("unreachable")}return e}function jo(n,e){let t=n[e],r=0;if(r+=t&pe,t<ee||(t=n[e+1],r+=(t&pe)<<7,t<ee)||(t=n[e+2],r+=(t&pe)<<14,t<ee)||(t=n[e+3],r+=(t&pe)<<21,t<ee)||(t=n[e+4],r+=(t&pe)*vn,t<ee)||(t=n[e+5],r+=(t&pe)*Pn,t<ee)||(t=n[e+6],r+=(t&pe)*In,t<ee)||(t=n[e+7],r+=(t&pe)*jn,t<ee))return r;throw new RangeError("Could not decode varint")}function Mo(n,e){let t=n.get(e),r=0;if(r+=t&pe,t<ee||(t=n.get(e+1),r+=(t&pe)<<7,t<ee)||(t=n.get(e+2),r+=(t&pe)<<14,t<ee)||(t=n.get(e+3),r+=(t&pe)<<21,t<ee)||(t=n.get(e+4),r+=(t&pe)*vn,t<ee)||(t=n.get(e+5),r+=(t&pe)*Pn,t<ee)||(t=n.get(e+6),r+=(t&pe)*In,t<ee)||(t=n.get(e+7),r+=(t&pe)*jn,t<ee))return r;throw new RangeError("Could not decode varint")}function Tn(n,e=0){return n instanceof Uint8Array?jo(n,e):Mo(n,e)}function $o(n){return n.buffer instanceof ArrayBuffer}function $n(n){return $o(n)?n:n.slice()}var kr=J("node:buffer");function bt(n,e){return tt(kr.Buffer.concat(n,e))}var xi=J("node:buffer");var zn={};Ee(zn,{base10:()=>Ho});var dl=new Uint8Array(0);function ti(n,e){if(n===e)return!0;if(n.byteLength!==e.byteLength)return!1;for(let t=0;t<n.byteLength;t++)if(n[t]!==e[t])return!1;return!0}function ge(n){if(n instanceof Uint8Array&&n.constructor.name==="Uint8Array")return nt(n);if(n instanceof ArrayBuffer)return new Uint8Array(n);if(ArrayBuffer.isView(n))return nt(new Uint8Array(n.buffer,n.byteOffset,n.byteLength));throw new Error("Unknown type, must be binary type")}function ni(n){let e=new Uint8Array(n.length);for(let t=0;t<n.length;t++)e[t]=n.charCodeAt(t);return e}var ei=4096;function ri(n){let e=n.length;if(e<=ei)return String.fromCharCode.apply(String,n);let t="",r=0;for(;r<e;)t+=String.fromCharCode.apply(String,n.subarray(r,r+=ei));return t}function No(n){return n?.buffer instanceof ArrayBuffer}function nt(n){return No(n)?n:n.slice()}function Lo(n,e,t){if(n.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var s=0;s<n.length;s++){var o=n.charAt(s),a=o.charCodeAt(0);if(r[a]!==255)throw new TypeError(o+" is ambiguous");if(r[a]=s,t){var f=o.toLowerCase().charCodeAt(0),m=o.toUpperCase().charCodeAt(0);f!==a&&(r[f]=s),m!==a&&(r[m]=s)}}var d=n.length,l=n.charAt(0),g=Math.log(d)/Math.log(256),C=Math.log(256)/Math.log(d);function E(_){if(_ instanceof Uint8Array||(ArrayBuffer.isView(_)?_=new Uint8Array(_.buffer,_.byteOffset,_.byteLength):Array.isArray(_)&&(_=Uint8Array.from(_))),!(_ instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(_.length===0)return"";for(var L=0,R=0,U=0,V=_.length;U!==V&&_[U]===0;)U++,L++;for(var W=(V-U)*C+1>>>0,q=new Uint8Array(W);U!==V;){for(var K=_[U],ae=0,z=W-1;(K!==0||ae<R)&&z!==-1;z--,ae++)K+=256*q[z]>>>0,q[z]=K%d>>>0,K=K/d>>>0;if(K!==0)throw new Error("Non-zero carry");R=ae,U++}for(var y=W-R;y!==W&&q[y]===0;)y++;for(var w=l.repeat(L);y<W;++y)w+=n.charAt(q[y]);return w}function b(_){if(typeof _!="string")throw new TypeError("Expected String");if(_.length===0)return new Uint8Array;var L=0;if(_[L]!==" "){for(var R=0,U=0;_[L]===l;)R++,L++;for(var V=(_.length-L)*g+1>>>0,W=new Uint8Array(V);_[L];){var q=r[_.charCodeAt(L)];if(q===255)return;for(var K=0,ae=V-1;(q!==0||K<U)&&ae!==-1;ae--,K++)q+=d*W[ae]>>>0,W[ae]=q%256>>>0,q=q/256>>>0;if(q!==0)throw new Error("Non-zero carry");U=K,L++}if(_[L]!==" "){for(var z=V-U;z!==V&&W[z]===0;)z++;for(var y=new Uint8Array(R+(V-z)),w=R;z!==V;)y[w++]=W[z++];return y}}}function p(_){var L=b(_);if(L)return L;throw new Error(`Non-${e} character`)}return{encode:E,decodeUnsafe:b,decode:p}}var Uo=Lo,Ro=Uo,si=Ro;var Nn=class{name;prefix;baseEncode;constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Ln=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,r){this.name=e,this.prefix=t;let i=t.codePointAt(0);if(i===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=i,this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return oi(this,e)}},Un=class{decoders;constructor(e){this.decoders=e}or(e){return oi(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r!=null)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function oi(n,e){return new Un({...n.decoders??{[n.prefix]:n},...e.decoders??{[e.prefix]:e}})}var Rn=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,r,i){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=i,this.encoder=new Nn(e,t,r),this.decoder=new Ln(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function xt({name:n,prefix:e,encode:t,decode:r}){return new Rn(n,e,t,r)}function He({name:n,prefix:e,alphabet:t,caseInsensitive:r=!1}){let{encode:i,decode:s}=si(t,n,r);return xt({prefix:e,name:n,encode:i,decode:o=>ge(s(o))})}function zo(n,e,t,r){let i=n.length;for(;n[i-1]==="=";)--i;let s=new Uint8Array(i*t/8|0),o=0,a=0,f=0;for(let m=0;m<i;++m){let d=e[n[m]];if(d===void 0)throw new SyntaxError(`Non-${r} character`);a=a<<t|d,o+=t,o>=8&&(o-=8,s[f++]=255&a>>o)}if(o>=t||(255&a<<8-o)!==0)throw new SyntaxError("Unexpected end of data");return s}function Wo(n,e,t){let r=e[e.length-1]==="=",i=(1<<t)-1,s="",o=0,a=0;for(let f=0;f<n.length;++f)for(a=a<<8|n[f],o+=8;o>t;)o-=t,s+=e[i&a>>o];if(o!==0&&(s+=e[i&a<<t-o]),r)for(;(s.length*t&7)!==0;)s+="=";return s}function Vo(n,e){let t={};for(let r=0;r<n.length;++r)if(t[n[r]]=r,e){let i=n[r].toLowerCase(),s=n[r].toUpperCase();i!==n[r]&&(t[i]=r),s!==n[r]&&(t[s]=r)}return t}function re({name:n,prefix:e,bitsPerChar:t,alphabet:r,caseInsensitive:i=!1}){let s=Vo(r,i);return xt({prefix:e,name:n,encode(o){return Wo(o,r,t)},decode(o){return zo(o,s,t,n)}})}var Ho=He({prefix:"9",name:"base10",alphabet:"0123456789"});var Wn={};Ee(Wn,{base16:()=>qo,base16upper:()=>Go});var qo=re({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4,caseInsensitive:!0}),Go=re({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4,caseInsensitive:!0});var Vn={};Ee(Vn,{base2:()=>Yo});var Yo=re({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Hn={};Ee(Hn,{base256emoji:()=>Xo});var ui=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Ko=ui.reduce((n,e,t)=>(n[t]=e,n),[]),Jo=ui.reduce((n,e,t)=>{let r=e.codePointAt(0);if(r==null)throw new Error(`Invalid character: ${e}`);return n[r]=t,n},[]);function Qo(n){return n.reduce((e,t)=>(e+=Ko[t],e),"")}function Zo(n){let e=[];for(let t of n){let r=t.codePointAt(0);if(r==null)throw new Error(`Invalid character: ${t}`);let i=Jo[r];if(i==null)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}var Xo=xt({prefix:"\u{1F680}",name:"base256emoji",encode:Qo,decode:Zo});var qn={};Ee(qn,{base32:()=>qe,base32hex:()=>nu,base32hexpad:()=>iu,base32hexpadupper:()=>su,base32hexupper:()=>ru,base32pad:()=>eu,base32padupper:()=>tu,base32upper:()=>ko,base32z:()=>ou});var qe=re({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5,caseInsensitive:!0}),ko=re({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5,caseInsensitive:!0}),eu=re({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5,caseInsensitive:!0}),tu=re({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5,caseInsensitive:!0}),nu=re({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5,caseInsensitive:!0}),ru=re({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5,caseInsensitive:!0}),iu=re({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5,caseInsensitive:!0}),su=re({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5,caseInsensitive:!0}),ou=re({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Gn={};Ee(Gn,{base36:()=>Nt,base36upper:()=>uu});var Nt=He({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz",caseInsensitive:!0}),uu=He({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",caseInsensitive:!0});var Yn={};Ee(Yn,{base58btc:()=>je,base58flickr:()=>au});var je=He({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),au=He({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Jn={};Ee(Jn,{base64:()=>cu,base64pad:()=>lu,base64url:()=>Kn,base64urlpad:()=>fu});var cu=re({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),lu=re({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Kn=re({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),fu=re({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Qn={};Ee(Qn,{base8:()=>Du});var Du=re({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Zn={};Ee(Zn,{identity:()=>hu});var hu=xt({prefix:"\0",name:"identity",encode:n=>ri(ge(n)),decode:n=>ge(ni(n))});var vl=new TextEncoder,Pl=new TextDecoder;var kn={};Ee(kn,{identity:()=>$u});var mu=li,ai=128,gu=127,Fu=~gu,Cu=Math.pow(2,31);function li(n,e,t){e=e||[],t=t||0;for(var r=t;n>=Cu;)e[t++]=n&255|ai,n/=128;for(;n&Fu;)e[t++]=n&255|ai,n>>>=7;return e[t]=n|0,li.bytes=t-r+1,e}var Eu=Xn,bu=128,ci=127;function Xn(n,r){var t=0,r=r||0,i=0,s=r,o,a=n.length;do{if(s>=a)throw Xn.bytes=0,new RangeError("Could not decode varint");o=n[s++],t+=i<28?(o&ci)<<i:(o&ci)*Math.pow(2,i),i+=7}while(o>=bu);return Xn.bytes=s-r,t}var xu=Math.pow(2,7),wu=Math.pow(2,14),yu=Math.pow(2,21),Au=Math.pow(2,28),_u=Math.pow(2,35),Bu=Math.pow(2,42),Ou=Math.pow(2,49),Su=Math.pow(2,56),vu=Math.pow(2,63),Pu=function(n){return n<xu?1:n<wu?2:n<yu?3:n<Au?4:n<_u?5:n<Bu?6:n<Ou?7:n<Su?8:n<vu?9:10},Iu={encode:mu,decode:Eu,encodingLength:Pu},ju=Iu,Lt=ju;function Ut(n,e=0){let t=Lt.decode(n,e),r=Lt.decode.bytes;if(r>9)throw new RangeError("Invalid varint: too long");if(r>1&&n[e+r-1]===0)throw new RangeError("Invalid varint: not minimally encoded");return[t,r]}function wt(n,e,t=0){return Lt.encode(n,e,t),e}function yt(n){return Lt.encodingLength(n)}function _t(n,e){let t=e.byteLength,r=yt(n),i=r+yt(t),s=new Uint8Array(i+t);return wt(n,s,0),wt(t,s,r),s.set(e,i),new At(n,t,e,s)}function fi(n){let e=ge(n),[t,r]=Ut(e),[i,s]=Ut(e.subarray(r)),o=e.subarray(r+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new At(t,i,o,e)}function Di(n,e){if(n===e)return!0;{let t=e;return n.code===t.code&&n.size===t.size&&t.bytes instanceof Uint8Array&&ti(n.bytes,t.bytes)}}var At=class{code;size;digest;bytes;constructor(e,t,r,i){this.code=e,this.size=t,this.digest=nt(r),this.bytes=nt(i)}};var hi=0,Mu="identity",di=ge;function Tu(n,e){if(e?.truncate!=null&&e.truncate!==n.byteLength){if(e.truncate<0||e.truncate>n.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${n.byteLength}`);n=n.subarray(0,e.truncate)}return _t(hi,di(n))}var $u={code:hi,name:Mu,encode:di,digest:Tu};var rr={};Ee(rr,{sha256:()=>Lu,sha512:()=>Uu});var nr=Ct(J("node:crypto"),1);var Nu=20;function tr({name:n,code:e,encode:t,minDigestLength:r,maxDigestLength:i}){return new er(n,e,t,r,i)}var er=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,r,i,s){this.name=e,this.code=t,this.encode=r,this.minDigestLength=i??Nu,this.maxDigestLength=s}digest(e,t){if(t?.truncate!=null){if(t.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&t.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?pi(r,this.code,t?.truncate):r.then(i=>pi(i,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function pi(n,e,t){if(t!=null&&t!==n.byteLength){if(t>n.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${n.byteLength}`);n=n.subarray(0,t)}return _t(e,n)}var Lu=tr({name:"sha2-256",code:18,encode:n=>ge(nr.default.createHash("sha256").update(n).digest())}),Uu=tr({name:"sha2-512",code:19,encode:n=>ge(nr.default.createHash("sha512").update(n).digest())});function gi(n,e){let{bytes:t,version:r}=n;return r===0?zu(t,ir(n),e??je.encoder):Wu(t,ir(n),e??qe.encoder)}var Fi=new WeakMap;function ir(n){let e=Fi.get(n);if(e==null){let t=new Map;return Fi.set(n,t),t}return e}var Bt=class n{code;version;multihash;bytes;"/";constructor(e,t,r,i){this.code=t,this.version=e,this.multihash=r,this.bytes=nt(i),this["/"]=this.bytes}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==zt)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Vu)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return n.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=_t(e,t);return n.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return n.equals(this,e)}static equals(e,t){let r=t;return r!=null&&e.code===r.code&&e.version===r.version&&Di(e.multihash,r.multihash)}toString(e){return gi(this,e)}toJSON(){return{"/":gi(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof n)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:r,code:i,multihash:s,bytes:o}=t;return new n(r,i,s,o??Ci(r,i,s.bytes))}else if(t[Hu]===!0){let{version:r,multihash:i,code:s}=t,o=fi(i);return n.create(r,s,o)}else return null}static create(e,t,r){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(r.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==zt)throw new Error(`Version 0 CID must use dag-pb (code: ${zt}) block encoding`);return new n(e,t,r,r.bytes)}case 1:{let i=Ci(e,t,r.bytes);return new n(e,t,r,i)}default:throw new Error("Invalid version")}}static createV0(e){return n.create(0,zt,e)}static createV1(e,t){return n.create(1,e,t)}static decode(e){let[t,r]=n.decodeFirst(e);if(r.length!==0)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=n.inspectBytes(e),r=t.size-t.multihashSize,i=ge(e.subarray(r,r+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=i.subarray(t.multihashSize-t.digestSize),o=new At(t.multihashCode,t.digestSize,s,i);return[t.version===0?n.createV0(o):n.createV1(t.codec,o),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[l,g]=Ut(e.subarray(t));return t+=g,l},i=r(),s=zt;if(i===18?(i=0,t=0):s=r(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=t,a=r(),f=r(),m=t+f,d=m-o;return{version:i,codec:s,multihashCode:a,digestSize:f,multihashSize:d,size:m}}static parse(e,t){let[r,i]=Ru(e,t),s=n.decode(i);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return ir(s).set(r,e),s}};function Ru(n,e){switch(n[0]){case"Q":{let t=e??je;return[je.prefix,t.decode(`${je.prefix}${n}`)]}case je.prefix:{let t=e??je;return[je.prefix,t.decode(n)]}case qe.prefix:{let t=e??qe;return[qe.prefix,t.decode(n)]}case Nt.prefix:{let t=e??Nt;return[Nt.prefix,t.decode(n)]}default:{if(e==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[n[0],e.decode(n)]}}}function zu(n,e,t){let{prefix:r}=t;if(r!==je.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(r);if(i==null){let s=t.encode(n).slice(1);return e.set(r,s),s}else return i}function Wu(n,e,t){let{prefix:r}=t,i=e.get(r);if(i==null){let s=t.encode(n);return e.set(r,s),s}else return i}var zt=112,Vu=18;function Ci(n,e,t){let r=yt(n),i=r+yt(e),s=new Uint8Array(i+t.byteLength);return wt(n,s,0),wt(e,s,r),s.set(t,i),s}var Hu=Symbol.for("@ipld/js-cid/CID");var Wt={...Zn,...Vn,...Qn,...zn,...Wn,...qn,...Gn,...Yn,...Jn,...Hn},ef={...rr,...kn};function bi(n,e,t,r){return{name:n,prefix:e,encoder:{name:n,prefix:e,encode:t},decoder:{decode:r}}}var Ei=bi("utf8","u",n=>"u"+new TextDecoder("utf8").decode(n),n=>new TextEncoder().encode(n.substring(1))),sr=bi("ascii","a",n=>{let e="a";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e},n=>{n=n.substring(1);let e=$t(n.length);for(let t=0;t<n.length;t++)e[t]=n.charCodeAt(t);return e}),qu={utf8:Ei,"utf-8":Ei,hex:Wt.base16,latin1:sr,ascii:sr,binary:sr,...Wt},Zt=qu;function Ot(n,e="utf8"){let t=Zt[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return e==="utf8"||e==="utf-8"?tt(xi.Buffer.from(n,"utf-8")):t.decoder.decode(`${t.prefix}${n}`)}var wi=J("node:buffer");function Ge(n,e="utf8"){let t=Zt[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return e==="utf8"||e==="utf-8"?wi.Buffer.from(n.buffer,n.byteOffset,n.byteLength).toString("utf8"):t.encoder.encode(n).substring(1)}var de=class extends Error{static name="InvalidMultiaddrError";name="InvalidMultiaddrError"},Le=class extends Error{static name="ValidationError";name="ValidationError"},Xt=class extends Error{static name="InvalidParametersError";name="InvalidParametersError"},kt=class extends Error{static name="UnknownProtocolError";name="UnknownProtocolError"};var Ue=J("node:net");function ur(n){return e=>Ge(e,n)}function ar(n){return e=>Ot(e,n)}function St(n){return new DataView(n.buffer).getUint16(n.byteOffset).toString()}function rt(n){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,typeof n=="string"?parseInt(n):n),new Uint8Array(e)}function yi(n){let e=n.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let t=Ot(e[0],"base32"),r=parseInt(e[1],10);if(r<1||r>65536)throw new Error("Port number is not in range(1, 65536)");let i=rt(r);return bt([t,i],t.length+i.length)}function Ai(n){let e=n.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let t=qe.decode(`b${e[0]}`),r=parseInt(e[1],10);if(r<1||r>65536)throw new Error("Port number is not in range(1, 65536)");let i=rt(r);return bt([t,i],t.length+i.length)}function cr(n){let e=n.subarray(0,n.length-2),t=n.subarray(n.length-2),r=Ge(e,"base32"),i=St(t);return`${r}:${i}`}var lr=function(n){n=n.toString().trim();let e=new Uint8Array(4);return n.split(/\./g).forEach((t,r)=>{let i=parseInt(t,10);if(isNaN(i)||i<0||i>255)throw new de("Invalid byte value in IP address");e[r]=i}),e},_i=function(n){let e=0;n=n.toString().trim();let t=n.split(":",8),r;for(r=0;r<t.length;r++){let s=(0,Ue.isIPv4)(t[r]),o;s&&(o=lr(t[r]),t[r]=Ge(o.subarray(0,2),"base16")),o!=null&&++r<8&&t.splice(r,0,Ge(o.subarray(2,4),"base16"))}if(t[0]==="")for(;t.length<8;)t.unshift("0");else if(t[t.length-1]==="")for(;t.length<8;)t.push("0");else if(t.length<8){for(r=0;r<t.length&&t[r]!=="";r++);let s=[r,1];for(r=9-t.length;r>0;r--)s.push("0");t.splice.apply(t,s)}let i=new Uint8Array(e+16);for(r=0;r<t.length;r++){t[r]===""&&(t[r]="0");let s=parseInt(t[r],16);if(isNaN(s)||s<0||s>65535)throw new de("Invalid byte value in IP address");i[e++]=s>>8&255,i[e++]=s&255}return i},Bi=function(n){if(n.byteLength!==4)throw new de("IPv4 address was incorrect length");let e=[];for(let t=0;t<n.byteLength;t++)e.push(n[t]);return e.join(".")},Oi=function(n){if(n.byteLength!==16)throw new de("IPv6 address was incorrect length");let e=[];for(let r=0;r<n.byteLength;r+=2){let i=n[r],s=n[r+1],o=`${i.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`;e.push(o)}let t=e.join(":");try{let r=new URL(`http://[${t}]`);return r.hostname.substring(1,r.hostname.length-1)}catch{throw new de(`Invalid IPv6 address "${t}"`)}};function Si(n){try{let e=new URL(`http://[${n}]`);return e.hostname.substring(1,e.hostname.length-1)}catch{throw new de(`Invalid IPv6 address "${n}"`)}}var or=Object.values(Wt).map(n=>n.decoder),Gu=(function(){let n=or[0].or(or[1]);return or.slice(2).forEach(e=>n=n.or(e)),n})();function vi(n){return Gu.decode(n)}function Pi(n){return e=>n.encoder.encode(e)}function Yu(n){if(parseInt(n).toString()!==n)throw new Le("Value must be an integer")}function Ku(n){if(n<0)throw new Le("Value must be a positive integer, or zero")}function Ju(n){return e=>{if(e>n)throw new Le(`Value must be smaller than or equal to ${n}`)}}function Qu(...n){return e=>{for(let t of n)t(e)}}var Vt=Qu(Yu,Ku,Ju(65535));var De=-1,fr=class{protocolsByCode=new Map;protocolsByName=new Map;getProtocol(e){let t;if(typeof e=="string"?t=this.protocolsByName.get(e):t=this.protocolsByCode.get(e),t==null)throw new kt(`Protocol ${e} was unknown`);return t}addProtocol(e){this.protocolsByCode.set(e.code,e),this.protocolsByName.set(e.name,e),e.aliases?.forEach(t=>{this.protocolsByName.set(t,e)})}removeProtocol(e){let t=this.protocolsByCode.get(e);t!=null&&(this.protocolsByCode.delete(t.code),this.protocolsByName.delete(t.name),t.aliases?.forEach(r=>{this.protocolsByName.delete(r)}))}},Re=new fr,Na=[{code:4,name:"ip4",size:32,valueToBytes:lr,bytesToValue:Bi,validate:n=>{if(!(0,Ue.isIPv4)(n))throw new Le(`Invalid IPv4 address "${n}"`)}},{code:6,name:"tcp",size:16,valueToBytes:rt,bytesToValue:St,validate:Vt},{code:273,name:"udp",size:16,valueToBytes:rt,bytesToValue:St,validate:Vt},{code:33,name:"dccp",size:16,valueToBytes:rt,bytesToValue:St,validate:Vt},{code:41,name:"ip6",size:128,valueToBytes:_i,bytesToValue:Oi,stringToValue:Si,validate:n=>{if(!(0,Ue.isIPv6)(n))throw new Le(`Invalid IPv6 address "${n}"`)}},{code:42,name:"ip6zone",size:De},{code:43,name:"ipcidr",size:8,bytesToValue:ur("base10"),valueToBytes:ar("base10")},{code:53,name:"dns",size:De},{code:54,name:"dns4",size:De},{code:55,name:"dns6",size:De},{code:56,name:"dnsaddr",size:De},{code:132,name:"sctp",size:16,valueToBytes:rt,bytesToValue:St,validate:Vt},{code:301,name:"udt"},{code:302,name:"utp"},{code:400,name:"unix",size:De,stringToValue:n=>decodeURIComponent(n),valueToString:n=>encodeURIComponent(n)},{code:421,name:"p2p",aliases:["ipfs"],size:De,bytesToValue:ur("base58btc"),valueToBytes:n=>n.startsWith("Q")||n.startsWith("1")?ar("base58btc")(n):Bt.parse(n).multihash.bytes},{code:444,name:"onion",size:96,bytesToValue:cr,valueToBytes:yi},{code:445,name:"onion3",size:296,bytesToValue:cr,valueToBytes:Ai},{code:446,name:"garlic64",size:De},{code:447,name:"garlic32",size:De},{code:448,name:"tls"},{code:449,name:"sni",size:De},{code:454,name:"noise"},{code:460,name:"quic"},{code:461,name:"quic-v1"},{code:465,name:"webtransport"},{code:466,name:"certhash",size:De,bytesToValue:Pi(Kn),valueToBytes:vi},{code:480,name:"http"},{code:481,name:"http-path",size:De,stringToValue:n=>`/${decodeURIComponent(n)}`,valueToString:n=>encodeURIComponent(n.substring(1))},{code:443,name:"https"},{code:477,name:"ws"},{code:478,name:"wss"},{code:479,name:"p2p-websocket-star"},{code:277,name:"p2p-stardust"},{code:275,name:"p2p-webrtc-star"},{code:276,name:"p2p-webrtc-direct"},{code:280,name:"webrtc-direct"},{code:281,name:"webrtc"},{code:290,name:"p2p-circuit"},{code:777,name:"memory",size:De}];Na.forEach(n=>{Re.addProtocol(n)});function Ii(n){let e=[],t=0;for(;t<n.length;){let r=Tn(n,t),i=Re.getProtocol(r),s=Et(r),o=La(i,n,t+s),a=0;o>0&&i.size===De&&(a=Et(o));let f=s+a+o,m={code:r,name:i.name,bytes:$n(n.subarray(t,t+f))};if(o>0){let d=t+s+a,l=n.subarray(d,d+o);m.value=i.bytesToValue?.(l)??Ge(l)}e.push(m),t+=f}return e}function ji(n){let e=0,t=[];for(let r of n){if(r.bytes==null){let i=Re.getProtocol(r.code),s=Et(r.code),o,a=0,f=0;r.value!=null&&(o=i.valueToBytes?.(r.value)??Ot(r.value),a=o.byteLength,i.size===De&&(f=Et(a)));let m=new Uint8Array(s+f+a),d=0;Mn(r.code,m,d),d+=s,o!=null&&(i.size===De&&(Mn(a,m,d),d+=f),m.set(o,d)),r.bytes=m}t.push(r.bytes),e+=r.bytes.byteLength}return bt(t,e)}function Mi(n){if(n.charAt(0)!=="/")throw new de('String multiaddr must start with "/"');let e=[],t="protocol",r="",i="";for(let s=1;s<n.length;s++){let o=n.charAt(s);o!=="/"&&(t==="protocol"?i+=n.charAt(s):r+=n.charAt(s));let a=s===n.length-1;if(o==="/"||a){let f=Re.getProtocol(i);if(t==="protocol"){if(f.size==null||f.size===0){e.push({code:f.code,name:f.name}),r="",i="",t="protocol";continue}else if(a)throw new de(`Component ${i} was missing value`);t="value"}else if(t==="value"){let m={code:f.code,name:f.name};if(f.size!=null&&f.size!==0){if(r==="")throw new de(`Component ${i} was missing value`);m.value=f.stringToValue?.(r)??r}e.push(m),r="",i="",t="protocol"}}}if(i!==""&&r!=="")throw new de("Incomplete multiaddr");return e}function Ti(n){return`/${n.flatMap(e=>{if(e.value==null)return e.name;let t=Re.getProtocol(e.code);if(t==null)throw new de(`Unknown protocol code ${e.code}`);return[e.name,t.valueToString?.(e.value)??e.value]}).join("/")}`}function La(n,e,t){return n.size==null||n.size===0?0:n.size>0?n.size/8:Tn(e,t)}var Ua=Symbol.for("nodejs.util.inspect.custom"),Dr=Symbol.for("@multiformats/multiaddr");function Ra(n){if(n==null&&(n="/"),$i(n))return n.getComponents();if(n instanceof Uint8Array)return Ii(n);if(typeof n=="string")return n=n.replace(/\/(\/)+/,"/").replace(/(\/)+$/,""),n===""&&(n="/"),Mi(n);if(Array.isArray(n))return n;throw new de("Must be a string, Uint8Array, Component[], or another Multiaddr")}var en=class n{[Dr]=!0;#e;#t;#n;constructor(e="/",t={}){this.#e=Ra(e),t.validate!==!1&&za(this)}get bytes(){return this.#n==null&&(this.#n=ji(this.#e)),this.#n}toString(){return this.#t==null&&(this.#t=Ti(this.#e)),this.#t}toJSON(){return this.toString()}getComponents(){return[...this.#e.map(e=>({...e}))]}encapsulate(e){let t=new n(e);return new n([...this.#e,...t.getComponents()],{validate:!1})}decapsulate(e){let t=e.toString(),r=this.toString(),i=r.lastIndexOf(t);if(i<0)throw new Xt(`Address ${this.toString()} does not contain subaddress: ${t}`);return new n(r.slice(0,i),{validate:!1})}decapsulateCode(e){let t;for(let r=this.#e.length-1;r>-1;r--)if(this.#e[r].code===e){t=r;break}return new n(this.#e.slice(0,t),{validate:!1})}equals(e){return Sn(this.bytes,e.bytes)}[Ua](){return`Multiaddr(${this.toString()})`}};function za(n){n.getComponents().forEach(e=>{let t=Re.getProtocol(e.code);e.value!=null&&t.validate?.(e.value)})}function $i(n){return!!n?.[Dr]}function Ni(n){return new en(n)}var Li=J("module"),dr=Ct(J("path"),1),hr=Ct(J("process"),1),Ui=J("url");function Wa(n){let e=dr.default.extname(n);return e?n.slice(0,-e.length):n}function pr(n){if(!n)return!1;if("main"in n)return!!n.main;if(!hr.default.argv[1])return!1;let t=(0,Li.createRequire)(n.url).resolve(hr.default.argv[1]),r=(0,Ui.fileURLToPath)(n.url);return dr.default.extname(t)?r===t:Wa(r)===t}var Dn=J("assert");var Va={right:Ka,center:Ja},Ha=0,tn=1,qa=2,nn=3,mr=class{constructor(e){var t;this.width=e.width,this.wrap=(t=e.wrap)!==null&&t!==void 0?t:!0,this.rows=[]}span(...e){let t=this.div(...e);t.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let t=e.map(r=>typeof r=="string"?this.colFromString(r):r);return this.rows.push(t),t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let t=e.split(`
3
+ "use strict";var Libp2PDaemon=(()=>{var Ao=Object.create;var Jt=Object.defineProperty;var _o=Object.getOwnPropertyDescriptor;var Bo=Object.getOwnPropertyNames;var Oo=Object.getPrototypeOf,So=Object.prototype.hasOwnProperty;var J=(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 On=(n,e)=>()=>{try{return e||n((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},Ee=(n,e)=>{for(var t in e)Jt(n,t,{get:e[t],enumerable:!0})},Zr=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Bo(e))!So.call(n,i)&&i!==t&&Jt(n,i,{get:()=>e[i],enumerable:!(r=_o(e,i))||r.enumerable});return n};var Ct=(n,e,t)=>(t=n!=null?Ao(Oo(n)):{},Zr(e||!n||!n.__esModule?Jt(t,"default",{value:n,enumerable:!0}):t,n)),vo=n=>Zr(Jt({},"__esModule",{value:!0}),n);var ki=On((Sh,Xi)=>{Xi.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var vs=On((fD,Ss)=>{"use strict";Ss.exports=function(e){if(e===void 0&&(e=2),e>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+e+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var t=Error.prepareStackTrace;Error.prepareStackTrace=function(i,s){return s};var r=new Error().stack;if(Error.prepareStackTrace=t,r!==null&&typeof r=="object")return r[e]?r[e].getFileName():void 0}});var bo=On((bd,Eo)=>{var Kr=class{constructor(e,t){this.ctx=t||{},this.yargs=e,this.parse=this.parse.bind(this),this.command=this.yargs.command,this.commandDir=this.yargs.commandDir}parse(e){let t=this.yargs,r;return new Promise((i,s)=>{let o=Object.assign({},this.ctx,{resolve:i,reject:s});t.parse(e,o,function(a,l,d){return r=l,a?l.reject(a):l.resolve(d)})}).then(i=>Promise.resolve(i)).then(i=>i&&i.argv?i:{data:i,argv:r}).catch(i=>Promise.resolve(i).then(s=>s&&s.argv?Promise.reject(s):Promise.reject({error:s,argv:r})))}};Eo.exports=Kr});var kc={};Ee(kc,{createLibp2pServer:()=>yo,default:()=>Qr});function Sn(n,e){if(n===e)return!0;if(n.byteLength!==e.byteLength)return!1;for(let t=0;t<n.byteLength;t++)if(n[t]!==e[t])return!1;return!0}var Xr=J("node:buffer");function tt(n){if(n.buffer instanceof ArrayBuffer)return new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let e=n.slice();return new Uint8Array(e.buffer,0,e.byteLength)}function $t(n=0){return tt(Xr.Buffer.allocUnsafe(n))}var Po=Math.pow(2,7),Io=Math.pow(2,14),jo=Math.pow(2,21),vn=Math.pow(2,28),Pn=Math.pow(2,35),In=Math.pow(2,42),jn=Math.pow(2,49),ee=128,pe=127;function Et(n){if(n<Po)return 1;if(n<Io)return 2;if(n<jo)return 3;if(n<vn)return 4;if(n<Pn)return 5;if(n<In)return 6;if(n<jn)return 7;if(Number.MAX_SAFE_INTEGER!=null&&n>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Mn(n,e,t=0){switch(Et(n)){case 8:e[t++]=n&255|ee,n/=128;case 7:e[t++]=n&255|ee,n/=128;case 6:e[t++]=n&255|ee,n/=128;case 5:e[t++]=n&255|ee,n/=128;case 4:e[t++]=n&255|ee,n>>>=7;case 3:e[t++]=n&255|ee,n>>>=7;case 2:e[t++]=n&255|ee,n>>>=7;case 1:{e[t++]=n&255,n>>>=7;break}default:throw new Error("unreachable")}return e}function Mo(n,e){let t=n[e],r=0;if(r+=t&pe,t<ee||(t=n[e+1],r+=(t&pe)<<7,t<ee)||(t=n[e+2],r+=(t&pe)<<14,t<ee)||(t=n[e+3],r+=(t&pe)<<21,t<ee)||(t=n[e+4],r+=(t&pe)*vn,t<ee)||(t=n[e+5],r+=(t&pe)*Pn,t<ee)||(t=n[e+6],r+=(t&pe)*In,t<ee)||(t=n[e+7],r+=(t&pe)*jn,t<ee))return r;throw new RangeError("Could not decode varint")}function To(n,e){let t=n.get(e),r=0;if(r+=t&pe,t<ee||(t=n.get(e+1),r+=(t&pe)<<7,t<ee)||(t=n.get(e+2),r+=(t&pe)<<14,t<ee)||(t=n.get(e+3),r+=(t&pe)<<21,t<ee)||(t=n.get(e+4),r+=(t&pe)*vn,t<ee)||(t=n.get(e+5),r+=(t&pe)*Pn,t<ee)||(t=n.get(e+6),r+=(t&pe)*In,t<ee)||(t=n.get(e+7),r+=(t&pe)*jn,t<ee))return r;throw new RangeError("Could not decode varint")}function Tn(n,e=0){return n instanceof Uint8Array?Mo(n,e):To(n,e)}function No(n){return n.buffer instanceof ArrayBuffer}function $n(n){return No(n)?n:n.slice()}var kr=J("node:buffer");function bt(n,e){return tt(kr.Buffer.concat(n,e))}var xi=J("node:buffer");var zn={};Ee(zn,{base10:()=>qo});var pl=new Uint8Array(0);function ti(n,e){if(n===e)return!0;if(n.byteLength!==e.byteLength)return!1;for(let t=0;t<n.byteLength;t++)if(n[t]!==e[t])return!1;return!0}function ge(n){if(n instanceof Uint8Array&&n.constructor.name==="Uint8Array")return nt(n);if(n instanceof ArrayBuffer)return new Uint8Array(n);if(ArrayBuffer.isView(n))return nt(new Uint8Array(n.buffer,n.byteOffset,n.byteLength));throw new Error("Unknown type, must be binary type")}function ni(n){let e=new Uint8Array(n.length);for(let t=0;t<n.length;t++)e[t]=n.charCodeAt(t);return e}var ei=4096;function ri(n){let e=n.length;if(e<=ei)return String.fromCharCode.apply(String,n);let t="",r=0;for(;r<e;)t+=String.fromCharCode.apply(String,n.subarray(r,r+=ei));return t}function Lo(n){return n?.buffer instanceof ArrayBuffer}function nt(n){return Lo(n)?n:n.slice()}function Uo(n,e,t){if(n.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var s=0;s<n.length;s++){var o=n.charAt(s),a=o.charCodeAt(0);if(r[a]!==255)throw new TypeError(o+" is ambiguous");if(r[a]=s,t){var l=o.toLowerCase().charCodeAt(0),d=o.toUpperCase().charCodeAt(0);l!==a&&(r[l]=s),d!==a&&(r[d]=s)}}var p=n.length,f=n.charAt(0),g=Math.log(p)/Math.log(256),C=Math.log(256)/Math.log(p);function E(y){if(y instanceof Uint8Array||(ArrayBuffer.isView(y)?y=new Uint8Array(y.buffer,y.byteOffset,y.byteLength):Array.isArray(y)&&(y=Uint8Array.from(y))),!(y instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(y.length===0)return"";for(var U=0,L=0,R=0,V=y.length;R!==V&&y[R]===0;)R++,U++;for(var W=(V-R)*C+1>>>0,q=new Uint8Array(W);R!==V;){for(var K=y[R],ae=0,z=W-1;(K!==0||ae<L)&&z!==-1;z--,ae++)K+=256*q[z]>>>0,q[z]=K%p>>>0,K=K/p>>>0;if(K!==0)throw new Error("Non-zero carry");L=ae,R++}for(var A=W-L;A!==W&&q[A]===0;)A++;for(var w=f.repeat(U);A<W;++A)w+=n.charAt(q[A]);return w}function b(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;var U=0;if(y[U]!==" "){for(var L=0,R=0;y[U]===f;)L++,U++;for(var V=(y.length-U)*g+1>>>0,W=new Uint8Array(V);y[U];){var q=r[y.charCodeAt(U)];if(q===255)return;for(var K=0,ae=V-1;(q!==0||K<R)&&ae!==-1;ae--,K++)q+=p*W[ae]>>>0,W[ae]=q%256>>>0,q=q/256>>>0;if(q!==0)throw new Error("Non-zero carry");R=K,U++}if(y[U]!==" "){for(var z=V-R;z!==V&&W[z]===0;)z++;for(var A=new Uint8Array(L+(V-z)),w=L;z!==V;)A[w++]=W[z++];return A}}}function m(y){var U=b(y);if(U)return U;throw new Error(`Non-${e} character`)}return{encode:E,decodeUnsafe:b,decode:m}}var Ro=Uo,zo=Ro,si=zo;var Nn=class{name;prefix;baseEncode;constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Ln=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,r){this.name=e,this.prefix=t;let i=t.codePointAt(0);if(i===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=i,this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return oi(this,e)}},Un=class{decoders;constructor(e){this.decoders=e}or(e){return oi(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r!=null)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function oi(n,e){return new Un({...n.decoders??{[n.prefix]:n},...e.decoders??{[e.prefix]:e}})}var Rn=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,r,i){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=i,this.encoder=new Nn(e,t,r),this.decoder=new Ln(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function xt({name:n,prefix:e,encode:t,decode:r}){return new Rn(n,e,t,r)}function He({name:n,prefix:e,alphabet:t,caseInsensitive:r=!1}){let{encode:i,decode:s}=si(t,n,r);return xt({prefix:e,name:n,encode:i,decode:o=>ge(s(o))})}function Wo(n,e,t,r){let i=n.length;for(;n[i-1]==="=";)--i;let s=new Uint8Array(i*t/8|0),o=0,a=0,l=0;for(let d=0;d<i;++d){let p=e[n[d]];if(p===void 0)throw new SyntaxError(`Non-${r} character`);a=a<<t|p,o+=t,o>=8&&(o-=8,s[l++]=255&a>>o)}if(o>=t||(255&a<<8-o)!==0)throw new SyntaxError("Unexpected end of data");return s}function Vo(n,e,t){let r=e[e.length-1]==="=",i=(1<<t)-1,s="",o=0,a=0;for(let l=0;l<n.length;++l)for(a=a<<8|n[l],o+=8;o>t;)o-=t,s+=e[i&a>>o];if(o!==0&&(s+=e[i&a<<t-o]),r)for(;(s.length*t&7)!==0;)s+="=";return s}function Ho(n,e){let t={};for(let r=0;r<n.length;++r)if(t[n[r]]=r,e){let i=n[r].toLowerCase(),s=n[r].toUpperCase();i!==n[r]&&(t[i]=r),s!==n[r]&&(t[s]=r)}return t}function re({name:n,prefix:e,bitsPerChar:t,alphabet:r,caseInsensitive:i=!1}){let s=Ho(r,i);return xt({prefix:e,name:n,encode(o){return Vo(o,r,t)},decode(o){return Wo(o,s,t,n)}})}var qo=He({prefix:"9",name:"base10",alphabet:"0123456789"});var Wn={};Ee(Wn,{base16:()=>Go,base16upper:()=>Yo});var Go=re({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4,caseInsensitive:!0}),Yo=re({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4,caseInsensitive:!0});var Vn={};Ee(Vn,{base2:()=>Ko});var Ko=re({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Hn={};Ee(Hn,{base256emoji:()=>ko});var ui=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Jo=ui.reduce((n,e,t)=>(n[t]=e,n),[]),Qo=ui.reduce((n,e,t)=>{let r=e.codePointAt(0);if(r==null)throw new Error(`Invalid character: ${e}`);return n[r]=t,n},[]);function Zo(n){return n.reduce((e,t)=>(e+=Jo[t],e),"")}function Xo(n){let e=[];for(let t of n){let r=t.codePointAt(0);if(r==null)throw new Error(`Invalid character: ${t}`);let i=Qo[r];if(i==null)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}var ko=xt({prefix:"\u{1F680}",name:"base256emoji",encode:Zo,decode:Xo});var qn={};Ee(qn,{base32:()=>qe,base32hex:()=>ru,base32hexpad:()=>su,base32hexpadupper:()=>ou,base32hexupper:()=>iu,base32pad:()=>tu,base32padupper:()=>nu,base32upper:()=>eu,base32z:()=>uu});var qe=re({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5,caseInsensitive:!0}),eu=re({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5,caseInsensitive:!0}),tu=re({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5,caseInsensitive:!0}),nu=re({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5,caseInsensitive:!0}),ru=re({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5,caseInsensitive:!0}),iu=re({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5,caseInsensitive:!0}),su=re({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5,caseInsensitive:!0}),ou=re({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5,caseInsensitive:!0}),uu=re({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Gn={};Ee(Gn,{base36:()=>Nt,base36upper:()=>au});var Nt=He({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz",caseInsensitive:!0}),au=He({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",caseInsensitive:!0});var Yn={};Ee(Yn,{base58btc:()=>je,base58flickr:()=>cu});var je=He({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),cu=He({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Jn={};Ee(Jn,{base64:()=>lu,base64pad:()=>fu,base64url:()=>Kn,base64urlpad:()=>hu});var lu=re({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),fu=re({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Kn=re({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),hu=re({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Qn={};Ee(Qn,{base8:()=>Du});var Du=re({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Zn={};Ee(Zn,{identity:()=>du});var du=xt({prefix:"\0",name:"identity",encode:n=>ri(ge(n)),decode:n=>ge(ni(n))});var Pl=new TextEncoder,Il=new TextDecoder;var kn={};Ee(kn,{identity:()=>Nu});var gu=li,ai=128,Fu=127,Cu=~Fu,Eu=Math.pow(2,31);function li(n,e,t){e=e||[],t=t||0;for(var r=t;n>=Eu;)e[t++]=n&255|ai,n/=128;for(;n&Cu;)e[t++]=n&255|ai,n>>>=7;return e[t]=n|0,li.bytes=t-r+1,e}var bu=Xn,xu=128,ci=127;function Xn(n,r){var t=0,r=r||0,i=0,s=r,o,a=n.length;do{if(s>=a)throw Xn.bytes=0,new RangeError("Could not decode varint");o=n[s++],t+=i<28?(o&ci)<<i:(o&ci)*Math.pow(2,i),i+=7}while(o>=xu);return Xn.bytes=s-r,t}var wu=Math.pow(2,7),yu=Math.pow(2,14),Au=Math.pow(2,21),_u=Math.pow(2,28),Bu=Math.pow(2,35),Ou=Math.pow(2,42),Su=Math.pow(2,49),vu=Math.pow(2,56),Pu=Math.pow(2,63),Iu=function(n){return n<wu?1:n<yu?2:n<Au?3:n<_u?4:n<Bu?5:n<Ou?6:n<Su?7:n<vu?8:n<Pu?9:10},ju={encode:gu,decode:bu,encodingLength:Iu},Mu=ju,Lt=Mu;function Ut(n,e=0){let t=Lt.decode(n,e),r=Lt.decode.bytes;if(r>9)throw new RangeError("Invalid varint: too long");if(r>1&&n[e+r-1]===0)throw new RangeError("Invalid varint: not minimally encoded");return[t,r]}function wt(n,e,t=0){return Lt.encode(n,e,t),e}function yt(n){return Lt.encodingLength(n)}function _t(n,e){let t=e.byteLength,r=yt(n),i=r+yt(t),s=new Uint8Array(i+t);return wt(n,s,0),wt(t,s,r),s.set(e,i),new At(n,t,e,s)}function fi(n){let e=ge(n),[t,r]=Ut(e),[i,s]=Ut(e.subarray(r)),o=e.subarray(r+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new At(t,i,o,e)}function hi(n,e){if(n===e)return!0;{let t=e;return n.code===t.code&&n.size===t.size&&t.bytes instanceof Uint8Array&&ti(n.bytes,t.bytes)}}var At=class{code;size;digest;bytes;constructor(e,t,r,i){this.code=e,this.size=t,this.digest=nt(r),this.bytes=nt(i)}};var Di=0,Tu="identity",di=ge;function $u(n,e){if(e?.truncate!=null&&e.truncate!==n.byteLength){if(e.truncate<0||e.truncate>n.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${n.byteLength}`);n=n.subarray(0,e.truncate)}return _t(Di,di(n))}var Nu={code:Di,name:Tu,encode:di,digest:$u};var rr={};Ee(rr,{sha256:()=>Uu,sha512:()=>Ru});var nr=Ct(J("node:crypto"),1);var Lu=20;function tr({name:n,code:e,encode:t,minDigestLength:r,maxDigestLength:i}){return new er(n,e,t,r,i)}var er=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,r,i,s){this.name=e,this.code=t,this.encode=r,this.minDigestLength=i??Lu,this.maxDigestLength=s}digest(e,t){if(t?.truncate!=null){if(t.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&t.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?pi(r,this.code,t?.truncate):r.then(i=>pi(i,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function pi(n,e,t){if(t!=null&&t!==n.byteLength){if(t>n.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${n.byteLength}`);n=n.subarray(0,t)}return _t(e,n)}var Uu=tr({name:"sha2-256",code:18,encode:n=>ge(nr.default.createHash("sha256").update(n).digest())}),Ru=tr({name:"sha2-512",code:19,encode:n=>ge(nr.default.createHash("sha512").update(n).digest())});function gi(n,e){let{bytes:t,version:r}=n;return r===0?Wu(t,ir(n),e??je.encoder):Vu(t,ir(n),e??qe.encoder)}var Fi=new WeakMap;function ir(n){let e=Fi.get(n);if(e==null){let t=new Map;return Fi.set(n,t),t}return e}var Bt=class n{code;version;multihash;bytes;"/";constructor(e,t,r,i){this.code=t,this.version=e,this.multihash=r,this.bytes=nt(i),this["/"]=this.bytes}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==zt)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Hu)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return n.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=_t(e,t);return n.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return n.equals(this,e)}static equals(e,t){let r=t;return r!=null&&e.code===r.code&&e.version===r.version&&hi(e.multihash,r.multihash)}toString(e){return gi(this,e)}toJSON(){return{"/":gi(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof n)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:r,code:i,multihash:s,bytes:o}=t;return new n(r,i,s,o??Ci(r,i,s.bytes))}else if(t[qu]===!0){let{version:r,multihash:i,code:s}=t,o=fi(i);return n.create(r,s,o)}else return null}static create(e,t,r){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(r.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==zt)throw new Error(`Version 0 CID must use dag-pb (code: ${zt}) block encoding`);return new n(e,t,r,r.bytes)}case 1:{let i=Ci(e,t,r.bytes);return new n(e,t,r,i)}default:throw new Error("Invalid version")}}static createV0(e){return n.create(0,zt,e)}static createV1(e,t){return n.create(1,e,t)}static decode(e){let[t,r]=n.decodeFirst(e);if(r.length!==0)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=n.inspectBytes(e),r=t.size-t.multihashSize,i=ge(e.subarray(r,r+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=i.subarray(t.multihashSize-t.digestSize),o=new At(t.multihashCode,t.digestSize,s,i);return[t.version===0?n.createV0(o):n.createV1(t.codec,o),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[f,g]=Ut(e.subarray(t));return t+=g,f},i=r(),s=zt;if(i===18?(i=0,t=0):s=r(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=t,a=r(),l=r(),d=t+l,p=d-o;return{version:i,codec:s,multihashCode:a,digestSize:l,multihashSize:p,size:d}}static parse(e,t){let[r,i]=zu(e,t),s=n.decode(i);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return ir(s).set(r,e),s}};function zu(n,e){switch(n[0]){case"Q":{let t=e??je;return[je.prefix,t.decode(`${je.prefix}${n}`)]}case je.prefix:{let t=e??je;return[je.prefix,t.decode(n)]}case qe.prefix:{let t=e??qe;return[qe.prefix,t.decode(n)]}case Nt.prefix:{let t=e??Nt;return[Nt.prefix,t.decode(n)]}default:{if(e==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[n[0],e.decode(n)]}}}function Wu(n,e,t){let{prefix:r}=t;if(r!==je.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(r);if(i==null){let s=t.encode(n).slice(1);return e.set(r,s),s}else return i}function Vu(n,e,t){let{prefix:r}=t,i=e.get(r);if(i==null){let s=t.encode(n);return e.set(r,s),s}else return i}var zt=112,Hu=18;function Ci(n,e,t){let r=yt(n),i=r+yt(e),s=new Uint8Array(i+t.byteLength);return wt(n,s,0),wt(e,s,r),s.set(t,i),s}var qu=Symbol.for("@ipld/js-cid/CID");var Wt={...Zn,...Vn,...Qn,...zn,...Wn,...qn,...Gn,...Yn,...Jn,...Hn},tf={...rr,...kn};function bi(n,e,t,r){return{name:n,prefix:e,encoder:{name:n,prefix:e,encode:t},decoder:{decode:r}}}var Ei=bi("utf8","u",n=>"u"+new TextDecoder("utf8").decode(n),n=>new TextEncoder().encode(n.substring(1))),sr=bi("ascii","a",n=>{let e="a";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e},n=>{n=n.substring(1);let e=$t(n.length);for(let t=0;t<n.length;t++)e[t]=n.charCodeAt(t);return e}),Gu={utf8:Ei,"utf-8":Ei,hex:Wt.base16,latin1:sr,ascii:sr,binary:sr,...Wt},Zt=Gu;function Ot(n,e="utf8"){let t=Zt[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return e==="utf8"||e==="utf-8"?tt(xi.Buffer.from(n,"utf-8")):t.decoder.decode(`${t.prefix}${n}`)}var wi=J("node:buffer");function Ge(n,e="utf8"){let t=Zt[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return e==="utf8"||e==="utf-8"?wi.Buffer.from(n.buffer,n.byteOffset,n.byteLength).toString("utf8"):t.encoder.encode(n).substring(1)}var de=class extends Error{static name="InvalidMultiaddrError";name="InvalidMultiaddrError"},Le=class extends Error{static name="ValidationError";name="ValidationError"},Xt=class extends Error{static name="InvalidParametersError";name="InvalidParametersError"},kt=class extends Error{static name="UnknownProtocolError";name="UnknownProtocolError"};var Ue=J("node:net");function ur(n){return e=>Ge(e,n)}function ar(n){return e=>Ot(e,n)}function St(n){return new DataView(n.buffer).getUint16(n.byteOffset).toString()}function rt(n){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,typeof n=="string"?parseInt(n):n),new Uint8Array(e)}function yi(n){let e=n.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let t=Ot(e[0],"base32"),r=parseInt(e[1],10);if(r<1||r>65536)throw new Error("Port number is not in range(1, 65536)");let i=rt(r);return bt([t,i],t.length+i.length)}function Ai(n){let e=n.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let t=qe.decode(`b${e[0]}`),r=parseInt(e[1],10);if(r<1||r>65536)throw new Error("Port number is not in range(1, 65536)");let i=rt(r);return bt([t,i],t.length+i.length)}function cr(n){let e=n.subarray(0,n.length-2),t=n.subarray(n.length-2),r=Ge(e,"base32"),i=St(t);return`${r}:${i}`}var lr=function(n){n=n.toString().trim();let e=new Uint8Array(4);return n.split(/\./g).forEach((t,r)=>{let i=parseInt(t,10);if(isNaN(i)||i<0||i>255)throw new de("Invalid byte value in IP address");e[r]=i}),e},_i=function(n){let e=0;n=n.toString().trim();let t=n.split(":",8),r;for(r=0;r<t.length;r++){let s=(0,Ue.isIPv4)(t[r]),o;s&&(o=lr(t[r]),t[r]=Ge(o.subarray(0,2),"base16")),o!=null&&++r<8&&t.splice(r,0,Ge(o.subarray(2,4),"base16"))}if(t[0]==="")for(;t.length<8;)t.unshift("0");else if(t[t.length-1]==="")for(;t.length<8;)t.push("0");else if(t.length<8){for(r=0;r<t.length&&t[r]!=="";r++);let s=[r,1];for(r=9-t.length;r>0;r--)s.push("0");t.splice.apply(t,s)}let i=new Uint8Array(e+16);for(r=0;r<t.length;r++){t[r]===""&&(t[r]="0");let s=parseInt(t[r],16);if(isNaN(s)||s<0||s>65535)throw new de("Invalid byte value in IP address");i[e++]=s>>8&255,i[e++]=s&255}return i},Bi=function(n){if(n.byteLength!==4)throw new de("IPv4 address was incorrect length");let e=[];for(let t=0;t<n.byteLength;t++)e.push(n[t]);return e.join(".")},Oi=function(n){if(n.byteLength!==16)throw new de("IPv6 address was incorrect length");let e=[];for(let r=0;r<n.byteLength;r+=2){let i=n[r],s=n[r+1],o=`${i.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`;e.push(o)}let t=e.join(":");try{let r=new URL(`http://[${t}]`);return r.hostname.substring(1,r.hostname.length-1)}catch{throw new de(`Invalid IPv6 address "${t}"`)}};function Si(n){try{let e=new URL(`http://[${n}]`);return e.hostname.substring(1,e.hostname.length-1)}catch{throw new de(`Invalid IPv6 address "${n}"`)}}var or=Object.values(Wt).map(n=>n.decoder),Yu=(function(){let n=or[0].or(or[1]);return or.slice(2).forEach(e=>n=n.or(e)),n})();function vi(n){return Yu.decode(n)}function Pi(n){return e=>n.encoder.encode(e)}function Ku(n){if(parseInt(n).toString()!==n)throw new Le("Value must be an integer")}function Ju(n){if(n<0)throw new Le("Value must be a positive integer, or zero")}function Qu(n){return e=>{if(e>n)throw new Le(`Value must be smaller than or equal to ${n}`)}}function Zu(...n){return e=>{for(let t of n)t(e)}}var Vt=Zu(Ku,Ju,Qu(65535));var he=-1,fr=class{protocolsByCode=new Map;protocolsByName=new Map;getProtocol(e){let t;if(typeof e=="string"?t=this.protocolsByName.get(e):t=this.protocolsByCode.get(e),t==null)throw new kt(`Protocol ${e} was unknown`);return t}addProtocol(e){this.protocolsByCode.set(e.code,e),this.protocolsByName.set(e.name,e),e.aliases?.forEach(t=>{this.protocolsByName.set(t,e)})}removeProtocol(e){let t=this.protocolsByCode.get(e);t!=null&&(this.protocolsByCode.delete(t.code),this.protocolsByName.delete(t.name),t.aliases?.forEach(r=>{this.protocolsByName.delete(r)}))}},Re=new fr,La=[{code:4,name:"ip4",size:32,valueToBytes:lr,bytesToValue:Bi,validate:n=>{if(!(0,Ue.isIPv4)(n))throw new Le(`Invalid IPv4 address "${n}"`)}},{code:6,name:"tcp",size:16,valueToBytes:rt,bytesToValue:St,validate:Vt},{code:273,name:"udp",size:16,valueToBytes:rt,bytesToValue:St,validate:Vt},{code:33,name:"dccp",size:16,valueToBytes:rt,bytesToValue:St,validate:Vt},{code:41,name:"ip6",size:128,valueToBytes:_i,bytesToValue:Oi,stringToValue:Si,validate:n=>{if(!(0,Ue.isIPv6)(n))throw new Le(`Invalid IPv6 address "${n}"`)}},{code:42,name:"ip6zone",size:he},{code:43,name:"ipcidr",size:8,bytesToValue:ur("base10"),valueToBytes:ar("base10")},{code:53,name:"dns",size:he},{code:54,name:"dns4",size:he},{code:55,name:"dns6",size:he},{code:56,name:"dnsaddr",size:he},{code:132,name:"sctp",size:16,valueToBytes:rt,bytesToValue:St,validate:Vt},{code:301,name:"udt"},{code:302,name:"utp"},{code:400,name:"unix",size:he,stringToValue:n=>decodeURIComponent(n),valueToString:n=>encodeURIComponent(n)},{code:421,name:"p2p",aliases:["ipfs"],size:he,bytesToValue:ur("base58btc"),valueToBytes:n=>n.startsWith("Q")||n.startsWith("1")?ar("base58btc")(n):Bt.parse(n).multihash.bytes},{code:444,name:"onion",size:96,bytesToValue:cr,valueToBytes:yi},{code:445,name:"onion3",size:296,bytesToValue:cr,valueToBytes:Ai},{code:446,name:"garlic64",size:he},{code:447,name:"garlic32",size:he},{code:448,name:"tls"},{code:449,name:"sni",size:he},{code:454,name:"noise"},{code:460,name:"quic"},{code:461,name:"quic-v1"},{code:465,name:"webtransport"},{code:466,name:"certhash",size:he,bytesToValue:Pi(Kn),valueToBytes:vi},{code:480,name:"http"},{code:481,name:"http-path",size:he,stringToValue:n=>`/${decodeURIComponent(n)}`,valueToString:n=>encodeURIComponent(n.substring(1))},{code:443,name:"https"},{code:477,name:"ws"},{code:478,name:"wss"},{code:479,name:"p2p-websocket-star"},{code:277,name:"p2p-stardust"},{code:275,name:"p2p-webrtc-star"},{code:276,name:"p2p-webrtc-direct"},{code:280,name:"webrtc-direct"},{code:281,name:"webrtc"},{code:290,name:"p2p-circuit"},{code:777,name:"memory",size:he}];La.forEach(n=>{Re.addProtocol(n)});function Ii(n){let e=[],t=0;for(;t<n.length;){let r=Tn(n,t),i=Re.getProtocol(r),s=Et(r),o=Ua(i,n,t+s),a=0;o>0&&i.size===he&&(a=Et(o));let l=s+a+o,d={code:r,name:i.name,bytes:$n(n.subarray(t,t+l))};if(o>0){let p=t+s+a,f=n.subarray(p,p+o);d.value=i.bytesToValue?.(f)??Ge(f)}e.push(d),t+=l}return e}function ji(n){let e=0,t=[];for(let r of n){if(r.bytes==null){let i=Re.getProtocol(r.code),s=Et(r.code),o,a=0,l=0;r.value!=null&&(o=i.valueToBytes?.(r.value)??Ot(r.value),a=o.byteLength,i.size===he&&(l=Et(a)));let d=new Uint8Array(s+l+a),p=0;Mn(r.code,d,p),p+=s,o!=null&&(i.size===he&&(Mn(a,d,p),p+=l),d.set(o,p)),r.bytes=d}t.push(r.bytes),e+=r.bytes.byteLength}return bt(t,e)}function Mi(n){if(n.charAt(0)!=="/")throw new de('String multiaddr must start with "/"');let e=[],t="protocol",r="",i="";for(let s=1;s<n.length;s++){let o=n.charAt(s);o!=="/"&&(t==="protocol"?i+=n.charAt(s):r+=n.charAt(s));let a=s===n.length-1;if(o==="/"||a){let l=Re.getProtocol(i);if(t==="protocol"){if(l.size==null||l.size===0){e.push({code:l.code,name:l.name}),r="",i="",t="protocol";continue}else if(a)throw new de(`Component ${i} was missing value`);t="value"}else if(t==="value"){let d={code:l.code,name:l.name};if(l.size!=null&&l.size!==0){if(r==="")throw new de(`Component ${i} was missing value`);d.value=l.stringToValue?.(r)??r}e.push(d),r="",i="",t="protocol"}}}if(i!==""&&r!=="")throw new de("Incomplete multiaddr");return e}function Ti(n){return`/${n.flatMap(e=>{if(e.value==null)return e.name;let t=Re.getProtocol(e.code);if(t==null)throw new de(`Unknown protocol code ${e.code}`);return[e.name,t.valueToString?.(e.value)??e.value]}).join("/")}`}function Ua(n,e,t){return n.size==null||n.size===0?0:n.size>0?n.size/8:Tn(e,t)}var Ra=Symbol.for("nodejs.util.inspect.custom"),hr=Symbol.for("@multiformats/multiaddr");function za(n){if(n==null&&(n="/"),$i(n))return n.getComponents();if(n instanceof Uint8Array)return Ii(n);if(typeof n=="string")return n=n.replace(/\/(\/)+/,"/").replace(/(\/)+$/,""),n===""&&(n="/"),Mi(n);if(Array.isArray(n))return n;throw new de("Must be a string, Uint8Array, Component[], or another Multiaddr")}var en=class n{[hr]=!0;#e;#t;#n;constructor(e="/",t={}){this.#e=za(e),t.validate!==!1&&Wa(this)}get bytes(){return this.#n==null&&(this.#n=ji(this.#e)),this.#n}toString(){return this.#t==null&&(this.#t=Ti(this.#e)),this.#t}toJSON(){return this.toString()}getComponents(){return[...this.#e.map(e=>({...e}))]}encapsulate(e){let t=new n(e);return new n([...this.#e,...t.getComponents()],{validate:!1})}decapsulate(e){let t=e.toString(),r=this.toString(),i=r.lastIndexOf(t);if(i<0)throw new Xt(`Address ${this.toString()} does not contain subaddress: ${t}`);return new n(r.slice(0,i),{validate:!1})}decapsulateCode(e){let t;for(let r=this.#e.length-1;r>-1;r--)if(this.#e[r].code===e){t=r;break}return new n(this.#e.slice(0,t),{validate:!1})}equals(e){return Sn(this.bytes,e.bytes)}[Ra](){return`Multiaddr(${this.toString()})`}};function Wa(n){n.getComponents().forEach(e=>{let t=Re.getProtocol(e.code);e.value!=null&&t.validate?.(e.value)})}function $i(n){return!!n?.[hr]}function Ni(n){return new en(n)}var Li=J("module"),dr=Ct(J("path"),1),Dr=Ct(J("process"),1),Ui=J("url");function Va(n){let e=dr.default.extname(n);return e?n.slice(0,-e.length):n}function pr(n){if(!n)return!1;if("main"in n)return!!n.main;if(!Dr.default.argv[1])return!1;let t=(0,Li.createRequire)(n.url).resolve(Dr.default.argv[1]),r=(0,Ui.fileURLToPath)(n.url);return dr.default.extname(t)?r===t:Va(r)===t}var hn=J("assert");var Ha={right:Ja,center:Qa},qa=0,tn=1,Ga=2,nn=3,mr=class{constructor(e){var t;this.width=e.width,this.wrap=(t=e.wrap)!==null&&t!==void 0?t:!0,this.rows=[]}span(...e){let t=this.div(...e);t.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let t=e.map(r=>typeof r=="string"?this.colFromString(r):r);return this.rows.push(t),t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let t=e.split(`
4
4
  `).map(i=>i.split(" ")),r=0;return t.forEach(i=>{i.length>1&&be.stringWidth(i[0])>r&&(r=Math.min(Math.floor(this.width*.5),be.stringWidth(i[0])))}),t.forEach(i=>{this.div(...i.map((s,o)=>({text:s.trim(),padding:this.measurePadding(s),width:o===0&&i.length>1?r:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let t=be.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(t=>{this.rowToString(t,e)}),e.filter(t=>!t.hidden).map(t=>t.text).join(`
5
- `)}rowToString(e,t){return this.rasterize(e).forEach((r,i)=>{let s="";r.forEach((o,a)=>{let{width:f}=e[a],m=this.negatePadding(e[a]),d=o;if(m>be.stringWidth(o)&&(d+=" ".repeat(m-be.stringWidth(o))),e[a].align&&e[a].align!=="left"&&this.wrap){let g=Va[e[a].align];d=g(d,m),be.stringWidth(d)<m&&(d+=" ".repeat((f||0)-be.stringWidth(d)-1))}let l=e[a].padding||[0,0,0,0];l[nn]&&(s+=" ".repeat(l[nn])),s+=Ri(e[a],d,"| "),s+=d,s+=Ri(e[a],d," |"),l[tn]&&(s+=" ".repeat(l[tn])),i===0&&t.length>0&&(s=this.renderInline(s,t[t.length-1]))}),t.push({text:s.replace(/ +$/,""),span:e.span})}),t}renderInline(e,t){let r=e.match(/^ */),i=r?r[0].length:0,s=t.text,o=be.stringWidth(s.trimRight());return t.span?this.wrap?i<o?e:(t.hidden=!0,s.trimRight()+" ".repeat(i-o)+e.trimLeft()):(t.hidden=!0,s+e):e}rasterize(e){let t=[],r=this.columnWidths(e),i;return e.forEach((s,o)=>{s.width=r[o],this.wrap?i=be.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
5
+ `)}rowToString(e,t){return this.rasterize(e).forEach((r,i)=>{let s="";r.forEach((o,a)=>{let{width:l}=e[a],d=this.negatePadding(e[a]),p=o;if(d>be.stringWidth(o)&&(p+=" ".repeat(d-be.stringWidth(o))),e[a].align&&e[a].align!=="left"&&this.wrap){let g=Ha[e[a].align];p=g(p,d),be.stringWidth(p)<d&&(p+=" ".repeat((l||0)-be.stringWidth(p)-1))}let f=e[a].padding||[0,0,0,0];f[nn]&&(s+=" ".repeat(f[nn])),s+=Ri(e[a],p,"| "),s+=p,s+=Ri(e[a],p," |"),f[tn]&&(s+=" ".repeat(f[tn])),i===0&&t.length>0&&(s=this.renderInline(s,t[t.length-1]))}),t.push({text:s.replace(/ +$/,""),span:e.span})}),t}renderInline(e,t){let r=e.match(/^ */),i=r?r[0].length:0,s=t.text,o=be.stringWidth(s.trimRight());return t.span?this.wrap?i<o?e:(t.hidden=!0,s.trimRight()+" ".repeat(i-o)+e.trimLeft()):(t.hidden=!0,s+e):e}rasterize(e){let t=[],r=this.columnWidths(e),i;return e.forEach((s,o)=>{s.width=r[o],this.wrap?i=be.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
6
6
  `):i=s.text.split(`
7
- `),s.border&&(i.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(i.unshift(...new Array(s.padding[Ha]||0).fill("")),i.push(...new Array(s.padding[qa]||0).fill(""))),i.forEach((a,f)=>{t[f]||t.push([]);let m=t[f];for(let d=0;d<o;d++)m[d]===void 0&&m.push("");m.push(a)})}),t}negatePadding(e){let t=e.width||0;return e.padding&&(t-=(e.padding[nn]||0)+(e.padding[tn]||0)),e.border&&(t-=4),t}columnWidths(e){if(!this.wrap)return e.map(o=>o.width||be.stringWidth(o.text));let t=e.length,r=this.width,i=e.map(o=>{if(o.width)return t--,r-=o.width,o.width}),s=t?Math.floor(r/t):0;return i.map((o,a)=>o===void 0?Math.max(s,Ga(e[a])):o)}};function Ri(n,e,t){return n.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?t:" ":""}function Ga(n){let e=n.padding||[],t=1+(e[nn]||0)+(e[tn]||0);return n.border?t+4:t}function Ya(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Ka(n,e){n=n.trim();let t=be.stringWidth(n);return t<e?" ".repeat(e-t)+n:n}function Ja(n,e){n=n.trim();let t=be.stringWidth(n);return t>=e?n:" ".repeat(e-t>>1)+n}var be;function zi(n,e){return be=e,new mr({width:n?.width||Ya(),wrap:n?.wrap})}function gr({onlyFirst:n=!1}={}){let i="(?:\\u001B\\][^\\u0007\\u001B\\u009C]*(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(i,n?void 0:"g")}var Qa=gr();function ze(n){if(typeof n!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof n}\``);return!n.includes("\x1B")&&!n.includes("\x9B")?n:n.replace(Qa,"")}var Wi=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Vi=12288,Hi=65510,qi=[12288,12288,65281,65376,65504,65510];var Gi=4352,Yi=262141,Fr=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var rn=(n,e)=>{let t=0,r=Math.floor(n.length/2)-1;for(;t<=r;){let i=Math.floor((t+r)/2),s=i*2;if(e<n[s])r=i-1;else if(e>n[s+1])t=i+1;else return!0}return!1};var Ki=19968,[ka,ec]=tc(Fr);function tc(n){let e=n[0],t=n[1];for(let r=0;r<n.length;r+=2){let i=n[r],s=n[r+1];if(Ki>=i&&Ki<=s)return[i,s];s-i>t-e&&(e=i,t=s)}return[e,t]}var Ji=n=>n<161||n>1114109?!1:rn(Wi,n),Qi=n=>n<Vi||n>Hi?!1:rn(qi,n);var Zi=n=>n>=ka&&n<=ec?!0:n<Gi||n>Yi?!1:rn(Fr,n);function nc(n){if(!Number.isSafeInteger(n))throw new TypeError(`Expected a code point, got \`${typeof n}\`.`)}function it(n,{ambiguousAsWide:e=!1}={}){return nc(n),Qi(n)||Zi(n)||e&&Ji(n)?2:1}var es=Ct(ki(),1),rc=new Intl.Segmenter,ic=/^\p{Default_Ignorable_Code_Point}$/u;function We(n,e={}){if(typeof n!="string"||n.length===0)return 0;let{ambiguousIsNarrow:t=!0,countAnsiEscapeCodes:r=!1}=e;if(r||(n=ze(n)),n.length===0)return 0;let i=0,s={ambiguousAsWide:!t};for(let{segment:o}of rc.segment(n)){let a=o.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!ic.test(o)){if((0,es.default)().test(o)){i+=2;continue}i+=it(a,s)}}return i}var ts=(n=0)=>e=>`\x1B[${e+n}m`,ns=(n=0)=>e=>`\x1B[${38+n};5;${e}m`,rs=(n=0)=>(e,t,r)=>`\x1B[${38+n};2;${e};${t};${r}m`,X={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},ID=Object.keys(X.modifier),sc=Object.keys(X.color),oc=Object.keys(X.bgColor),jD=[...sc,...oc];function uc(){let n=new Map;for(let[e,t]of Object.entries(X)){for(let[r,i]of Object.entries(t))X[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[r]=X[r],n.set(i[0],i[1]);Object.defineProperty(X,e,{value:t,enumerable:!1})}return Object.defineProperty(X,"codes",{value:n,enumerable:!1}),X.color.close="\x1B[39m",X.bgColor.close="\x1B[49m",X.color.ansi=ts(),X.color.ansi256=ns(),X.color.ansi16m=rs(),X.bgColor.ansi=ts(10),X.bgColor.ansi256=ns(10),X.bgColor.ansi16m=rs(10),Object.defineProperties(X,{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=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(s=>s+s).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>X.rgbToAnsi256(...X.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 s=Math.max(t,r,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>X.ansi256ToAnsi(X.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>X.ansi256ToAnsi(X.hexToAnsi256(e)),enumerable:!1}}),X}var ac=uc(),is=ac;var on=new Set(["\x1B","\x9B"]),cc=39,Er="\x07",us="[",lc="]",as="m",sn=`${lc}8;;`,ss=n=>`${on.values().next().value}${us}${n}${as}`,os=n=>`${on.values().next().value}${sn}${n}${Er}`,fc=n=>n.split(" ").map(e=>We(e)),Cr=(n,e,t)=>{let r=[...e],i=!1,s=!1,o=We(ze(n.at(-1)));for(let[a,f]of r.entries()){let m=We(f);if(o+m<=t?n[n.length-1]+=f:(n.push(f),o=0),on.has(f)&&(i=!0,s=r.slice(a+1,a+1+sn.length).join("")===sn),i){s?f===Er&&(i=!1,s=!1):f===as&&(i=!1);continue}o+=m,o===t&&a<r.length-1&&(n.push(""),o=0)}!o&&n.at(-1).length>0&&n.length>1&&(n[n.length-2]+=n.pop())},Dc=n=>{let e=n.split(" "),t=e.length;for(;t>0&&!(We(e[t-1])>0);)t--;return t===e.length?n:e.slice(0,t).join(" ")+e.slice(t).join("")},hc=(n,e,t={})=>{if(t.trim!==!1&&n.trim()==="")return"";let r="",i,s,o=fc(n),a=[""];for(let[l,g]of n.split(" ").entries()){t.trim!==!1&&(a[a.length-1]=a.at(-1).trimStart());let C=We(a.at(-1));if(l!==0&&(C>=e&&(t.wordWrap===!1||t.trim===!1)&&(a.push(""),C=0),(C>0||t.trim===!1)&&(a[a.length-1]+=" ",C++)),t.hard&&o[l]>e){let E=e-C,b=1+Math.floor((o[l]-E-1)/e);Math.floor((o[l]-1)/e)<b&&a.push(""),Cr(a,g,e);continue}if(C+o[l]>e&&C>0&&o[l]>0){if(t.wordWrap===!1&&C<e){Cr(a,g,e);continue}a.push("")}if(C+o[l]>e&&t.wordWrap===!1){Cr(a,g,e);continue}a[a.length-1]+=g}t.trim!==!1&&(a=a.map(l=>Dc(l)));let f=a.join(`
8
- `),m=[...f],d=0;for(let[l,g]of m.entries()){if(r+=g,on.has(g)){let{groups:E}=new RegExp(`(?:\\${us}(?<code>\\d+)m|\\${sn}(?<uri>.*)${Er})`).exec(f.slice(d))||{groups:{}};if(E.code!==void 0){let b=Number.parseFloat(E.code);i=b===cc?void 0:b}else E.uri!==void 0&&(s=E.uri.length===0?void 0:E.uri)}let C=is.codes.get(Number(i));m[l+1]===`
7
+ `),s.border&&(i.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(i.unshift(...new Array(s.padding[qa]||0).fill("")),i.push(...new Array(s.padding[Ga]||0).fill(""))),i.forEach((a,l)=>{t[l]||t.push([]);let d=t[l];for(let p=0;p<o;p++)d[p]===void 0&&d.push("");d.push(a)})}),t}negatePadding(e){let t=e.width||0;return e.padding&&(t-=(e.padding[nn]||0)+(e.padding[tn]||0)),e.border&&(t-=4),t}columnWidths(e){if(!this.wrap)return e.map(o=>o.width||be.stringWidth(o.text));let t=e.length,r=this.width,i=e.map(o=>{if(o.width)return t--,r-=o.width,o.width}),s=t?Math.floor(r/t):0;return i.map((o,a)=>o===void 0?Math.max(s,Ya(e[a])):o)}};function Ri(n,e,t){return n.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?t:" ":""}function Ya(n){let e=n.padding||[],t=1+(e[nn]||0)+(e[tn]||0);return n.border?t+4:t}function Ka(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Ja(n,e){n=n.trim();let t=be.stringWidth(n);return t<e?" ".repeat(e-t)+n:n}function Qa(n,e){n=n.trim();let t=be.stringWidth(n);return t>=e?n:" ".repeat(e-t>>1)+n}var be;function zi(n,e){return be=e,new mr({width:n?.width||Ka(),wrap:n?.wrap})}function gr({onlyFirst:n=!1}={}){let i="(?:\\u001B\\][^\\u0007\\u001B\\u009C]*(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(i,n?void 0:"g")}var Za=gr();function ze(n){if(typeof n!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof n}\``);return!n.includes("\x1B")&&!n.includes("\x9B")?n:n.replace(Za,"")}var Wi=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Vi=12288,Hi=65510,qi=[12288,12288,65281,65376,65504,65510];var Gi=4352,Yi=262141,Fr=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101594,101631,101664,101760,101874,101888,102801,102816,102866,110576,110579,110581,110587,110589,110590,110592,110888,110898,110898,110928,110930,110933,110933,110948,110952,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127406,127406,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128729,128732,128735,128747,128748,128756,128764,128986,128986,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129734,129736,129736,129740,129757,129759,129771,129775,129786,131072,196605,196608,262141];var rn=(n,e)=>{let t=0,r=Math.floor(n.length/2)-1;for(;t<=r;){let i=Math.floor((t+r)/2),s=i*2;if(e<n[s])r=i-1;else if(e>n[s+1])t=i+1;else return!0}return!1};var Ki=19968,[ec,tc]=nc(Fr);function nc(n){let e=n[0],t=n[1];for(let r=0;r<n.length;r+=2){let i=n[r],s=n[r+1];if(Ki>=i&&Ki<=s)return[i,s];s-i>t-e&&(e=i,t=s)}return[e,t]}var Ji=n=>n<161||n>1114109?!1:rn(Wi,n),Qi=n=>n<Vi||n>Hi?!1:rn(qi,n);var Zi=n=>n>=ec&&n<=tc?!0:n<Gi||n>Yi?!1:rn(Fr,n);function rc(n){if(!Number.isSafeInteger(n))throw new TypeError(`Expected a code point, got \`${typeof n}\`.`)}function it(n,{ambiguousAsWide:e=!1}={}){return rc(n),Qi(n)||Zi(n)||e&&Ji(n)?2:1}var es=Ct(ki(),1),ic=new Intl.Segmenter,sc=/^\p{Default_Ignorable_Code_Point}$/u;function We(n,e={}){if(typeof n!="string"||n.length===0)return 0;let{ambiguousIsNarrow:t=!0,countAnsiEscapeCodes:r=!1}=e;if(r||(n=ze(n)),n.length===0)return 0;let i=0,s={ambiguousAsWide:!t};for(let{segment:o}of ic.segment(n)){let a=o.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!sc.test(o)){if((0,es.default)().test(o)){i+=2;continue}i+=it(a,s)}}return i}var ts=(n=0)=>e=>`\x1B[${e+n}m`,ns=(n=0)=>e=>`\x1B[${38+n};5;${e}m`,rs=(n=0)=>(e,t,r)=>`\x1B[${38+n};2;${e};${t};${r}m`,X={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},jh=Object.keys(X.modifier),oc=Object.keys(X.color),uc=Object.keys(X.bgColor),Mh=[...oc,...uc];function ac(){let n=new Map;for(let[e,t]of Object.entries(X)){for(let[r,i]of Object.entries(t))X[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[r]=X[r],n.set(i[0],i[1]);Object.defineProperty(X,e,{value:t,enumerable:!1})}return Object.defineProperty(X,"codes",{value:n,enumerable:!1}),X.color.close="\x1B[39m",X.bgColor.close="\x1B[49m",X.color.ansi=ts(),X.color.ansi256=ns(),X.color.ansi16m=rs(),X.bgColor.ansi=ts(10),X.bgColor.ansi256=ns(10),X.bgColor.ansi16m=rs(10),Object.defineProperties(X,{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=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(s=>s+s).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>X.rgbToAnsi256(...X.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 s=Math.max(t,r,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>X.ansi256ToAnsi(X.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>X.ansi256ToAnsi(X.hexToAnsi256(e)),enumerable:!1}}),X}var cc=ac(),is=cc;var on=new Set(["\x1B","\x9B"]),lc=39,Er="\x07",us="[",fc="]",as="m",sn=`${fc}8;;`,ss=n=>`${on.values().next().value}${us}${n}${as}`,os=n=>`${on.values().next().value}${sn}${n}${Er}`,hc=n=>n.split(" ").map(e=>We(e)),Cr=(n,e,t)=>{let r=[...e],i=!1,s=!1,o=We(ze(n.at(-1)));for(let[a,l]of r.entries()){let d=We(l);if(o+d<=t?n[n.length-1]+=l:(n.push(l),o=0),on.has(l)&&(i=!0,s=r.slice(a+1,a+1+sn.length).join("")===sn),i){s?l===Er&&(i=!1,s=!1):l===as&&(i=!1);continue}o+=d,o===t&&a<r.length-1&&(n.push(""),o=0)}!o&&n.at(-1).length>0&&n.length>1&&(n[n.length-2]+=n.pop())},Dc=n=>{let e=n.split(" "),t=e.length;for(;t>0&&!(We(e[t-1])>0);)t--;return t===e.length?n:e.slice(0,t).join(" ")+e.slice(t).join("")},dc=(n,e,t={})=>{if(t.trim!==!1&&n.trim()==="")return"";let r="",i,s,o=hc(n),a=[""];for(let[f,g]of n.split(" ").entries()){t.trim!==!1&&(a[a.length-1]=a.at(-1).trimStart());let C=We(a.at(-1));if(f!==0&&(C>=e&&(t.wordWrap===!1||t.trim===!1)&&(a.push(""),C=0),(C>0||t.trim===!1)&&(a[a.length-1]+=" ",C++)),t.hard&&o[f]>e){let E=e-C,b=1+Math.floor((o[f]-E-1)/e);Math.floor((o[f]-1)/e)<b&&a.push(""),Cr(a,g,e);continue}if(C+o[f]>e&&C>0&&o[f]>0){if(t.wordWrap===!1&&C<e){Cr(a,g,e);continue}a.push("")}if(C+o[f]>e&&t.wordWrap===!1){Cr(a,g,e);continue}a[a.length-1]+=g}t.trim!==!1&&(a=a.map(f=>Dc(f)));let l=a.join(`
8
+ `),d=[...l],p=0;for(let[f,g]of d.entries()){if(r+=g,on.has(g)){let{groups:E}=new RegExp(`(?:\\${us}(?<code>\\d+)m|\\${sn}(?<uri>.*)${Er})`).exec(l.slice(p))||{groups:{}};if(E.code!==void 0){let b=Number.parseFloat(E.code);i=b===lc?void 0:b}else E.uri!==void 0&&(s=E.uri.length===0?void 0:E.uri)}let C=is.codes.get(Number(i));d[f+1]===`
9
9
  `?(s&&(r+=os("")),i&&C&&(r+=ss(C))):g===`
10
- `&&(i&&C&&(r+=ss(i)),s&&(r+=os(s))),d+=g.length}return r};function br(n,e,t){return String(n).normalize().replaceAll(`\r
10
+ `&&(i&&C&&(r+=ss(i)),s&&(r+=os(s))),p+=g.length}return r};function br(n,e,t){return String(n).normalize().replaceAll(`\r
11
11
  `,`
12
12
  `).split(`
13
- `).map(r=>hc(r,e,t)).join(`
14
- `)}function xr(n){return zi(n,{stringWidth:We,stripAnsi:ze,wrap:br})}var vt=J("path"),un=J("fs");function cs(n,e){let t=(0,vt.resolve)(".",n),r;for((0,un.statSync)(t).isDirectory()||(t=(0,vt.dirname)(t));;){if(r=e(t,(0,un.readdirSync)(t)),r)return(0,vt.resolve)(t,r);if(t=(0,vt.dirname)(r=t),r===t)break}}var Ps=J("util"),Pr=J("url");var ps=J("util"),fn=J("path");function st(n){if(n!==n.toLowerCase()&&n!==n.toUpperCase()||(n=n.toLowerCase()),n.indexOf("-")===-1&&n.indexOf("_")===-1)return n;{let t="",r=!1,i=n.match(/^-+/);for(let s=i?i[0].length:0;s<n.length;s++){let o=n.charAt(s);r&&(r=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?r=!0:o!=="-"&&o!=="_"&&(t+=o)}return t}}function an(n,e){let t=n.toLowerCase();e=e||"-";let r="";for(let i=0;i<n.length;i++){let s=t.charAt(i),o=n.charAt(i);s!==o&&i>0?r+=`${e}${t.charAt(i)}`:r+=o}return r}function cn(n){return n==null?!1:typeof n=="number"||/^0x[0-9a-f]+$/i.test(n)?!0:/^0[^.]/.test(n)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(n)}function ls(n){if(Array.isArray(n))return n.map(o=>typeof o!="string"?o+"":o);n=n.trim();let e=0,t=null,r=null,i=null,s=[];for(let o=0;o<n.length;o++){if(t=r,r=n.charAt(o),r===" "&&!i){t!==" "&&e++;continue}r===i?i=null:(r==="'"||r==='"')&&!i&&(i=r),s[e]||(s[e]=""),s[e]+=r}return s}var _e;(function(n){n.BOOLEAN="boolean",n.STRING="string",n.NUMBER="number",n.ARRAY="array"})(_e||(_e={}));var Ve,ln=class{constructor(e){Ve=e}parse(e,t){let r=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),i=ls(e),s=typeof e=="string",o=dc(Object.assign(Object.create(null),r.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},r.configuration),f=Object.assign(Object.create(null),r.default),m=r.configObjects||[],d=r.envPrefix,l=a["populate--"],g=l?"--":"_",C=Object.create(null),E=Object.create(null),b=r.__||Ve.format,p={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},_=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,L=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(r.array||[]).filter(Boolean).forEach(function(c){let h=typeof c=="object"?c.key:c,x=Object.keys(c).map(function(F){return{boolean:"bools",string:"strings",number:"numbers"}[F]}).filter(Boolean).pop();x&&(p[x][h]=!0),p.arrays[h]=!0,p.keys.push(h)}),[].concat(r.boolean||[]).filter(Boolean).forEach(function(c){p.bools[c]=!0,p.keys.push(c)}),[].concat(r.string||[]).filter(Boolean).forEach(function(c){p.strings[c]=!0,p.keys.push(c)}),[].concat(r.number||[]).filter(Boolean).forEach(function(c){p.numbers[c]=!0,p.keys.push(c)}),[].concat(r.count||[]).filter(Boolean).forEach(function(c){p.counts[c]=!0,p.keys.push(c)}),[].concat(r.normalize||[]).filter(Boolean).forEach(function(c){p.normalize[c]=!0,p.keys.push(c)}),typeof r.narg=="object"&&Object.entries(r.narg).forEach(([c,h])=>{typeof h=="number"&&(p.nargs[c]=h,p.keys.push(c))}),typeof r.coerce=="object"&&Object.entries(r.coerce).forEach(([c,h])=>{typeof h=="function"&&(p.coercions[c]=h,p.keys.push(c))}),typeof r.config<"u"&&(Array.isArray(r.config)||typeof r.config=="string"?[].concat(r.config).filter(Boolean).forEach(function(c){p.configs[c]=!0}):typeof r.config=="object"&&Object.entries(r.config).forEach(([c,h])=>{(typeof h=="boolean"||typeof h=="function")&&(p.configs[c]=h)})),et(r.key,o,r.default,p.arrays),Object.keys(f).forEach(function(c){(p.aliases[c]||[]).forEach(function(h){f[h]=f[c]})});let R=null;Kt();let U=[],V=Object.assign(Object.create(null),{_:[]}),W={};for(let c=0;c<i.length;c++){let h=i[c],x=h.replace(/^-{3,}/,"---"),F,D,v,A,I,fe;if(h!=="--"&&/^-/.test(h)&&te(h))q(h);else if(x.match(/^---+(=|$)/)){q(h);continue}else if(h.match(/^--.+=/)||!a["short-option-groups"]&&h.match(/^-.+=/))A=h.match(/^--?([^=]+)=([\s\S]*)$/),A!==null&&Array.isArray(A)&&A.length>=3&&(T(A[1],p.arrays)?c=ae(c,A[1],i,A[2]):T(A[1],p.nargs)!==!1?c=K(c,A[1],i,A[2]):z(A[1],A[2],!0));else if(h.match(L)&&a["boolean-negation"])A=h.match(L),A!==null&&Array.isArray(A)&&A.length>=2&&(D=A[1],z(D,T(D,p.arrays)?[!1]:!1));else if(h.match(/^--.+/)||!a["short-option-groups"]&&h.match(/^-[^-]+/))A=h.match(/^--?(.+)/),A!==null&&Array.isArray(A)&&A.length>=2&&(D=A[1],T(D,p.arrays)?c=ae(c,D,i):T(D,p.nargs)!==!1?c=K(c,D,i):(I=i[c+1],I!==void 0&&(!I.match(/^-/)||I.match(_))&&!T(D,p.bools)&&!T(D,p.counts)||/^(true|false)$/.test(I)?(z(D,I),c++):z(D,ne(D))));else if(h.match(/^-.\..+=/))A=h.match(/^-([^=]+)=([\s\S]*)$/),A!==null&&Array.isArray(A)&&A.length>=3&&z(A[1],A[2]);else if(h.match(/^-.\..+/)&&!h.match(_))I=i[c+1],A=h.match(/^-(.\..+)/),A!==null&&Array.isArray(A)&&A.length>=2&&(D=A[1],I!==void 0&&!I.match(/^-/)&&!T(D,p.bools)&&!T(D,p.counts)?(z(D,I),c++):z(D,ne(D)));else if(h.match(/^-[^-]+/)&&!h.match(_)){v=h.slice(1,-1).split(""),F=!1;for(let me=0;me<v.length;me++){if(I=h.slice(me+2),v[me+1]&&v[me+1]==="="){fe=h.slice(me+3),D=v[me],T(D,p.arrays)?c=ae(c,D,i,fe):T(D,p.nargs)!==!1?c=K(c,D,i,fe):z(D,fe),F=!0;break}if(I==="-"){z(v[me],I);continue}if(/[A-Za-z]/.test(v[me])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(I)&&T(I,p.bools)===!1){z(v[me],I),F=!0;break}if(v[me+1]&&v[me+1].match(/\W/)){z(v[me],I),F=!0;break}else z(v[me],ne(v[me]))}D=h.slice(-1)[0],!F&&D!=="-"&&(T(D,p.arrays)?c=ae(c,D,i):T(D,p.nargs)!==!1?c=K(c,D,i):(I=i[c+1],I!==void 0&&(!/^(-|--)[^-]/.test(I)||I.match(_))&&!T(D,p.bools)&&!T(D,p.counts)||/^(true|false)$/.test(I)?(z(D,I),c++):z(D,ne(D))))}else if(h.match(/^-[0-9]$/)&&h.match(_)&&T(h.slice(1),p.bools))D=h.slice(1),z(D,ne(D));else if(h==="--"){U=i.slice(c+1);break}else if(a["halt-at-non-option"]){U=i.slice(c);break}else q(h)}G(V,!0),G(V,!1),N(V),ce(),k(V,p.aliases,f,!0),le(V),a["set-placeholder-key"]&&ke(V),Object.keys(p.counts).forEach(function(c){$e(V,c.split("."))||z(c,0)}),l&&U.length&&(V[g]=[]),U.forEach(function(c){V[g].push(c)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(V).filter(c=>c!=="--"&&c.includes("-")).forEach(c=>{delete V[c]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(c=>o[c])).forEach(c=>{a["camel-case-expansion"]&&c.includes("-")&&delete V[c.split(".").map(h=>st(h)).join(".")],delete V[c]});function q(c){let h=S("_",c);(typeof h=="string"||typeof h=="number")&&V._.push(h)}function K(c,h,x,F){let D,v=T(h,p.nargs);if(v=typeof v!="number"||isNaN(v)?1:v,v===0)return Pe(F)||(R=Error(b("Argument unexpected for: %s",h))),z(h,ne(h)),c;let A=Pe(F)?0:1;if(a["nargs-eats-options"])x.length-(c+1)+A<v&&(R=Error(b("Not enough arguments following: %s",h))),A=v;else{for(D=c+1;D<x.length&&(!x[D].match(/^-[^0-9]/)||x[D].match(_)||te(x[D]));D++)A++;A<v&&(R=Error(b("Not enough arguments following: %s",h)))}let I=Math.min(A,v);for(!Pe(F)&&I>0&&(z(h,F),I--),D=c+1;D<I+c+1;D++)z(h,x[D]);return c+I}function ae(c,h,x,F){let D=[],v=F||x[c+1],A=T(h,p.nargs);if(T(h,p.bools)&&!/^(true|false)$/.test(v))D.push(!0);else if(Pe(v)||Pe(F)&&/^-/.test(v)&&!_.test(v)&&!te(v)){if(f[h]!==void 0){let I=f[h];D=Array.isArray(I)?I:[I]}}else{Pe(F)||D.push(w(h,F,!0));for(let I=c+1;I<x.length&&!(!a["greedy-arrays"]&&D.length>0||A&&typeof A=="number"&&D.length>=A||(v=x[I],/^-/.test(v)&&!_.test(v)&&!te(v)));I++)c=I,D.push(w(h,v,s))}return typeof A=="number"&&(A&&D.length<A||isNaN(A)&&D.length===0)&&(R=Error(b("Not enough arguments following: %s",h))),z(h,D),c}function z(c,h,x=s){if(/-/.test(c)&&a["camel-case-expansion"]){let v=c.split(".").map(function(A){return st(A)}).join(".");y(c,v)}let F=w(c,h,x),D=c.split(".");Ne(V,D,F),p.aliases[c]&&p.aliases[c].forEach(function(v){let A=v.split(".");Ne(V,A,F)}),D.length>1&&a["dot-notation"]&&(p.aliases[D[0]]||[]).forEach(function(v){let A=v.split("."),I=[].concat(D);I.shift(),A=A.concat(I),(p.aliases[c]||[]).includes(A.join("."))||Ne(V,A,F)}),T(c,p.normalize)&&!T(c,p.arrays)&&[c].concat(p.aliases[c]||[]).forEach(function(A){Object.defineProperty(W,A,{enumerable:!0,get(){return h},set(I){h=typeof I=="string"?Ve.normalize(I):I}})})}function y(c,h){p.aliases[c]&&p.aliases[c].length||(p.aliases[c]=[h],C[h]=!0),p.aliases[h]&&p.aliases[h].length||y(h,c)}function w(c,h,x){x&&(h=pc(h)),(T(c,p.bools)||T(c,p.counts))&&typeof h=="string"&&(h=h==="true");let F=Array.isArray(h)?h.map(function(D){return S(c,D)}):S(c,h);return T(c,p.counts)&&(Pe(F)||typeof F=="boolean")&&(F=wr()),T(c,p.normalize)&&T(c,p.arrays)&&(Array.isArray(h)?F=h.map(D=>Ve.normalize(D)):F=Ve.normalize(h)),F}function S(c,h){return!a["parse-positional-numbers"]&&c==="_"||!T(c,p.strings)&&!T(c,p.bools)&&!Array.isArray(h)&&(cn(h)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${h}`)))||!Pe(h)&&T(c,p.numbers))&&(h=Number(h)),h}function N(c){let h=Object.create(null);k(h,p.aliases,f),Object.keys(p.configs).forEach(function(x){let F=c[x]||h[x];if(F)try{let D=null,v=Ve.resolve(Ve.cwd(),F),A=p.configs[x];if(typeof A=="function"){try{D=A(v)}catch(I){D=I}if(D instanceof Error){R=D;return}}else D=Ve.require(v);Y(D)}catch(D){D.name==="PermissionDenied"?R=D:c[x]&&(R=Error(b("Invalid JSON config file: %s",F)))}})}function Y(c,h){Object.keys(c).forEach(function(x){let F=c[x],D=h?h+"."+x:x;typeof F=="object"&&F!==null&&!Array.isArray(F)&&a["dot-notation"]?Y(F,D):(!$e(V,D.split("."))||T(D,p.arrays)&&a["combine-arrays"])&&z(D,F)})}function ce(){typeof m<"u"&&m.forEach(function(c){Y(c)})}function G(c,h){if(typeof d>"u")return;let x=typeof d=="string"?d:"",F=Ve.env();Object.keys(F).forEach(function(D){if(x===""||D.lastIndexOf(x,0)===0){let v=D.split("__").map(function(A,I){return I===0&&(A=A.substring(x.length)),st(A)});(h&&p.configs[v.join(".")]||!h)&&!$e(c,v)&&z(v.join("."),F[D])}})}function le(c){let h,x=new Set;Object.keys(c).forEach(function(F){if(!x.has(F)&&(h=T(F,p.coercions),typeof h=="function"))try{let D=S(F,h(c[F]));[].concat(p.aliases[F]||[],F).forEach(v=>{x.add(v),c[v]=D})}catch(D){R=D}})}function ke(c){return p.keys.forEach(h=>{~h.indexOf(".")||typeof c[h]>"u"&&(c[h]=void 0)}),c}function k(c,h,x,F=!1){Object.keys(x).forEach(function(D){$e(c,D.split("."))||(Ne(c,D.split("."),x[D]),F&&(E[D]=!0),(h[D]||[]).forEach(function(v){$e(c,v.split("."))||Ne(c,v.split("."),x[D])}))})}function $e(c,h){let x=c;a["dot-notation"]||(h=[h.join(".")]),h.slice(0,-1).forEach(function(D){x=x[D]||{}});let F=h[h.length-1];return typeof x!="object"?!1:F in x}function Ne(c,h,x){let F=c;a["dot-notation"]||(h=[h.join(".")]),h.slice(0,-1).forEach(function(fe){fe=fs(fe),typeof F=="object"&&F[fe]===void 0&&(F[fe]={}),typeof F[fe]!="object"||Array.isArray(F[fe])?(Array.isArray(F[fe])?F[fe].push({}):F[fe]=[F[fe],{}],F=F[fe][F[fe].length-1]):F=F[fe]});let D=fs(h[h.length-1]),v=T(h.join("."),p.arrays),A=Array.isArray(x),I=a["duplicate-arguments-array"];!I&&T(D,p.nargs)&&(I=!0,(!Pe(F[D])&&p.nargs[D]===1||Array.isArray(F[D])&&F[D].length===p.nargs[D])&&(F[D]=void 0)),x===wr()?F[D]=wr(F[D]):Array.isArray(F[D])?I&&v&&A?F[D]=a["flatten-duplicate-arrays"]?F[D].concat(x):(Array.isArray(F[D][0])?F[D]:[F[D]]).concat([x]):!I&&!!v==!!A?F[D]=x:F[D]=F[D].concat([x]):F[D]===void 0&&v?F[D]=A?x:[x]:I&&!(F[D]===void 0||T(D,p.counts)||T(D,p.bools))?F[D]=[F[D],x]:F[D]=x}function et(...c){c.forEach(function(h){Object.keys(h||{}).forEach(function(x){p.aliases[x]||(p.aliases[x]=[].concat(o[x]||[]),p.aliases[x].concat(x).forEach(function(F){if(/-/.test(F)&&a["camel-case-expansion"]){let D=st(F);D!==x&&p.aliases[x].indexOf(D)===-1&&(p.aliases[x].push(D),C[D]=!0)}}),p.aliases[x].concat(x).forEach(function(F){if(F.length>1&&/[A-Z]/.test(F)&&a["camel-case-expansion"]){let D=an(F,"-");D!==x&&p.aliases[x].indexOf(D)===-1&&(p.aliases[x].push(D),C[D]=!0)}}),p.aliases[x].forEach(function(F){p.aliases[F]=[x].concat(p.aliases[x].filter(function(D){return F!==D}))}))})})}function T(c,h){let x=[].concat(p.aliases[c]||[],c),F=Object.keys(h),D=x.find(v=>F.includes(v));return D?h[D]:!1}function Bn(c){let h=Object.keys(p);return[].concat(h.map(F=>p[F])).some(function(F){return Array.isArray(F)?F.includes(c):F[c]})}function j(c,...h){return[].concat(...h).some(function(F){let D=c.match(F);return D&&Bn(D[1])})}function Z(c){if(c.match(_)||!c.match(/^-[^-]+/))return!1;let h=!0,x,F=c.slice(1).split("");for(let D=0;D<F.length;D++){if(x=c.slice(D+2),!Bn(F[D])){h=!1;break}if(F[D+1]&&F[D+1]==="="||x==="-"||/[A-Za-z]/.test(F[D])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(x)||F[D+1]&&F[D+1].match(/\W/))break}return h}function te(c){return a["unknown-options-as-args"]&&H(c)}function H(c){return c=c.replace(/^-{3,}/,"--"),c.match(_)||Z(c)?!1:!j(c,/^-+([^=]+?)=[\s\S]*$/,L,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function ne(c){return!T(c,p.bools)&&!T(c,p.counts)&&`${c}`in f?f[c]:se(ve(c))}function se(c){return{[_e.BOOLEAN]:!0,[_e.STRING]:"",[_e.NUMBER]:void 0,[_e.ARRAY]:[]}[c]}function ve(c){let h=_e.BOOLEAN;return T(c,p.strings)?h=_e.STRING:T(c,p.numbers)?h=_e.NUMBER:T(c,p.bools)?h=_e.BOOLEAN:T(c,p.arrays)&&(h=_e.ARRAY),h}function Pe(c){return c===void 0}function Kt(){Object.keys(p.counts).find(c=>T(c,p.arrays)?(R=Error(b("Invalid configuration: %s, opts.count excludes opts.array.",c)),!0):T(c,p.nargs)?(R=Error(b("Invalid configuration: %s, opts.count excludes opts.narg.",c)),!0):!1)}return{aliases:Object.assign({},p.aliases),argv:Object.assign(W,V),configuration:a,defaulted:Object.assign({},E),error:R,newAliases:Object.assign({},C)}}};function dc(n){let e=[],t=Object.create(null),r=!0;for(Object.keys(n).forEach(function(i){e.push([].concat(n[i],i))});r;){r=!1;for(let i=0;i<e.length;i++)for(let s=i+1;s<e.length;s++)if(e[i].filter(function(a){return e[s].indexOf(a)!==-1}).length){e[i]=e[i].concat(e[s]),e.splice(s,1),r=!0;break}}return e.forEach(function(i){i=i.filter(function(o,a,f){return f.indexOf(o)===a});let s=i.pop();s!==void 0&&typeof s=="string"&&(t[s]=i)}),t}function wr(n){return n!==void 0?n+1:1}function fs(n){return n==="__proto__"?"___proto___":n}function pc(n){return typeof n=="string"&&(n[0]==="'"||n[0]==='"')&&n[n.length-1]===n[0]?n.substring(1,n.length-1):n}var ms=J("fs"),Br=J("node:module"),gc={};var yr,Ar,_r,Ds=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20,hs=(Ar=(yr=process==null?void 0:process.versions)===null||yr===void 0?void 0:yr.node)!==null&&Ar!==void 0?Ar:(_r=process==null?void 0:process.version)===null||_r===void 0?void 0:_r.slice(1);if(hs&&Number(hs.match(/^([^.]+)/)[1])<Ds)throw Error(`yargs parser supports a minimum Node.js version of ${Ds}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var mc=process?process.env:{},ds=Br.createRequire?(0,Br.createRequire)(gc.url):void 0,gs=new ln({cwd:process.cwd,env:()=>mc,format:ps.format,normalize:fn.normalize,resolve:fn.resolve,require:n=>{if(typeof ds<"u")return ds(n);if(n.match(/\.json$/))return JSON.parse((0,ms.readFileSync)(n,"utf8"));throw Error("only .json config files are supported in ESM")}}),Ht=function(e,t){return gs.parse(e.slice(),t).argv};Ht.detailed=function(n,e){return gs.parse(n.slice(),e)};Ht.camelCase=st;Ht.decamelize=an;Ht.looksLikeNumber=cn;var Fs=Ht;var xe=J("path");function Fc(){return Cc()?0:1}function Cc(){return Ec()&&!process.defaultApp}function Ec(){return!!process.versions.electron}function Cs(){return process.argv[Fc()]}var bc=new Intl.Segmenter,Es=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Nonspacing_Mark}|\p{Enclosing_Mark}|\p{Surrogate})+$/v,xc=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Nonspacing_Mark}\p{Enclosing_Mark}\p{Surrogate}]+/v,wc=/\p{Spacing_Mark}/v,yc=/^\p{RGI_Emoji}$/v,Ac=/^[\d#*]\u20E3$/,_c=/\p{Extended_Pictographic}/gu;function Bc(n){if(n.length>50)return!1;if(Ac.test(n))return!0;if(n.includes("\u200D")){let e=n.match(_c);return e!==null&&e.length>=2}return!1}function Oc(n){return n.replace(xc,"")}function Sc(n){return Es.test(n)}function bs(n){return n>=4352&&n<=4447||n>=43360&&n<=43388}function xs(n){return n>=4448&&n<=4519||n>=55216&&n<=55238}function ws(n){return n>=4520&&n<=4607||n>=55243&&n<=55291}function vc(n){return bs(n)||xs(n)||ws(n)}function Pc(n,e){let t=[];for(let i of n)Es.test(i)||t.push(i.codePointAt(0));if(t.length===0)return;let r=0;for(let i=0;i<t.length;i++){let s=t[i];if(!vc(s)){if(r===0)return;for(let o=i;o<t.length;o++)r+=it(t[o],e);return r}if(bs(s)&&xs(t[i+1])){r+=2,i+=ws(t[i+2])?2:1;continue}r+=it(s,e)}return r}function Ic(n,e){let t=0,r=!0;for(let i of n){if(r){r=!1;continue}(wc.test(i)||i>="\uFF00"&&i<="\uFFEF")&&(t+=it(i.codePointAt(0),e))}return t}function Or(n,e={}){if(typeof n!="string"||n.length===0)return 0;let{ambiguousIsNarrow:t=!0,countAnsiEscapeCodes:r=!1}=e,i=n;if(!r&&(i.includes("\x1B")||i.includes("\x9B"))&&(i=ze(i)),i.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(i))return i.length;let s=0,o={ambiguousAsWide:!t};for(let{segment:a}of bc.segment(i)){if(Sc(a))continue;if(yc.test(a)||Bc(a)){s+=2;continue}let f=Oc(a),m=Pc(f,o);if(m!==void 0){s+=m;continue}let d=f.codePointAt(0);s+=it(d,o),s+=Ic(f,o)}return s}var Pt=J("fs"),ys=J("util"),As=J("path"),_s={fs:{readFileSync:Pt.readFileSync,writeFile:Pt.writeFile},format:ys.format,resolve:As.resolve,exists:n=>{try{return(0,Pt.statSync)(n).isFile()}catch{return!1}}};var Ie,Sr=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let t=e.shift(),r=function(){};return typeof e[e.length-1]=="function"&&(r=e.pop()),r=r||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:r})):r(),Ie.format.apply(Ie.format,[this.cache[this.locale][t]||t].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),t=e.shift(),r=e.shift(),i=e.shift(),s=function(){};typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let o=i===1?t:r;this.cache[this.locale][t]&&(o=this.cache[this.locale][t][i===1?"one":"other"]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:r},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let a=[o];return~o.indexOf("%d")&&a.push(i),Ie.format.apply(Ie.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let r="";return e.forEach(function(i,s){let o=t[s+1];r+=i,typeof o<"u"&&(r+="%s")}),this.__.apply(this,[r].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,t=this.writeQueue[0],r=t.directory,i=t.locale,s=t.cb,o=this._resolveLocaleFile(r,i),a=JSON.stringify(this.cache[i],null,2);Ie.fs.writeFile(o,a,"utf-8",function(f){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(f)})}_readLocaleFile(){let e={},t=this._resolveLocaleFile(this.directory,this.locale);try{Ie.fs.readFileSync&&(e=JSON.parse(Ie.fs.readFileSync(t,"utf-8")))}catch(r){if(r instanceof SyntaxError&&(r.message="syntax error in "+t),r.code==="ENOENT")e={};else throw r}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let r=Ie.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~t.lastIndexOf("_")){let i=Ie.resolve(e,"./",t.split("_")[0]+".json");this._fileExistsSync(i)&&(r=i)}return r}_fileExistsSync(e){return Ie.exists(e)}};function Bs(n,e){Ie=e;let t=new Sr(n);return{__:t.__.bind(t),__n:t.__n.bind(t),setLocale:t.setLocale.bind(t),getLocale:t.getLocale.bind(t),updateLocale:t.updateLocale.bind(t),locale:t.locale}}var jc=n=>Bs(n,_s),Os=jc;var Is=J("node:module"),js=Ct(vs(),1),hn=J("node:fs"),Ts={},vr=(0,Pr.fileURLToPath)(Ts.url),Mc=vr.substring(0,vr.lastIndexOf("node_modules")),Tc=(0,Is.createRequire)(Ts.url),Ms={assert:{notStrictEqual:Dn.notStrictEqual,strictEqual:Dn.strictEqual},cliui:xr,findUp:cs,getEnv:n=>process.env[n],inspect:Ps.inspect,getProcessArgvBin:Cs,mainFilename:Mc||process.cwd(),Parser:Fs,path:{basename:xe.basename,dirname:xe.dirname,extname:xe.extname,relative:xe.relative,resolve:xe.resolve,join:xe.join},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(n,e)=>process.emitWarning(n,e),execPath:()=>process.execPath,exit:n=>{process.exit(n)},nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:hn.readFileSync,readdirSync:hn.readdirSync,require:Tc,getCallerFile:()=>{let n=(0,js.default)(3);return n.match(/^file:\/\//)?(0,Pr.fileURLToPath)(n):n},stringWidth:Or,y18n:Os({directory:(0,xe.resolve)(vr,"../../../locales"),updateFiles:!1})};function Fe(n,e,t,r){t.assert.notStrictEqual(n,e,r)}function Ir(n,e){e.assert.strictEqual(typeof n,"string")}function It(n){return Object.keys(n)}function Q(n){return!!n&&!!n.then&&typeof n.then=="function"}var oe=class n extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,n)}};function Ye(n){let t=n.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),r=/\.*[\][<>]/g,i=t.shift();if(!i)throw new Error(`No command found in: ${n}`);let s={cmd:i.replace(r,""),demanded:[],optional:[]};return t.forEach((o,a)=>{let f=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&a===t.length-1&&(f=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(r,"").split("|"),variadic:f}):s.demanded.push({cmd:o.replace(r,"").split("|"),variadic:f})}),s}var $c=["first","second","third","fourth","fifth","sixth"];function B(n,e,t){function r(){return typeof n=="object"?[{demanded:[],optional:[]},n,e]:[Ye(`cmd ${n}`),e,t]}try{let i=0,[s,o,a]=r(),f=[].slice.call(o);for(;f.length&&f[f.length-1]===void 0;)f.pop();let m=a||f.length;if(m<s.demanded.length)throw new oe(`Not enough arguments provided. Expected ${s.demanded.length} but received ${f.length}.`);let d=s.demanded.length+s.optional.length;if(m>d)throw new oe(`Too many arguments provided. Expected max ${d} but received ${m}.`);s.demanded.forEach(l=>{let g=f.shift(),C=$s(g);l.cmd.filter(b=>b===C||b==="*").length===0&&Ns(C,l.cmd,i),i+=1}),s.optional.forEach(l=>{if(f.length===0)return;let g=f.shift(),C=$s(g);l.cmd.filter(b=>b===C||b==="*").length===0&&Ns(C,l.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function $s(n){return Array.isArray(n)?"array":n===null?"null":typeof n}function Ns(n,e,t){throw new oe(`Invalid ${$c[t]||"manyith"} argument. Expected ${e.join(" or ")} but received ${n}.`)}var dn=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,r=!0,i=!1){if(B("<array|function> [boolean] [boolean] [boolean]",[e,t,r],arguments.length),Array.isArray(e)){for(let s=0;s<e.length;s++){if(typeof e[s]!="function")throw Error("middleware must be a function");let o=e[s];o.applyBeforeValidation=t,o.global=r}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){let s=e;s.applyBeforeValidation=t,s.global=r,s.mutates=i,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){let r=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let s=[...r[t]||[],t];return i.option?!s.includes(i.option):!0}),e.option=t,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function Ls(n){return n?n.map(e=>(e.applyBeforeValidation=!1,e)):[]}function ot(n,e,t,r){return t.reduce((i,s)=>{if(s.applyBeforeValidation!==r)return i;if(s.mutates){if(s.applied)return i;s.applied=!0}if(Q(i))return i.then(o=>Promise.all([o,s(o,e)])).then(([o,a])=>Object.assign(o,a));{let o=s(i,e);return Q(o)?o.then(a=>Object.assign(i,a)):Object.assign(i,o)}},n)}function ut(n,e,t=r=>{throw r}){try{let r=Nc(n)?n():n;return Q(r)?r.then(i=>e(i)):e(r)}catch(r){return t(r)}}function Nc(n){return typeof n=="function"}var jt=/(^\*)|(^\$0)/,jr=class{constructor(e,t,r,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=e,this.globalMiddleware=r,this.validation=t}addDirectory(e,t,r,i){i=i||{},this.requireCache.add(r);let s=this.shim.path.resolve(this.shim.path.dirname(r),e),o=this.shim.readdirSync(s,{recursive:!!i.recurse});Array.isArray(i.extensions)||(i.extensions=["js"]);let a=typeof i.visit=="function"?i.visit:f=>f;for(let f of o){let m=f.toString();if(i.exclude){let l=!1;if(typeof i.exclude=="function"?l=i.exclude(m):l=i.exclude.test(m),l)continue}if(i.include){let l=!1;if(typeof i.include=="function"?l=i.include(m):l=i.include.test(m),!l)continue}let d=!1;for(let l of i.extensions)m.endsWith(l)&&(d=!0);if(d){let l=this.shim.path.join(s,m),g=t(l),C=Object.create(null,Object.getOwnPropertyDescriptors({...g}));if(a(C,l,m)){if(this.requireCache.has(l))continue;this.requireCache.add(l),C.command||(C.command=this.shim.path.basename(l,this.shim.path.extname(l))),this.addHandler(C)}}}}addHandler(e,t,r,i,s,o){let a=[],f=Ls(s);if(i=i||(()=>{}),Array.isArray(e))if(Lc(e))[e,...a]=e;else for(let m of e)this.addHandler(m);else if(Rc(e)){let m=Array.isArray(e.command)||typeof e.command=="string"?e.command:null;if(m===null)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);e.aliases&&(m=[].concat(m).concat(e.aliases)),this.addHandler(m,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(Us(r)){this.addHandler([e].concat(a),t,r.builder,r.handler,r.middlewares,r.deprecated);return}if(typeof e=="string"){let m=Ye(e);a=a.map(g=>Ye(g).cmd);let d=!1,l=[m.cmd].concat(a).filter(g=>jt.test(g)?(d=!0,!1):!0);l.length===0&&d&&l.push("$0"),d&&(m.cmd=l[0],a=l.slice(1),e=e.replace(jt,m.cmd)),a.forEach(g=>{this.aliasMap[g]=m.cmd}),t!==!1&&this.usage.command(e,t,d,a,o),this.handlers[m.cmd]={original:e,description:t,handler:i,builder:r||{},middlewares:f,deprecated:o,demanded:m.demanded,optional:m.optional},d&&(this.defaultCommand=this.handlers[m.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,r,i,s,o){let a=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,f=t.getInternalMethods().getContext(),m=f.commands.slice(),d=!e;e&&(f.commands.push(e),f.fullCommands.push(a.original));let l=this.applyBuilderUpdateUsageAndParse(d,a,t,r.aliases,m,i,s,o);return Q(l)?l.then(g=>this.applyMiddlewareAndGetResult(d,a,g.innerArgv,f,s,g.aliases,t)):this.applyMiddlewareAndGetResult(d,a,l.innerArgv,f,s,l.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,r,i,s,o,a,f){let m=t.builder,d=r;if(pn(m)){r.getInternalMethods().getUsageInstance().freeze();let l=m(r.getInternalMethods().reset(i),f);if(Q(l))return l.then(g=>(d=zs(g)?g:r,this.parseAndUpdateUsage(e,t,d,s,o,a)))}else Uc(m)&&(r.getInternalMethods().getUsageInstance().freeze(),d=r.getInternalMethods().reset(i),Object.keys(t.builder).forEach(l=>{d.option(l,m[l])}));return this.parseAndUpdateUsage(e,t,d,s,o,a)}parseAndUpdateUsage(e,t,r,i,s,o){e&&r.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(r)&&r.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,t),t.description);let a=r.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return Q(a)?a.then(f=>({aliases:r.parsed.aliases,innerArgv:f})):{aliases:r.parsed.aliases,innerArgv:a}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){let r=jt.test(t.original)?t.original.replace(jt,"").trim():t.original,i=e.filter(s=>!jt.test(s));return i.push(r),`$0 ${i.join(" ")}`}handleValidationAndGetResult(e,t,r,i,s,o,a,f){if(!o.getInternalMethods().getHasOutput()){let m=o.getInternalMethods().runValidation(s,f,o.parsed.error,e);r=ut(r,d=>(m(d),d))}if(t.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();let m=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(r,m,!1,!1),r=ot(r,o,a,!1),r=ut(r,d=>{let l=t.handler(d);return Q(l)?l.then(()=>d):d}),e||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),Q(r)&&!o.getInternalMethods().hasParseCallback()&&r.catch(d=>{try{o.getInternalMethods().getUsageInstance().fail(null,d)}catch{}})}return e||(i.commands.pop(),i.fullCommands.pop()),r}applyMiddlewareAndGetResult(e,t,r,i,s,o,a){let f={};if(s)return r;a.getInternalMethods().getHasOutput()||(f=this.populatePositionals(t,r,i,a));let m=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares),d=ot(r,a,m,!0);return Q(d)?d.then(l=>this.handleValidationAndGetResult(e,t,l,i,o,a,m,f)):this.handleValidationAndGetResult(e,t,d,i,o,a,m,f)}populatePositionals(e,t,r,i){t._=t._.slice(r.commands.length);let s=e.demanded.slice(0),o=e.optional.slice(0),a={};for(this.validation.positionalCount(s.length,t._.length);s.length;){let f=s.shift();this.populatePositional(f,t,a)}for(;o.length;){let f=o.shift();this.populatePositional(f,t,a)}return t._=r.commands.concat(t._.map(f=>""+f)),this.postProcessPositionals(t,a,this.cmdToParseOptions(e.original),i),a}populatePositional(e,t,r){let i=e.cmd[0];e.variadic?r[i]=t._.splice(0).map(String):t._.length&&(r[i]=[String(t._.shift())])}cmdToParseOptions(e){let t={array:[],default:{},alias:{},demand:{}},r=Ye(e);return r.demanded.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(t.array.push(s),t.default[s]=[]),t.alias[s]=o,t.demand[s]=!0}),r.optional.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(t.array.push(s),t.default[s]=[]),t.alias[s]=o}),t}postProcessPositionals(e,t,r,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(r.default,s.default);for(let m of Object.keys(r.alias))s.alias[m]=(s.alias[m]||[]).concat(r.alias[m]);s.array=s.array.concat(r.array),s.config={};let o=[];if(Object.keys(t).forEach(m=>{t[m].map(d=>{s.configuration["unknown-options-as-args"]&&(s.key[m]=!0),o.push(`--${m}`),o.push(d)})}),!o.length)return;let a=Object.assign({},s.configuration,{"populate--":!1}),f=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:a}));if(f.error)i.getInternalMethods().getUsageInstance().fail(f.error.message,f.error);else{let m=Object.keys(t);Object.keys(t).forEach(d=>{m.push(...f.aliases[d])}),Object.keys(f.argv).forEach(d=>{m.includes(d)&&(t[d]||(t[d]=f.argv[d]),!this.isInConfigs(i,d)&&!this.isDefaulted(i,d)&&Object.prototype.hasOwnProperty.call(e,d)&&Object.prototype.hasOwnProperty.call(f.argv,d)&&(Array.isArray(e[d])||Array.isArray(f.argv[d]))?e[d]=[].concat(e[d],f.argv[d]):e[d]=f.argv[d])})}}isDefaulted(e,t){let{default:r}=e.getOptions();return Object.prototype.hasOwnProperty.call(r,t)||Object.prototype.hasOwnProperty.call(r,this.shim.Parser.camelCase(t))}isInConfigs(e,t){let{configObjects:r}=e.getOptions();return r.some(i=>Object.prototype.hasOwnProperty.call(i,t))||r.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(t)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let r=jt.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(r,this.defaultCommand.description)}let t=this.defaultCommand.builder;if(pn(t))return t(e,!0);Us(t)||Object.keys(t).forEach(r=>{e.option(r,t[r])})}extractDesc({describe:e,description:t,desc:r}){for(let i of[e,t,r]){if(typeof i=="string"||i===!1)return i;Fe(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();Fe(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function Rs(n,e,t,r){return new jr(n,e,t,r)}function Us(n){return typeof n=="object"&&!!n.builder&&typeof n.handler=="function"}function Lc(n){return n.every(e=>typeof e=="string")}function pn(n){return typeof n=="function"}function Uc(n){return typeof n=="object"}function Rc(n){return typeof n=="object"&&!Array.isArray(n)}function Ke(n={},e=()=>!0){let t={};return It(n).forEach(r=>{e(r,n[r])&&(t[r]=n[r])}),t}function Je(n){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let t=e;t._handle&&t.isTTY&&typeof t._handle.setBlocking=="function"&&t._handle.setBlocking(n)})}function zc(n){return typeof n=="boolean"}function Vs(n,e){let t=e.y18n.__,r={},i=[];r.failFn=function(w){i.push(w)};let s=null,o=null,a=!0;r.showHelpOnFail=function(w=!0,S){let[N,Y]=typeof w=="string"?[!0,w]:[w,S];return n.getInternalMethods().isGlobalContext()&&(o=Y),s=Y,a=N,r};let f=!1;r.fail=function(w,S){let N=n.getInternalMethods().getLoggerInstance();if(i.length)for(let Y=i.length-1;Y>=0;--Y){let ce=i[Y];if(zc(ce)){if(S)throw S;if(w)throw Error(w)}else ce(w,S,r)}else{if(n.getExitProcess()&&Je(!0),!f){f=!0,a&&(n.showHelp("error"),N.error()),(w||S)&&N.error(w||S);let Y=s||o;Y&&((w||S)&&N.error(""),N.error(Y))}if(S=S||new oe(w),n.getExitProcess())return n.exit(1);if(n.getInternalMethods().hasParseCallback())return n.exit(1,S);throw S}};let m=[],d=!1;r.usage=(y,w)=>y===null?(d=!0,m=[],r):(d=!1,m.push([y,w||""]),r),r.getUsage=()=>m,r.getUsageDisabled=()=>d,r.getPositionalGroupName=()=>t("Positionals:");let l=[];r.example=(y,w)=>{l.push([y,w||""])};let g=[];r.command=function(w,S,N,Y,ce=!1){N&&(g=g.map(G=>(G[2]=!1,G))),g.push([w,S||"",N,Y,ce])},r.getCommands=()=>g;let C={};r.describe=function(w,S){Array.isArray(w)?w.forEach(N=>{r.describe(N,S)}):typeof w=="object"?Object.keys(w).forEach(N=>{r.describe(N,w[N])}):C[w]=S},r.getDescriptions=()=>C;let E=[];r.epilog=y=>{E.push(y)};let b=!1,p;r.wrap=y=>{b=!0,p=y},r.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(b||(p=K(),b=!0),p);let _="__yargsString__:";r.deferY18nLookup=y=>_+y,r.help=function(){if(U)return U;R();let w=n.customScriptName?n.$0:e.path.basename(n.$0),S=n.getDemandedOptions(),N=n.getDemandedCommands(),Y=n.getDeprecatedOptions(),ce=n.getGroups(),G=n.getOptions(),le=[];le=le.concat(Object.keys(C)),le=le.concat(Object.keys(S)),le=le.concat(Object.keys(N)),le=le.concat(Object.keys(G.default)),le=le.filter(W),le=Object.keys(le.reduce((j,Z)=>(Z!=="_"&&(j[Z]=!0),j),{}));let ke=r.getWrap(),k=e.cliui({width:ke,wrap:!!ke});if(!d){if(m.length)m.forEach(j=>{k.div({text:`${j[0].replace(/\$0/g,w)}`}),j[1]&&k.div({text:`${j[1]}`,padding:[1,0,0,0]})}),k.div();else if(g.length){let j=null;N._?j=`${w} <${t("command")}>
13
+ `).map(r=>dc(r,e,t)).join(`
14
+ `)}function xr(n){return zi(n,{stringWidth:We,stripAnsi:ze,wrap:br})}var vt=J("path"),un=J("fs");function cs(n,e){let t=(0,vt.resolve)(".",n),r;for((0,un.statSync)(t).isDirectory()||(t=(0,vt.dirname)(t));;){if(r=e(t,(0,un.readdirSync)(t)),r)return(0,vt.resolve)(t,r);if(t=(0,vt.dirname)(r=t),r===t)break}}var Ps=J("util"),Pr=J("url");var ps=J("util"),fn=J("path");function st(n){if(n!==n.toLowerCase()&&n!==n.toUpperCase()||(n=n.toLowerCase()),n.indexOf("-")===-1&&n.indexOf("_")===-1)return n;{let t="",r=!1,i=n.match(/^-+/);for(let s=i?i[0].length:0;s<n.length;s++){let o=n.charAt(s);r&&(r=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?r=!0:o!=="-"&&o!=="_"&&(t+=o)}return t}}function an(n,e){let t=n.toLowerCase();e=e||"-";let r="";for(let i=0;i<n.length;i++){let s=t.charAt(i),o=n.charAt(i);s!==o&&i>0?r+=`${e}${t.charAt(i)}`:r+=o}return r}function cn(n){return n==null?!1:typeof n=="number"||/^0x[0-9a-f]+$/i.test(n)?!0:/^0[^.]/.test(n)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(n)}function ls(n){if(Array.isArray(n))return n.map(o=>typeof o!="string"?o+"":o);n=n.trim();let e=0,t=null,r=null,i=null,s=[];for(let o=0;o<n.length;o++){if(t=r,r=n.charAt(o),r===" "&&!i){t!==" "&&e++;continue}r===i?i=null:(r==="'"||r==='"')&&!i&&(i=r),s[e]||(s[e]=""),s[e]+=r}return s}var _e;(function(n){n.BOOLEAN="boolean",n.STRING="string",n.NUMBER="number",n.ARRAY="array"})(_e||(_e={}));var Ve,ln=class{constructor(e){Ve=e}parse(e,t){let r=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),i=ls(e),s=typeof e=="string",o=pc(Object.assign(Object.create(null),r.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},r.configuration),l=Object.assign(Object.create(null),r.default),d=r.configObjects||[],p=r.envPrefix,f=a["populate--"],g=f?"--":"_",C=Object.create(null),E=Object.create(null),b=r.__||Ve.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},y=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,U=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(r.array||[]).filter(Boolean).forEach(function(c){let D=typeof c=="object"?c.key:c,x=Object.keys(c).map(function(F){return{boolean:"bools",string:"strings",number:"numbers"}[F]}).filter(Boolean).pop();x&&(m[x][D]=!0),m.arrays[D]=!0,m.keys.push(D)}),[].concat(r.boolean||[]).filter(Boolean).forEach(function(c){m.bools[c]=!0,m.keys.push(c)}),[].concat(r.string||[]).filter(Boolean).forEach(function(c){m.strings[c]=!0,m.keys.push(c)}),[].concat(r.number||[]).filter(Boolean).forEach(function(c){m.numbers[c]=!0,m.keys.push(c)}),[].concat(r.count||[]).filter(Boolean).forEach(function(c){m.counts[c]=!0,m.keys.push(c)}),[].concat(r.normalize||[]).filter(Boolean).forEach(function(c){m.normalize[c]=!0,m.keys.push(c)}),typeof r.narg=="object"&&Object.entries(r.narg).forEach(([c,D])=>{typeof D=="number"&&(m.nargs[c]=D,m.keys.push(c))}),typeof r.coerce=="object"&&Object.entries(r.coerce).forEach(([c,D])=>{typeof D=="function"&&(m.coercions[c]=D,m.keys.push(c))}),typeof r.config<"u"&&(Array.isArray(r.config)||typeof r.config=="string"?[].concat(r.config).filter(Boolean).forEach(function(c){m.configs[c]=!0}):typeof r.config=="object"&&Object.entries(r.config).forEach(([c,D])=>{(typeof D=="boolean"||typeof D=="function")&&(m.configs[c]=D)})),et(r.key,o,r.default,m.arrays),Object.keys(l).forEach(function(c){(m.aliases[c]||[]).forEach(function(D){l[D]=l[c]})});let L=null;Kt();let R=[],V=Object.assign(Object.create(null),{_:[]}),W={};for(let c=0;c<i.length;c++){let D=i[c],x=D.replace(/^-{3,}/,"---"),F,h,v,_,I,fe;if(D!=="--"&&/^-/.test(D)&&te(D))q(D);else if(x.match(/^---+(=|$)/)){q(D);continue}else if(D.match(/^--.+=/)||!a["short-option-groups"]&&D.match(/^-.+=/))_=D.match(/^--?([^=]+)=([\s\S]*)$/),_!==null&&Array.isArray(_)&&_.length>=3&&(T(_[1],m.arrays)?c=ae(c,_[1],i,_[2]):T(_[1],m.nargs)!==!1?c=K(c,_[1],i,_[2]):z(_[1],_[2],!0));else if(D.match(U)&&a["boolean-negation"])_=D.match(U),_!==null&&Array.isArray(_)&&_.length>=2&&(h=_[1],z(h,T(h,m.arrays)?[!1]:!1));else if(D.match(/^--.+/)||!a["short-option-groups"]&&D.match(/^-[^-]+/))_=D.match(/^--?(.+)/),_!==null&&Array.isArray(_)&&_.length>=2&&(h=_[1],T(h,m.arrays)?c=ae(c,h,i):T(h,m.nargs)!==!1?c=K(c,h,i):(I=i[c+1],I!==void 0&&(!I.match(/^-/)||I.match(y))&&!T(h,m.bools)&&!T(h,m.counts)||/^(true|false)$/.test(I)?(z(h,I),c++):z(h,ne(h))));else if(D.match(/^-.\..+=/))_=D.match(/^-([^=]+)=([\s\S]*)$/),_!==null&&Array.isArray(_)&&_.length>=3&&z(_[1],_[2]);else if(D.match(/^-.\..+/)&&!D.match(y))I=i[c+1],_=D.match(/^-(.\..+)/),_!==null&&Array.isArray(_)&&_.length>=2&&(h=_[1],I!==void 0&&!I.match(/^-/)&&!T(h,m.bools)&&!T(h,m.counts)?(z(h,I),c++):z(h,ne(h)));else if(D.match(/^-[^-]+/)&&!D.match(y)){v=D.slice(1,-1).split(""),F=!1;for(let me=0;me<v.length;me++){if(I=D.slice(me+2),v[me+1]&&v[me+1]==="="){fe=D.slice(me+3),h=v[me],T(h,m.arrays)?c=ae(c,h,i,fe):T(h,m.nargs)!==!1?c=K(c,h,i,fe):z(h,fe),F=!0;break}if(I==="-"){z(v[me],I);continue}if(/[A-Za-z]/.test(v[me])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(I)&&T(I,m.bools)===!1){z(v[me],I),F=!0;break}if(v[me+1]&&v[me+1].match(/\W/)){z(v[me],I),F=!0;break}else z(v[me],ne(v[me]))}h=D.slice(-1)[0],!F&&h!=="-"&&(T(h,m.arrays)?c=ae(c,h,i):T(h,m.nargs)!==!1?c=K(c,h,i):(I=i[c+1],I!==void 0&&(!/^(-|--)[^-]/.test(I)||I.match(y))&&!T(h,m.bools)&&!T(h,m.counts)||/^(true|false)$/.test(I)?(z(h,I),c++):z(h,ne(h))))}else if(D.match(/^-[0-9]$/)&&D.match(y)&&T(D.slice(1),m.bools))h=D.slice(1),z(h,ne(h));else if(D==="--"){R=i.slice(c+1);break}else if(a["halt-at-non-option"]){R=i.slice(c);break}else q(D)}G(V,!0),G(V,!1),N(V),ce(),k(V,m.aliases,l,!0),le(V),a["set-placeholder-key"]&&ke(V),Object.keys(m.counts).forEach(function(c){$e(V,c.split("."))||z(c,0)}),f&&R.length&&(V[g]=[]),R.forEach(function(c){V[g].push(c)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(V).filter(c=>c!=="--"&&c.includes("-")).forEach(c=>{delete V[c]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(c=>o[c])).forEach(c=>{a["camel-case-expansion"]&&c.includes("-")&&delete V[c.split(".").map(D=>st(D)).join(".")],delete V[c]});function q(c){let D=S("_",c);(typeof D=="string"||typeof D=="number")&&V._.push(D)}function K(c,D,x,F){let h,v=T(D,m.nargs);if(v=typeof v!="number"||isNaN(v)?1:v,v===0)return Pe(F)||(L=Error(b("Argument unexpected for: %s",D))),z(D,ne(D)),c;let _=Pe(F)?0:1;if(a["nargs-eats-options"])x.length-(c+1)+_<v&&(L=Error(b("Not enough arguments following: %s",D))),_=v;else{for(h=c+1;h<x.length&&(!x[h].match(/^-[^0-9]/)||x[h].match(y)||te(x[h]));h++)_++;_<v&&(L=Error(b("Not enough arguments following: %s",D)))}let I=Math.min(_,v);for(!Pe(F)&&I>0&&(z(D,F),I--),h=c+1;h<I+c+1;h++)z(D,x[h]);return c+I}function ae(c,D,x,F){let h=[],v=F||x[c+1],_=T(D,m.nargs);if(T(D,m.bools)&&!/^(true|false)$/.test(v))h.push(!0);else if(Pe(v)||Pe(F)&&/^-/.test(v)&&!y.test(v)&&!te(v)){if(l[D]!==void 0){let I=l[D];h=Array.isArray(I)?I:[I]}}else{Pe(F)||h.push(w(D,F,!0));for(let I=c+1;I<x.length&&!(!a["greedy-arrays"]&&h.length>0||_&&typeof _=="number"&&h.length>=_||(v=x[I],/^-/.test(v)&&!y.test(v)&&!te(v)));I++)c=I,h.push(w(D,v,s))}return typeof _=="number"&&(_&&h.length<_||isNaN(_)&&h.length===0)&&(L=Error(b("Not enough arguments following: %s",D))),z(D,h),c}function z(c,D,x=s){if(/-/.test(c)&&a["camel-case-expansion"]){let v=c.split(".").map(function(_){return st(_)}).join(".");A(c,v)}let F=w(c,D,x),h=c.split(".");Ne(V,h,F),m.aliases[c]&&m.aliases[c].forEach(function(v){let _=v.split(".");Ne(V,_,F)}),h.length>1&&a["dot-notation"]&&(m.aliases[h[0]]||[]).forEach(function(v){let _=v.split("."),I=[].concat(h);I.shift(),_=_.concat(I),(m.aliases[c]||[]).includes(_.join("."))||Ne(V,_,F)}),T(c,m.normalize)&&!T(c,m.arrays)&&[c].concat(m.aliases[c]||[]).forEach(function(_){Object.defineProperty(W,_,{enumerable:!0,get(){return D},set(I){D=typeof I=="string"?Ve.normalize(I):I}})})}function A(c,D){m.aliases[c]&&m.aliases[c].length||(m.aliases[c]=[D],C[D]=!0),m.aliases[D]&&m.aliases[D].length||A(D,c)}function w(c,D,x){x&&(D=mc(D)),(T(c,m.bools)||T(c,m.counts))&&typeof D=="string"&&(D=D==="true");let F=Array.isArray(D)?D.map(function(h){return S(c,h)}):S(c,D);return T(c,m.counts)&&(Pe(F)||typeof F=="boolean")&&(F=wr()),T(c,m.normalize)&&T(c,m.arrays)&&(Array.isArray(D)?F=D.map(h=>Ve.normalize(h)):F=Ve.normalize(D)),F}function S(c,D){return!a["parse-positional-numbers"]&&c==="_"||!T(c,m.strings)&&!T(c,m.bools)&&!Array.isArray(D)&&(cn(D)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${D}`)))||!Pe(D)&&T(c,m.numbers))&&(D=Number(D)),D}function N(c){let D=Object.create(null);k(D,m.aliases,l),Object.keys(m.configs).forEach(function(x){let F=c[x]||D[x];if(F)try{let h=null,v=Ve.resolve(Ve.cwd(),F),_=m.configs[x];if(typeof _=="function"){try{h=_(v)}catch(I){h=I}if(h instanceof Error){L=h;return}}else h=Ve.require(v);Y(h)}catch(h){h.name==="PermissionDenied"?L=h:c[x]&&(L=Error(b("Invalid JSON config file: %s",F)))}})}function Y(c,D){Object.keys(c).forEach(function(x){let F=c[x],h=D?D+"."+x:x;typeof F=="object"&&F!==null&&!Array.isArray(F)&&a["dot-notation"]?Y(F,h):(!$e(V,h.split("."))||T(h,m.arrays)&&a["combine-arrays"])&&z(h,F)})}function ce(){typeof d<"u"&&d.forEach(function(c){Y(c)})}function G(c,D){if(typeof p>"u")return;let x=typeof p=="string"?p:"",F=Ve.env();Object.keys(F).forEach(function(h){if(x===""||h.lastIndexOf(x,0)===0){let v=h.split("__").map(function(_,I){return I===0&&(_=_.substring(x.length)),st(_)});(D&&m.configs[v.join(".")]||!D)&&!$e(c,v)&&z(v.join("."),F[h])}})}function le(c){let D,x=new Set;Object.keys(c).forEach(function(F){if(!x.has(F)&&(D=T(F,m.coercions),typeof D=="function"))try{let h=S(F,D(c[F]));[].concat(m.aliases[F]||[],F).forEach(v=>{x.add(v),c[v]=h})}catch(h){L=h}})}function ke(c){return m.keys.forEach(D=>{~D.indexOf(".")||typeof c[D]>"u"&&(c[D]=void 0)}),c}function k(c,D,x,F=!1){Object.keys(x).forEach(function(h){$e(c,h.split("."))||(Ne(c,h.split("."),x[h]),F&&(E[h]=!0),(D[h]||[]).forEach(function(v){$e(c,v.split("."))||Ne(c,v.split("."),x[h])}))})}function $e(c,D){let x=c;a["dot-notation"]||(D=[D.join(".")]),D.slice(0,-1).forEach(function(h){x=x[h]||{}});let F=D[D.length-1];return typeof x!="object"?!1:F in x}function Ne(c,D,x){let F=c;a["dot-notation"]||(D=[D.join(".")]),D.slice(0,-1).forEach(function(fe){fe=fs(fe),typeof F=="object"&&F[fe]===void 0&&(F[fe]={}),typeof F[fe]!="object"||Array.isArray(F[fe])?(Array.isArray(F[fe])?F[fe].push({}):F[fe]=[F[fe],{}],F=F[fe][F[fe].length-1]):F=F[fe]});let h=fs(D[D.length-1]),v=T(D.join("."),m.arrays),_=Array.isArray(x),I=a["duplicate-arguments-array"];!I&&T(h,m.nargs)&&(I=!0,(!Pe(F[h])&&m.nargs[h]===1||Array.isArray(F[h])&&F[h].length===m.nargs[h])&&(F[h]=void 0)),x===wr()?F[h]=wr(F[h]):Array.isArray(F[h])?I&&v&&_?F[h]=a["flatten-duplicate-arrays"]?F[h].concat(x):(Array.isArray(F[h][0])?F[h]:[F[h]]).concat([x]):!I&&!!v==!!_?F[h]=x:F[h]=F[h].concat([x]):F[h]===void 0&&v?F[h]=_?x:[x]:I&&!(F[h]===void 0||T(h,m.counts)||T(h,m.bools))?F[h]=[F[h],x]:F[h]=x}function et(...c){c.forEach(function(D){Object.keys(D||{}).forEach(function(x){m.aliases[x]||(m.aliases[x]=[].concat(o[x]||[]),m.aliases[x].concat(x).forEach(function(F){if(/-/.test(F)&&a["camel-case-expansion"]){let h=st(F);h!==x&&m.aliases[x].indexOf(h)===-1&&(m.aliases[x].push(h),C[h]=!0)}}),m.aliases[x].concat(x).forEach(function(F){if(F.length>1&&/[A-Z]/.test(F)&&a["camel-case-expansion"]){let h=an(F,"-");h!==x&&m.aliases[x].indexOf(h)===-1&&(m.aliases[x].push(h),C[h]=!0)}}),m.aliases[x].forEach(function(F){m.aliases[F]=[x].concat(m.aliases[x].filter(function(h){return F!==h}))}))})})}function T(c,D){let x=[].concat(m.aliases[c]||[],c),F=Object.keys(D),h=x.find(v=>F.includes(v));return h?D[h]:!1}function Bn(c){let D=Object.keys(m);return[].concat(D.map(F=>m[F])).some(function(F){return Array.isArray(F)?F.includes(c):F[c]})}function j(c,...D){return[].concat(...D).some(function(F){let h=c.match(F);return h&&Bn(h[1])})}function Z(c){if(c.match(y)||!c.match(/^-[^-]+/))return!1;let D=!0,x,F=c.slice(1).split("");for(let h=0;h<F.length;h++){if(x=c.slice(h+2),!Bn(F[h])){D=!1;break}if(F[h+1]&&F[h+1]==="="||x==="-"||/[A-Za-z]/.test(F[h])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(x)||F[h+1]&&F[h+1].match(/\W/))break}return D}function te(c){return a["unknown-options-as-args"]&&H(c)}function H(c){return c=c.replace(/^-{3,}/,"--"),c.match(y)||Z(c)?!1:!j(c,/^-+([^=]+?)=[\s\S]*$/,U,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function ne(c){return!T(c,m.bools)&&!T(c,m.counts)&&`${c}`in l?l[c]:se(ve(c))}function se(c){return{[_e.BOOLEAN]:!0,[_e.STRING]:"",[_e.NUMBER]:void 0,[_e.ARRAY]:[]}[c]}function ve(c){let D=_e.BOOLEAN;return T(c,m.strings)?D=_e.STRING:T(c,m.numbers)?D=_e.NUMBER:T(c,m.bools)?D=_e.BOOLEAN:T(c,m.arrays)&&(D=_e.ARRAY),D}function Pe(c){return c===void 0}function Kt(){Object.keys(m.counts).find(c=>T(c,m.arrays)?(L=Error(b("Invalid configuration: %s, opts.count excludes opts.array.",c)),!0):T(c,m.nargs)?(L=Error(b("Invalid configuration: %s, opts.count excludes opts.narg.",c)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(W,V),configuration:a,defaulted:Object.assign({},E),error:L,newAliases:Object.assign({},C)}}};function pc(n){let e=[],t=Object.create(null),r=!0;for(Object.keys(n).forEach(function(i){e.push([].concat(n[i],i))});r;){r=!1;for(let i=0;i<e.length;i++)for(let s=i+1;s<e.length;s++)if(e[i].filter(function(a){return e[s].indexOf(a)!==-1}).length){e[i]=e[i].concat(e[s]),e.splice(s,1),r=!0;break}}return e.forEach(function(i){i=i.filter(function(o,a,l){return l.indexOf(o)===a});let s=i.pop();s!==void 0&&typeof s=="string"&&(t[s]=i)}),t}function wr(n){return n!==void 0?n+1:1}function fs(n){return n==="__proto__"?"___proto___":n}function mc(n){return typeof n=="string"&&(n[0]==="'"||n[0]==='"')&&n[n.length-1]===n[0]?n.substring(1,n.length-1):n}var ms=J("fs"),Br=J("node:module"),Fc={};var yr,Ar,_r,hs=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20,Ds=(Ar=(yr=process==null?void 0:process.versions)===null||yr===void 0?void 0:yr.node)!==null&&Ar!==void 0?Ar:(_r=process==null?void 0:process.version)===null||_r===void 0?void 0:_r.slice(1);if(Ds&&Number(Ds.match(/^([^.]+)/)[1])<hs)throw Error(`yargs parser supports a minimum Node.js version of ${hs}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var gc=process?process.env:{},ds=Br.createRequire?(0,Br.createRequire)(Fc.url):void 0,gs=new ln({cwd:process.cwd,env:()=>gc,format:ps.format,normalize:fn.normalize,resolve:fn.resolve,require:n=>{if(typeof ds<"u")return ds(n);if(n.match(/\.json$/))return JSON.parse((0,ms.readFileSync)(n,"utf8"));throw Error("only .json config files are supported in ESM")}}),Ht=function(e,t){return gs.parse(e.slice(),t).argv};Ht.detailed=function(n,e){return gs.parse(n.slice(),e)};Ht.camelCase=st;Ht.decamelize=an;Ht.looksLikeNumber=cn;var Fs=Ht;var xe=J("path");function Cc(){return Ec()?0:1}function Ec(){return bc()&&!process.defaultApp}function bc(){return!!process.versions.electron}function Cs(){return process.argv[Cc()]}var xc=new Intl.Segmenter,Es=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Nonspacing_Mark}|\p{Enclosing_Mark}|\p{Surrogate})+$/v,wc=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Nonspacing_Mark}\p{Enclosing_Mark}\p{Surrogate}]+/v,yc=/\p{Spacing_Mark}/v,Ac=/^\p{RGI_Emoji}$/v,_c=/^[\d#*]\u20E3$/,Bc=/\p{Extended_Pictographic}/gu;function Oc(n){if(n.length>50)return!1;if(_c.test(n))return!0;if(n.includes("\u200D")){let e=n.match(Bc);return e!==null&&e.length>=2}return!1}function Sc(n){return n.replace(wc,"")}function vc(n){return Es.test(n)}function bs(n){return n>=4352&&n<=4447||n>=43360&&n<=43388}function xs(n){return n>=4448&&n<=4519||n>=55216&&n<=55238}function ws(n){return n>=4520&&n<=4607||n>=55243&&n<=55291}function Pc(n){return bs(n)||xs(n)||ws(n)}function Ic(n,e){let t=[];for(let i of n)Es.test(i)||t.push(i.codePointAt(0));if(t.length===0)return;let r=0;for(let i=0;i<t.length;i++){let s=t[i];if(!Pc(s)){if(r===0)return;for(let o=i;o<t.length;o++)r+=it(t[o],e);return r}if(bs(s)&&xs(t[i+1])){r+=2,i+=ws(t[i+2])?2:1;continue}r+=it(s,e)}return r}function jc(n,e){let t=0,r=!0;for(let i of n){if(r){r=!1;continue}(yc.test(i)||i>="\uFF00"&&i<="\uFFEF")&&(t+=it(i.codePointAt(0),e))}return t}function Or(n,e={}){if(typeof n!="string"||n.length===0)return 0;let{ambiguousIsNarrow:t=!0,countAnsiEscapeCodes:r=!1}=e,i=n;if(!r&&(i.includes("\x1B")||i.includes("\x9B"))&&(i=ze(i)),i.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(i))return i.length;let s=0,o={ambiguousAsWide:!t};for(let{segment:a}of xc.segment(i)){if(vc(a))continue;if(Ac.test(a)||Oc(a)){s+=2;continue}let l=Sc(a),d=Ic(l,o);if(d!==void 0){s+=d;continue}let p=l.codePointAt(0);s+=it(p,o),s+=jc(l,o)}return s}var Pt=J("fs"),ys=J("util"),As=J("path"),_s={fs:{readFileSync:Pt.readFileSync,writeFile:Pt.writeFile},format:ys.format,resolve:As.resolve,exists:n=>{try{return(0,Pt.statSync)(n).isFile()}catch{return!1}}};var Ie,Sr=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let t=e.shift(),r=function(){};return typeof e[e.length-1]=="function"&&(r=e.pop()),r=r||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:r})):r(),Ie.format.apply(Ie.format,[this.cache[this.locale][t]||t].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),t=e.shift(),r=e.shift(),i=e.shift(),s=function(){};typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let o=i===1?t:r;this.cache[this.locale][t]&&(o=this.cache[this.locale][t][i===1?"one":"other"]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:r},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let a=[o];return~o.indexOf("%d")&&a.push(i),Ie.format.apply(Ie.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let r="";return e.forEach(function(i,s){let o=t[s+1];r+=i,typeof o<"u"&&(r+="%s")}),this.__.apply(this,[r].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,t=this.writeQueue[0],r=t.directory,i=t.locale,s=t.cb,o=this._resolveLocaleFile(r,i),a=JSON.stringify(this.cache[i],null,2);Ie.fs.writeFile(o,a,"utf-8",function(l){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(l)})}_readLocaleFile(){let e={},t=this._resolveLocaleFile(this.directory,this.locale);try{Ie.fs.readFileSync&&(e=JSON.parse(Ie.fs.readFileSync(t,"utf-8")))}catch(r){if(r instanceof SyntaxError&&(r.message="syntax error in "+t),r.code==="ENOENT")e={};else throw r}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let r=Ie.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~t.lastIndexOf("_")){let i=Ie.resolve(e,"./",t.split("_")[0]+".json");this._fileExistsSync(i)&&(r=i)}return r}_fileExistsSync(e){return Ie.exists(e)}};function Bs(n,e){Ie=e;let t=new Sr(n);return{__:t.__.bind(t),__n:t.__n.bind(t),setLocale:t.setLocale.bind(t),getLocale:t.getLocale.bind(t),updateLocale:t.updateLocale.bind(t),locale:t.locale}}var Mc=n=>Bs(n,_s),Os=Mc;var Is=J("node:module"),js=Ct(vs(),1),Dn=J("node:fs"),Ts={},vr=(0,Pr.fileURLToPath)(Ts.url),Tc=vr.substring(0,vr.lastIndexOf("node_modules")),$c=(0,Is.createRequire)(Ts.url),Ms={assert:{notStrictEqual:hn.notStrictEqual,strictEqual:hn.strictEqual},cliui:xr,findUp:cs,getEnv:n=>process.env[n],inspect:Ps.inspect,getProcessArgvBin:Cs,mainFilename:Tc||process.cwd(),Parser:Fs,path:{basename:xe.basename,dirname:xe.dirname,extname:xe.extname,relative:xe.relative,resolve:xe.resolve,join:xe.join},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(n,e)=>process.emitWarning(n,e),execPath:()=>process.execPath,exit:n=>{process.exit(n)},nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:Dn.readFileSync,readdirSync:Dn.readdirSync,require:$c,getCallerFile:()=>{let n=(0,js.default)(3);return n.match(/^file:\/\//)?(0,Pr.fileURLToPath)(n):n},stringWidth:Or,y18n:Os({directory:(0,xe.resolve)(vr,"../../../locales"),updateFiles:!1})};function Fe(n,e,t,r){t.assert.notStrictEqual(n,e,r)}function Ir(n,e){e.assert.strictEqual(typeof n,"string")}function It(n){return Object.keys(n)}function Q(n){return!!n&&!!n.then&&typeof n.then=="function"}var oe=class n extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,n)}};function Ye(n){let t=n.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),r=/\.*[\][<>]/g,i=t.shift();if(!i)throw new Error(`No command found in: ${n}`);let s={cmd:i.replace(r,""),demanded:[],optional:[]};return t.forEach((o,a)=>{let l=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&a===t.length-1&&(l=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(r,"").split("|"),variadic:l}):s.demanded.push({cmd:o.replace(r,"").split("|"),variadic:l})}),s}var Nc=["first","second","third","fourth","fifth","sixth"];function B(n,e,t){function r(){return typeof n=="object"?[{demanded:[],optional:[]},n,e]:[Ye(`cmd ${n}`),e,t]}try{let i=0,[s,o,a]=r(),l=[].slice.call(o);for(;l.length&&l[l.length-1]===void 0;)l.pop();let d=a||l.length;if(d<s.demanded.length)throw new oe(`Not enough arguments provided. Expected ${s.demanded.length} but received ${l.length}.`);let p=s.demanded.length+s.optional.length;if(d>p)throw new oe(`Too many arguments provided. Expected max ${p} but received ${d}.`);s.demanded.forEach(f=>{let g=l.shift(),C=$s(g);f.cmd.filter(b=>b===C||b==="*").length===0&&Ns(C,f.cmd,i),i+=1}),s.optional.forEach(f=>{if(l.length===0)return;let g=l.shift(),C=$s(g);f.cmd.filter(b=>b===C||b==="*").length===0&&Ns(C,f.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function $s(n){return Array.isArray(n)?"array":n===null?"null":typeof n}function Ns(n,e,t){throw new oe(`Invalid ${Nc[t]||"manyith"} argument. Expected ${e.join(" or ")} but received ${n}.`)}var dn=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,r=!0,i=!1){if(B("<array|function> [boolean] [boolean] [boolean]",[e,t,r],arguments.length),Array.isArray(e)){for(let s=0;s<e.length;s++){if(typeof e[s]!="function")throw Error("middleware must be a function");let o=e[s];o.applyBeforeValidation=t,o.global=r}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){let s=e;s.applyBeforeValidation=t,s.global=r,s.mutates=i,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){let r=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let s=[...r[t]||[],t];return i.option?!s.includes(i.option):!0}),e.option=t,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function Ls(n){return n?n.map(e=>(e.applyBeforeValidation=!1,e)):[]}function ot(n,e,t,r){return t.reduce((i,s)=>{if(s.applyBeforeValidation!==r)return i;if(s.mutates){if(s.applied)return i;s.applied=!0}if(Q(i))return i.then(o=>Promise.all([o,s(o,e)])).then(([o,a])=>Object.assign(o,a));{let o=s(i,e);return Q(o)?o.then(a=>Object.assign(i,a)):Object.assign(i,o)}},n)}function ut(n,e,t=r=>{throw r}){try{let r=Lc(n)?n():n;return Q(r)?r.then(i=>e(i)):e(r)}catch(r){return t(r)}}function Lc(n){return typeof n=="function"}var jt=/(^\*)|(^\$0)/,jr=class{constructor(e,t,r,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=e,this.globalMiddleware=r,this.validation=t}addDirectory(e,t,r,i){i=i||{},this.requireCache.add(r);let s=this.shim.path.resolve(this.shim.path.dirname(r),e),o=this.shim.readdirSync(s,{recursive:!!i.recurse});Array.isArray(i.extensions)||(i.extensions=["js"]);let a=typeof i.visit=="function"?i.visit:l=>l;for(let l of o){let d=l.toString();if(i.exclude){let f=!1;if(typeof i.exclude=="function"?f=i.exclude(d):f=i.exclude.test(d),f)continue}if(i.include){let f=!1;if(typeof i.include=="function"?f=i.include(d):f=i.include.test(d),!f)continue}let p=!1;for(let f of i.extensions)d.endsWith(f)&&(p=!0);if(p){let f=this.shim.path.join(s,d),g=t(f),C=Object.create(null,Object.getOwnPropertyDescriptors({...g}));if(a(C,f,d)){if(this.requireCache.has(f))continue;this.requireCache.add(f),C.command||(C.command=this.shim.path.basename(f,this.shim.path.extname(f))),this.addHandler(C)}}}}addHandler(e,t,r,i,s,o){let a=[],l=Ls(s);if(i=i||(()=>{}),Array.isArray(e))if(Uc(e))[e,...a]=e;else for(let d of e)this.addHandler(d);else if(zc(e)){let d=Array.isArray(e.command)||typeof e.command=="string"?e.command:null;if(d===null)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);e.aliases&&(d=[].concat(d).concat(e.aliases)),this.addHandler(d,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(Us(r)){this.addHandler([e].concat(a),t,r.builder,r.handler,r.middlewares,r.deprecated);return}if(typeof e=="string"){let d=Ye(e);a=a.map(g=>Ye(g).cmd);let p=!1,f=[d.cmd].concat(a).filter(g=>jt.test(g)?(p=!0,!1):!0);f.length===0&&p&&f.push("$0"),p&&(d.cmd=f[0],a=f.slice(1),e=e.replace(jt,d.cmd)),a.forEach(g=>{this.aliasMap[g]=d.cmd}),t!==!1&&this.usage.command(e,t,p,a,o),this.handlers[d.cmd]={original:e,description:t,handler:i,builder:r||{},middlewares:l,deprecated:o,demanded:d.demanded,optional:d.optional},p&&(this.defaultCommand=this.handlers[d.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,r,i,s,o){let a=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,l=t.getInternalMethods().getContext(),d=l.commands.slice(),p=!e;e&&(l.commands.push(e),l.fullCommands.push(a.original));let f=this.applyBuilderUpdateUsageAndParse(p,a,t,r.aliases,d,i,s,o);return Q(f)?f.then(g=>this.applyMiddlewareAndGetResult(p,a,g.innerArgv,l,s,g.aliases,t)):this.applyMiddlewareAndGetResult(p,a,f.innerArgv,l,s,f.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,r,i,s,o,a,l){let d=t.builder,p=r;if(pn(d)){r.getInternalMethods().getUsageInstance().freeze();let f=d(r.getInternalMethods().reset(i),l);if(Q(f))return f.then(g=>(p=zs(g)?g:r,this.parseAndUpdateUsage(e,t,p,s,o,a)))}else Rc(d)&&(r.getInternalMethods().getUsageInstance().freeze(),p=r.getInternalMethods().reset(i),Object.keys(t.builder).forEach(f=>{p.option(f,d[f])}));return this.parseAndUpdateUsage(e,t,p,s,o,a)}parseAndUpdateUsage(e,t,r,i,s,o){e&&r.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(r)&&r.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,t),t.description);let a=r.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return Q(a)?a.then(l=>({aliases:r.parsed.aliases,innerArgv:l})):{aliases:r.parsed.aliases,innerArgv:a}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){let r=jt.test(t.original)?t.original.replace(jt,"").trim():t.original,i=e.filter(s=>!jt.test(s));return i.push(r),`$0 ${i.join(" ")}`}handleValidationAndGetResult(e,t,r,i,s,o,a,l){if(!o.getInternalMethods().getHasOutput()){let d=o.getInternalMethods().runValidation(s,l,o.parsed.error,e);r=ut(r,p=>(d(p),p))}if(t.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();let d=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(r,d,!1,!1),r=ot(r,o,a,!1),r=ut(r,p=>{let f=t.handler(p);return Q(f)?f.then(()=>p):p}),e||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),Q(r)&&!o.getInternalMethods().hasParseCallback()&&r.catch(p=>{try{o.getInternalMethods().getUsageInstance().fail(null,p)}catch{}})}return e||(i.commands.pop(),i.fullCommands.pop()),r}applyMiddlewareAndGetResult(e,t,r,i,s,o,a){let l={};if(s)return r;a.getInternalMethods().getHasOutput()||(l=this.populatePositionals(t,r,i,a));let d=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares),p=ot(r,a,d,!0);return Q(p)?p.then(f=>this.handleValidationAndGetResult(e,t,f,i,o,a,d,l)):this.handleValidationAndGetResult(e,t,p,i,o,a,d,l)}populatePositionals(e,t,r,i){t._=t._.slice(r.commands.length);let s=e.demanded.slice(0),o=e.optional.slice(0),a={};for(this.validation.positionalCount(s.length,t._.length);s.length;){let l=s.shift();this.populatePositional(l,t,a)}for(;o.length;){let l=o.shift();this.populatePositional(l,t,a)}return t._=r.commands.concat(t._.map(l=>""+l)),this.postProcessPositionals(t,a,this.cmdToParseOptions(e.original),i),a}populatePositional(e,t,r){let i=e.cmd[0];e.variadic?r[i]=t._.splice(0).map(String):t._.length&&(r[i]=[String(t._.shift())])}cmdToParseOptions(e){let t={array:[],default:{},alias:{},demand:{}},r=Ye(e);return r.demanded.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(t.array.push(s),t.default[s]=[]),t.alias[s]=o,t.demand[s]=!0}),r.optional.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(t.array.push(s),t.default[s]=[]),t.alias[s]=o}),t}postProcessPositionals(e,t,r,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(r.default,s.default);for(let d of Object.keys(r.alias))s.alias[d]=(s.alias[d]||[]).concat(r.alias[d]);s.array=s.array.concat(r.array),s.config={};let o=[];if(Object.keys(t).forEach(d=>{t[d].map(p=>{s.configuration["unknown-options-as-args"]&&(s.key[d]=!0),o.push(`--${d}`),o.push(p)})}),!o.length)return;let a=Object.assign({},s.configuration,{"populate--":!1}),l=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:a}));if(l.error)i.getInternalMethods().getUsageInstance().fail(l.error.message,l.error);else{let d=Object.keys(t);Object.keys(t).forEach(p=>{d.push(...l.aliases[p])}),Object.keys(l.argv).forEach(p=>{d.includes(p)&&(t[p]||(t[p]=l.argv[p]),!this.isInConfigs(i,p)&&!this.isDefaulted(i,p)&&Object.prototype.hasOwnProperty.call(e,p)&&Object.prototype.hasOwnProperty.call(l.argv,p)&&(Array.isArray(e[p])||Array.isArray(l.argv[p]))?e[p]=[].concat(e[p],l.argv[p]):e[p]=l.argv[p])})}}isDefaulted(e,t){let{default:r}=e.getOptions();return Object.prototype.hasOwnProperty.call(r,t)||Object.prototype.hasOwnProperty.call(r,this.shim.Parser.camelCase(t))}isInConfigs(e,t){let{configObjects:r}=e.getOptions();return r.some(i=>Object.prototype.hasOwnProperty.call(i,t))||r.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(t)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let r=jt.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(r,this.defaultCommand.description)}let t=this.defaultCommand.builder;if(pn(t))return t(e,!0);Us(t)||Object.keys(t).forEach(r=>{e.option(r,t[r])})}extractDesc({describe:e,description:t,desc:r}){for(let i of[e,t,r]){if(typeof i=="string"||i===!1)return i;Fe(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();Fe(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function Rs(n,e,t,r){return new jr(n,e,t,r)}function Us(n){return typeof n=="object"&&!!n.builder&&typeof n.handler=="function"}function Uc(n){return n.every(e=>typeof e=="string")}function pn(n){return typeof n=="function"}function Rc(n){return typeof n=="object"}function zc(n){return typeof n=="object"&&!Array.isArray(n)}function Ke(n={},e=()=>!0){let t={};return It(n).forEach(r=>{e(r,n[r])&&(t[r]=n[r])}),t}function Je(n){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let t=e;t._handle&&t.isTTY&&typeof t._handle.setBlocking=="function"&&t._handle.setBlocking(n)})}function Wc(n){return typeof n=="boolean"}function Vs(n,e){let t=e.y18n.__,r={},i=[];r.failFn=function(w){i.push(w)};let s=null,o=null,a=!0;r.showHelpOnFail=function(w=!0,S){let[N,Y]=typeof w=="string"?[!0,w]:[w,S];return n.getInternalMethods().isGlobalContext()&&(o=Y),s=Y,a=N,r};let l=!1;r.fail=function(w,S){let N=n.getInternalMethods().getLoggerInstance();if(i.length)for(let Y=i.length-1;Y>=0;--Y){let ce=i[Y];if(Wc(ce)){if(S)throw S;if(w)throw Error(w)}else ce(w,S,r)}else{if(n.getExitProcess()&&Je(!0),!l){l=!0,a&&(n.showHelp("error"),N.error()),(w||S)&&N.error(w||S);let Y=s||o;Y&&((w||S)&&N.error(""),N.error(Y))}if(S=S||new oe(w),n.getExitProcess())return n.exit(1);if(n.getInternalMethods().hasParseCallback())return n.exit(1,S);throw S}};let d=[],p=!1;r.usage=(A,w)=>A===null?(p=!0,d=[],r):(p=!1,d.push([A,w||""]),r),r.getUsage=()=>d,r.getUsageDisabled=()=>p,r.getPositionalGroupName=()=>t("Positionals:");let f=[];r.example=(A,w)=>{f.push([A,w||""])};let g=[];r.command=function(w,S,N,Y,ce=!1){N&&(g=g.map(G=>(G[2]=!1,G))),g.push([w,S||"",N,Y,ce])},r.getCommands=()=>g;let C={};r.describe=function(w,S){Array.isArray(w)?w.forEach(N=>{r.describe(N,S)}):typeof w=="object"?Object.keys(w).forEach(N=>{r.describe(N,w[N])}):C[w]=S},r.getDescriptions=()=>C;let E=[];r.epilog=A=>{E.push(A)};let b=!1,m;r.wrap=A=>{b=!0,m=A},r.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(b||(m=K(),b=!0),m);let y="__yargsString__:";r.deferY18nLookup=A=>y+A,r.help=function(){if(R)return R;L();let w=n.customScriptName?n.$0:e.path.basename(n.$0),S=n.getDemandedOptions(),N=n.getDemandedCommands(),Y=n.getDeprecatedOptions(),ce=n.getGroups(),G=n.getOptions(),le=[];le=le.concat(Object.keys(C)),le=le.concat(Object.keys(S)),le=le.concat(Object.keys(N)),le=le.concat(Object.keys(G.default)),le=le.filter(W),le=Object.keys(le.reduce((j,Z)=>(Z!=="_"&&(j[Z]=!0),j),{}));let ke=r.getWrap(),k=e.cliui({width:ke,wrap:!!ke});if(!p){if(d.length)d.forEach(j=>{k.div({text:`${j[0].replace(/\$0/g,w)}`}),j[1]&&k.div({text:`${j[1]}`,padding:[1,0,0,0]})}),k.div();else if(g.length){let j=null;N._?j=`${w} <${t("command")}>
15
15
  `:j=`${w} [${t("command")}]
16
- `,k.div(`${j}`)}}if(g.length>1||g.length===1&&!g[0][2]){k.div(t("Commands:"));let j=n.getInternalMethods().getContext(),Z=j.commands.length?`${j.commands.join(" ")} `:"";n.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(g=g.sort((H,ne)=>H[0].localeCompare(ne[0])));let te=w?`${w} `:"";g.forEach(H=>{let ne=`${te}${Z}${H[0].replace(/^\$0 ?/,"")}`;k.span({text:ne,padding:[0,2,0,2],width:L(g,ke,`${w}${Z}`)+4},{text:H[1]});let se=[];H[2]&&se.push(`[${t("default")}]`),H[3]&&H[3].length&&se.push(`[${t("aliases:")} ${H[3].join(", ")}]`),H[4]&&(typeof H[4]=="string"?se.push(`[${t("deprecated: %s",H[4])}]`):se.push(`[${t("deprecated")}]`)),se.length?k.div({text:se.join(" "),padding:[0,0,0,2],align:"right"}):k.div()}),k.div()}let $e=(Object.keys(G.alias)||[]).concat(Object.keys(n.parsed.newAliases)||[]);le=le.filter(j=>!n.parsed.newAliases[j]&&$e.every(Z=>(G.alias[Z]||[]).indexOf(j)===-1));let Ne=t("Options:");ce[Ne]||(ce[Ne]=[]),V(le,G.alias,ce,Ne);let et=j=>/^--/.test(mn(j)),T=Object.keys(ce).filter(j=>ce[j].length>0).map(j=>{let Z=ce[j].filter(W).map(te=>{if($e.includes(te))return te;for(let H=0,ne;(ne=$e[H])!==void 0;H++)if((G.alias[ne]||[]).includes(te))return ne;return te});return{groupName:j,normalizedKeys:Z}}).filter(({normalizedKeys:j})=>j.length>0).map(({groupName:j,normalizedKeys:Z})=>{let te=Z.reduce((H,ne)=>(H[ne]=[ne].concat(G.alias[ne]||[]).map(se=>j===r.getPositionalGroupName()?se:(/^[0-9]$/.test(se)?G.boolean.includes(ne)?"-":"--":se.length>1?"--":"-")+se).sort((se,ve)=>et(se)===et(ve)?0:et(se)?1:-1).join(", "),H),{});return{groupName:j,normalizedKeys:Z,switches:te}});if(T.filter(({groupName:j})=>j!==r.getPositionalGroupName()).some(({normalizedKeys:j,switches:Z})=>!j.every(te=>et(Z[te])))&&T.filter(({groupName:j})=>j!==r.getPositionalGroupName()).forEach(({normalizedKeys:j,switches:Z})=>{j.forEach(te=>{et(Z[te])&&(Z[te]=Wc(Z[te],4))})}),T.forEach(({groupName:j,normalizedKeys:Z,switches:te})=>{k.div(j),Z.forEach(H=>{let ne=te[H],se=C[H]||"",ve=null;se.includes(_)&&(se=t(se.substring(_.length))),G.boolean.includes(H)&&(ve=`[${t("boolean")}]`),G.count.includes(H)&&(ve=`[${t("count")}]`),G.string.includes(H)&&(ve=`[${t("string")}]`),G.normalize.includes(H)&&(ve=`[${t("string")}]`),G.array.includes(H)&&(ve=`[${t("array")}]`),G.number.includes(H)&&(ve=`[${t("number")}]`);let Pe=h=>typeof h=="string"?`[${t("deprecated: %s",h)}]`:`[${t("deprecated")}]`,Kt=[H in Y?Pe(Y[H]):null,ve,H in S?`[${t("required")}]`:null,G.choices&&G.choices[H]?`[${t("choices:")} ${r.stringifiedValues(G.choices[H])}]`:null,q(G.default[H],G.defaultDescription[H])].filter(Boolean).join(" ");k.span({text:mn(ne),padding:[0,2,0,2+Ws(ne)],width:L(te,ke)+4},se);let c=n.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;Kt&&!c?k.div({text:Kt,padding:[0,0,0,2],align:"right"}):k.div()}),k.div()}),l.length&&(k.div(t("Examples:")),l.forEach(j=>{j[0]=j[0].replace(/\$0/g,w)}),l.forEach(j=>{j[1]===""?k.div({text:j[0],padding:[0,2,0,2]}):k.div({text:j[0],padding:[0,2,0,2],width:L(l,ke)+4},{text:j[1]})}),k.div()),E.length>0){let j=E.map(Z=>Z.replace(/\$0/g,w)).join(`
16
+ `,k.div(`${j}`)}}if(g.length>1||g.length===1&&!g[0][2]){k.div(t("Commands:"));let j=n.getInternalMethods().getContext(),Z=j.commands.length?`${j.commands.join(" ")} `:"";n.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(g=g.sort((H,ne)=>H[0].localeCompare(ne[0])));let te=w?`${w} `:"";g.forEach(H=>{let ne=`${te}${Z}${H[0].replace(/^\$0 ?/,"")}`;k.span({text:ne,padding:[0,2,0,2],width:U(g,ke,`${w}${Z}`)+4},{text:H[1]});let se=[];H[2]&&se.push(`[${t("default")}]`),H[3]&&H[3].length&&se.push(`[${t("aliases:")} ${H[3].join(", ")}]`),H[4]&&(typeof H[4]=="string"?se.push(`[${t("deprecated: %s",H[4])}]`):se.push(`[${t("deprecated")}]`)),se.length?k.div({text:se.join(" "),padding:[0,0,0,2],align:"right"}):k.div()}),k.div()}let $e=(Object.keys(G.alias)||[]).concat(Object.keys(n.parsed.newAliases)||[]);le=le.filter(j=>!n.parsed.newAliases[j]&&$e.every(Z=>(G.alias[Z]||[]).indexOf(j)===-1));let Ne=t("Options:");ce[Ne]||(ce[Ne]=[]),V(le,G.alias,ce,Ne);let et=j=>/^--/.test(mn(j)),T=Object.keys(ce).filter(j=>ce[j].length>0).map(j=>{let Z=ce[j].filter(W).map(te=>{if($e.includes(te))return te;for(let H=0,ne;(ne=$e[H])!==void 0;H++)if((G.alias[ne]||[]).includes(te))return ne;return te});return{groupName:j,normalizedKeys:Z}}).filter(({normalizedKeys:j})=>j.length>0).map(({groupName:j,normalizedKeys:Z})=>{let te=Z.reduce((H,ne)=>(H[ne]=[ne].concat(G.alias[ne]||[]).map(se=>j===r.getPositionalGroupName()?se:(/^[0-9]$/.test(se)?G.boolean.includes(ne)?"-":"--":se.length>1?"--":"-")+se).sort((se,ve)=>et(se)===et(ve)?0:et(se)?1:-1).join(", "),H),{});return{groupName:j,normalizedKeys:Z,switches:te}});if(T.filter(({groupName:j})=>j!==r.getPositionalGroupName()).some(({normalizedKeys:j,switches:Z})=>!j.every(te=>et(Z[te])))&&T.filter(({groupName:j})=>j!==r.getPositionalGroupName()).forEach(({normalizedKeys:j,switches:Z})=>{j.forEach(te=>{et(Z[te])&&(Z[te]=Vc(Z[te],4))})}),T.forEach(({groupName:j,normalizedKeys:Z,switches:te})=>{k.div(j),Z.forEach(H=>{let ne=te[H],se=C[H]||"",ve=null;se.includes(y)&&(se=t(se.substring(y.length))),G.boolean.includes(H)&&(ve=`[${t("boolean")}]`),G.count.includes(H)&&(ve=`[${t("count")}]`),G.string.includes(H)&&(ve=`[${t("string")}]`),G.normalize.includes(H)&&(ve=`[${t("string")}]`),G.array.includes(H)&&(ve=`[${t("array")}]`),G.number.includes(H)&&(ve=`[${t("number")}]`);let Pe=D=>typeof D=="string"?`[${t("deprecated: %s",D)}]`:`[${t("deprecated")}]`,Kt=[H in Y?Pe(Y[H]):null,ve,H in S?`[${t("required")}]`:null,G.choices&&G.choices[H]?`[${t("choices:")} ${r.stringifiedValues(G.choices[H])}]`:null,q(G.default[H],G.defaultDescription[H])].filter(Boolean).join(" ");k.span({text:mn(ne),padding:[0,2,0,2+Ws(ne)],width:U(te,ke)+4},se);let c=n.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;Kt&&!c?k.div({text:Kt,padding:[0,0,0,2],align:"right"}):k.div()}),k.div()}),f.length&&(k.div(t("Examples:")),f.forEach(j=>{j[0]=j[0].replace(/\$0/g,w)}),f.forEach(j=>{j[1]===""?k.div({text:j[0],padding:[0,2,0,2]}):k.div({text:j[0],padding:[0,2,0,2],width:U(f,ke)+4},{text:j[1]})}),k.div()),E.length>0){let j=E.map(Z=>Z.replace(/\$0/g,w)).join(`
17
17
  `);k.div(`${j}
18
- `)}return k.toString().replace(/\s*$/,"")};function L(y,w,S){let N=0;return Array.isArray(y)||(y=Object.values(y).map(Y=>[Y])),y.forEach(Y=>{N=Math.max(e.stringWidth(S?`${S} ${mn(Y[0])}`:mn(Y[0]))+Ws(Y[0]),N)}),w&&(N=Math.min(N,parseInt((w*.5).toString(),10))),N}function R(){let y=n.getDemandedOptions(),w=n.getOptions();(Object.keys(w.alias)||[]).forEach(S=>{w.alias[S].forEach(N=>{C[N]&&r.describe(S,C[N]),N in y&&n.demandOption(S,y[N]),w.boolean.includes(N)&&n.boolean(S),w.count.includes(N)&&n.count(S),w.string.includes(N)&&n.string(S),w.normalize.includes(N)&&n.normalize(S),w.array.includes(N)&&n.array(S),w.number.includes(N)&&n.number(S)})})}let U;r.cacheHelpMessage=function(){U=this.help()},r.clearCachedHelpMessage=function(){U=void 0},r.hasCachedHelpMessage=function(){return!!U};function V(y,w,S,N){let Y=[],ce=null;return Object.keys(S).forEach(G=>{Y=Y.concat(S[G])}),y.forEach(G=>{ce=[G].concat(w[G]),ce.some(le=>Y.indexOf(le)!==-1)||S[N].push(G)}),Y}function W(y){return n.getOptions().hiddenOptions.indexOf(y)<0||n.parsed.argv[n.getOptions().showHiddenOpt]}r.showHelp=y=>{let w=n.getInternalMethods().getLoggerInstance();y||(y="error"),(typeof y=="function"?y:w[y])(r.help())},r.functionDescription=y=>["(",y.name?e.Parser.decamelize(y.name,"-"):t("generated-value"),")"].join(""),r.stringifiedValues=function(w,S){let N="",Y=S||", ",ce=[].concat(w);return!w||!ce.length||ce.forEach(G=>{N.length&&(N+=Y),N+=JSON.stringify(G)}),N};function q(y,w){let S=`[${t("default:")} `;if(y===void 0&&!w)return null;if(w)S+=w;else switch(typeof y){case"string":S+=`"${y}"`;break;case"object":S+=JSON.stringify(y);break;default:S+=y}return`${S}]`}function K(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let ae=null;r.version=y=>{ae=y},r.showVersion=y=>{let w=n.getInternalMethods().getLoggerInstance();y||(y="error"),(typeof y=="function"?y:w[y])(ae)},r.reset=function(w){return s=null,f=!1,m=[],d=!1,E=[],l=[],g=[],C=Ke(C,S=>!w[S]),r};let z=[];return r.freeze=function(){z.push({failMessage:s,failureOutput:f,usages:m,usageDisabled:d,epilogs:E,examples:l,commands:g,descriptions:C})},r.unfreeze=function(w=!1){let S=z.pop();S&&(w?(C={...S.descriptions,...C},g=[...S.commands,...g],m=[...S.usages,...m],l=[...S.examples,...l],E=[...S.epilogs,...E]):{failMessage:s,failureOutput:f,usages:m,usageDisabled:d,epilogs:E,examples:l,commands:g,descriptions:C}=S)},r}function Mr(n){return typeof n=="object"}function Wc(n,e){return Mr(n)?{text:n.text,indentation:n.indentation+e}:{text:n,indentation:e}}function Ws(n){return Mr(n)?n.indentation:0}function mn(n){return Mr(n)?n.text:n}var Hs=`###-begin-{{app_name}}-completions-###
18
+ `)}return k.toString().replace(/\s*$/,"")};function U(A,w,S){let N=0;return Array.isArray(A)||(A=Object.values(A).map(Y=>[Y])),A.forEach(Y=>{N=Math.max(e.stringWidth(S?`${S} ${mn(Y[0])}`:mn(Y[0]))+Ws(Y[0]),N)}),w&&(N=Math.min(N,parseInt((w*.5).toString(),10))),N}function L(){let A=n.getDemandedOptions(),w=n.getOptions();(Object.keys(w.alias)||[]).forEach(S=>{w.alias[S].forEach(N=>{C[N]&&r.describe(S,C[N]),N in A&&n.demandOption(S,A[N]),w.boolean.includes(N)&&n.boolean(S),w.count.includes(N)&&n.count(S),w.string.includes(N)&&n.string(S),w.normalize.includes(N)&&n.normalize(S),w.array.includes(N)&&n.array(S),w.number.includes(N)&&n.number(S)})})}let R;r.cacheHelpMessage=function(){R=this.help()},r.clearCachedHelpMessage=function(){R=void 0},r.hasCachedHelpMessage=function(){return!!R};function V(A,w,S,N){let Y=[],ce=null;return Object.keys(S).forEach(G=>{Y=Y.concat(S[G])}),A.forEach(G=>{ce=[G].concat(w[G]),ce.some(le=>Y.indexOf(le)!==-1)||S[N].push(G)}),Y}function W(A){return n.getOptions().hiddenOptions.indexOf(A)<0||n.parsed.argv[n.getOptions().showHiddenOpt]}r.showHelp=A=>{let w=n.getInternalMethods().getLoggerInstance();A||(A="error"),(typeof A=="function"?A:w[A])(r.help())},r.functionDescription=A=>["(",A.name?e.Parser.decamelize(A.name,"-"):t("generated-value"),")"].join(""),r.stringifiedValues=function(w,S){let N="",Y=S||", ",ce=[].concat(w);return!w||!ce.length||ce.forEach(G=>{N.length&&(N+=Y),N+=JSON.stringify(G)}),N};function q(A,w){let S=`[${t("default:")} `;if(A===void 0&&!w)return null;if(w)S+=w;else switch(typeof A){case"string":S+=`"${A}"`;break;case"object":S+=JSON.stringify(A);break;default:S+=A}return`${S}]`}function K(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let ae=null;r.version=A=>{ae=A},r.showVersion=A=>{let w=n.getInternalMethods().getLoggerInstance();A||(A="error"),(typeof A=="function"?A:w[A])(ae)},r.reset=function(w){return s=null,l=!1,d=[],p=!1,E=[],f=[],g=[],C=Ke(C,S=>!w[S]),r};let z=[];return r.freeze=function(){z.push({failMessage:s,failureOutput:l,usages:d,usageDisabled:p,epilogs:E,examples:f,commands:g,descriptions:C})},r.unfreeze=function(w=!1){let S=z.pop();S&&(w?(C={...S.descriptions,...C},g=[...S.commands,...g],d=[...S.usages,...d],f=[...S.examples,...f],E=[...S.epilogs,...E]):{failMessage:s,failureOutput:l,usages:d,usageDisabled:p,epilogs:E,examples:f,commands:g,descriptions:C}=S)},r}function Mr(n){return typeof n=="object"}function Vc(n,e){return Mr(n)?{text:n.text,indentation:n.indentation+e}:{text:n,indentation:e}}function Ws(n){return Mr(n)?n.indentation:0}function mn(n){return Mr(n)?n.text:n}var Hs=`###-begin-{{app_name}}-completions-###
19
19
  #
20
20
  # yargs command completion script
21
21
  #
@@ -65,20 +65,28 @@ _{{app_name}}_yargs_completions()
65
65
  _default
66
66
  fi
67
67
  }
68
- if [[ "'\${zsh_eval_context[-1]}" == "loadautofunc" ]]; then
68
+ if [[ "\${zsh_eval_context[-1]}" == "loadautofunc" ]]; then
69
69
  _{{app_name}}_yargs_completions "$@"
70
70
  else
71
71
  compdef _{{app_name}}_yargs_completions {{app_name}}
72
72
  fi
73
73
  ###-end-{{app_name}}-completions-###
74
- `;var Tr=class{constructor(e,t,r,i){var s,o,a;this.yargs=e,this.usage=t,this.command=r,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(a=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(e,t,r,i){let s=this.command.getCommandHandlers();for(let a=0,f=e.length;a<f;++a)if(s[e[a]]&&s[e[a]].builder){let m=s[e[a]].builder;if(pn(m)){this.indexAfterLastReset=a+1;let d=this.yargs.getInternalMethods().reset();return m(d,!0),d.argv}}let o=[];this.commandCompletions(o,e,r),this.optionCompletions(o,e,t,r),this.choicesFromOptionsCompletions(o,e,t,r),this.choicesFromPositionalsCompletions(o,e,t,r),i(null,o)}commandCompletions(e,t,r){let i=this.yargs.getInternalMethods().getContext().commands;!r.match(/^-/)&&i[i.length-1]!==r&&!this.previousArgHasChoices(t)&&this.usage.getCommands().forEach(s=>{let o=Ye(s[0]).cmd;if(t.indexOf(o)===-1)if(!this.zshShell)e.push(o);else{let a=s[1]||"";e.push(o.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(e,t,r,i){if((i.match(/^-/)||i===""&&e.length===0)&&!this.previousArgHasChoices(t)){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(a=>{let f=!!s.configuration["boolean-negation"]&&s.boolean.includes(a);!o.includes(a)&&!s.hiddenOptions.includes(a)&&!this.argsContainKey(t,a,f)&&this.completeOptionKey(a,e,i,f&&!!s.default[a])})}}choicesFromOptionsCompletions(e,t,r,i){if(this.previousArgHasChoices(t)){let s=this.getPreviousArgChoices(t);s&&s.length>0&&e.push(...s.map(o=>o.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,t,r,i){if(i===""&&e.length>0&&this.previousArgHasChoices(t))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=s[r._.length-o-1];if(!a)return;let f=this.yargs.getOptions().choices[a]||[];for(let m of f)m.startsWith(i)&&e.push(m.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let t=e[e.length-1],r="";if(!t.startsWith("-")&&e.length>1&&(r=t,t=e[e.length-2]),!t.startsWith("-"))return;let i=t.replace(/^-+/,""),s=this.yargs.getOptions(),o=[i,...this.yargs.getAliases()[i]||[]],a;for(let f of o)if(Object.prototype.hasOwnProperty.call(s.key,f)&&Array.isArray(s.choices[f])){a=s.choices[f];break}if(a)return a.filter(f=>!r||f.startsWith(r))}previousArgHasChoices(e){let t=this.getPreviousArgChoices(e);return t!==void 0&&t.length>0}argsContainKey(e,t,r){let i=s=>e.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1;if(i(t)||r&&i(`no-${t}`))return!0;if(this.aliases){for(let s of this.aliases[t])if(i(s))return!0}return!1}completeOptionKey(e,t,r,i){var s,o,a,f;let m=e;if(this.zshShell){let C=this.usage.getDescriptions(),E=(o=(s=this===null||this===void 0?void 0:this.aliases)===null||s===void 0?void 0:s[e])===null||o===void 0?void 0:o.find(_=>{let L=C[_];return typeof L=="string"&&L.length>0}),b=E?C[E]:void 0,p=(f=(a=C[e])!==null&&a!==void 0?a:b)!==null&&f!==void 0?f:"";m=`${e.replace(/:/g,"\\:")}:${p.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let d=C=>/^--/.test(C),l=C=>/^[^0-9]$/.test(C),g=!d(r)&&l(e)?"-":"--";t.push(g+m),i&&t.push(g+"no-"+m)}customCompletion(e,t,r,i){if(Fe(this.customCompletionFunction,null,this.shim),Hc(this.customCompletionFunction)){let s=this.customCompletionFunction(r,t);return Q(s)?s.then(o=>{this.shim.process.nextTick(()=>{i(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{i(o,void 0)})}):i(null,s)}else return qc(this.customCompletionFunction)?this.customCompletionFunction(r,t,(s=i)=>this.defaultCompletion(e,t,r,s),s=>{i(null,s)}):this.customCompletionFunction(r,t,s=>{i(null,s)})}getCompletion(e,t){let r=e.length?e[e.length-1]:"",i=this.yargs.parse(e,!0),s=this.customCompletionFunction?o=>this.customCompletion(e,o,r,t):o=>this.defaultCompletion(e,o,r,t);return Q(i)?i.then(s):s(i)}generateCompletionScript(e,t){let r=this.zshShell?qs:Hs,i=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),r=r.replace(/{{app_name}}/g,i),r=r.replace(/{{completion_command}}/g,t),r.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function Gs(n,e,t,r){return new Tr(n,e,t,r)}function Hc(n){return n.length<3}function qc(n){return n.length>3}function Ys(n,e){if(n.length===0)return e.length;if(e.length===0)return n.length;let t=[],r;for(r=0;r<=e.length;r++)t[r]=[r];let i;for(i=0;i<=n.length;i++)t[0][i]=i;for(r=1;r<=e.length;r++)for(i=1;i<=n.length;i++)e.charAt(r-1)===n.charAt(i-1)?t[r][i]=t[r-1][i-1]:r>1&&i>1&&e.charAt(r-2)===n.charAt(i-1)&&e.charAt(r-1)===n.charAt(i-2)?t[r][i]=t[r-2][i-2]+1:t[r][i]=Math.min(t[r-1][i-1]+1,Math.min(t[r][i-1]+1,t[r-1][i]+1));return t[e.length][n.length]}var Ks=["$0","--","_"];function Js(n,e,t){let r=t.y18n.__,i=t.y18n.__n,s={};s.nonOptionCount=function(l){let g=n.getDemandedCommands(),E=l._.length+(l["--"]?l["--"].length:0)-n.getInternalMethods().getContext().commands.length;g._&&(E<g._.min||E>g._.max)&&(E<g._.min?g._.minMsg!==void 0?e.fail(g._.minMsg?g._.minMsg.replace(/\$0/g,E.toString()).replace(/\$1/,g._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",E,E.toString(),g._.min.toString())):E>g._.max&&(g._.maxMsg!==void 0?e.fail(g._.maxMsg?g._.maxMsg.replace(/\$0/g,E.toString()).replace(/\$1/,g._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",E,E.toString(),g._.max.toString()))))},s.positionalCount=function(l,g){g<l&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",g,g+"",l+""))},s.requiredArguments=function(l,g){let C=null;for(let E of Object.keys(g))(!Object.prototype.hasOwnProperty.call(l,E)||typeof l[E]>"u")&&(C=C||{},C[E]=g[E]);if(C){let E=[];for(let p of Object.keys(C)){let _=C[p];_&&E.indexOf(_)<0&&E.push(_)}let b=E.length?`
74
+ `,Gs=`###-begin-{{app_name}}-completions-###
75
+ #
76
+ # yargs command completion script
77
+ #
78
+ # Installation: {{app_path}} {{completion_command}} > ~/.config/fish/completions/{{app_name}}.fish
79
+ #
80
+ complete -f -c {{app_name}} -a '({{app_path}} --get-yargs-completions (commandline -o)[2..-1])'
81
+ ###-end-{{app_name}}-completions-###
82
+ `;var Tr=class{constructor(e,t,r,i){var s,o,a,l,d;this.yargs=e,this.usage=t,this.command=r,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(a=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&a!==void 0?a:!1,this.fishShell=(d=(l=this.shim.getEnv("SHELL"))===null||l===void 0?void 0:l.includes("fish"))!==null&&d!==void 0?d:!1}defaultCompletion(e,t,r,i){let s=this.command.getCommandHandlers();for(let a=0,l=e.length;a<l;++a)if(s[e[a]]&&s[e[a]].builder){let d=s[e[a]].builder;if(pn(d)){this.indexAfterLastReset=a+1;let p=this.yargs.getInternalMethods().reset();return d(p,!0),p.argv}}let o=[];this.commandCompletions(o,e,r),this.optionCompletions(o,e,t,r),this.choicesFromOptionsCompletions(o,e,t,r),this.choicesFromPositionalsCompletions(o,e,t,r),i(null,o)}commandCompletions(e,t,r){let i=this.yargs.getInternalMethods().getContext().commands;!r.match(/^-/)&&i[i.length-1]!==r&&!this.previousArgHasChoices(t)&&this.usage.getCommands().forEach(s=>{let o=Ye(s[0]).cmd;if(t.indexOf(o)===-1){let a=s[1]||"";this.fishShell?e.push(o+" "+a):this.zshShell?e.push(o.replace(/:/g,"\\:")+":"+a):e.push(o)}})}optionCompletions(e,t,r,i){if((i.match(/^-/)||i===""&&e.length===0)&&!this.previousArgHasChoices(t)){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(a=>{let l=!!s.configuration["boolean-negation"]&&s.boolean.includes(a);!o.includes(a)&&!s.hiddenOptions.includes(a)&&!this.argsContainKey(t,a,l)&&this.completeOptionKey(a,e,i,l&&!!s.default[a])})}}choicesFromOptionsCompletions(e,t,r,i){if(this.previousArgHasChoices(t)){let s=this.getPreviousArgChoices(t);s&&s.length>0&&(this.fishShell?e.push(...s):e.push(...s.map(o=>o.replace(/:/g,"\\:"))))}}choicesFromPositionalsCompletions(e,t,r,i){if(i===""&&e.length>0&&this.previousArgHasChoices(t))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=s[r._.length-o-1];if(!a)return;let l=this.yargs.getOptions().choices[a]||[];for(let d of l)d.startsWith(i)&&(this.fishShell?e.push(d):e.push(d.replace(/:/g,"\\:")))}getPreviousArgChoices(e){if(e.length<1)return;let t=e[e.length-1],r="";if(!t.startsWith("-")&&e.length>1&&(r=t,t=e[e.length-2]),!t.startsWith("-"))return;let i=t.replace(/^-+/,""),s=this.yargs.getOptions(),o=[i,...this.yargs.getAliases()[i]||[]],a;for(let l of o)if(Object.prototype.hasOwnProperty.call(s.key,l)&&Array.isArray(s.choices[l])){a=s.choices[l];break}if(a)return a.filter(l=>!r||l.startsWith(r))}previousArgHasChoices(e){let t=this.getPreviousArgChoices(e);return t!==void 0&&t.length>0}argsContainKey(e,t,r){let i=s=>e.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1;if(i(t)||r&&i(`no-${t}`))return!0;if(this.aliases){for(let s of this.aliases[t])if(i(s))return!0}return!1}completeOptionKey(e,t,r,i){var s,o,a,l;let d=e;if(this.zshShell||this.fishShell){let C=this.usage.getDescriptions(),E=(o=(s=this===null||this===void 0?void 0:this.aliases)===null||s===void 0?void 0:s[e])===null||o===void 0?void 0:o.find(U=>{let L=C[U];return typeof L=="string"&&L.length>0}),b=E?C[E]:void 0,y=((l=(a=C[e])!==null&&a!==void 0?a:b)!==null&&l!==void 0?l:"").replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ");this.fishShell?d=`${e} ${y}`:d=`${e.replace(/:/g,"\\:")}:${y}`}let p=C=>/^--/.test(C),f=C=>/^[^0-9]$/.test(C),g=!p(r)&&f(e)?"-":"--";t.push(g+d),i&&t.push(g+"no-"+d)}customCompletion(e,t,r,i){if(Fe(this.customCompletionFunction,null,this.shim),qc(this.customCompletionFunction)){let s=this.customCompletionFunction(r,t);return Q(s)?s.then(o=>{this.shim.process.nextTick(()=>{i(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{i(o,void 0)})}):i(null,s)}else return Gc(this.customCompletionFunction)?this.customCompletionFunction(r,t,(s=i)=>this.defaultCompletion(e,t,r,s),s=>{i(null,s)}):this.customCompletionFunction(r,t,s=>{i(null,s)})}getCompletion(e,t){let r=e.length?e[e.length-1]:"",i=this.yargs.parse(e,!0),s=this.customCompletionFunction?o=>this.customCompletion(e,o,r,t):o=>this.defaultCompletion(e,o,r,t);return Q(i)?i.then(s):s(i)}generateCompletionScript(e,t){let r;this.zshShell?r=qs:this.fishShell?r=Gs:r=Hs;let i=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),r=r.replace(/{{app_name}}/g,i),r=r.replace(/{{completion_command}}/g,t),r.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function Ys(n,e,t,r){return new Tr(n,e,t,r)}function qc(n){return n.length<3}function Gc(n){return n.length>3}function Ks(n,e){if(n.length===0)return e.length;if(e.length===0)return n.length;let t=[],r;for(r=0;r<=e.length;r++)t[r]=[r];let i;for(i=0;i<=n.length;i++)t[0][i]=i;for(r=1;r<=e.length;r++)for(i=1;i<=n.length;i++)e.charAt(r-1)===n.charAt(i-1)?t[r][i]=t[r-1][i-1]:r>1&&i>1&&e.charAt(r-2)===n.charAt(i-1)&&e.charAt(r-1)===n.charAt(i-2)?t[r][i]=t[r-2][i-2]+1:t[r][i]=Math.min(t[r-1][i-1]+1,Math.min(t[r][i-1]+1,t[r-1][i]+1));return t[e.length][n.length]}var Js=["$0","--","_"];function Qs(n,e,t){let r=t.y18n.__,i=t.y18n.__n,s={};s.nonOptionCount=function(f){let g=n.getDemandedCommands(),E=f._.length+(f["--"]?f["--"].length:0)-n.getInternalMethods().getContext().commands.length;g._&&(E<g._.min||E>g._.max)&&(E<g._.min?g._.minMsg!==void 0?e.fail(g._.minMsg?g._.minMsg.replace(/\$0/g,E.toString()).replace(/\$1/,g._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",E,E.toString(),g._.min.toString())):E>g._.max&&(g._.maxMsg!==void 0?e.fail(g._.maxMsg?g._.maxMsg.replace(/\$0/g,E.toString()).replace(/\$1/,g._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",E,E.toString(),g._.max.toString()))))},s.positionalCount=function(f,g){g<f&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",g,g+"",f+""))},s.requiredArguments=function(f,g){let C=null;for(let E of Object.keys(g))(!Object.prototype.hasOwnProperty.call(f,E)||typeof f[E]>"u")&&(C=C||{},C[E]=g[E]);if(C){let E=[];for(let m of Object.keys(C)){let y=C[m];y&&E.indexOf(y)<0&&E.push(y)}let b=E.length?`
75
83
  ${E.join(`
76
- `)}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(C).length,Object.keys(C).join(", ")+b))}},s.unknownArguments=function(l,g,C,E,b=!0){var p;let _=n.getInternalMethods().getCommandInstance().getCommands(),L=[],R=n.getInternalMethods().getContext();if(Object.keys(l).forEach(U=>{!Ks.includes(U)&&!Object.prototype.hasOwnProperty.call(C,U)&&!Object.prototype.hasOwnProperty.call(n.getInternalMethods().getParseContext(),U)&&!s.isValidAndSomeAliasIsNotNew(U,g)&&L.push(U)}),b&&(R.commands.length>0||_.length>0||E)&&l._.slice(R.commands.length).forEach(U=>{_.includes(""+U)||L.push(""+U)}),b){let V=((p=n.getDemandedCommands()._)===null||p===void 0?void 0:p.max)||0,W=R.commands.length+V;W<l._.length&&l._.slice(W).forEach(q=>{q=String(q),!R.commands.includes(q)&&!L.includes(q)&&L.push(q)})}L.length&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",L.length,L.map(U=>U.trim()?U:`"${U}"`).join(", ")))},s.unknownCommands=function(l){let g=n.getInternalMethods().getCommandInstance().getCommands(),C=[],E=n.getInternalMethods().getContext();return(E.commands.length>0||g.length>0)&&l._.slice(E.commands.length).forEach(b=>{g.includes(""+b)||C.push(""+b)}),C.length>0?(e.fail(i("Unknown command: %s","Unknown commands: %s",C.length,C.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(l,g){if(!Object.prototype.hasOwnProperty.call(g,l))return!1;let C=n.parsed.newAliases;return[l,...g[l]].some(E=>!Object.prototype.hasOwnProperty.call(C,E)||!C[l])},s.limitedChoices=function(l){let g=n.getOptions(),C={};if(!Object.keys(g.choices).length)return;Object.keys(l).forEach(p=>{Ks.indexOf(p)===-1&&Object.prototype.hasOwnProperty.call(g.choices,p)&&[].concat(l[p]).forEach(_=>{g.choices[p].indexOf(_)===-1&&_!==void 0&&(C[p]=(C[p]||[]).concat(_))})});let E=Object.keys(C);if(!E.length)return;let b=r("Invalid values:");E.forEach(p=>{b+=`
77
- ${r("Argument: %s, Given: %s, Choices: %s",p,e.stringifiedValues(C[p]),e.stringifiedValues(g.choices[p]))}`}),e.fail(b)};let o={};s.implies=function(l,g){B("<string|object> [array|number|string]",[l,g],arguments.length),typeof l=="object"?Object.keys(l).forEach(C=>{s.implies(C,l[C])}):(n.global(l),o[l]||(o[l]=[]),Array.isArray(g)?g.forEach(C=>s.implies(l,C)):(Fe(g,void 0,t),o[l].push(g)))},s.getImplied=function(){return o};function a(d,l){let g=Number(l);return l=isNaN(g)?l:g,typeof l=="number"?l=d._.length>=l:l.match(/^--no-.+/)?(l=l.match(/^--no-(.+)/)[1],l=!Object.prototype.hasOwnProperty.call(d,l)):l=Object.prototype.hasOwnProperty.call(d,l),l}s.implications=function(l){let g=[];if(Object.keys(o).forEach(C=>{let E=C;(o[C]||[]).forEach(b=>{let p=E,_=b;p=a(l,p),b=a(l,b),p&&!b&&g.push(` ${E} -> ${_}`)})}),g.length){let C=`${r("Implications failed:")}
78
- `;g.forEach(E=>{C+=E}),e.fail(C)}};let f={};s.conflicts=function(l,g){B("<string|object> [array|string]",[l,g],arguments.length),typeof l=="object"?Object.keys(l).forEach(C=>{s.conflicts(C,l[C])}):(n.global(l),f[l]||(f[l]=[]),Array.isArray(g)?g.forEach(C=>s.conflicts(l,C)):f[l].push(g))},s.getConflicting=()=>f,s.conflicting=function(l){Object.keys(l).forEach(g=>{f[g]&&f[g].forEach(C=>{C&&l[g]!==void 0&&l[C]!==void 0&&e.fail(r("Arguments %s and %s are mutually exclusive",g,C))})}),n.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(f).forEach(g=>{f[g].forEach(C=>{C&&l[t.Parser.camelCase(g)]!==void 0&&l[t.Parser.camelCase(C)]!==void 0&&e.fail(r("Arguments %s and %s are mutually exclusive",g,C))})})},s.recommendCommands=function(l,g){g=g.sort((p,_)=>_.length-p.length);let E=null,b=1/0;for(let p=0,_;(_=g[p])!==void 0;p++){let L=Ys(l,_);L<=3&&L<b&&(b=L,E=_)}E&&e.fail(r("Did you mean %s?",E))},s.reset=function(l){return o=Ke(o,g=>!l[g]),f=Ke(f,g=>!l[g]),s};let m=[];return s.freeze=function(){m.push({implied:o,conflicting:f})},s.unfreeze=function(){let l=m.pop();Fe(l,void 0,t),{implied:o,conflicting:f}=l},s}var Kc={},$r=[],qt;function gn(n,e,t,r){qt=r;let i={};if(Object.prototype.hasOwnProperty.call(n,"extends")){if(typeof n.extends!="string")return i;let s=/\.json|\..*rc$/.test(n.extends),o=null;if(s)o=Yc(e,n.extends);else try{o=Kc.resolve(n.extends)}catch{return n}Gc(o),$r.push(o),i=s?JSON.parse(qt.readFileSync(o,"utf8")):r.require(n.extends),delete n.extends,i=gn(i,qt.path.dirname(o),t,qt)}return $r=[],t?Qs(i,n):Object.assign({},i,n)}function Gc(n){if($r.indexOf(n)>-1)throw new oe(`Circular extended configurations: '${n}'.`)}function Yc(n,e){return qt.path.resolve(n,e)}function Qs(n,e){let t={};function r(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(t,n);for(let i of Object.keys(e))i!=="__proto__"&&(r(e[i])&&r(t[i])?t[i]=Qs(n[i],e[i]):t[i]=e[i]);return t}var O=function(n,e,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(n,t):i?i.value=t:e.set(n,t),t},u=function(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)},ue,at,Gt,Ce,we,Fn,Qe,ct,Cn,Be,En,Oe,Me,ye,Se,bn,lt,he,P,xn,wn,Ae,ft,Mt,Dt,Ze,yn,M,ht,dt,pt,$,An,Te,ie;function go(n){return(e=[],t=n.process.cwd(),r)=>{let i=new Yr(e,t,r,n);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var Zs=Symbol("copyDoubleDash"),Xs=Symbol("copyDoubleDash"),Nr=Symbol("deleteFromParserHintObject"),ks=Symbol("emitWarning"),eo=Symbol("freeze"),to=Symbol("getDollarZero"),mt=Symbol("getParserConfiguration"),no=Symbol("getUsageConfiguration"),Lr=Symbol("guessLocale"),ro=Symbol("guessVersion"),io=Symbol("parsePositionalNumbers"),Ur=Symbol("pkgUp"),Xe=Symbol("populateParserHintArray"),Tt=Symbol("populateParserHintSingleValueDictionary"),Rr=Symbol("populateParserHintArrayDictionary"),zr=Symbol("populateParserHintDictionary"),Wr=Symbol("sanitizeKey"),Vr=Symbol("setKey"),Hr=Symbol("unfreeze"),so=Symbol("validateAsync"),oo=Symbol("getCommandInstance"),uo=Symbol("getContext"),ao=Symbol("getHasOutput"),co=Symbol("getLoggerInstance"),lo=Symbol("getParseContext"),fo=Symbol("getUsageInstance"),Do=Symbol("getValidationInstance"),_n=Symbol("hasParseCallback"),ho=Symbol("isGlobalContext"),gt=Symbol("postProcess"),po=Symbol("rebase"),qr=Symbol("reset"),Yt=Symbol("runYargsParserAndExecuteCommands"),Gr=Symbol("runValidation"),mo=Symbol("setHasOutput"),Ft=Symbol("kTrackManuallySetKeys"),Jc="en_US",Yr=class{constructor(e=[],t,r,i){this.customScriptName=!1,this.parsed=!1,ue.set(this,void 0),at.set(this,void 0),Gt.set(this,{commands:[],fullCommands:[]}),Ce.set(this,null),we.set(this,null),Fn.set(this,"show-hidden"),Qe.set(this,null),ct.set(this,!0),Cn.set(this,{}),Be.set(this,!0),En.set(this,[]),Oe.set(this,void 0),Me.set(this,{}),ye.set(this,!1),Se.set(this,null),bn.set(this,!0),lt.set(this,void 0),he.set(this,""),P.set(this,void 0),xn.set(this,void 0),wn.set(this,{}),Ae.set(this,null),ft.set(this,null),Mt.set(this,{}),Dt.set(this,{}),Ze.set(this,void 0),yn.set(this,!1),M.set(this,void 0),ht.set(this,!1),dt.set(this,!1),pt.set(this,!1),$.set(this,void 0),An.set(this,{}),Te.set(this,null),ie.set(this,void 0),O(this,M,i,"f"),O(this,Ze,e,"f"),O(this,at,t,"f"),O(this,xn,r,"f"),O(this,Oe,new dn(this),"f"),this.$0=this[to](),this[qr](),O(this,ue,u(this,ue,"f"),"f"),O(this,$,u(this,$,"f"),"f"),O(this,ie,u(this,ie,"f"),"f"),O(this,P,u(this,P,"f"),"f"),u(this,P,"f").showHiddenOpt=u(this,Fn,"f"),O(this,lt,this[Xs](),"f"),u(this,M,"f").y18n.setLocale(Jc)}addHelpOpt(e,t){let r="help";return B("[string|boolean] [string]",[e,t],arguments.length),u(this,Se,"f")&&(this[Nr](u(this,Se,"f")),O(this,Se,null,"f")),e===!1&&t===void 0?this:(O(this,Se,typeof e=="string"?e:r,"f"),this.boolean(u(this,Se,"f")),this.describe(u(this,Se,"f"),t||u(this,$,"f").deferY18nLookup("Show help")),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(B("[string|boolean] [string]",[e,t],arguments.length),e===!1&&t===void 0)return this;let r=typeof e=="string"?e:u(this,Fn,"f");return this.boolean(r),this.describe(r,t||u(this,$,"f").deferY18nLookup("Show hidden options")),u(this,P,"f").showHiddenOpt=r,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return B("<object|string|array> [string|array]",[e,t],arguments.length),this[Rr](this.alias.bind(this),"alias",e,t),this}array(e){return B("<array|string>",[e],arguments.length),this[Xe]("array",e),this[Ft](e),this}boolean(e){return B("<array|string>",[e],arguments.length),this[Xe]("boolean",e),this[Ft](e),this}check(e,t){return B("<function> [boolean]",[e,t],arguments.length),this.middleware((r,i)=>ut(()=>e(r,i.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&u(this,$,"f").fail(s.toString(),s):u(this,$,"f").fail(u(this,M,"f").y18n.__("Argument check failed: %s",e.toString())),r),s=>(u(this,$,"f").fail(s.message?s.message:s.toString(),s),r)),!1,t),this}choices(e,t){return B("<object|string|array> [string|array]",[e,t],arguments.length),this[Rr](this.choices.bind(this),"choices",e,t),this}coerce(e,t){if(B("<object|string|array> [function]",[e,t],arguments.length),Array.isArray(e)){if(!t)throw new oe("coerce callback must be provided");for(let i of e)this.coerce(i,t);return this}else if(typeof e=="object"){for(let i of Object.keys(e))this.coerce(i,e[i]);return this}if(!t)throw new oe("coerce callback must be provided");let r=e;return u(this,P,"f").key[r]=!0,u(this,Oe,"f").addCoerceMiddleware((i,s)=>{var o;let a=(o=s.getAliases()[r])!==null&&o!==void 0?o:[],f=[r,...a].filter(m=>Object.prototype.hasOwnProperty.call(i,m));return f.length===0?i:ut(()=>t(i[f[0]]),m=>(f.forEach(d=>{i[d]=m}),i),m=>{throw new oe(m.message)})},r),this}conflicts(e,t){return B("<string|object> [string|array]",[e,t],arguments.length),u(this,ie,"f").conflicts(e,t),this}config(e="config",t,r){return B("[object|string] [string|function] [function]",[e,t,r],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=gn(e,u(this,at,"f"),this[mt]()["deep-merge-config"]||!1,u(this,M,"f")),u(this,P,"f").configObjects=(u(this,P,"f").configObjects||[]).concat(e),this):(typeof t=="function"&&(r=t,t=void 0),this.describe(e,t||u(this,$,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{u(this,P,"f").config[i]=r||!0}),this)}completion(e,t,r){return B("[string] [string|boolean|function] [function]",[e,t,r],arguments.length),typeof t=="function"&&(r=t,t=void 0),O(this,we,e||u(this,we,"f")||"completion","f"),!t&&t!==!1&&(t="generate completion script"),this.command(u(this,we,"f"),t),r&&u(this,Ce,"f").registerFunction(r),this}command(e,t,r,i,s,o){return B("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,r,i,s,o],arguments.length),u(this,ue,"f").addHandler(e,t,r,i,s,o),this}commands(e,t,r,i,s,o){return this.command(e,t,r,i,s,o)}commandDir(e,t){B("<string> [object]",[e,t],arguments.length);let r=u(this,xn,"f")||u(this,M,"f").require;return u(this,ue,"f").addDirectory(e,r,u(this,M,"f").getCallerFile(),t),this}count(e){return B("<array|string>",[e],arguments.length),this[Xe]("count",e),this[Ft](e),this}default(e,t,r){return B("<object|string|array> [*] [string]",[e,t,r],arguments.length),r&&(Ir(e,u(this,M,"f")),u(this,P,"f").defaultDescription[e]=r),typeof t=="function"&&(Ir(e,u(this,M,"f")),u(this,P,"f").defaultDescription[e]||(u(this,P,"f").defaultDescription[e]=u(this,$,"f").functionDescription(t)),t=t.call()),this[Tt](this.default.bind(this),"default",e,t),this}defaults(e,t,r){return this.default(e,t,r)}demandCommand(e=1,t,r,i){return B("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,r,i],arguments.length),typeof t!="number"&&(r=t,t=1/0),this.global("_",!1),u(this,P,"f").demandedCommands._={min:e,max:t,minMsg:r,maxMsg:i},this}demand(e,t,r){return Array.isArray(t)?(t.forEach(i=>{Fe(r,!0,u(this,M,"f")),this.demandOption(i,r)}),t=1/0):typeof t!="number"&&(r=t,t=1/0),typeof e=="number"?(Fe(r,!0,u(this,M,"f")),this.demandCommand(e,t,r,r)):Array.isArray(e)?e.forEach(i=>{Fe(r,!0,u(this,M,"f")),this.demandOption(i,r)}):typeof r=="string"?this.demandOption(e,r):(r===!0||typeof r>"u")&&this.demandOption(e),this}demandOption(e,t){return B("<object|string|array> [string]",[e,t],arguments.length),this[Tt](this.demandOption.bind(this),"demandedOptions",e,t),this}deprecateOption(e,t){return B("<string> [string|boolean]",[e,t],arguments.length),u(this,P,"f").deprecatedOptions[e]=t,this}describe(e,t){return B("<object|string|array> [string]",[e,t],arguments.length),this[Vr](e,!0),u(this,$,"f").describe(e,t),this}detectLocale(e){return B("<boolean>",[e],arguments.length),O(this,ct,e,"f"),this}env(e){return B("[string|boolean]",[e],arguments.length),e===!1?delete u(this,P,"f").envPrefix:u(this,P,"f").envPrefix=e||"",this}epilogue(e){return B("<string>",[e],arguments.length),u(this,$,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return B("<string|array> [string]",[e,t],arguments.length),Array.isArray(e)?e.forEach(r=>this.example(...r)):u(this,$,"f").example(e,t),this}exit(e,t){O(this,ye,!0,"f"),O(this,Qe,t,"f"),u(this,Be,"f")&&u(this,M,"f").process.exit(e)}exitProcess(e=!0){return B("[boolean]",[e],arguments.length),O(this,Be,e,"f"),this}fail(e){if(B("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new oe("Invalid first argument. Expected function or boolean 'false'");return u(this,$,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return B("<array> [function]",[e,t],arguments.length),t?u(this,Ce,"f").getCompletion(e,t):new Promise((r,i)=>{u(this,Ce,"f").getCompletion(e,(s,o)=>{s?i(s):r(o)})})}getDemandedOptions(){return B([],0),u(this,P,"f").demandedOptions}getDemandedCommands(){return B([],0),u(this,P,"f").demandedCommands}getDeprecatedOptions(){return B([],0),u(this,P,"f").deprecatedOptions}getDetectLocale(){return u(this,ct,"f")}getExitProcess(){return u(this,Be,"f")}getGroups(){return Object.assign({},u(this,Me,"f"),u(this,Dt,"f"))}getHelp(){if(O(this,ye,!0,"f"),!u(this,$,"f").hasCachedHelpMessage()){if(!this.parsed){let t=this[Yt](u(this,Ze,"f"),void 0,void 0,0,!0);if(Q(t))return t.then(()=>u(this,$,"f").help())}let e=u(this,ue,"f").runDefaultBuilderOn(this);if(Q(e))return e.then(()=>u(this,$,"f").help())}return Promise.resolve(u(this,$,"f").help())}getOptions(){return u(this,P,"f")}getStrict(){return u(this,ht,"f")}getStrictCommands(){return u(this,dt,"f")}getStrictOptions(){return u(this,pt,"f")}global(e,t){return B("<string|array> [boolean]",[e,t],arguments.length),e=[].concat(e),t!==!1?u(this,P,"f").local=u(this,P,"f").local.filter(r=>e.indexOf(r)===-1):e.forEach(r=>{u(this,P,"f").local.includes(r)||u(this,P,"f").local.push(r)}),this}group(e,t){B("<string|array> <string>",[e,t],arguments.length);let r=u(this,Dt,"f")[t]||u(this,Me,"f")[t];u(this,Dt,"f")[t]&&delete u(this,Dt,"f")[t];let i={};return u(this,Me,"f")[t]=(r||[]).concat(e).filter(s=>i[s]?!1:i[s]=!0),this}hide(e){return B("<string>",[e],arguments.length),u(this,P,"f").hiddenOptions.push(e),this}implies(e,t){return B("<string|object> [number|string|array]",[e,t],arguments.length),u(this,ie,"f").implies(e,t),this}locale(e){return B("[string]",[e],arguments.length),e===void 0?(this[Lr](),u(this,M,"f").y18n.getLocale()):(O(this,ct,!1,"f"),u(this,M,"f").y18n.setLocale(e),this)}middleware(e,t,r){return u(this,Oe,"f").addMiddleware(e,!!t,r)}nargs(e,t){return B("<string|object|array> [number]",[e,t],arguments.length),this[Tt](this.nargs.bind(this),"narg",e,t),this}normalize(e){return B("<array|string>",[e],arguments.length),this[Xe]("normalize",e),this}number(e){return B("<array|string>",[e],arguments.length),this[Xe]("number",e),this[Ft](e),this}option(e,t){if(B("<string|object> [object]",[e,t],arguments.length),typeof e=="object")Object.keys(e).forEach(r=>{this.options(r,e[r])});else{typeof t!="object"&&(t={}),this[Ft](e),u(this,Te,"f")&&(e==="version"||t?.alias==="version")&&this[ks](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
79
- `),void 0,"versionWarning"),u(this,P,"f").key[e]=!0,t.alias&&this.alias(e,t.alias);let r=t.deprecate||t.deprecated;r&&this.deprecateOption(e,r);let i=t.demand||t.required||t.require;i&&this.demand(e,i),t.demandOption&&this.demandOption(e,typeof t.demandOption=="string"?t.demandOption:void 0),t.conflicts&&this.conflicts(e,t.conflicts),"default"in t&&this.default(e,t.default),t.implies!==void 0&&this.implies(e,t.implies),t.nargs!==void 0&&this.nargs(e,t.nargs),t.config&&this.config(e,t.configParser),t.normalize&&this.normalize(e),t.choices&&this.choices(e,t.choices),t.coerce&&this.coerce(e,t.coerce),t.group&&this.group(e,t.group),(t.boolean||t.type==="boolean")&&(this.boolean(e),t.alias&&this.boolean(t.alias)),(t.array||t.type==="array")&&(this.array(e),t.alias&&this.array(t.alias)),(t.number||t.type==="number")&&(this.number(e),t.alias&&this.number(t.alias)),(t.string||t.type==="string")&&(this.string(e),t.alias&&this.string(t.alias)),(t.count||t.type==="count")&&this.count(e),typeof t.global=="boolean"&&this.global(e,t.global),t.defaultDescription&&(u(this,P,"f").defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);let s=t.describe||t.description||t.desc,o=u(this,$,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(o,e)||typeof s=="string")&&this.describe(e,s),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,r){B("[string|array] [function|boolean|object] [function]",[e,t,r],arguments.length),this[eo](),typeof e>"u"&&(e=u(this,Ze,"f")),typeof t=="object"&&(O(this,ft,t,"f"),t=r),typeof t=="function"&&(O(this,Ae,t,"f"),t=!1),t||O(this,Ze,e,"f"),u(this,Ae,"f")&&O(this,Be,!1,"f");let i=this[Yt](e,!!t),s=this.parsed;return u(this,Ce,"f").setParsed(this.parsed),Q(i)?i.then(o=>(u(this,Ae,"f")&&u(this,Ae,"f").call(this,u(this,Qe,"f"),o,u(this,he,"f")),o)).catch(o=>{throw u(this,Ae,"f")&&u(this,Ae,"f")(o,this.parsed.argv,u(this,he,"f")),o}).finally(()=>{this[Hr](),this.parsed=s}):(u(this,Ae,"f")&&u(this,Ae,"f").call(this,u(this,Qe,"f"),i,u(this,he,"f")),this[Hr](),this.parsed=s,i)}parseAsync(e,t,r){let i=this.parse(e,t,r);return Q(i)?i:Promise.resolve(i)}parseSync(e,t,r){let i=this.parse(e,t,r);if(Q(i))throw new oe(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return B("<object>",[e],arguments.length),O(this,wn,e,"f"),this}pkgConf(e,t){B("<string> [string]",[e,t],arguments.length);let r=null,i=this[Ur](t||u(this,at,"f"));return i[e]&&typeof i[e]=="object"&&(r=gn(i[e],t||u(this,at,"f"),this[mt]()["deep-merge-config"]||!1,u(this,M,"f")),u(this,P,"f").configObjects=(u(this,P,"f").configObjects||[]).concat(r)),this}positional(e,t){B("<string> <object>",[e,t],arguments.length);let r=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=Ke(t,(o,a)=>o==="type"&&!["string","number","boolean"].includes(a)?!1:r.includes(o));let i=u(this,Gt,"f").fullCommands[u(this,Gt,"f").fullCommands.length-1],s=i?u(this,ue,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return It(s).forEach(o=>{let a=s[o];Array.isArray(a)?a.indexOf(e)!==-1&&(t[o]=!0):a[e]&&!(o in t)&&(t[o]=a[e])}),this.group(e,u(this,$,"f").getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return B("[boolean]",[e],arguments.length),O(this,yn,e,"f"),this}required(e,t,r){return this.demand(e,t,r)}require(e,t,r){return this.demand(e,t,r)}requiresArg(e){return B("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&u(this,P,"f").narg[e]?this:(this[Tt](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,t){return B("[string] [string]",[e,t],arguments.length),e=e||this.$0,u(this,lt,"f").log(u(this,Ce,"f").generateCompletionScript(e,t||u(this,we,"f")||"completion")),this}showHelp(e){if(B("[string|function]",[e],arguments.length),O(this,ye,!0,"f"),!u(this,$,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[Yt](u(this,Ze,"f"),void 0,void 0,0,!0);if(Q(r))return r.then(()=>{u(this,$,"f").showHelp(e)}),this}let t=u(this,ue,"f").runDefaultBuilderOn(this);if(Q(t))return t.then(()=>{u(this,$,"f").showHelp(e)}),this}return u(this,$,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return B("[boolean|string] [string]",[e,t],arguments.length),u(this,$,"f").showHelpOnFail(e,t),this}showVersion(e){return B("[string|function]",[e],arguments.length),u(this,$,"f").showVersion(e),this}skipValidation(e){return B("<array|string>",[e],arguments.length),this[Xe]("skipValidation",e),this}strict(e){return B("[boolean]",[e],arguments.length),O(this,ht,e!==!1,"f"),this}strictCommands(e){return B("[boolean]",[e],arguments.length),O(this,dt,e!==!1,"f"),this}strictOptions(e){return B("[boolean]",[e],arguments.length),O(this,pt,e!==!1,"f"),this}string(e){return B("<array|string>",[e],arguments.length),this[Xe]("string",e),this[Ft](e),this}terminalWidth(){return B([],0),u(this,M,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return B("<object>",[e],arguments.length),O(this,ct,!1,"f"),u(this,M,"f").y18n.updateLocale(e),this}usage(e,t,r,i){if(B("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,r,i],arguments.length),t!==void 0){if(Fe(e,null,u(this,M,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,t,r,i);throw new oe(".usage() description must start with $0 if being used as alias for .command()")}else return u(this,$,"f").usage(e),this}usageConfiguration(e){return B("<object>",[e],arguments.length),O(this,An,e,"f"),this}version(e,t,r){let i="version";if(B("[boolean|string] [string] [string]",[e,t,r],arguments.length),u(this,Te,"f")&&(this[Nr](u(this,Te,"f")),u(this,$,"f").version(void 0),O(this,Te,null,"f")),arguments.length===0)r=this[ro](),e=i;else if(arguments.length===1){if(e===!1)return this;r=e,e=i}else arguments.length===2&&(r=t,t=void 0);return O(this,Te,typeof e=="string"?e:i,"f"),t=t||u(this,$,"f").deferY18nLookup("Show version number"),u(this,$,"f").version(r||void 0),this.boolean(u(this,Te,"f")),this.describe(u(this,Te,"f"),t),this}wrap(e){return B("<number|null|undefined>",[e],arguments.length),u(this,$,"f").wrap(e),this}[(ue=new WeakMap,at=new WeakMap,Gt=new WeakMap,Ce=new WeakMap,we=new WeakMap,Fn=new WeakMap,Qe=new WeakMap,ct=new WeakMap,Cn=new WeakMap,Be=new WeakMap,En=new WeakMap,Oe=new WeakMap,Me=new WeakMap,ye=new WeakMap,Se=new WeakMap,bn=new WeakMap,lt=new WeakMap,he=new WeakMap,P=new WeakMap,xn=new WeakMap,wn=new WeakMap,Ae=new WeakMap,ft=new WeakMap,Mt=new WeakMap,Dt=new WeakMap,Ze=new WeakMap,yn=new WeakMap,M=new WeakMap,ht=new WeakMap,dt=new WeakMap,pt=new WeakMap,$=new WeakMap,An=new WeakMap,Te=new WeakMap,ie=new WeakMap,Zs)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[Xs](){return{log:(...e)=>{this[_n]()||console.log(...e),O(this,ye,!0,"f"),u(this,he,"f").length&&O(this,he,u(this,he,"f")+`
80
- `,"f"),O(this,he,u(this,he,"f")+e.join(" "),"f")},error:(...e)=>{this[_n]()||console.error(...e),O(this,ye,!0,"f"),u(this,he,"f").length&&O(this,he,u(this,he,"f")+`
81
- `,"f"),O(this,he,u(this,he,"f")+e.join(" "),"f")}}}[Nr](e){It(u(this,P,"f")).forEach(t=>{if((i=>i==="configObjects")(t))return;let r=u(this,P,"f")[t];Array.isArray(r)?r.includes(e)&&r.splice(r.indexOf(e),1):typeof r=="object"&&delete r[e]}),delete u(this,$,"f").getDescriptions()[e]}[ks](e,t,r){u(this,Cn,"f")[r]||(u(this,M,"f").process.emitWarning(e,t),u(this,Cn,"f")[r]=!0)}[eo](){u(this,En,"f").push({options:u(this,P,"f"),configObjects:u(this,P,"f").configObjects.slice(0),exitProcess:u(this,Be,"f"),groups:u(this,Me,"f"),strict:u(this,ht,"f"),strictCommands:u(this,dt,"f"),strictOptions:u(this,pt,"f"),completionCommand:u(this,we,"f"),output:u(this,he,"f"),exitError:u(this,Qe,"f"),hasOutput:u(this,ye,"f"),parsed:this.parsed,parseFn:u(this,Ae,"f"),parseContext:u(this,ft,"f")}),u(this,$,"f").freeze(),u(this,ie,"f").freeze(),u(this,ue,"f").freeze(),u(this,Oe,"f").freeze()}[to](){let e="",t;return/\b(node|iojs|electron|bun)(\.exe)?$/.test(u(this,M,"f").process.argv()[0])?t=u(this,M,"f").process.argv().slice(1,2):t=u(this,M,"f").process.argv().slice(0,1),e=t.map(r=>{let i=this[po](u(this,at,"f"),r);return r.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<r.length?i:r}).join(" ").trim(),u(this,M,"f").getEnv("_")&&u(this,M,"f").getProcessArgvBin()===u(this,M,"f").getEnv("_")&&(e=u(this,M,"f").getEnv("_").replace(`${u(this,M,"f").path.dirname(u(this,M,"f").process.execPath())}/`,"")),e}[mt](){return u(this,wn,"f")}[no](){return u(this,An,"f")}[Lr](){if(!u(this,ct,"f"))return;let e=u(this,M,"f").getEnv("LC_ALL")||u(this,M,"f").getEnv("LC_MESSAGES")||u(this,M,"f").getEnv("LANG")||u(this,M,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[ro](){return this[Ur]().version||"unknown"}[io](e){let t=e["--"]?e["--"]:e._;for(let r=0,i;(i=t[r])!==void 0;r++)u(this,M,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(t[r]=Number(i));return e}[Ur](e){let t=e||"*";if(u(this,Mt,"f")[t])return u(this,Mt,"f")[t];let r={};try{let i=e||u(this,M,"f").mainFilename;u(this,M,"f").path.extname(i)&&(i=u(this,M,"f").path.dirname(i));let s=u(this,M,"f").findUp(i,(o,a)=>{if(a.includes("package.json"))return"package.json"});Fe(s,void 0,u(this,M,"f")),r=JSON.parse(u(this,M,"f").readFileSync(s,"utf8"))}catch{}return u(this,Mt,"f")[t]=r||{},u(this,Mt,"f")[t]}[Xe](e,t){t=[].concat(t),t.forEach(r=>{r=this[Wr](r),u(this,P,"f")[e].push(r)})}[Tt](e,t,r,i){this[zr](e,t,r,i,(s,o,a)=>{u(this,P,"f")[s][o]=a})}[Rr](e,t,r,i){this[zr](e,t,r,i,(s,o,a)=>{u(this,P,"f")[s][o]=(u(this,P,"f")[s][o]||[]).concat(a)})}[zr](e,t,r,i,s){if(Array.isArray(r))r.forEach(o=>{e(o,i)});else if((o=>typeof o=="object")(r))for(let o of It(r))e(o,r[o]);else s(t,this[Wr](r),i)}[Wr](e){return e==="__proto__"?"___proto___":e}[Vr](e,t){return this[Tt](this[Vr].bind(this),"key",e,t),this}[Hr](){var e,t,r,i,s,o,a,f,m,d,l,g;let C=u(this,En,"f").pop();Fe(C,void 0,u(this,M,"f"));let E;e=this,t=this,r=this,i=this,s=this,o=this,a=this,f=this,m=this,d=this,l=this,g=this,{options:{set value(b){O(e,P,b,"f")}}.value,configObjects:E,exitProcess:{set value(b){O(t,Be,b,"f")}}.value,groups:{set value(b){O(r,Me,b,"f")}}.value,output:{set value(b){O(i,he,b,"f")}}.value,exitError:{set value(b){O(s,Qe,b,"f")}}.value,hasOutput:{set value(b){O(o,ye,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){O(a,ht,b,"f")}}.value,strictCommands:{set value(b){O(f,dt,b,"f")}}.value,strictOptions:{set value(b){O(m,pt,b,"f")}}.value,completionCommand:{set value(b){O(d,we,b,"f")}}.value,parseFn:{set value(b){O(l,Ae,b,"f")}}.value,parseContext:{set value(b){O(g,ft,b,"f")}}.value}=C,u(this,P,"f").configObjects=E,u(this,$,"f").unfreeze(),u(this,ie,"f").unfreeze(),u(this,ue,"f").unfreeze(),u(this,Oe,"f").unfreeze()}[so](e,t){return ut(t,r=>(e(r),r))}getInternalMethods(){return{getCommandInstance:this[oo].bind(this),getContext:this[uo].bind(this),getHasOutput:this[ao].bind(this),getLoggerInstance:this[co].bind(this),getParseContext:this[lo].bind(this),getParserConfiguration:this[mt].bind(this),getUsageConfiguration:this[no].bind(this),getUsageInstance:this[fo].bind(this),getValidationInstance:this[Do].bind(this),hasParseCallback:this[_n].bind(this),isGlobalContext:this[ho].bind(this),postProcess:this[gt].bind(this),reset:this[qr].bind(this),runValidation:this[Gr].bind(this),runYargsParserAndExecuteCommands:this[Yt].bind(this),setHasOutput:this[mo].bind(this)}}[oo](){return u(this,ue,"f")}[uo](){return u(this,Gt,"f")}[ao](){return u(this,ye,"f")}[co](){return u(this,lt,"f")}[lo](){return u(this,ft,"f")||{}}[fo](){return u(this,$,"f")}[Do](){return u(this,ie,"f")}[_n](){return!!u(this,Ae,"f")}[ho](){return u(this,bn,"f")}[gt](e,t,r,i){return r||Q(e)||(t||(e=this[Zs](e)),(this[mt]()["parse-positional-numbers"]||this[mt]()["parse-positional-numbers"]===void 0)&&(e=this[io](e)),i&&(e=ot(e,this,u(this,Oe,"f").getMiddleware(),!1))),e}[qr](e={}){O(this,P,u(this,P,"f")||{},"f");let t={};t.local=u(this,P,"f").local||[],t.configObjects=u(this,P,"f").configObjects||[];let r={};t.local.forEach(o=>{r[o]=!0,(e[o]||[]).forEach(a=>{r[a]=!0})}),Object.assign(u(this,Dt,"f"),Object.keys(u(this,Me,"f")).reduce((o,a)=>{let f=u(this,Me,"f")[a].filter(m=>!(m in r));return f.length>0&&(o[a]=f),o},{})),O(this,Me,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(o=>{t[o]=(u(this,P,"f")[o]||[]).filter(a=>!r[a])}),s.forEach(o=>{t[o]=Ke(u(this,P,"f")[o],a=>!r[a])}),t.envPrefix=u(this,P,"f").envPrefix,O(this,P,t,"f"),O(this,$,u(this,$,"f")?u(this,$,"f").reset(r):Vs(this,u(this,M,"f")),"f"),O(this,ie,u(this,ie,"f")?u(this,ie,"f").reset(r):Js(this,u(this,$,"f"),u(this,M,"f")),"f"),O(this,ue,u(this,ue,"f")?u(this,ue,"f").reset():Rs(u(this,$,"f"),u(this,ie,"f"),u(this,Oe,"f"),u(this,M,"f")),"f"),u(this,Ce,"f")||O(this,Ce,Gs(this,u(this,$,"f"),u(this,ue,"f"),u(this,M,"f")),"f"),u(this,Oe,"f").reset(),O(this,we,null,"f"),O(this,he,"","f"),O(this,Qe,null,"f"),O(this,ye,!1,"f"),this.parsed=!1,this}[po](e,t){return u(this,M,"f").path.relative(e,t)}[Yt](e,t,r,i=0,s=!1){var o,a,f,m;let d=!!r||s;e=e||u(this,Ze,"f"),u(this,P,"f").__=u(this,M,"f").y18n.__,u(this,P,"f").configuration=this[mt]();let l=!!u(this,P,"f").configuration["populate--"],g=Object.assign({},u(this,P,"f").configuration,{"populate--":!0}),C=u(this,M,"f").Parser.detailed(e,Object.assign({},u(this,P,"f"),{configuration:{"parse-positional-numbers":!1,...g}})),E=Object.assign(C.argv,u(this,ft,"f")),b,p=C.aliases,_=!1,L=!1;Object.keys(E).forEach(R=>{R===u(this,Se,"f")&&E[R]?_=!0:R===u(this,Te,"f")&&E[R]&&(L=!0)}),E.$0=this.$0,this.parsed=C,i===0&&u(this,$,"f").clearCachedHelpMessage();try{if(this[Lr](),t)return this[gt](E,l,!!r,!1);u(this,Se,"f")&&[u(this,Se,"f")].concat(p[u(this,Se,"f")]||[]).filter(q=>q.length>1).includes(""+E._[E._.length-1])&&(E._.pop(),_=!0),O(this,bn,!1,"f");let R=u(this,ue,"f").getCommands(),U=!((o=u(this,Ce,"f"))===null||o===void 0)&&o.completionKey?[(a=u(this,Ce,"f"))===null||a===void 0?void 0:a.completionKey,...(m=this.getAliases()[(f=u(this,Ce,"f"))===null||f===void 0?void 0:f.completionKey])!==null&&m!==void 0?m:[]].some(W=>Object.prototype.hasOwnProperty.call(E,W)):!1,V=_||U||s;if(E._.length){if(R.length){let W;for(let q=i||0,K;E._[q]!==void 0;q++)if(K=String(E._[q]),R.includes(K)&&K!==u(this,we,"f")){let ae=u(this,ue,"f").runCommand(K,this,C,q+1,s,_||L||s);return this[gt](ae,l,!!r,!1)}else if(!W&&K!==u(this,we,"f")){W=K;break}!u(this,ue,"f").hasDefaultCommand()&&u(this,yn,"f")&&W&&!V&&u(this,ie,"f").recommendCommands(W,R)}u(this,we,"f")&&E._.includes(u(this,we,"f"))&&!U&&(u(this,Be,"f")&&Je(!0),this.showCompletionScript(),this.exit(0))}if(u(this,ue,"f").hasDefaultCommand()&&!V){let W=u(this,ue,"f").runCommand(null,this,C,0,s,_||L||s);return this[gt](W,l,!!r,!1)}if(U){u(this,Be,"f")&&Je(!0),e=[].concat(e);let W=e.slice(e.indexOf(`--${u(this,Ce,"f").completionKey}`)+1);return u(this,Ce,"f").getCompletion(W,(q,K)=>{if(q)throw new oe(q.message);(K||[]).forEach(ae=>{u(this,lt,"f").log(ae)}),this.exit(0)}),this[gt](E,!l,!!r,!1)}if(u(this,ye,"f")||(_?(u(this,Be,"f")&&Je(!0),d=!0,this.showHelp(W=>{u(this,lt,"f").log(W),this.exit(0)})):L&&(u(this,Be,"f")&&Je(!0),d=!0,u(this,$,"f").showVersion("log"),this.exit(0))),!d&&u(this,P,"f").skipValidation.length>0&&(d=Object.keys(E).some(W=>u(this,P,"f").skipValidation.indexOf(W)>=0&&E[W]===!0)),!d){if(C.error)throw new oe(C.error.message);if(!U){let W=this[Gr](p,{},C.error);r||(b=ot(E,this,u(this,Oe,"f").getMiddleware(),!0)),b=this[so](W,b??E),Q(b)&&!r&&(b=b.then(()=>ot(E,this,u(this,Oe,"f").getMiddleware(),!1)))}}}catch(R){if(R instanceof oe)u(this,$,"f").fail(R.message,R);else throw R}return this[gt](b??E,l,!!r,!0)}[Gr](e,t,r,i){let s={...this.getDemandedOptions()};return o=>{if(r)throw new oe(r.message);u(this,ie,"f").nonOptionCount(o),u(this,ie,"f").requiredArguments(o,s);let a=!1;u(this,dt,"f")&&(a=u(this,ie,"f").unknownCommands(o)),u(this,ht,"f")&&!a?u(this,ie,"f").unknownArguments(o,e,t,!!i):u(this,pt,"f")&&u(this,ie,"f").unknownArguments(o,e,{},!1,!1),u(this,ie,"f").limitedChoices(o),u(this,ie,"f").implications(o),u(this,ie,"f").conflicting(o)}}[mo](){O(this,ye,!0,"f")}[Ft](e){if(typeof e=="string")u(this,P,"f").key[e]=!0;else for(let t of e)u(this,P,"f").key[t]=!0}};function zs(n){return!!n&&typeof n.getInternalMethods=="function"}var Qc=go(Ms),Fo=Qc;var xo=Ct(Eo(),1),kc={},Zc=process.argv.slice(2),bo=new xo.default(Fo),Jr=console.log;async function Qr(n){bo.yargs.option("listen",{desc:"daemon control listen multiaddr",type:"string",default:"/unix/tmp/p2pd.sock"}).option("quiet",{alias:"q",desc:"be quiet",type:"boolean",default:!1}).option("id",{desc:"peer identity; private key file",type:"string",default:""}).option("hostAddrs",{desc:"Comma separated list of multiaddrs the host should listen on",type:"string",default:""}).option("announceAddrs",{desc:"Comma separated list of multiaddrs the host should announce to the network",type:"string",default:""}).option("bootstrap",{alias:"b",desc:"Connects to bootstrap peers and bootstraps the dht if enabled",type:"boolean",default:!1}).option("bootstrapPeers",{desc:"Comma separated list of bootstrap peers; defaults to the IPFS DHT peers",type:"string",default:""}).option("dht",{desc:"Enables the DHT in full node mode",type:"boolean",default:!1}).option("dhtClient",{desc:"(Not yet supported) Enables the DHT in client mode",type:"boolean",default:!1}).option("nat",{desc:"Enables UPnP NAT hole punching",type:"boolean",default:!1}).option("connMgr",{desc:"(Not yet supported) Enables the Connection Manager",type:"boolean",default:!1}).option("connMgrLo",{desc:"Number identifying the number of peers below which this node will not activate preemptive disconnections",type:"number"}).option("connMgrHi",{desc:"Number identifying the maximum number of peers the current peer is willing to be connected to before is starts disconnecting",type:"number"}).option("pubsub",{desc:"Enables pubsub",type:"boolean",default:!1}).option("pubsubRouter",{desc:"Specifies the pubsub router implementation",type:"string",default:"gossipsub"}).fail((i,s,o)=>{if(s!=null)throw s;Zc.length>0&&Jr(i),o.showHelp()});let{data:e,argv:t}=await bo.parse(n);e!=null&&(Jr(e),process.exit(0)),await(await wo(Ni(t.listen),t)).start(),t.quiet!==!0&&Jr("daemon has started")}async function wo(n,e){throw new Error("Not implemented yet")}pr(kc)&&Qr(process.argv).catch(n=>{console.error(n),process.exit(1)});return So(Xc);})();
84
+ `)}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(C).length,Object.keys(C).join(", ")+b))}},s.unknownArguments=function(f,g,C,E,b=!0){var m;let y=n.getInternalMethods().getCommandInstance().getCommands(),U=[],L=n.getInternalMethods().getContext();if(Object.keys(f).forEach(R=>{!Js.includes(R)&&!Object.prototype.hasOwnProperty.call(C,R)&&!Object.prototype.hasOwnProperty.call(n.getInternalMethods().getParseContext(),R)&&!s.isValidAndSomeAliasIsNotNew(R,g)&&U.push(R)}),b&&(L.commands.length>0||y.length>0||E)&&f._.slice(L.commands.length).forEach(R=>{y.includes(""+R)||U.push(""+R)}),b){let V=((m=n.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,W=L.commands.length+V;W<f._.length&&f._.slice(W).forEach(q=>{q=String(q),!L.commands.includes(q)&&!U.includes(q)&&U.push(q)})}U.length&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",U.length,U.map(R=>R.trim()?R:`"${R}"`).join(", ")))},s.unknownCommands=function(f){let g=n.getInternalMethods().getCommandInstance().getCommands(),C=[],E=n.getInternalMethods().getContext();return(E.commands.length>0||g.length>0)&&f._.slice(E.commands.length).forEach(b=>{g.includes(""+b)||C.push(""+b)}),C.length>0?(e.fail(i("Unknown command: %s","Unknown commands: %s",C.length,C.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(f,g){if(!Object.prototype.hasOwnProperty.call(g,f))return!1;let C=n.parsed.newAliases;return[f,...g[f]].some(E=>!Object.prototype.hasOwnProperty.call(C,E)||!C[f])},s.limitedChoices=function(f){let g=n.getOptions(),C={};if(!Object.keys(g.choices).length)return;Object.keys(f).forEach(m=>{Js.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(g.choices,m)&&[].concat(f[m]).forEach(y=>{g.choices[m].indexOf(y)===-1&&y!==void 0&&(C[m]=(C[m]||[]).concat(y))})});let E=Object.keys(C);if(!E.length)return;let b=r("Invalid values:");E.forEach(m=>{b+=`
85
+ ${r("Argument: %s, Given: %s, Choices: %s",m,e.stringifiedValues(C[m]),e.stringifiedValues(g.choices[m]))}`}),e.fail(b)};let o={};s.implies=function(f,g){B("<string|object> [array|number|string]",[f,g],arguments.length),typeof f=="object"?Object.keys(f).forEach(C=>{s.implies(C,f[C])}):(n.global(f),o[f]||(o[f]=[]),Array.isArray(g)?g.forEach(C=>s.implies(f,C)):(Fe(g,void 0,t),o[f].push(g)))},s.getImplied=function(){return o};function a(p,f){let g=Number(f);return f=isNaN(g)?f:g,typeof f=="number"?f=p._.length>=f:f.match(/^--no-.+/)?(f=f.match(/^--no-(.+)/)[1],f=!Object.prototype.hasOwnProperty.call(p,f)):f=Object.prototype.hasOwnProperty.call(p,f),f}s.implications=function(f){let g=[];if(Object.keys(o).forEach(C=>{let E=C;(o[C]||[]).forEach(b=>{let m=E,y=b;m=a(f,m),b=a(f,b),m&&!b&&g.push(` ${E} -> ${y}`)})}),g.length){let C=`${r("Implications failed:")}
86
+ `;g.forEach(E=>{C+=E}),e.fail(C)}};let l={};s.conflicts=function(f,g){B("<string|object> [array|string]",[f,g],arguments.length),typeof f=="object"?Object.keys(f).forEach(C=>{s.conflicts(C,f[C])}):(n.global(f),l[f]||(l[f]=[]),Array.isArray(g)?g.forEach(C=>s.conflicts(f,C)):l[f].push(g))},s.getConflicting=()=>l,s.conflicting=function(f){Object.keys(f).forEach(g=>{l[g]&&l[g].forEach(C=>{C&&f[g]!==void 0&&f[C]!==void 0&&e.fail(r("Arguments %s and %s are mutually exclusive",g,C))})}),n.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach(g=>{l[g].forEach(C=>{C&&f[t.Parser.camelCase(g)]!==void 0&&f[t.Parser.camelCase(C)]!==void 0&&e.fail(r("Arguments %s and %s are mutually exclusive",g,C))})})},s.recommendCommands=function(f,g){g=g.sort((m,y)=>y.length-m.length);let E=null,b=1/0;for(let m=0,y;(y=g[m])!==void 0;m++){let U=Ks(f,y);U<=3&&U<b&&(b=U,E=y)}E&&e.fail(r("Did you mean %s?",E))},s.reset=function(f){return o=Ke(o,g=>!f[g]),l=Ke(l,g=>!f[g]),s};let d=[];return s.freeze=function(){d.push({implied:o,conflicting:l})},s.unfreeze=function(){let f=d.pop();Fe(f,void 0,t),{implied:o,conflicting:l}=f},s}var Jc={},$r=[],qt;function gn(n,e,t,r){qt=r;let i={};if(Object.prototype.hasOwnProperty.call(n,"extends")){if(typeof n.extends!="string")return i;let s=/\.json|\..*rc$/.test(n.extends),o=null;if(s)o=Kc(e,n.extends);else try{o=Jc.resolve(n.extends)}catch{return n}Yc(o),$r.push(o),i=s?JSON.parse(qt.readFileSync(o,"utf8")):r.require(n.extends),delete n.extends,i=gn(i,qt.path.dirname(o),t,qt)}return $r=[],t?Zs(i,n):Object.assign({},i,n)}function Yc(n){if($r.indexOf(n)>-1)throw new oe(`Circular extended configurations: '${n}'.`)}function Kc(n,e){return qt.path.resolve(n,e)}function Zs(n,e){let t={};function r(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(t,n);for(let i of Object.keys(e))i!=="__proto__"&&(r(e[i])&&r(t[i])?t[i]=Zs(n[i],e[i]):t[i]=e[i]);return t}var O=function(n,e,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(n,t):i?i.value=t:e.set(n,t),t},u=function(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)},ue,at,Gt,Ce,we,Fn,Qe,ct,Cn,Be,En,Oe,Me,ye,Se,bn,lt,De,P,xn,wn,Ae,ft,Mt,ht,Ze,yn,M,Dt,dt,pt,$,An,Te,ie;function Fo(n){return(e=[],t=n.process.cwd(),r)=>{let i=new Yr(e,t,r,n);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var Xs=Symbol("copyDoubleDash"),ks=Symbol("copyDoubleDash"),Nr=Symbol("deleteFromParserHintObject"),eo=Symbol("emitWarning"),to=Symbol("freeze"),no=Symbol("getDollarZero"),mt=Symbol("getParserConfiguration"),ro=Symbol("getUsageConfiguration"),Lr=Symbol("guessLocale"),io=Symbol("guessVersion"),so=Symbol("parsePositionalNumbers"),Ur=Symbol("pkgUp"),Xe=Symbol("populateParserHintArray"),Tt=Symbol("populateParserHintSingleValueDictionary"),Rr=Symbol("populateParserHintArrayDictionary"),zr=Symbol("populateParserHintDictionary"),Wr=Symbol("sanitizeKey"),Vr=Symbol("setKey"),Hr=Symbol("unfreeze"),oo=Symbol("validateAsync"),uo=Symbol("getCommandInstance"),ao=Symbol("getContext"),co=Symbol("getHasOutput"),lo=Symbol("getLoggerInstance"),fo=Symbol("getParseContext"),ho=Symbol("getUsageInstance"),Do=Symbol("getValidationInstance"),_n=Symbol("hasParseCallback"),po=Symbol("isGlobalContext"),gt=Symbol("postProcess"),mo=Symbol("rebase"),qr=Symbol("reset"),Yt=Symbol("runYargsParserAndExecuteCommands"),Gr=Symbol("runValidation"),go=Symbol("setHasOutput"),Ft=Symbol("kTrackManuallySetKeys"),Qc="en_US",Yr=class{constructor(e=[],t,r,i){this.customScriptName=!1,this.parsed=!1,ue.set(this,void 0),at.set(this,void 0),Gt.set(this,{commands:[],fullCommands:[]}),Ce.set(this,null),we.set(this,null),Fn.set(this,"show-hidden"),Qe.set(this,null),ct.set(this,!0),Cn.set(this,{}),Be.set(this,!0),En.set(this,[]),Oe.set(this,void 0),Me.set(this,{}),ye.set(this,!1),Se.set(this,null),bn.set(this,!0),lt.set(this,void 0),De.set(this,""),P.set(this,void 0),xn.set(this,void 0),wn.set(this,{}),Ae.set(this,null),ft.set(this,null),Mt.set(this,{}),ht.set(this,{}),Ze.set(this,void 0),yn.set(this,!1),M.set(this,void 0),Dt.set(this,!1),dt.set(this,!1),pt.set(this,!1),$.set(this,void 0),An.set(this,{}),Te.set(this,null),ie.set(this,void 0),O(this,M,i,"f"),O(this,Ze,e,"f"),O(this,at,t,"f"),O(this,xn,r,"f"),O(this,Oe,new dn(this),"f"),this.$0=this[no](),this[qr](),O(this,ue,u(this,ue,"f"),"f"),O(this,$,u(this,$,"f"),"f"),O(this,ie,u(this,ie,"f"),"f"),O(this,P,u(this,P,"f"),"f"),u(this,P,"f").showHiddenOpt=u(this,Fn,"f"),O(this,lt,this[ks](),"f"),u(this,M,"f").y18n.setLocale(Qc)}addHelpOpt(e,t){let r="help";return B("[string|boolean] [string]",[e,t],arguments.length),u(this,Se,"f")&&(this[Nr](u(this,Se,"f")),O(this,Se,null,"f")),e===!1&&t===void 0?this:(O(this,Se,typeof e=="string"?e:r,"f"),this.boolean(u(this,Se,"f")),this.describe(u(this,Se,"f"),t||u(this,$,"f").deferY18nLookup("Show help")),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(B("[string|boolean] [string]",[e,t],arguments.length),e===!1&&t===void 0)return this;let r=typeof e=="string"?e:u(this,Fn,"f");return this.boolean(r),this.describe(r,t||u(this,$,"f").deferY18nLookup("Show hidden options")),u(this,P,"f").showHiddenOpt=r,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return B("<object|string|array> [string|array]",[e,t],arguments.length),this[Rr](this.alias.bind(this),"alias",e,t),this}array(e){return B("<array|string>",[e],arguments.length),this[Xe]("array",e),this[Ft](e),this}boolean(e){return B("<array|string>",[e],arguments.length),this[Xe]("boolean",e),this[Ft](e),this}check(e,t){return B("<function> [boolean]",[e,t],arguments.length),this.middleware((r,i)=>ut(()=>e(r,i.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&u(this,$,"f").fail(s.toString(),s):u(this,$,"f").fail(u(this,M,"f").y18n.__("Argument check failed: %s",e.toString())),r),s=>(u(this,$,"f").fail(s.message?s.message:s.toString(),s),r)),!1,t),this}choices(e,t){return B("<object|string|array> [string|array]",[e,t],arguments.length),this[Rr](this.choices.bind(this),"choices",e,t),this}coerce(e,t){if(B("<object|string|array> [function]",[e,t],arguments.length),Array.isArray(e)){if(!t)throw new oe("coerce callback must be provided");for(let i of e)this.coerce(i,t);return this}else if(typeof e=="object"){for(let i of Object.keys(e))this.coerce(i,e[i]);return this}if(!t)throw new oe("coerce callback must be provided");let r=e;return u(this,P,"f").key[r]=!0,u(this,Oe,"f").addCoerceMiddleware((i,s)=>{var o;let a=(o=s.getAliases()[r])!==null&&o!==void 0?o:[],l=[r,...a].filter(d=>Object.prototype.hasOwnProperty.call(i,d));return l.length===0?i:ut(()=>t(i[l[0]]),d=>(l.forEach(p=>{i[p]=d}),i),d=>{throw new oe(d.message)})},r),this}conflicts(e,t){return B("<string|object> [string|array]",[e,t],arguments.length),u(this,ie,"f").conflicts(e,t),this}config(e="config",t,r){return B("[object|string] [string|function] [function]",[e,t,r],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=gn(e,u(this,at,"f"),this[mt]()["deep-merge-config"]||!1,u(this,M,"f")),u(this,P,"f").configObjects=(u(this,P,"f").configObjects||[]).concat(e),this):(typeof t=="function"&&(r=t,t=void 0),this.describe(e,t||u(this,$,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{u(this,P,"f").config[i]=r||!0}),this)}completion(e,t,r){return B("[string] [string|boolean|function] [function]",[e,t,r],arguments.length),typeof t=="function"&&(r=t,t=void 0),O(this,we,e||u(this,we,"f")||"completion","f"),!t&&t!==!1&&(t="generate completion script"),this.command(u(this,we,"f"),t),r&&u(this,Ce,"f").registerFunction(r),this}command(e,t,r,i,s,o){return B("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,r,i,s,o],arguments.length),u(this,ue,"f").addHandler(e,t,r,i,s,o),this}commands(e,t,r,i,s,o){return this.command(e,t,r,i,s,o)}commandDir(e,t){B("<string> [object]",[e,t],arguments.length);let r=u(this,xn,"f")||u(this,M,"f").require;return u(this,ue,"f").addDirectory(e,r,u(this,M,"f").getCallerFile(),t),this}count(e){return B("<array|string>",[e],arguments.length),this[Xe]("count",e),this[Ft](e),this}default(e,t,r){return B("<object|string|array> [*] [string]",[e,t,r],arguments.length),r&&(Ir(e,u(this,M,"f")),u(this,P,"f").defaultDescription[e]=r),typeof t=="function"&&(Ir(e,u(this,M,"f")),u(this,P,"f").defaultDescription[e]||(u(this,P,"f").defaultDescription[e]=u(this,$,"f").functionDescription(t)),t=t.call()),this[Tt](this.default.bind(this),"default",e,t),this}defaults(e,t,r){return this.default(e,t,r)}demandCommand(e=1,t,r,i){return B("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,r,i],arguments.length),typeof t!="number"&&(r=t,t=1/0),this.global("_",!1),u(this,P,"f").demandedCommands._={min:e,max:t,minMsg:r,maxMsg:i},this}demand(e,t,r){return Array.isArray(t)?(t.forEach(i=>{Fe(r,!0,u(this,M,"f")),this.demandOption(i,r)}),t=1/0):typeof t!="number"&&(r=t,t=1/0),typeof e=="number"?(Fe(r,!0,u(this,M,"f")),this.demandCommand(e,t,r,r)):Array.isArray(e)?e.forEach(i=>{Fe(r,!0,u(this,M,"f")),this.demandOption(i,r)}):typeof r=="string"?this.demandOption(e,r):(r===!0||typeof r>"u")&&this.demandOption(e),this}demandOption(e,t){return B("<object|string|array> [string]",[e,t],arguments.length),this[Tt](this.demandOption.bind(this),"demandedOptions",e,t),this}deprecateOption(e,t){return B("<string> [string|boolean]",[e,t],arguments.length),u(this,P,"f").deprecatedOptions[e]=t,this}describe(e,t){return B("<object|string|array> [string]",[e,t],arguments.length),this[Vr](e,!0),u(this,$,"f").describe(e,t),this}detectLocale(e){return B("<boolean>",[e],arguments.length),O(this,ct,e,"f"),this}env(e){return B("[string|boolean]",[e],arguments.length),e===!1?delete u(this,P,"f").envPrefix:u(this,P,"f").envPrefix=e||"",this}epilogue(e){return B("<string>",[e],arguments.length),u(this,$,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return B("<string|array> [string]",[e,t],arguments.length),Array.isArray(e)?e.forEach(r=>this.example(...r)):u(this,$,"f").example(e,t),this}exit(e,t){O(this,ye,!0,"f"),O(this,Qe,t,"f"),u(this,Be,"f")&&u(this,M,"f").process.exit(e)}exitProcess(e=!0){return B("[boolean]",[e],arguments.length),O(this,Be,e,"f"),this}fail(e){if(B("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new oe("Invalid first argument. Expected function or boolean 'false'");return u(this,$,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return B("<array> [function]",[e,t],arguments.length),t?u(this,Ce,"f").getCompletion(e,t):new Promise((r,i)=>{u(this,Ce,"f").getCompletion(e,(s,o)=>{s?i(s):r(o)})})}getDemandedOptions(){return B([],0),u(this,P,"f").demandedOptions}getDemandedCommands(){return B([],0),u(this,P,"f").demandedCommands}getDeprecatedOptions(){return B([],0),u(this,P,"f").deprecatedOptions}getDetectLocale(){return u(this,ct,"f")}getExitProcess(){return u(this,Be,"f")}getGroups(){return Object.assign({},u(this,Me,"f"),u(this,ht,"f"))}getHelp(){if(O(this,ye,!0,"f"),!u(this,$,"f").hasCachedHelpMessage()){if(!this.parsed){let t=this[Yt](u(this,Ze,"f"),void 0,void 0,0,!0);if(Q(t))return t.then(()=>u(this,$,"f").help())}let e=u(this,ue,"f").runDefaultBuilderOn(this);if(Q(e))return e.then(()=>u(this,$,"f").help())}return Promise.resolve(u(this,$,"f").help())}getOptions(){return u(this,P,"f")}getStrict(){return u(this,Dt,"f")}getStrictCommands(){return u(this,dt,"f")}getStrictOptions(){return u(this,pt,"f")}global(e,t){return B("<string|array> [boolean]",[e,t],arguments.length),e=[].concat(e),t!==!1?u(this,P,"f").local=u(this,P,"f").local.filter(r=>e.indexOf(r)===-1):e.forEach(r=>{u(this,P,"f").local.includes(r)||u(this,P,"f").local.push(r)}),this}group(e,t){B("<string|array> <string>",[e,t],arguments.length);let r=u(this,ht,"f")[t]||u(this,Me,"f")[t];u(this,ht,"f")[t]&&delete u(this,ht,"f")[t];let i={};return u(this,Me,"f")[t]=(r||[]).concat(e).filter(s=>i[s]?!1:i[s]=!0),this}hide(e){return B("<string>",[e],arguments.length),u(this,P,"f").hiddenOptions.push(e),this}implies(e,t){return B("<string|object> [number|string|array]",[e,t],arguments.length),u(this,ie,"f").implies(e,t),this}locale(e){return B("[string]",[e],arguments.length),e===void 0?(this[Lr](),u(this,M,"f").y18n.getLocale()):(O(this,ct,!1,"f"),u(this,M,"f").y18n.setLocale(e),this)}middleware(e,t,r){return u(this,Oe,"f").addMiddleware(e,!!t,r)}nargs(e,t){return B("<string|object|array> [number]",[e,t],arguments.length),this[Tt](this.nargs.bind(this),"narg",e,t),this}normalize(e){return B("<array|string>",[e],arguments.length),this[Xe]("normalize",e),this}number(e){return B("<array|string>",[e],arguments.length),this[Xe]("number",e),this[Ft](e),this}option(e,t){if(B("<string|object> [object]",[e,t],arguments.length),typeof e=="object")Object.keys(e).forEach(r=>{this.options(r,e[r])});else{typeof t!="object"&&(t={}),this[Ft](e),u(this,Te,"f")&&(e==="version"||t?.alias==="version")&&this[eo](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
87
+ `),void 0,"versionWarning"),u(this,P,"f").key[e]=!0,t.alias&&this.alias(e,t.alias);let r=t.deprecate||t.deprecated;r&&this.deprecateOption(e,r);let i=t.demand||t.required||t.require;i&&this.demand(e,i),t.demandOption&&this.demandOption(e,typeof t.demandOption=="string"?t.demandOption:void 0),t.conflicts&&this.conflicts(e,t.conflicts),"default"in t&&this.default(e,t.default),t.implies!==void 0&&this.implies(e,t.implies),t.nargs!==void 0&&this.nargs(e,t.nargs),t.config&&this.config(e,t.configParser),t.normalize&&this.normalize(e),t.choices&&this.choices(e,t.choices),t.coerce&&this.coerce(e,t.coerce),t.group&&this.group(e,t.group),(t.boolean||t.type==="boolean")&&(this.boolean(e),t.alias&&this.boolean(t.alias)),(t.array||t.type==="array")&&(this.array(e),t.alias&&this.array(t.alias)),(t.number||t.type==="number")&&(this.number(e),t.alias&&this.number(t.alias)),(t.string||t.type==="string")&&(this.string(e),t.alias&&this.string(t.alias)),(t.count||t.type==="count")&&this.count(e),typeof t.global=="boolean"&&this.global(e,t.global),t.defaultDescription&&(u(this,P,"f").defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);let s=t.describe||t.description||t.desc,o=u(this,$,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(o,e)||typeof s=="string")&&this.describe(e,s),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,r){B("[string|array] [function|boolean|object] [function]",[e,t,r],arguments.length),this[to](),typeof e>"u"&&(e=u(this,Ze,"f")),typeof t=="object"&&(O(this,ft,t,"f"),t=r),typeof t=="function"&&(O(this,Ae,t,"f"),t=!1),t||O(this,Ze,e,"f"),u(this,Ae,"f")&&O(this,Be,!1,"f");let i=this[Yt](e,!!t),s=this.parsed;return u(this,Ce,"f").setParsed(this.parsed),Q(i)?i.then(o=>(u(this,Ae,"f")&&u(this,Ae,"f").call(this,u(this,Qe,"f"),o,u(this,De,"f")),o)).catch(o=>{throw u(this,Ae,"f")&&u(this,Ae,"f")(o,this.parsed.argv,u(this,De,"f")),o}).finally(()=>{this[Hr](),this.parsed=s}):(u(this,Ae,"f")&&u(this,Ae,"f").call(this,u(this,Qe,"f"),i,u(this,De,"f")),this[Hr](),this.parsed=s,i)}parseAsync(e,t,r){let i=this.parse(e,t,r);return Q(i)?i:Promise.resolve(i)}parseSync(e,t,r){let i=this.parse(e,t,r);if(Q(i))throw new oe(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return B("<object>",[e],arguments.length),O(this,wn,e,"f"),this}pkgConf(e,t){B("<string> [string]",[e,t],arguments.length);let r=null,i=this[Ur](t||u(this,at,"f"));return i[e]&&typeof i[e]=="object"&&(r=gn(i[e],t||u(this,at,"f"),this[mt]()["deep-merge-config"]||!1,u(this,M,"f")),u(this,P,"f").configObjects=(u(this,P,"f").configObjects||[]).concat(r)),this}positional(e,t){B("<string> <object>",[e,t],arguments.length);let r=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=Ke(t,(o,a)=>o==="type"&&!["string","number","boolean"].includes(a)?!1:r.includes(o));let i=u(this,Gt,"f").fullCommands[u(this,Gt,"f").fullCommands.length-1],s=i?u(this,ue,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return It(s).forEach(o=>{let a=s[o];Array.isArray(a)?a.indexOf(e)!==-1&&(t[o]=!0):a[e]&&!(o in t)&&(t[o]=a[e])}),this.group(e,u(this,$,"f").getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return B("[boolean]",[e],arguments.length),O(this,yn,e,"f"),this}required(e,t,r){return this.demand(e,t,r)}require(e,t,r){return this.demand(e,t,r)}requiresArg(e){return B("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&u(this,P,"f").narg[e]?this:(this[Tt](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,t){return B("[string] [string]",[e,t],arguments.length),e=e||this.$0,u(this,lt,"f").log(u(this,Ce,"f").generateCompletionScript(e,t||u(this,we,"f")||"completion")),this}showHelp(e){if(B("[string|function]",[e],arguments.length),O(this,ye,!0,"f"),!u(this,$,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[Yt](u(this,Ze,"f"),void 0,void 0,0,!0);if(Q(r))return r.then(()=>{u(this,$,"f").showHelp(e)}),this}let t=u(this,ue,"f").runDefaultBuilderOn(this);if(Q(t))return t.then(()=>{u(this,$,"f").showHelp(e)}),this}return u(this,$,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return B("[boolean|string] [string]",[e,t],arguments.length),u(this,$,"f").showHelpOnFail(e,t),this}showVersion(e){return B("[string|function]",[e],arguments.length),u(this,$,"f").showVersion(e),this}skipValidation(e){return B("<array|string>",[e],arguments.length),this[Xe]("skipValidation",e),this}strict(e){return B("[boolean]",[e],arguments.length),O(this,Dt,e!==!1,"f"),this}strictCommands(e){return B("[boolean]",[e],arguments.length),O(this,dt,e!==!1,"f"),this}strictOptions(e){return B("[boolean]",[e],arguments.length),O(this,pt,e!==!1,"f"),this}string(e){return B("<array|string>",[e],arguments.length),this[Xe]("string",e),this[Ft](e),this}terminalWidth(){return B([],0),u(this,M,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return B("<object>",[e],arguments.length),O(this,ct,!1,"f"),u(this,M,"f").y18n.updateLocale(e),this}usage(e,t,r,i){if(B("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,r,i],arguments.length),t!==void 0){if(Fe(e,null,u(this,M,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,t,r,i);throw new oe(".usage() description must start with $0 if being used as alias for .command()")}else return u(this,$,"f").usage(e),this}usageConfiguration(e){return B("<object>",[e],arguments.length),O(this,An,e,"f"),this}version(e,t,r){let i="version";if(B("[boolean|string] [string] [string]",[e,t,r],arguments.length),u(this,Te,"f")&&(this[Nr](u(this,Te,"f")),u(this,$,"f").version(void 0),O(this,Te,null,"f")),arguments.length===0)r=this[io](),e=i;else if(arguments.length===1){if(e===!1)return this;r=e,e=i}else arguments.length===2&&(r=t,t=void 0);return O(this,Te,typeof e=="string"?e:i,"f"),t=t||u(this,$,"f").deferY18nLookup("Show version number"),u(this,$,"f").version(r||void 0),this.boolean(u(this,Te,"f")),this.describe(u(this,Te,"f"),t),this}wrap(e){return B("<number|null|undefined>",[e],arguments.length),u(this,$,"f").wrap(e),this}[(ue=new WeakMap,at=new WeakMap,Gt=new WeakMap,Ce=new WeakMap,we=new WeakMap,Fn=new WeakMap,Qe=new WeakMap,ct=new WeakMap,Cn=new WeakMap,Be=new WeakMap,En=new WeakMap,Oe=new WeakMap,Me=new WeakMap,ye=new WeakMap,Se=new WeakMap,bn=new WeakMap,lt=new WeakMap,De=new WeakMap,P=new WeakMap,xn=new WeakMap,wn=new WeakMap,Ae=new WeakMap,ft=new WeakMap,Mt=new WeakMap,ht=new WeakMap,Ze=new WeakMap,yn=new WeakMap,M=new WeakMap,Dt=new WeakMap,dt=new WeakMap,pt=new WeakMap,$=new WeakMap,An=new WeakMap,Te=new WeakMap,ie=new WeakMap,Xs)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[ks](){return{log:(...e)=>{this[_n]()||console.log(...e),O(this,ye,!0,"f"),u(this,De,"f").length&&O(this,De,u(this,De,"f")+`
88
+ `,"f"),O(this,De,u(this,De,"f")+e.join(" "),"f")},error:(...e)=>{this[_n]()||console.error(...e),O(this,ye,!0,"f"),u(this,De,"f").length&&O(this,De,u(this,De,"f")+`
89
+ `,"f"),O(this,De,u(this,De,"f")+e.join(" "),"f")}}}[Nr](e){It(u(this,P,"f")).forEach(t=>{if((i=>i==="configObjects")(t))return;let r=u(this,P,"f")[t];Array.isArray(r)?r.includes(e)&&r.splice(r.indexOf(e),1):typeof r=="object"&&delete r[e]}),delete u(this,$,"f").getDescriptions()[e]}[eo](e,t,r){u(this,Cn,"f")[r]||(u(this,M,"f").process.emitWarning(e,t),u(this,Cn,"f")[r]=!0)}[to](){u(this,En,"f").push({options:u(this,P,"f"),configObjects:u(this,P,"f").configObjects.slice(0),exitProcess:u(this,Be,"f"),groups:u(this,Me,"f"),strict:u(this,Dt,"f"),strictCommands:u(this,dt,"f"),strictOptions:u(this,pt,"f"),completionCommand:u(this,we,"f"),output:u(this,De,"f"),exitError:u(this,Qe,"f"),hasOutput:u(this,ye,"f"),parsed:this.parsed,parseFn:u(this,Ae,"f"),parseContext:u(this,ft,"f")}),u(this,$,"f").freeze(),u(this,ie,"f").freeze(),u(this,ue,"f").freeze(),u(this,Oe,"f").freeze()}[no](){let e="",t;return/\b(node|iojs|electron|bun)(\.exe)?$/.test(u(this,M,"f").process.argv()[0])?t=u(this,M,"f").process.argv().slice(1,2):t=u(this,M,"f").process.argv().slice(0,1),e=t.map(r=>{let i=this[mo](u(this,at,"f"),r);return r.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<r.length?i:r}).join(" ").trim(),u(this,M,"f").getEnv("_")&&u(this,M,"f").getProcessArgvBin()===u(this,M,"f").getEnv("_")&&(e=u(this,M,"f").getEnv("_").replace(`${u(this,M,"f").path.dirname(u(this,M,"f").process.execPath())}/`,"")),e}[mt](){return u(this,wn,"f")}[ro](){return u(this,An,"f")}[Lr](){if(!u(this,ct,"f"))return;let e=u(this,M,"f").getEnv("LC_ALL")||u(this,M,"f").getEnv("LC_MESSAGES")||u(this,M,"f").getEnv("LANG")||u(this,M,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[io](){return this[Ur]().version||"unknown"}[so](e){let t=e["--"]?e["--"]:e._;for(let r=0,i;(i=t[r])!==void 0;r++)u(this,M,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(t[r]=Number(i));return e}[Ur](e){let t=e||"*";if(u(this,Mt,"f")[t])return u(this,Mt,"f")[t];let r={};try{let i=e||u(this,M,"f").mainFilename;u(this,M,"f").path.extname(i)&&(i=u(this,M,"f").path.dirname(i));let s=u(this,M,"f").findUp(i,(o,a)=>{if(a.includes("package.json"))return"package.json"});Fe(s,void 0,u(this,M,"f")),r=JSON.parse(u(this,M,"f").readFileSync(s,"utf8"))}catch{}return u(this,Mt,"f")[t]=r||{},u(this,Mt,"f")[t]}[Xe](e,t){t=[].concat(t),t.forEach(r=>{r=this[Wr](r),u(this,P,"f")[e].push(r)})}[Tt](e,t,r,i){this[zr](e,t,r,i,(s,o,a)=>{u(this,P,"f")[s][o]=a})}[Rr](e,t,r,i){this[zr](e,t,r,i,(s,o,a)=>{u(this,P,"f")[s][o]=(u(this,P,"f")[s][o]||[]).concat(a)})}[zr](e,t,r,i,s){if(Array.isArray(r))r.forEach(o=>{e(o,i)});else if((o=>typeof o=="object")(r))for(let o of It(r))e(o,r[o]);else s(t,this[Wr](r),i)}[Wr](e){return e==="__proto__"?"___proto___":e}[Vr](e,t){return this[Tt](this[Vr].bind(this),"key",e,t),this}[Hr](){var e,t,r,i,s,o,a,l,d,p,f,g;let C=u(this,En,"f").pop();Fe(C,void 0,u(this,M,"f"));let E;e=this,t=this,r=this,i=this,s=this,o=this,a=this,l=this,d=this,p=this,f=this,g=this,{options:{set value(b){O(e,P,b,"f")}}.value,configObjects:E,exitProcess:{set value(b){O(t,Be,b,"f")}}.value,groups:{set value(b){O(r,Me,b,"f")}}.value,output:{set value(b){O(i,De,b,"f")}}.value,exitError:{set value(b){O(s,Qe,b,"f")}}.value,hasOutput:{set value(b){O(o,ye,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){O(a,Dt,b,"f")}}.value,strictCommands:{set value(b){O(l,dt,b,"f")}}.value,strictOptions:{set value(b){O(d,pt,b,"f")}}.value,completionCommand:{set value(b){O(p,we,b,"f")}}.value,parseFn:{set value(b){O(f,Ae,b,"f")}}.value,parseContext:{set value(b){O(g,ft,b,"f")}}.value}=C,u(this,P,"f").configObjects=E,u(this,$,"f").unfreeze(),u(this,ie,"f").unfreeze(),u(this,ue,"f").unfreeze(),u(this,Oe,"f").unfreeze()}[oo](e,t){return ut(t,r=>(e(r),r))}getInternalMethods(){return{getCommandInstance:this[uo].bind(this),getContext:this[ao].bind(this),getHasOutput:this[co].bind(this),getLoggerInstance:this[lo].bind(this),getParseContext:this[fo].bind(this),getParserConfiguration:this[mt].bind(this),getUsageConfiguration:this[ro].bind(this),getUsageInstance:this[ho].bind(this),getValidationInstance:this[Do].bind(this),hasParseCallback:this[_n].bind(this),isGlobalContext:this[po].bind(this),postProcess:this[gt].bind(this),reset:this[qr].bind(this),runValidation:this[Gr].bind(this),runYargsParserAndExecuteCommands:this[Yt].bind(this),setHasOutput:this[go].bind(this)}}[uo](){return u(this,ue,"f")}[ao](){return u(this,Gt,"f")}[co](){return u(this,ye,"f")}[lo](){return u(this,lt,"f")}[fo](){return u(this,ft,"f")||{}}[ho](){return u(this,$,"f")}[Do](){return u(this,ie,"f")}[_n](){return!!u(this,Ae,"f")}[po](){return u(this,bn,"f")}[gt](e,t,r,i){return r||Q(e)||(t||(e=this[Xs](e)),(this[mt]()["parse-positional-numbers"]||this[mt]()["parse-positional-numbers"]===void 0)&&(e=this[so](e)),i&&(e=ot(e,this,u(this,Oe,"f").getMiddleware(),!1))),e}[qr](e={}){O(this,P,u(this,P,"f")||{},"f");let t={};t.local=u(this,P,"f").local||[],t.configObjects=u(this,P,"f").configObjects||[];let r={};t.local.forEach(o=>{r[o]=!0,(e[o]||[]).forEach(a=>{r[a]=!0})}),Object.assign(u(this,ht,"f"),Object.keys(u(this,Me,"f")).reduce((o,a)=>{let l=u(this,Me,"f")[a].filter(d=>!(d in r));return l.length>0&&(o[a]=l),o},{})),O(this,Me,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(o=>{t[o]=(u(this,P,"f")[o]||[]).filter(a=>!r[a])}),s.forEach(o=>{t[o]=Ke(u(this,P,"f")[o],a=>!r[a])}),t.envPrefix=u(this,P,"f").envPrefix,O(this,P,t,"f"),O(this,$,u(this,$,"f")?u(this,$,"f").reset(r):Vs(this,u(this,M,"f")),"f"),O(this,ie,u(this,ie,"f")?u(this,ie,"f").reset(r):Qs(this,u(this,$,"f"),u(this,M,"f")),"f"),O(this,ue,u(this,ue,"f")?u(this,ue,"f").reset():Rs(u(this,$,"f"),u(this,ie,"f"),u(this,Oe,"f"),u(this,M,"f")),"f"),u(this,Ce,"f")||O(this,Ce,Ys(this,u(this,$,"f"),u(this,ue,"f"),u(this,M,"f")),"f"),u(this,Oe,"f").reset(),O(this,we,null,"f"),O(this,De,"","f"),O(this,Qe,null,"f"),O(this,ye,!1,"f"),this.parsed=!1,this}[mo](e,t){return u(this,M,"f").path.relative(e,t)}[Yt](e,t,r,i=0,s=!1){var o,a,l,d;let p=!!r||s;e=e||u(this,Ze,"f"),u(this,P,"f").__=u(this,M,"f").y18n.__,u(this,P,"f").configuration=this[mt]();let f=!!u(this,P,"f").configuration["populate--"],g=Object.assign({},u(this,P,"f").configuration,{"populate--":!0}),C=u(this,M,"f").Parser.detailed(e,Object.assign({},u(this,P,"f"),{configuration:{"parse-positional-numbers":!1,...g}})),E=Object.assign(C.argv,u(this,ft,"f")),b,m=C.aliases,y=!1,U=!1;Object.keys(E).forEach(L=>{L===u(this,Se,"f")&&E[L]?y=!0:L===u(this,Te,"f")&&E[L]&&(U=!0)}),E.$0=this.$0,this.parsed=C,i===0&&u(this,$,"f").clearCachedHelpMessage();try{if(this[Lr](),t)return this[gt](E,f,!!r,!1);u(this,Se,"f")&&[u(this,Se,"f")].concat(m[u(this,Se,"f")]||[]).filter(q=>q.length>1).includes(""+E._[E._.length-1])&&(E._.pop(),y=!0),O(this,bn,!1,"f");let L=u(this,ue,"f").getCommands(),R=!((o=u(this,Ce,"f"))===null||o===void 0)&&o.completionKey?[(a=u(this,Ce,"f"))===null||a===void 0?void 0:a.completionKey,...(d=this.getAliases()[(l=u(this,Ce,"f"))===null||l===void 0?void 0:l.completionKey])!==null&&d!==void 0?d:[]].some(W=>Object.prototype.hasOwnProperty.call(E,W)):!1,V=y||R||s;if(E._.length){if(L.length){let W;for(let q=i||0,K;E._[q]!==void 0;q++)if(K=String(E._[q]),L.includes(K)&&K!==u(this,we,"f")){let ae=u(this,ue,"f").runCommand(K,this,C,q+1,s,y||U||s);return this[gt](ae,f,!!r,!1)}else if(!W&&K!==u(this,we,"f")){W=K;break}!u(this,ue,"f").hasDefaultCommand()&&u(this,yn,"f")&&W&&!V&&u(this,ie,"f").recommendCommands(W,L)}u(this,we,"f")&&E._.includes(u(this,we,"f"))&&!R&&(u(this,Be,"f")&&Je(!0),this.showCompletionScript(),this.exit(0))}if(u(this,ue,"f").hasDefaultCommand()&&!V){let W=u(this,ue,"f").runCommand(null,this,C,0,s,y||U||s);return this[gt](W,f,!!r,!1)}if(R){u(this,Be,"f")&&Je(!0),e=[].concat(e);let W=e.slice(e.indexOf(`--${u(this,Ce,"f").completionKey}`)+1);return u(this,Ce,"f").getCompletion(W,(q,K)=>{if(q)throw new oe(q.message);(K||[]).forEach(ae=>{u(this,lt,"f").log(ae)}),this.exit(0)}),this[gt](E,!f,!!r,!1)}if(u(this,ye,"f")||(y?(u(this,Be,"f")&&Je(!0),p=!0,this.showHelp(W=>{u(this,lt,"f").log(W),this.exit(0)})):U&&(u(this,Be,"f")&&Je(!0),p=!0,u(this,$,"f").showVersion("log"),this.exit(0))),!p&&u(this,P,"f").skipValidation.length>0&&(p=Object.keys(E).some(W=>u(this,P,"f").skipValidation.indexOf(W)>=0&&E[W]===!0)),!p){if(C.error)throw new oe(C.error.message);if(!R){let W=this[Gr](m,{},C.error);r||(b=ot(E,this,u(this,Oe,"f").getMiddleware(),!0)),b=this[oo](W,b??E),Q(b)&&!r&&(b=b.then(()=>ot(E,this,u(this,Oe,"f").getMiddleware(),!1)))}}}catch(L){if(L instanceof oe)u(this,$,"f").fail(L.message,L);else throw L}return this[gt](b??E,f,!!r,!0)}[Gr](e,t,r,i){let s={...this.getDemandedOptions()};return o=>{if(r)throw new oe(r.message);u(this,ie,"f").nonOptionCount(o),u(this,ie,"f").requiredArguments(o,s);let a=!1;u(this,dt,"f")&&(a=u(this,ie,"f").unknownCommands(o)),u(this,Dt,"f")&&!a?u(this,ie,"f").unknownArguments(o,e,t,!!i):u(this,pt,"f")&&u(this,ie,"f").unknownArguments(o,e,{},!1,!1),u(this,ie,"f").limitedChoices(o),u(this,ie,"f").implications(o),u(this,ie,"f").conflicting(o)}}[go](){O(this,ye,!0,"f")}[Ft](e){if(typeof e=="string")u(this,P,"f").key[e]=!0;else for(let t of e)u(this,P,"f").key[t]=!0}};function zs(n){return!!n&&typeof n.getInternalMethods=="function"}var Zc=Fo(Ms),Co=Zc;var wo=Ct(bo(),1),el={},Xc=process.argv.slice(2),xo=new wo.default(Co),Jr=console.log;async function Qr(n){xo.yargs.option("listen",{desc:"daemon control listen multiaddr",type:"string",default:"/unix/tmp/p2pd.sock"}).option("quiet",{alias:"q",desc:"be quiet",type:"boolean",default:!1}).option("id",{desc:"peer identity; private key file",type:"string",default:""}).option("hostAddrs",{desc:"Comma separated list of multiaddrs the host should listen on",type:"string",default:""}).option("announceAddrs",{desc:"Comma separated list of multiaddrs the host should announce to the network",type:"string",default:""}).option("bootstrap",{alias:"b",desc:"Connects to bootstrap peers and bootstraps the dht if enabled",type:"boolean",default:!1}).option("bootstrapPeers",{desc:"Comma separated list of bootstrap peers; defaults to the IPFS DHT peers",type:"string",default:""}).option("dht",{desc:"Enables the DHT in full node mode",type:"boolean",default:!1}).option("dhtClient",{desc:"(Not yet supported) Enables the DHT in client mode",type:"boolean",default:!1}).option("nat",{desc:"Enables UPnP NAT hole punching",type:"boolean",default:!1}).option("connMgr",{desc:"(Not yet supported) Enables the Connection Manager",type:"boolean",default:!1}).option("connMgrLo",{desc:"Number identifying the number of peers below which this node will not activate preemptive disconnections",type:"number"}).option("connMgrHi",{desc:"Number identifying the maximum number of peers the current peer is willing to be connected to before is starts disconnecting",type:"number"}).option("pubsub",{desc:"Enables pubsub",type:"boolean",default:!1}).option("pubsubRouter",{desc:"Specifies the pubsub router implementation",type:"string",default:"gossipsub"}).fail((i,s,o)=>{if(s!=null)throw s;Xc.length>0&&Jr(i),o.showHelp()});let{data:e,argv:t}=await xo.parse(n);e!=null&&(Jr(e),process.exit(0)),await(await yo(Ni(t.listen),t)).start(),t.quiet!==!0&&Jr("daemon has started")}async function yo(n,e){throw new Error("Not implemented yet")}pr(el)&&Qr(process.argv).catch(n=>{console.error(n),process.exit(1)});return vo(kc);})();
82
90
  /*! Bundled license information:
83
91
 
84
92
  yargs-parser/build/lib/string-utils.js: