Hide secrets in your Obsidian.md vault
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

103 lines
119 KiB

var ri=Object.create;var $n=Object.defineProperty;var oi=Object.getOwnPropertyDescriptor;var ui=Object.getOwnPropertyNames;var ai=Object.getPrototypeOf,ci=Object.prototype.hasOwnProperty;var Tn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var li=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ui(t))!ci.call(e,i)&&i!==n&&$n(e,i,{get:()=>t[i],enumerable:!(s=oi(t,i))||s.enumerable});return e};var Nn=(e,t,n)=>(n=e!=null?ri(ai(e)):{},li(t||!e||!e.__esModule?$n(n,"default",{value:e,enumerable:!0}):n,e));var Vn=Tn((Ur,Kn)=>{Kn.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\uDC70\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-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\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\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var ms=Tn((Po,Fs)=>{"use strict";Fs.exports=function(t){if(t===void 0&&(t=2),t>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+t+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var n=Error.prepareStackTrace;Error.prepareStackTrace=function(i,r){return r};var s=new Error().stack;if(Error.prepareStackTrace=n,s!==null&&typeof s=="object")return s[t]?s[t].getFileName():void 0}});import{notStrictEqual as qi,strictEqual as Xi}from"assert";var fi={right:Fi,center:mi},Di=0,Ce=1,hi=2,be=3,Ge=class{constructor(t){var n;this.width=t.width,this.wrap=(n=t.wrap)!==null&&n!==void 0?n:!0,this.rows=[]}span(...t){let n=this.div(...t);n.span=!0}resetOutput(){this.rows=[]}div(...t){if(t.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]=="string")return this.applyLayoutDSL(t[0]);let n=t.map(s=>typeof s=="string"?this.colFromString(s):s);return this.rows.push(n),n}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){let n=t.split(`
`).map(i=>i.split(" ")),s=0;return n.forEach(i=>{i.length>1&&ht.stringWidth(i[0])>s&&(s=Math.min(Math.floor(this.width*.5),ht.stringWidth(i[0])))}),n.forEach(i=>{this.div(...i.map((r,u)=>({text:r.trim(),padding:this.measurePadding(r),width:u===0&&i.length>1?s:void 0})))}),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){let n=ht.stripAnsi(t);return[0,n.match(/\s*$/)[0].length,0,n.match(/^\s*/)[0].length]}toString(){let t=[];return this.rows.forEach(n=>{this.rowToString(n,t)}),t.filter(n=>!n.hidden).map(n=>n.text).join(`
`)}rowToString(t,n){return this.rasterize(t).forEach((s,i)=>{let r="";s.forEach((u,a)=>{let{width:h}=t[a],m=this.negatePadding(t[a]),F=u;if(m>ht.stringWidth(u)&&(F+=" ".repeat(m-ht.stringWidth(u))),t[a].align&&t[a].align!=="left"&&this.wrap){let p=fi[t[a].align];F=p(F,m),ht.stringWidth(F)<m&&(F+=" ".repeat((h||0)-ht.stringWidth(F)-1))}let l=t[a].padding||[0,0,0,0];l[be]&&(r+=" ".repeat(l[be])),r+=Ln(t[a],F,"| "),r+=F,r+=Ln(t[a],F," |"),l[Ce]&&(r+=" ".repeat(l[Ce])),i===0&&n.length>0&&(r=this.renderInline(r,n[n.length-1]))}),n.push({text:r.replace(/ +$/,""),span:t.span})}),n}renderInline(t,n){let s=t.match(/^ */),i=s?s[0].length:0,r=n.text,u=ht.stringWidth(r.trimRight());return n.span?this.wrap?i<u?t:(n.hidden=!0,r.trimRight()+" ".repeat(i-u)+t.trimLeft()):(n.hidden=!0,r+t):t}rasterize(t){let n=[],s=this.columnWidths(t),i;return t.forEach((r,u)=>{r.width=s[u],this.wrap?i=ht.wrap(r.text,this.negatePadding(r),{hard:!0}).split(`
`):i=r.text.split(`
`),r.border&&(i.unshift("."+"-".repeat(this.negatePadding(r)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(r)+2)+"'")),r.padding&&(i.unshift(...new Array(r.padding[Di]||0).fill("")),i.push(...new Array(r.padding[hi]||0).fill(""))),i.forEach((a,h)=>{n[h]||n.push([]);let m=n[h];for(let F=0;F<u;F++)m[F]===void 0&&m.push("");m.push(a)})}),n}negatePadding(t){let n=t.width||0;return t.padding&&(n-=(t.padding[be]||0)+(t.padding[Ce]||0)),t.border&&(n-=4),n}columnWidths(t){if(!this.wrap)return t.map(u=>u.width||ht.stringWidth(u.text));let n=t.length,s=this.width,i=t.map(u=>{if(u.width)return n--,s-=u.width,u.width}),r=n?Math.floor(s/n):0;return i.map((u,a)=>u===void 0?Math.max(r,di(t[a])):u)}};function Ln(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function di(e){let t=e.padding||[],n=1+(t[be]||0)+(t[Ce]||0);return e.border?n+4:n}function pi(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Fi(e,t){e=e.trim();let n=ht.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function mi(e,t){e=e.trim();let n=ht.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var ht;function Rn(e,t){return ht=t,new Ge({width:(e==null?void 0:e.width)||pi(),wrap:e==null?void 0:e.wrap})}function qe({onlyFirst:e=!1}={}){let n=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(n,e?void 0:"g")}var gi=qe();function Ut(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(gi,"")}function Wn(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function Un(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function zn(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function Ei(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function Hn(e,{ambiguousAsWide:t=!1}={}){return Ei(e),Un(e)||zn(e)||t&&Wn(e)?2:1}var Yn=Nn(Vn(),1),Ci=new Intl.Segmenter,bi=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function wt(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:s=!1}=t;if(s||(e=Ut(e)),e.length===0)return 0;let i=0,r={ambiguousAsWide:!n};for(let{segment:u}of Ci.segment(e)){let a=u.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)&&!bi.test(u)){if((0,Yn.default)().test(u)){i+=2;continue}i+=Hn(a,r)}}return i}var Gn=(e=0)=>t=>`\x1B[${t+e}m`,qn=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Xn=(e=0)=>(t,n,s)=>`\x1B[${38+e};2;${t};${n};${s}m`,J={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]}},Vr=Object.keys(J.modifier),yi=Object.keys(J.color),Ai=Object.keys(J.bgColor),Yr=[...yi,...Ai];function Bi(){let e=new Map;for(let[t,n]of Object.entries(J)){for(let[s,i]of Object.entries(n))J[s]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},n[s]=J[s],e.set(i[0],i[1]);Object.defineProperty(J,t,{value:n,enumerable:!1})}return Object.defineProperty(J,"codes",{value:e,enumerable:!1}),J.color.close="\x1B[39m",J.bgColor.close="\x1B[49m",J.color.ansi=Gn(),J.color.ansi256=qn(),J.color.ansi16m=Xn(),J.bgColor.ansi=Gn(10),J.bgColor.ansi256=qn(10),J.bgColor.ansi16m=Xn(10),Object.defineProperties(J,{rgbToAnsi256:{value:(t,n,s)=>t===n&&n===s?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(s/255*5),enumerable:!1},hexToRgb:{value:t=>{let n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!n)return[0,0,0];let[s]=n;s.length===3&&(s=[...s].map(r=>r+r).join(""));let i=Number.parseInt(s,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>J.rgbToAnsi256(...J.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,s,i;if(t>=232)n=((t-232)*10+8)/255,s=n,i=n;else{t-=16;let a=t%36;n=Math.floor(t/36)/5,s=Math.floor(a/6)/5,i=a%6/5}let r=Math.max(n,s,i)*2;if(r===0)return 30;let u=30+(Math.round(i)<<2|Math.round(s)<<1|Math.round(n));return r===2&&(u+=60),u},enumerable:!1},rgbToAnsi:{value:(t,n,s)=>J.ansi256ToAnsi(J.rgbToAnsi256(t,n,s)),enumerable:!1},hexToAnsi:{value:t=>J.ansi256ToAnsi(J.hexToAnsi256(t)),enumerable:!1}}),J}var wi=Bi(),Jn=wi;var Ae=new Set(["\x1B","\x9B"]),_i=39,Je="\x07",kn="[",xi="]",ts="m",ye=`${xi}8;;`,Zn=e=>`${Ae.values().next().value}${kn}${e}${ts}`,Qn=e=>`${Ae.values().next().value}${ye}${e}${Je}`,Oi=e=>e.split(" ").map(t=>wt(t)),Xe=(e,t,n)=>{let s=[...t],i=!1,r=!1,u=wt(Ut(e.at(-1)));for(let[a,h]of s.entries()){let m=wt(h);if(u+m<=n?e[e.length-1]+=h:(e.push(h),u=0),Ae.has(h)&&(i=!0,r=s.slice(a+1,a+1+ye.length).join("")===ye),i){r?h===Je&&(i=!1,r=!1):h===ts&&(i=!1);continue}u+=m,u===n&&a<s.length-1&&(e.push(""),u=0)}!u&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Si=e=>{let t=e.split(" "),n=t.length;for(;n>0&&!(wt(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},Pi=(e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let s="",i,r,u=Oi(e),a=[""];for(let[l,p]of e.split(" ").entries()){n.trim!==!1&&(a[a.length-1]=a.at(-1).trimStart());let g=wt(a.at(-1));if(l!==0&&(g>=t&&(n.wordWrap===!1||n.trim===!1)&&(a.push(""),g=0),(g>0||n.trim===!1)&&(a[a.length-1]+=" ",g++)),n.hard&&u[l]>t){let C=t-g,b=1+Math.floor((u[l]-C-1)/t);Math.floor((u[l]-1)/t)<b&&a.push(""),Xe(a,p,t);continue}if(g+u[l]>t&&g>0&&u[l]>0){if(n.wordWrap===!1&&g<t){Xe(a,p,t);continue}a.push("")}if(g+u[l]>t&&n.wordWrap===!1){Xe(a,p,t);continue}a[a.length-1]+=p}n.trim!==!1&&(a=a.map(l=>Si(l)));let h=a.join(`
`),m=[...h],F=0;for(let[l,p]of m.entries()){if(s+=p,Ae.has(p)){let{groups:C}=new RegExp(`(?:\\${kn}(?<code>\\d+)m|\\${ye}(?<uri>.*)${Je})`).exec(h.slice(F))||{groups:{}};if(C.code!==void 0){let b=Number.parseFloat(C.code);i=b===_i?void 0:b}else C.uri!==void 0&&(r=C.uri.length===0?void 0:C.uri)}let g=Jn.codes.get(Number(i));m[l+1]===`
`?(r&&(s+=Qn("")),i&&g&&(s+=Zn(g))):p===`
`&&(i&&g&&(s+=Zn(i)),r&&(s+=Qn(r))),F+=p.length}return s};function Ze(e,t,n){return String(e).normalize().replaceAll(`\r
`,`
`).split(`
`).map(s=>Pi(s,t,n)).join(`
`)}function Qe(e){return Rn(e,{stringWidth:wt,stripAnsi:Ut,wrap:Ze})}import{dirname as es,resolve as ns}from"path";import{readdirSync as ji,statSync as Ii}from"fs";function ss(e,t){let n=ns(".",e),s;for(Ii(n).isDirectory()||(n=es(n));;){if(s=t(n,ji(n)),s)return ns(n,s);if(n=es(s=n),s===n)break}}import{inspect as Ji}from"util";import{fileURLToPath as Es}from"url";import{format as $i}from"util";import{normalize as Ti,resolve as Ni}from"path";function zt(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let n="",s=!1,i=e.match(/^-+/);for(let r=i?i[0].length:0;r<e.length;r++){let u=e.charAt(r);s&&(s=!1,u=u.toUpperCase()),r!==0&&(u==="-"||u==="_")?s=!0:u!=="-"&&u!=="_"&&(n+=u)}return n}}function Be(e,t){let n=e.toLowerCase();t=t||"-";let s="";for(let i=0;i<e.length;i++){let r=n.charAt(i),u=e.charAt(i);r!==u&&i>0?s+=`${t}${n.charAt(i)}`:s+=u}return s}function we(e){return e==null?!1:typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function is(e){if(Array.isArray(e))return e.map(u=>typeof u!="string"?u+"":u);e=e.trim();let t=0,n=null,s=null,i=null,r=[];for(let u=0;u<e.length;u++){if(n=s,s=e.charAt(u),s===" "&&!i){n!==" "&&t++;continue}s===i?i=null:(s==="'"||s==='"')&&!i&&(i=s),r[t]||(r[t]=""),r[t]+=s}return r}var gt;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(gt||(gt={}));var It,_e=class{constructor(t){It=t}parse(t,n){let s=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},n),i=is(t),r=typeof t=="string",u=vi(Object.assign(Object.create(null),s.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},s.configuration),h=Object.assign(Object.create(null),s.default),m=s.configObjects||[],F=s.envPrefix,l=a["populate--"],p=l?"--":"_",g=Object.create(null),C=Object.create(null),b=s.__||It.format,d={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]+)$/,K=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(s.array||[]).filter(Boolean).forEach(function(c){let D=typeof c=="object"?c.key:c,y=Object.keys(c).map(function(E){return{boolean:"bools",string:"strings",number:"numbers"}[E]}).filter(Boolean).pop();y&&(d[y][D]=!0),d.arrays[D]=!0,d.keys.push(D)}),[].concat(s.boolean||[]).filter(Boolean).forEach(function(c){d.bools[c]=!0,d.keys.push(c)}),[].concat(s.string||[]).filter(Boolean).forEach(function(c){d.strings[c]=!0,d.keys.push(c)}),[].concat(s.number||[]).filter(Boolean).forEach(function(c){d.numbers[c]=!0,d.keys.push(c)}),[].concat(s.count||[]).filter(Boolean).forEach(function(c){d.counts[c]=!0,d.keys.push(c)}),[].concat(s.normalize||[]).filter(Boolean).forEach(function(c){d.normalize[c]=!0,d.keys.push(c)}),typeof s.narg=="object"&&Object.entries(s.narg).forEach(([c,D])=>{typeof D=="number"&&(d.nargs[c]=D,d.keys.push(c))}),typeof s.coerce=="object"&&Object.entries(s.coerce).forEach(([c,D])=>{typeof D=="function"&&(d.coercions[c]=D,d.keys.push(c))}),typeof s.config<"u"&&(Array.isArray(s.config)||typeof s.config=="string"?[].concat(s.config).filter(Boolean).forEach(function(c){d.configs[c]=!0}):typeof s.config=="object"&&Object.entries(s.config).forEach(([c,D])=>{(typeof D=="boolean"||typeof D=="function")&&(d.configs[c]=D)})),Wt(s.key,u,s.default,d.arrays),Object.keys(h).forEach(function(c){(d.aliases[c]||[]).forEach(function(D){h[D]=h[c]})});let R=null;Ee();let W=[],V=Object.assign(Object.create(null),{_:[]}),U={};for(let c=0;c<i.length;c++){let D=i[c],y=D.replace(/^-{3,}/,"---"),E,f,O,B,j,ot;if(D!=="--"&&/^-/.test(D)&&Q(D))G(D);else if(y.match(/^---+(=|$)/)){G(D);continue}else if(D.match(/^--.+=/)||!a["short-option-groups"]&&D.match(/^-.+=/))B=D.match(/^--?([^=]+)=([\s\S]*)$/),B!==null&&Array.isArray(B)&&B.length>=3&&(M(B[1],d.arrays)?c=yt(c,B[1],i,B[2]):M(B[1],d.nargs)!==!1?c=ct(c,B[1],i,B[2]):Y(B[1],B[2],!0));else if(D.match(K)&&a["boolean-negation"])B=D.match(K),B!==null&&Array.isArray(B)&&B.length>=2&&(f=B[1],Y(f,M(f,d.arrays)?[!1]:!1));else if(D.match(/^--.+/)||!a["short-option-groups"]&&D.match(/^-[^-]+/))B=D.match(/^--?(.+)/),B!==null&&Array.isArray(B)&&B.length>=2&&(f=B[1],M(f,d.arrays)?c=yt(c,f,i):M(f,d.nargs)!==!1?c=ct(c,f,i):(j=i[c+1],j!==void 0&&(!j.match(/^-/)||j.match($))&&!M(f,d.bools)&&!M(f,d.counts)||/^(true|false)$/.test(j)?(Y(f,j),c++):Y(f,k(f))));else if(D.match(/^-.\..+=/))B=D.match(/^-([^=]+)=([\s\S]*)$/),B!==null&&Array.isArray(B)&&B.length>=3&&Y(B[1],B[2]);else if(D.match(/^-.\..+/)&&!D.match($))j=i[c+1],B=D.match(/^-(.\..+)/),B!==null&&Array.isArray(B)&&B.length>=2&&(f=B[1],j!==void 0&&!j.match(/^-/)&&!M(f,d.bools)&&!M(f,d.counts)?(Y(f,j),c++):Y(f,k(f)));else if(D.match(/^-[^-]+/)&&!D.match($)){O=D.slice(1,-1).split(""),E=!1;for(let lt=0;lt<O.length;lt++){if(j=D.slice(lt+2),O[lt+1]&&O[lt+1]==="="){ot=D.slice(lt+3),f=O[lt],M(f,d.arrays)?c=yt(c,f,i,ot):M(f,d.nargs)!==!1?c=ct(c,f,i,ot):Y(f,ot),E=!0;break}if(j==="-"){Y(O[lt],j);continue}if(/[A-Za-z]/.test(O[lt])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(j)&&M(j,d.bools)===!1){Y(O[lt],j),E=!0;break}if(O[lt+1]&&O[lt+1].match(/\W/)){Y(O[lt],j),E=!0;break}else Y(O[lt],k(O[lt]))}f=D.slice(-1)[0],!E&&f!=="-"&&(M(f,d.arrays)?c=yt(c,f,i):M(f,d.nargs)!==!1?c=ct(c,f,i):(j=i[c+1],j!==void 0&&(!/^(-|--)[^-]/.test(j)||j.match($))&&!M(f,d.bools)&&!M(f,d.counts)||/^(true|false)$/.test(j)?(Y(f,j),c++):Y(f,k(f))))}else if(D.match(/^-[0-9]$/)&&D.match($)&&M(D.slice(1),d.bools))f=D.slice(1),Y(f,k(f));else if(D==="--"){W=i.slice(c+1);break}else if(a["halt-at-non-option"]){W=i.slice(c);break}else G(D)}z(V,!0),z(V,!1),N(V),it(),Z(V,d.aliases,h,!0),rt(V),a["set-placeholder-key"]&&Rt(V),Object.keys(d.counts).forEach(function(c){Pt(V,c.split("."))||Y(c,0)}),l&&W.length&&(V[p]=[]),W.forEach(function(c){V[p].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(u).map(c=>u[c])).forEach(c=>{a["camel-case-expansion"]&&c.includes("-")&&delete V[c.split(".").map(D=>zt(D)).join(".")],delete V[c]});function G(c){let D=x("_",c);(typeof D=="string"||typeof D=="number")&&V._.push(D)}function ct(c,D,y,E){let f,O=M(D,d.nargs);if(O=typeof O!="number"||isNaN(O)?1:O,O===0)return Bt(E)||(R=Error(b("Argument unexpected for: %s",D))),Y(D,k(D)),c;let B=Bt(E)?0:1;if(a["nargs-eats-options"])y.length-(c+1)+B<O&&(R=Error(b("Not enough arguments following: %s",D))),B=O;else{for(f=c+1;f<y.length&&(!y[f].match(/^-[^0-9]/)||y[f].match($)||Q(y[f]));f++)B++;B<O&&(R=Error(b("Not enough arguments following: %s",D)))}let j=Math.min(B,O);for(!Bt(E)&&j>0&&(Y(D,E),j--),f=c+1;f<j+c+1;f++)Y(D,y[f]);return c+j}function yt(c,D,y,E){let f=[],O=E||y[c+1],B=M(D,d.nargs);if(M(D,d.bools)&&!/^(true|false)$/.test(O))f.push(!0);else if(Bt(O)||Bt(E)&&/^-/.test(O)&&!$.test(O)&&!Q(O)){if(h[D]!==void 0){let j=h[D];f=Array.isArray(j)?j:[j]}}else{Bt(E)||f.push(A(D,E,!0));for(let j=c+1;j<y.length&&!(!a["greedy-arrays"]&&f.length>0||B&&typeof B=="number"&&f.length>=B||(O=y[j],/^-/.test(O)&&!$.test(O)&&!Q(O)));j++)c=j,f.push(A(D,O,r))}return typeof B=="number"&&(B&&f.length<B||isNaN(B)&&f.length===0)&&(R=Error(b("Not enough arguments following: %s",D))),Y(D,f),c}function Y(c,D,y=r){if(/-/.test(c)&&a["camel-case-expansion"]){let O=c.split(".").map(function(B){return zt(B)}).join(".");S(c,O)}let E=A(c,D,y),f=c.split(".");jt(V,f,E),d.aliases[c]&&d.aliases[c].forEach(function(O){let B=O.split(".");jt(V,B,E)}),f.length>1&&a["dot-notation"]&&(d.aliases[f[0]]||[]).forEach(function(O){let B=O.split("."),j=[].concat(f);j.shift(),B=B.concat(j),(d.aliases[c]||[]).includes(B.join("."))||jt(V,B,E)}),M(c,d.normalize)&&!M(c,d.arrays)&&[c].concat(d.aliases[c]||[]).forEach(function(B){Object.defineProperty(U,B,{enumerable:!0,get(){return D},set(j){D=typeof j=="string"?It.normalize(j):j}})})}function S(c,D){d.aliases[c]&&d.aliases[c].length||(d.aliases[c]=[D],g[D]=!0),d.aliases[D]&&d.aliases[D].length||S(D,c)}function A(c,D,y){y&&(D=Mi(D)),(M(c,d.bools)||M(c,d.counts))&&typeof D=="string"&&(D=D==="true");let E=Array.isArray(D)?D.map(function(f){return x(c,f)}):x(c,D);return M(c,d.counts)&&(Bt(E)||typeof E=="boolean")&&(E=ke()),M(c,d.normalize)&&M(c,d.arrays)&&(Array.isArray(D)?E=D.map(f=>It.normalize(f)):E=It.normalize(D)),E}function x(c,D){return!a["parse-positional-numbers"]&&c==="_"||!M(c,d.strings)&&!M(c,d.bools)&&!Array.isArray(D)&&(we(D)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${D}`)))||!Bt(D)&&M(c,d.numbers))&&(D=Number(D)),D}function N(c){let D=Object.create(null);Z(D,d.aliases,h),Object.keys(d.configs).forEach(function(y){let E=c[y]||D[y];if(E)try{let f=null,O=It.resolve(It.cwd(),E),B=d.configs[y];if(typeof B=="function"){try{f=B(O)}catch(j){f=j}if(f instanceof Error){R=f;return}}else f=It.require(O);H(f)}catch(f){f.name==="PermissionDenied"?R=f:c[y]&&(R=Error(b("Invalid JSON config file: %s",E)))}})}function H(c,D){Object.keys(c).forEach(function(y){let E=c[y],f=D?D+"."+y:y;typeof E=="object"&&E!==null&&!Array.isArray(E)&&a["dot-notation"]?H(E,f):(!Pt(V,f.split("."))||M(f,d.arrays)&&a["combine-arrays"])&&Y(f,E)})}function it(){typeof m<"u"&&m.forEach(function(c){H(c)})}function z(c,D){if(typeof F>"u")return;let y=typeof F=="string"?F:"",E=It.env();Object.keys(E).forEach(function(f){if(y===""||f.lastIndexOf(y,0)===0){let O=f.split("__").map(function(B,j){return j===0&&(B=B.substring(y.length)),zt(B)});(D&&d.configs[O.join(".")]||!D)&&!Pt(c,O)&&Y(O.join("."),E[f])}})}function rt(c){let D,y=new Set;Object.keys(c).forEach(function(E){if(!y.has(E)&&(D=M(E,d.coercions),typeof D=="function"))try{let f=x(E,D(c[E]));[].concat(d.aliases[E]||[],E).forEach(O=>{y.add(O),c[O]=f})}catch(f){R=f}})}function Rt(c){return d.keys.forEach(D=>{~D.indexOf(".")||typeof c[D]>"u"&&(c[D]=void 0)}),c}function Z(c,D,y,E=!1){Object.keys(y).forEach(function(f){Pt(c,f.split("."))||(jt(c,f.split("."),y[f]),E&&(C[f]=!0),(D[f]||[]).forEach(function(O){Pt(c,O.split("."))||jt(c,O.split("."),y[f])}))})}function Pt(c,D){let y=c;a["dot-notation"]||(D=[D.join(".")]),D.slice(0,-1).forEach(function(f){y=y[f]||{}});let E=D[D.length-1];return typeof y!="object"?!1:E in y}function jt(c,D,y){let E=c;a["dot-notation"]||(D=[D.join(".")]),D.slice(0,-1).forEach(function(ot){ot=rs(ot),typeof E=="object"&&E[ot]===void 0&&(E[ot]={}),typeof E[ot]!="object"||Array.isArray(E[ot])?(Array.isArray(E[ot])?E[ot].push({}):E[ot]=[E[ot],{}],E=E[ot][E[ot].length-1]):E=E[ot]});let f=rs(D[D.length-1]),O=M(D.join("."),d.arrays),B=Array.isArray(y),j=a["duplicate-arguments-array"];!j&&M(f,d.nargs)&&(j=!0,(!Bt(E[f])&&d.nargs[f]===1||Array.isArray(E[f])&&E[f].length===d.nargs[f])&&(E[f]=void 0)),y===ke()?E[f]=ke(E[f]):Array.isArray(E[f])?j&&O&&B?E[f]=a["flatten-duplicate-arrays"]?E[f].concat(y):(Array.isArray(E[f][0])?E[f]:[E[f]]).concat([y]):!j&&!!O==!!B?E[f]=y:E[f]=E[f].concat([y]):E[f]===void 0&&O?E[f]=B?y:[y]:j&&!(E[f]===void 0||M(f,d.counts)||M(f,d.bools))?E[f]=[E[f],y]:E[f]=y}function Wt(...c){c.forEach(function(D){Object.keys(D||{}).forEach(function(y){d.aliases[y]||(d.aliases[y]=[].concat(u[y]||[]),d.aliases[y].concat(y).forEach(function(E){if(/-/.test(E)&&a["camel-case-expansion"]){let f=zt(E);f!==y&&d.aliases[y].indexOf(f)===-1&&(d.aliases[y].push(f),g[f]=!0)}}),d.aliases[y].concat(y).forEach(function(E){if(E.length>1&&/[A-Z]/.test(E)&&a["camel-case-expansion"]){let f=Be(E,"-");f!==y&&d.aliases[y].indexOf(f)===-1&&(d.aliases[y].push(f),g[f]=!0)}}),d.aliases[y].forEach(function(E){d.aliases[E]=[y].concat(d.aliases[y].filter(function(f){return E!==f}))}))})})}function M(c,D){let y=[].concat(d.aliases[c]||[],c),E=Object.keys(D),f=y.find(O=>E.includes(O));return f?D[f]:!1}function Ye(c){let D=Object.keys(d);return[].concat(D.map(E=>d[E])).some(function(E){return Array.isArray(E)?E.includes(c):E[c]})}function I(c,...D){return[].concat(...D).some(function(E){let f=c.match(E);return f&&Ye(f[1])})}function X(c){if(c.match($)||!c.match(/^-[^-]+/))return!1;let D=!0,y,E=c.slice(1).split("");for(let f=0;f<E.length;f++){if(y=c.slice(f+2),!Ye(E[f])){D=!1;break}if(E[f+1]&&E[f+1]==="="||y==="-"||/[A-Za-z]/.test(E[f])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(y)||E[f+1]&&E[f+1].match(/\W/))break}return D}function Q(c){return a["unknown-options-as-args"]&&L(c)}function L(c){return c=c.replace(/^-{3,}/,"--"),c.match($)||X(c)?!1:!I(c,/^-+([^=]+?)=[\s\S]*$/,K,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function k(c){return!M(c,d.bools)&&!M(c,d.counts)&&`${c}`in h?h[c]:et(At(c))}function et(c){return{[gt.BOOLEAN]:!0,[gt.STRING]:"",[gt.NUMBER]:void 0,[gt.ARRAY]:[]}[c]}function At(c){let D=gt.BOOLEAN;return M(c,d.strings)?D=gt.STRING:M(c,d.numbers)?D=gt.NUMBER:M(c,d.bools)?D=gt.BOOLEAN:M(c,d.arrays)&&(D=gt.ARRAY),D}function Bt(c){return c===void 0}function Ee(){Object.keys(d.counts).find(c=>M(c,d.arrays)?(R=Error(b("Invalid configuration: %s, opts.count excludes opts.array.",c)),!0):M(c,d.nargs)?(R=Error(b("Invalid configuration: %s, opts.count excludes opts.narg.",c)),!0):!1)}return{aliases:Object.assign({},d.aliases),argv:Object.assign(U,V),configuration:a,defaulted:Object.assign({},C),error:R,newAliases:Object.assign({},g)}}};function vi(e){let t=[],n=Object.create(null),s=!0;for(Object.keys(e).forEach(function(i){t.push([].concat(e[i],i))});s;){s=!1;for(let i=0;i<t.length;i++)for(let r=i+1;r<t.length;r++)if(t[i].filter(function(a){return t[r].indexOf(a)!==-1}).length){t[i]=t[i].concat(t[r]),t.splice(r,1),s=!0;break}}return t.forEach(function(i){i=i.filter(function(u,a,h){return h.indexOf(u)===a});let r=i.pop();r!==void 0&&typeof r=="string"&&(n[r]=i)}),n}function ke(e){return e!==void 0?e+1:1}function rs(e){return e==="__proto__"?"___proto___":e}function Mi(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}import{readFileSync as Li}from"fs";import{createRequire as os}from"node:module";var tn,en,nn,us=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20,as=(en=(tn=process==null?void 0:process.versions)===null||tn===void 0?void 0:tn.node)!==null&&en!==void 0?en:(nn=process==null?void 0:process.version)===null||nn===void 0?void 0:nn.slice(1);if(as&&Number(as.match(/^([^.]+)/)[1])<us)throw Error(`yargs parser supports a minimum Node.js version of ${us}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Ri=process?process.env:{},cs=os?os(import.meta.url):void 0,ls=new _e({cwd:process.cwd,env:()=>Ri,format:$i,normalize:Ti,resolve:Ni,require:e=>{if(typeof cs<"u")return cs(e);if(e.match(/\.json$/))return JSON.parse(Li(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),ue=function(t,n){return ls.parse(t.slice(),n).argv};ue.detailed=function(e,t){return ls.parse(e.slice(),t)};ue.camelCase=zt;ue.decamelize=Be;ue.looksLikeNumber=we;var sn=ue;import{basename as Zi,dirname as Qi,extname as ki,relative as tr,resolve as gs,join as er}from"path";function fs(){return Wi()?0:1}function Wi(){return Ui()&&!process.defaultApp}function Ui(){return!!process.versions.electron}function rn(e){return e.slice(fs()+1)}function Ds(){return process.argv[fs()]}import{readFileSync as zi,statSync as Hi,writeFile as Ki}from"fs";import{format as Vi}from"util";import{resolve as Yi}from"path";var hs={fs:{readFileSync:zi,writeFile:Ki},format:Vi,resolve:Yi,exists:e=>{try{return Hi(e).isFile()}catch{return!1}}};var _t,on=class{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let n=t.shift(),s=function(){};return typeof t[t.length-1]=="function"&&(s=t.pop()),s=s||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]=n,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s(),_t.format.apply(_t.format,[this.cache[this.locale][n]||n].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),n=t.shift(),s=t.shift(),i=t.shift(),r=function(){};typeof t[t.length-1]=="function"&&(r=t.pop()),this.cache[this.locale]||this._readLocaleFile();let u=i===1?n:s;this.cache[this.locale][n]&&(u=this.cache[this.locale][n][i===1?"one":"other"]),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]={one:n,other:s},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:r})):r();let a=[u];return~u.indexOf("%d")&&a.push(i),_t.format.apply(_t.format,a.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this.cache[this.locale][n]=t[n])}_taggedLiteral(t,...n){let s="";return t.forEach(function(i,r){let u=n[r+1];s+=i,typeof u<"u"&&(s+="%s")}),this.__.apply(this,[s].concat([].slice.call(n,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,n=this.writeQueue[0],s=n.directory,i=n.locale,r=n.cb,u=this._resolveLocaleFile(s,i),a=JSON.stringify(this.cache[i],null,2);_t.fs.writeFile(u,a,"utf-8",function(h){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),r(h)})}_readLocaleFile(){let t={},n=this._resolveLocaleFile(this.directory,this.locale);try{_t.fs.readFileSync&&(t=JSON.parse(_t.fs.readFileSync(n,"utf-8")))}catch(s){if(s instanceof SyntaxError&&(s.message="syntax error in "+n),s.code==="ENOENT")t={};else throw s}this.cache[this.locale]=t}_resolveLocaleFile(t,n){let s=_t.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(s)&&~n.lastIndexOf("_")){let i=_t.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(i)&&(s=i)}return s}_fileExistsSync(t){return _t.exists(t)}};function ds(e,t){_t=t;let n=new on(e);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}var Gi=e=>ds(e,hs),ps=Gi;var Cs=Nn(ms(),1);import{createRequire as nr}from"node:module";import{readFileSync as sr,readdirSync as ir}from"node:fs";var un=Es(import.meta.url),rr=un.substring(0,un.lastIndexOf("node_modules")),or=nr(import.meta.url),an={assert:{notStrictEqual:qi,strictEqual:Xi},cliui:Qe,findUp:ss,getEnv:e=>process.env[e],inspect:Ji,getProcessArgvBin:Ds,mainFilename:rr||process.cwd(),Parser:sn,path:{basename:Zi,dirname:Qi,extname:ki,relative:tr,resolve:gs,join:er},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:e=>{process.exit(e)},nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:sr,readdirSync:ir,require:or,getCallerFile:()=>{let e=(0,Cs.default)(3);return e.match(/^file:\/\//)?Es(e):e},stringWidth:wt,y18n:ps({directory:gs(un,"../../../locales"),updateFiles:!1})};function ft(e,t,n,s){n.assert.notStrictEqual(e,t,s)}function cn(e,t){t.assert.strictEqual(typeof e,"string")}function se(e){return Object.keys(e)}function q(e){return!!e&&!!e.then&&typeof e.then=="function"}var nt=class e extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}};function vt(e){let n=e.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),s=/\.*[\][<>]/g,i=n.shift();if(!i)throw new Error(`No command found in: ${e}`);let r={cmd:i.replace(s,""),demanded:[],optional:[]};return n.forEach((u,a)=>{let h=!1;u=u.replace(/\s/g,""),/\.+[\]>]/.test(u)&&a===n.length-1&&(h=!0),/^\[/.test(u)?r.optional.push({cmd:u.replace(s,"").split("|"),variadic:h}):r.demanded.push({cmd:u.replace(s,"").split("|"),variadic:h})}),r}var ur=["first","second","third","fourth","fifth","sixth"];function w(e,t,n){function s(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[vt(`cmd ${e}`),t,n]}try{let i=0,[r,u,a]=s(),h=[].slice.call(u);for(;h.length&&h[h.length-1]===void 0;)h.pop();let m=a||h.length;if(m<r.demanded.length)throw new nt(`Not enough arguments provided. Expected ${r.demanded.length} but received ${h.length}.`);let F=r.demanded.length+r.optional.length;if(m>F)throw new nt(`Too many arguments provided. Expected max ${F} but received ${m}.`);r.demanded.forEach(l=>{let p=h.shift(),g=bs(p);l.cmd.filter(b=>b===g||b==="*").length===0&&ys(g,l.cmd,i),i+=1}),r.optional.forEach(l=>{if(h.length===0)return;let p=h.shift(),g=bs(p);l.cmd.filter(b=>b===g||b==="*").length===0&&ys(g,l.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function bs(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function ys(e,t,n){throw new nt(`Invalid ${ur[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var xe=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,s=!0,i=!1){if(w("<array|function> [boolean] [boolean] [boolean]",[t,n,s],arguments.length),Array.isArray(t)){for(let r=0;r<t.length;r++){if(typeof t[r]!="function")throw Error("middleware must be a function");let u=t[r];u.applyBeforeValidation=n,u.global=s}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let r=t;r.applyBeforeValidation=n,r.global=s,r.mutates=i,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,n){let s=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let r=[...s[n]||[],n];return i.option?!r.includes(i.option):!0}),t.option=n,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function As(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function Ht(e,t,n,s){return n.reduce((i,r)=>{if(r.applyBeforeValidation!==s)return i;if(r.mutates){if(r.applied)return i;r.applied=!0}if(q(i))return i.then(u=>Promise.all([u,r(u,t)])).then(([u,a])=>Object.assign(u,a));{let u=r(i,t);return q(u)?u.then(a=>Object.assign(i,a)):Object.assign(i,u)}},e)}function Kt(e,t,n=s=>{throw s}){try{let s=ar(e)?e():e;return q(s)?s.then(i=>t(i)):t(s)}catch(s){return n(s)}}function ar(e){return typeof e=="function"}var ie=/(^\*)|(^\$0)/,ln=class{constructor(t,n,s,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=s,this.validation=n}addDirectory(t,n,s,i){i=i||{},this.requireCache.add(s);let r=this.shim.path.resolve(this.shim.path.dirname(s),t),u=this.shim.readdirSync(r,{recursive:!!i.recurse});Array.isArray(i.extensions)||(i.extensions=["js"]);let a=typeof i.visit=="function"?i.visit:h=>h;for(let h of u){let m=h.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 F=!1;for(let l of i.extensions)m.endsWith(l)&&(F=!0);if(F){let l=this.shim.path.join(r,m),p=n(l),g=Object.create(null,Object.getOwnPropertyDescriptors({...p}));if(a(g,l,m)){if(this.requireCache.has(l))continue;this.requireCache.add(l),g.command||(g.command=this.shim.path.basename(l,this.shim.path.extname(l))),this.addHandler(g)}}}}addHandler(t,n,s,i,r,u){let a=[],h=As(r);if(i=i||(()=>{}),Array.isArray(t))if(cr(t))[t,...a]=t;else for(let m of t)this.addHandler(m);else if(fr(t)){let m=Array.isArray(t.command)||typeof t.command=="string"?t.command:null;if(m===null)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);t.aliases&&(m=[].concat(m).concat(t.aliases)),this.addHandler(m,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(Bs(s)){this.addHandler([t].concat(a),n,s.builder,s.handler,s.middlewares,s.deprecated);return}if(typeof t=="string"){let m=vt(t);a=a.map(p=>vt(p).cmd);let F=!1,l=[m.cmd].concat(a).filter(p=>ie.test(p)?(F=!0,!1):!0);l.length===0&&F&&l.push("$0"),F&&(m.cmd=l[0],a=l.slice(1),t=t.replace(ie,m.cmd)),a.forEach(p=>{this.aliasMap[p]=m.cmd}),n!==!1&&this.usage.command(t,n,F,a,u),this.handlers[m.cmd]={original:t,description:n,handler:i,builder:s||{},middlewares:h,deprecated:u,demanded:m.demanded,optional:m.optional},F&&(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(t,n,s,i,r,u){let a=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,h=n.getInternalMethods().getContext(),m=h.commands.slice(),F=!t;t&&(h.commands.push(t),h.fullCommands.push(a.original));let l=this.applyBuilderUpdateUsageAndParse(F,a,n,s.aliases,m,i,r,u);return q(l)?l.then(p=>this.applyMiddlewareAndGetResult(F,a,p.innerArgv,h,r,p.aliases,n)):this.applyMiddlewareAndGetResult(F,a,l.innerArgv,h,r,l.aliases,n)}applyBuilderUpdateUsageAndParse(t,n,s,i,r,u,a,h){let m=n.builder,F=s;if(Oe(m)){s.getInternalMethods().getUsageInstance().freeze();let l=m(s.getInternalMethods().reset(i),h);if(q(l))return l.then(p=>(F=_s(p)?p:s,this.parseAndUpdateUsage(t,n,F,r,u,a)))}else lr(m)&&(s.getInternalMethods().getUsageInstance().freeze(),F=s.getInternalMethods().reset(i),Object.keys(n.builder).forEach(l=>{F.option(l,m[l])}));return this.parseAndUpdateUsage(t,n,F,r,u,a)}parseAndUpdateUsage(t,n,s,i,r,u){t&&s.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(s)&&s.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,n),n.description);let a=s.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,r,u);return q(a)?a.then(h=>({aliases:s.parsed.aliases,innerArgv:h})):{aliases:s.parsed.aliases,innerArgv:a}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,n){let s=ie.test(n.original)?n.original.replace(ie,"").trim():n.original,i=t.filter(r=>!ie.test(r));return i.push(s),`$0 ${i.join(" ")}`}handleValidationAndGetResult(t,n,s,i,r,u,a,h){if(!u.getInternalMethods().getHasOutput()){let m=u.getInternalMethods().runValidation(r,h,u.parsed.error,t);s=Kt(s,F=>(m(F),F))}if(n.handler&&!u.getInternalMethods().getHasOutput()){u.getInternalMethods().setHasOutput();let m=!!u.getOptions().configuration["populate--"];u.getInternalMethods().postProcess(s,m,!1,!1),s=Ht(s,u,a,!1),s=Kt(s,F=>{let l=n.handler(F);return q(l)?l.then(()=>F):F}),t||u.getInternalMethods().getUsageInstance().cacheHelpMessage(),q(s)&&!u.getInternalMethods().hasParseCallback()&&s.catch(F=>{try{u.getInternalMethods().getUsageInstance().fail(null,F)}catch{}})}return t||(i.commands.pop(),i.fullCommands.pop()),s}applyMiddlewareAndGetResult(t,n,s,i,r,u,a){let h={};if(r)return s;a.getInternalMethods().getHasOutput()||(h=this.populatePositionals(n,s,i,a));let m=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares),F=Ht(s,a,m,!0);return q(F)?F.then(l=>this.handleValidationAndGetResult(t,n,l,i,u,a,m,h)):this.handleValidationAndGetResult(t,n,F,i,u,a,m,h)}populatePositionals(t,n,s,i){n._=n._.slice(s.commands.length);let r=t.demanded.slice(0),u=t.optional.slice(0),a={};for(this.validation.positionalCount(r.length,n._.length);r.length;){let h=r.shift();this.populatePositional(h,n,a)}for(;u.length;){let h=u.shift();this.populatePositional(h,n,a)}return n._=s.commands.concat(n._.map(h=>""+h)),this.postProcessPositionals(n,a,this.cmdToParseOptions(t.original),i),a}populatePositional(t,n,s){let i=t.cmd[0];t.variadic?s[i]=n._.splice(0).map(String):n._.length&&(s[i]=[String(n._.shift())])}cmdToParseOptions(t){let n={array:[],default:{},alias:{},demand:{}},s=vt(t);return s.demanded.forEach(i=>{let[r,...u]=i.cmd;i.variadic&&(n.array.push(r),n.default[r]=[]),n.alias[r]=u,n.demand[r]=!0}),s.optional.forEach(i=>{let[r,...u]=i.cmd;i.variadic&&(n.array.push(r),n.default[r]=[]),n.alias[r]=u}),n}postProcessPositionals(t,n,s,i){let r=Object.assign({},i.getOptions());r.default=Object.assign(s.default,r.default);for(let m of Object.keys(s.alias))r.alias[m]=(r.alias[m]||[]).concat(s.alias[m]);r.array=r.array.concat(s.array),r.config={};let u=[];if(Object.keys(n).forEach(m=>{n[m].map(F=>{r.configuration["unknown-options-as-args"]&&(r.key[m]=!0),u.push(`--${m}`),u.push(F)})}),!u.length)return;let a=Object.assign({},r.configuration,{"populate--":!1}),h=this.shim.Parser.detailed(u,Object.assign({},r,{configuration:a}));if(h.error)i.getInternalMethods().getUsageInstance().fail(h.error.message,h.error);else{let m=Object.keys(n);Object.keys(n).forEach(F=>{m.push(...h.aliases[F])}),Object.keys(h.argv).forEach(F=>{m.includes(F)&&(n[F]||(n[F]=h.argv[F]),!this.isInConfigs(i,F)&&!this.isDefaulted(i,F)&&Object.prototype.hasOwnProperty.call(t,F)&&Object.prototype.hasOwnProperty.call(h.argv,F)&&(Array.isArray(t[F])||Array.isArray(h.argv[F]))?t[F]=[].concat(t[F],h.argv[F]):t[F]=h.argv[F])})}}isDefaulted(t,n){let{default:s}=t.getOptions();return Object.prototype.hasOwnProperty.call(s,n)||Object.prototype.hasOwnProperty.call(s,this.shim.Parser.camelCase(n))}isInConfigs(t,n){let{configObjects:s}=t.getOptions();return s.some(i=>Object.prototype.hasOwnProperty.call(i,n))||s.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(n)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let s=ie.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(s,this.defaultCommand.description)}let n=this.defaultCommand.builder;if(Oe(n))return n(t,!0);Bs(n)||Object.keys(n).forEach(s=>{t.option(s,n[s])})}extractDesc({describe:t,description:n,desc:s}){for(let i of[t,n,s]){if(typeof i=="string"||i===!1)return i;ft(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();ft(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function ws(e,t,n,s){return new ln(e,t,n,s)}function Bs(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function cr(e){return e.every(t=>typeof t=="string")}function Oe(e){return typeof e=="function"}function lr(e){return typeof e=="object"}function fr(e){return typeof e=="object"&&!Array.isArray(e)}function Mt(e={},t=()=>!0){let n={};return se(e).forEach(s=>{t(s,e[s])&&(n[s]=e[s])}),n}function $t(e){typeof process>"u"||[process.stdout,process.stderr].forEach(t=>{let n=t;n._handle&&n.isTTY&&typeof n._handle.setBlocking=="function"&&n._handle.setBlocking(e)})}function Dr(e){return typeof e=="boolean"}function Os(e,t){let n=t.y18n.__,s={},i=[];s.failFn=function(A){i.push(A)};let r=null,u=null,a=!0;s.showHelpOnFail=function(A=!0,x){let[N,H]=typeof A=="string"?[!0,A]:[A,x];return e.getInternalMethods().isGlobalContext()&&(u=H),r=H,a=N,s};let h=!1;s.fail=function(A,x){let N=e.getInternalMethods().getLoggerInstance();if(i.length)for(let H=i.length-1;H>=0;--H){let it=i[H];if(Dr(it)){if(x)throw x;if(A)throw Error(A)}else it(A,x,s)}else{if(e.getExitProcess()&&$t(!0),!h){h=!0,a&&(e.showHelp("error"),N.error()),(A||x)&&N.error(A||x);let H=r||u;H&&((A||x)&&N.error(""),N.error(H))}if(x=x||new nt(A),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,x);throw x}};let m=[],F=!1;s.usage=(S,A)=>S===null?(F=!0,m=[],s):(F=!1,m.push([S,A||""]),s),s.getUsage=()=>m,s.getUsageDisabled=()=>F,s.getPositionalGroupName=()=>n("Positionals:");let l=[];s.example=(S,A)=>{l.push([S,A||""])};let p=[];s.command=function(A,x,N,H,it=!1){N&&(p=p.map(z=>(z[2]=!1,z))),p.push([A,x||"",N,H,it])},s.getCommands=()=>p;let g={};s.describe=function(A,x){Array.isArray(A)?A.forEach(N=>{s.describe(N,x)}):typeof A=="object"?Object.keys(A).forEach(N=>{s.describe(N,A[N])}):g[A]=x},s.getDescriptions=()=>g;let C=[];s.epilog=S=>{C.push(S)};let b=!1,d;s.wrap=S=>{b=!0,d=S},s.getWrap=()=>t.getEnv("YARGS_DISABLE_WRAP")?null:(b||(d=ct(),b=!0),d);let $="__yargsString__:";s.deferY18nLookup=S=>$+S,s.help=function(){if(W)return W;R();let A=e.customScriptName?e.$0:t.path.basename(e.$0),x=e.getDemandedOptions(),N=e.getDemandedCommands(),H=e.getDeprecatedOptions(),it=e.getGroups(),z=e.getOptions(),rt=[];rt=rt.concat(Object.keys(g)),rt=rt.concat(Object.keys(x)),rt=rt.concat(Object.keys(N)),rt=rt.concat(Object.keys(z.default)),rt=rt.filter(U),rt=Object.keys(rt.reduce((I,X)=>(X!=="_"&&(I[X]=!0),I),{}));let Rt=s.getWrap(),Z=t.cliui({width:Rt,wrap:!!Rt});if(!F){if(m.length)m.forEach(I=>{Z.div({text:`${I[0].replace(/\$0/g,A)}`}),I[1]&&Z.div({text:`${I[1]}`,padding:[1,0,0,0]})}),Z.div();else if(p.length){let I=null;N._?I=`${A} <${n("command")}>
`:I=`${A} [${n("command")}]
`,Z.div(`${I}`)}}if(p.length>1||p.length===1&&!p[0][2]){Z.div(n("Commands:"));let I=e.getInternalMethods().getContext(),X=I.commands.length?`${I.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(p=p.sort((L,k)=>L[0].localeCompare(k[0])));let Q=A?`${A} `:"";p.forEach(L=>{let k=`${Q}${X}${L[0].replace(/^\$0 ?/,"")}`;Z.span({text:k,padding:[0,2,0,2],width:K(p,Rt,`${A}${X}`)+4},{text:L[1]});let et=[];L[2]&&et.push(`[${n("default")}]`),L[3]&&L[3].length&&et.push(`[${n("aliases:")} ${L[3].join(", ")}]`),L[4]&&(typeof L[4]=="string"?et.push(`[${n("deprecated: %s",L[4])}]`):et.push(`[${n("deprecated")}]`)),et.length?Z.div({text:et.join(" "),padding:[0,0,0,2],align:"right"}):Z.div()}),Z.div()}let Pt=(Object.keys(z.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);rt=rt.filter(I=>!e.parsed.newAliases[I]&&Pt.every(X=>(z.alias[X]||[]).indexOf(I)===-1));let jt=n("Options:");it[jt]||(it[jt]=[]),V(rt,z.alias,it,jt);let Wt=I=>/^--/.test(Se(I)),M=Object.keys(it).filter(I=>it[I].length>0).map(I=>{let X=it[I].filter(U).map(Q=>{if(Pt.includes(Q))return Q;for(let L=0,k;(k=Pt[L])!==void 0;L++)if((z.alias[k]||[]).includes(Q))return k;return Q});return{groupName:I,normalizedKeys:X}}).filter(({normalizedKeys:I})=>I.length>0).map(({groupName:I,normalizedKeys:X})=>{let Q=X.reduce((L,k)=>(L[k]=[k].concat(z.alias[k]||[]).map(et=>I===s.getPositionalGroupName()?et:(/^[0-9]$/.test(et)?z.boolean.includes(k)?"-":"--":et.length>1?"--":"-")+et).sort((et,At)=>Wt(et)===Wt(At)?0:Wt(et)?1:-1).join(", "),L),{});return{groupName:I,normalizedKeys:X,switches:Q}});if(M.filter(({groupName:I})=>I!==s.getPositionalGroupName()).some(({normalizedKeys:I,switches:X})=>!I.every(Q=>Wt(X[Q])))&&M.filter(({groupName:I})=>I!==s.getPositionalGroupName()).forEach(({normalizedKeys:I,switches:X})=>{I.forEach(Q=>{Wt(X[Q])&&(X[Q]=hr(X[Q],4))})}),M.forEach(({groupName:I,normalizedKeys:X,switches:Q})=>{Z.div(I),X.forEach(L=>{let k=Q[L],et=g[L]||"",At=null;et.includes($)&&(et=n(et.substring($.length))),z.boolean.includes(L)&&(At=`[${n("boolean")}]`),z.count.includes(L)&&(At=`[${n("count")}]`),z.string.includes(L)&&(At=`[${n("string")}]`),z.normalize.includes(L)&&(At=`[${n("string")}]`),z.array.includes(L)&&(At=`[${n("array")}]`),z.number.includes(L)&&(At=`[${n("number")}]`);let Bt=D=>typeof D=="string"?`[${n("deprecated: %s",D)}]`:`[${n("deprecated")}]`,Ee=[L in H?Bt(H[L]):null,At,L in x?`[${n("required")}]`:null,z.choices&&z.choices[L]?`[${n("choices:")} ${s.stringifiedValues(z.choices[L])}]`:null,G(z.default[L],z.defaultDescription[L])].filter(Boolean).join(" ");Z.span({text:Se(k),padding:[0,2,0,2+xs(k)],width:K(Q,Rt)+4},et);let c=e.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;Ee&&!c?Z.div({text:Ee,padding:[0,0,0,2],align:"right"}):Z.div()}),Z.div()}),l.length&&(Z.div(n("Examples:")),l.forEach(I=>{I[0]=I[0].replace(/\$0/g,A)}),l.forEach(I=>{I[1]===""?Z.div({text:I[0],padding:[0,2,0,2]}):Z.div({text:I[0],padding:[0,2,0,2],width:K(l,Rt)+4},{text:I[1]})}),Z.div()),C.length>0){let I=C.map(X=>X.replace(/\$0/g,A)).join(`
`);Z.div(`${I}
`)}return Z.toString().replace(/\s*$/,"")};function K(S,A,x){let N=0;return Array.isArray(S)||(S=Object.values(S).map(H=>[H])),S.forEach(H=>{N=Math.max(t.stringWidth(x?`${x} ${Se(H[0])}`:Se(H[0]))+xs(H[0]),N)}),A&&(N=Math.min(N,parseInt((A*.5).toString(),10))),N}function R(){let S=e.getDemandedOptions(),A=e.getOptions();(Object.keys(A.alias)||[]).forEach(x=>{A.alias[x].forEach(N=>{g[N]&&s.describe(x,g[N]),N in S&&e.demandOption(x,S[N]),A.boolean.includes(N)&&e.boolean(x),A.count.includes(N)&&e.count(x),A.string.includes(N)&&e.string(x),A.normalize.includes(N)&&e.normalize(x),A.array.includes(N)&&e.array(x),A.number.includes(N)&&e.number(x)})})}let W;s.cacheHelpMessage=function(){W=this.help()},s.clearCachedHelpMessage=function(){W=void 0},s.hasCachedHelpMessage=function(){return!!W};function V(S,A,x,N){let H=[],it=null;return Object.keys(x).forEach(z=>{H=H.concat(x[z])}),S.forEach(z=>{it=[z].concat(A[z]),it.some(rt=>H.indexOf(rt)!==-1)||x[N].push(z)}),H}function U(S){return e.getOptions().hiddenOptions.indexOf(S)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}s.showHelp=S=>{let A=e.getInternalMethods().getLoggerInstance();S||(S="error"),(typeof S=="function"?S:A[S])(s.help())},s.functionDescription=S=>["(",S.name?t.Parser.decamelize(S.name,"-"):n("generated-value"),")"].join(""),s.stringifiedValues=function(A,x){let N="",H=x||", ",it=[].concat(A);return!A||!it.length||it.forEach(z=>{N.length&&(N+=H),N+=JSON.stringify(z)}),N};function G(S,A){let x=`[${n("default:")} `;if(S===void 0&&!A)return null;if(A)x+=A;else switch(typeof S){case"string":x+=`"${S}"`;break;case"object":x+=JSON.stringify(S);break;default:x+=S}return`${x}]`}function ct(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let yt=null;s.version=S=>{yt=S},s.showVersion=S=>{let A=e.getInternalMethods().getLoggerInstance();S||(S="error"),(typeof S=="function"?S:A[S])(yt)},s.reset=function(A){return r=null,h=!1,m=[],F=!1,C=[],l=[],p=[],g=Mt(g,x=>!A[x]),s};let Y=[];return s.freeze=function(){Y.push({failMessage:r,failureOutput:h,usages:m,usageDisabled:F,epilogs:C,examples:l,commands:p,descriptions:g})},s.unfreeze=function(A=!1){let x=Y.pop();x&&(A?(g={...x.descriptions,...g},p=[...x.commands,...p],m=[...x.usages,...m],l=[...x.examples,...l],C=[...x.epilogs,...C]):{failMessage:r,failureOutput:h,usages:m,usageDisabled:F,epilogs:C,examples:l,commands:p,descriptions:g}=x)},s}function fn(e){return typeof e=="object"}function hr(e,t){return fn(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function xs(e){return fn(e)?e.indentation:0}function Se(e){return fn(e)?e.text:e}var Ss=`###-begin-{{app_name}}-completions-###
#
# yargs command completion script
#
# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc
# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.
#
_{{app_name}}_yargs_completions()
{
local cur_word args type_list
cur_word="\${COMP_WORDS[COMP_CWORD]}"
args=("\${COMP_WORDS[@]}")
# ask yargs to generate completions.
# see https://stackoverflow.com/a/40944195/7080036 for the spaces-handling awk
mapfile -t type_list < <({{app_path}} --get-yargs-completions "\${args[@]}")
mapfile -t COMPREPLY < <(compgen -W "$( printf '%q ' "\${type_list[@]}" )" -- "\${cur_word}" |
awk '/ / { print "\\""$0"\\"" } /^[^ ]+$/ { print $0 }')
# if no match was found, fall back to filename completion
if [ \${#COMPREPLY[@]} -eq 0 ]; then
COMPREPLY=()
fi
return 0
}
complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
###-end-{{app_name}}-completions-###
`,Ps=`#compdef {{app_name}}
###-begin-{{app_name}}-completions-###
#
# yargs command completion script
#
# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.
#
_{{app_name}}_yargs_completions()
{
local reply
local si=$IFS
IFS=$'
' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
IFS=$si
if [[ \${#reply} -gt 0 ]]; then
_describe 'values' reply
else
_default
fi
}
if [[ "'\${zsh_eval_context[-1]}" == "loadautofunc" ]]; then
_{{app_name}}_yargs_completions "$@"
else
compdef _{{app_name}}_yargs_completions {{app_name}}
fi
###-end-{{app_name}}-completions-###
`;var Dn=class{constructor(t,n,s,i){var r,u,a;this.yargs=t,this.usage=n,this.command=s,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(a=((r=this.shim.getEnv("SHELL"))===null||r===void 0?void 0:r.includes("zsh"))||((u=this.shim.getEnv("ZSH_NAME"))===null||u===void 0?void 0:u.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(t,n,s,i){let r=this.command.getCommandHandlers();for(let a=0,h=t.length;a<h;++a)if(r[t[a]]&&r[t[a]].builder){let m=r[t[a]].builder;if(Oe(m)){this.indexAfterLastReset=a+1;let F=this.yargs.getInternalMethods().reset();return m(F,!0),F.argv}}let u=[];this.commandCompletions(u,t,s),this.optionCompletions(u,t,n,s),this.choicesFromOptionsCompletions(u,t,n,s),this.choicesFromPositionalsCompletions(u,t,n,s),i(null,u)}commandCompletions(t,n,s){let i=this.yargs.getInternalMethods().getContext().commands;!s.match(/^-/)&&i[i.length-1]!==s&&!this.previousArgHasChoices(n)&&this.usage.getCommands().forEach(r=>{let u=vt(r[0]).cmd;if(n.indexOf(u)===-1)if(!this.zshShell)t.push(u);else{let a=r[1]||"";t.push(u.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(t,n,s,i){if((i.match(/^-/)||i===""&&t.length===0)&&!this.previousArgHasChoices(n)){let r=this.yargs.getOptions(),u=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(r.key).forEach(a=>{let h=!!r.configuration["boolean-negation"]&&r.boolean.includes(a);!u.includes(a)&&!r.hiddenOptions.includes(a)&&!this.argsContainKey(n,a,h)&&this.completeOptionKey(a,t,i,h&&!!r.default[a])})}}choicesFromOptionsCompletions(t,n,s,i){if(this.previousArgHasChoices(n)){let r=this.getPreviousArgChoices(n);r&&r.length>0&&t.push(...r.map(u=>u.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(t,n,s,i){if(i===""&&t.length>0&&this.previousArgHasChoices(n))return;let r=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],u=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=r[s._.length-u-1];if(!a)return;let h=this.yargs.getOptions().choices[a]||[];for(let m of h)m.startsWith(i)&&t.push(m.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let n=t[t.length-1],s="";if(!n.startsWith("-")&&t.length>1&&(s=n,n=t[t.length-2]),!n.startsWith("-"))return;let i=n.replace(/^-+/,""),r=this.yargs.getOptions(),u=[i,...this.yargs.getAliases()[i]||[]],a;for(let h of u)if(Object.prototype.hasOwnProperty.call(r.key,h)&&Array.isArray(r.choices[h])){a=r.choices[h];break}if(a)return a.filter(h=>!s||h.startsWith(s))}previousArgHasChoices(t){let n=this.getPreviousArgChoices(t);return n!==void 0&&n.length>0}argsContainKey(t,n,s){let i=r=>t.indexOf((/^[^0-9]$/.test(r)?"-":"--")+r)!==-1;if(i(n)||s&&i(`no-${n}`))return!0;if(this.aliases){for(let r of this.aliases[n])if(i(r))return!0}return!1}completeOptionKey(t,n,s,i){var r,u,a,h;let m=t;if(this.zshShell){let g=this.usage.getDescriptions(),C=(u=(r=this===null||this===void 0?void 0:this.aliases)===null||r===void 0?void 0:r[t])===null||u===void 0?void 0:u.find($=>{let K=g[$];return typeof K=="string"&&K.length>0}),b=C?g[C]:void 0,d=(h=(a=g[t])!==null&&a!==void 0?a:b)!==null&&h!==void 0?h:"";m=`${t.replace(/:/g,"\\:")}:${d.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let F=g=>/^--/.test(g),l=g=>/^[^0-9]$/.test(g),p=!F(s)&&l(t)?"-":"--";n.push(p+m),i&&n.push(p+"no-"+m)}customCompletion(t,n,s,i){if(ft(this.customCompletionFunction,null,this.shim),pr(this.customCompletionFunction)){let r=this.customCompletionFunction(s,n);return q(r)?r.then(u=>{this.shim.process.nextTick(()=>{i(null,u)})}).catch(u=>{this.shim.process.nextTick(()=>{i(u,void 0)})}):i(null,r)}else return Fr(this.customCompletionFunction)?this.customCompletionFunction(s,n,(r=i)=>this.defaultCompletion(t,n,s,r),r=>{i(null,r)}):this.customCompletionFunction(s,n,r=>{i(null,r)})}getCompletion(t,n){let s=t.length?t[t.length-1]:"",i=this.yargs.parse(t,!0),r=this.customCompletionFunction?u=>this.customCompletion(t,u,s,n):u=>this.defaultCompletion(t,u,s,n);return q(i)?i.then(r):r(i)}generateCompletionScript(t,n){let s=this.zshShell?Ps:Ss,i=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),s=s.replace(/{{app_name}}/g,i),s=s.replace(/{{completion_command}}/g,n),s.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}};function js(e,t,n,s){return new Dn(e,t,n,s)}function pr(e){return e.length<3}function Fr(e){return e.length>3}function Is(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let n=[],s;for(s=0;s<=t.length;s++)n[s]=[s];let i;for(i=0;i<=e.length;i++)n[0][i]=i;for(s=1;s<=t.length;s++)for(i=1;i<=e.length;i++)t.charAt(s-1)===e.charAt(i-1)?n[s][i]=n[s-1][i-1]:s>1&&i>1&&t.charAt(s-2)===e.charAt(i-1)&&t.charAt(s-1)===e.charAt(i-2)?n[s][i]=n[s-2][i-2]+1:n[s][i]=Math.min(n[s-1][i-1]+1,Math.min(n[s][i-1]+1,n[s-1][i]+1));return n[t.length][e.length]}var vs=["$0","--","_"];function Ms(e,t,n){let s=n.y18n.__,i=n.y18n.__n,r={};r.nonOptionCount=function(l){let p=e.getDemandedCommands(),C=l._.length+(l["--"]?l["--"].length:0)-e.getInternalMethods().getContext().commands.length;p._&&(C<p._.min||C>p._.max)&&(C<p._.min?p._.minMsg!==void 0?t.fail(p._.minMsg?p._.minMsg.replace(/\$0/g,C.toString()).replace(/\$1/,p._.min.toString()):null):t.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",C,C.toString(),p._.min.toString())):C>p._.max&&(p._.maxMsg!==void 0?t.fail(p._.maxMsg?p._.maxMsg.replace(/\$0/g,C.toString()).replace(/\$1/,p._.max.toString()):null):t.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",C,C.toString(),p._.max.toString()))))},r.positionalCount=function(l,p){p<l&&t.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",p,p+"",l+""))},r.requiredArguments=function(l,p){let g=null;for(let C of Object.keys(p))(!Object.prototype.hasOwnProperty.call(l,C)||typeof l[C]>"u")&&(g=g||{},g[C]=p[C]);if(g){let C=[];for(let d of Object.keys(g)){let $=g[d];$&&C.indexOf($)<0&&C.push($)}let b=C.length?`
${C.join(`
`)}`:"";t.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(g).length,Object.keys(g).join(", ")+b))}},r.unknownArguments=function(l,p,g,C,b=!0){var d;let $=e.getInternalMethods().getCommandInstance().getCommands(),K=[],R=e.getInternalMethods().getContext();if(Object.keys(l).forEach(W=>{!vs.includes(W)&&!Object.prototype.hasOwnProperty.call(g,W)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),W)&&!r.isValidAndSomeAliasIsNotNew(W,p)&&K.push(W)}),b&&(R.commands.length>0||$.length>0||C)&&l._.slice(R.commands.length).forEach(W=>{$.includes(""+W)||K.push(""+W)}),b){let V=((d=e.getDemandedCommands()._)===null||d===void 0?void 0:d.max)||0,U=R.commands.length+V;U<l._.length&&l._.slice(U).forEach(G=>{G=String(G),!R.commands.includes(G)&&!K.includes(G)&&K.push(G)})}K.length&&t.fail(i("Unknown argument: %s","Unknown arguments: %s",K.length,K.map(W=>W.trim()?W:`"${W}"`).join(", ")))},r.unknownCommands=function(l){let p=e.getInternalMethods().getCommandInstance().getCommands(),g=[],C=e.getInternalMethods().getContext();return(C.commands.length>0||p.length>0)&&l._.slice(C.commands.length).forEach(b=>{p.includes(""+b)||g.push(""+b)}),g.length>0?(t.fail(i("Unknown command: %s","Unknown commands: %s",g.length,g.join(", "))),!0):!1},r.isValidAndSomeAliasIsNotNew=function(l,p){if(!Object.prototype.hasOwnProperty.call(p,l))return!1;let g=e.parsed.newAliases;return[l,...p[l]].some(C=>!Object.prototype.hasOwnProperty.call(g,C)||!g[l])},r.limitedChoices=function(l){let p=e.getOptions(),g={};if(!Object.keys(p.choices).length)return;Object.keys(l).forEach(d=>{vs.indexOf(d)===-1&&Object.prototype.hasOwnProperty.call(p.choices,d)&&[].concat(l[d]).forEach($=>{p.choices[d].indexOf($)===-1&&$!==void 0&&(g[d]=(g[d]||[]).concat($))})});let C=Object.keys(g);if(!C.length)return;let b=s("Invalid values:");C.forEach(d=>{b+=`
${s("Argument: %s, Given: %s, Choices: %s",d,t.stringifiedValues(g[d]),t.stringifiedValues(p.choices[d]))}`}),t.fail(b)};let u={};r.implies=function(l,p){w("<string|object> [array|number|string]",[l,p],arguments.length),typeof l=="object"?Object.keys(l).forEach(g=>{r.implies(g,l[g])}):(e.global(l),u[l]||(u[l]=[]),Array.isArray(p)?p.forEach(g=>r.implies(l,g)):(ft(p,void 0,n),u[l].push(p)))},r.getImplied=function(){return u};function a(F,l){let p=Number(l);return l=isNaN(p)?l:p,typeof l=="number"?l=F._.length>=l:l.match(/^--no-.+/)?(l=l.match(/^--no-(.+)/)[1],l=!Object.prototype.hasOwnProperty.call(F,l)):l=Object.prototype.hasOwnProperty.call(F,l),l}r.implications=function(l){let p=[];if(Object.keys(u).forEach(g=>{let C=g;(u[g]||[]).forEach(b=>{let d=C,$=b;d=a(l,d),b=a(l,b),d&&!b&&p.push(` ${C} -> ${$}`)})}),p.length){let g=`${s("Implications failed:")}
`;p.forEach(C=>{g+=C}),t.fail(g)}};let h={};r.conflicts=function(l,p){w("<string|object> [array|string]",[l,p],arguments.length),typeof l=="object"?Object.keys(l).forEach(g=>{r.conflicts(g,l[g])}):(e.global(l),h[l]||(h[l]=[]),Array.isArray(p)?p.forEach(g=>r.conflicts(l,g)):h[l].push(p))},r.getConflicting=()=>h,r.conflicting=function(l){Object.keys(l).forEach(p=>{h[p]&&h[p].forEach(g=>{g&&l[p]!==void 0&&l[g]!==void 0&&t.fail(s("Arguments %s and %s are mutually exclusive",p,g))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(h).forEach(p=>{h[p].forEach(g=>{g&&l[n.Parser.camelCase(p)]!==void 0&&l[n.Parser.camelCase(g)]!==void 0&&t.fail(s("Arguments %s and %s are mutually exclusive",p,g))})})},r.recommendCommands=function(l,p){p=p.sort((d,$)=>$.length-d.length);let C=null,b=1/0;for(let d=0,$;($=p[d])!==void 0;d++){let K=Is(l,$);K<=3&&K<b&&(b=K,C=$)}C&&t.fail(s("Did you mean %s?",C))},r.reset=function(l){return u=Mt(u,p=>!l[p]),h=Mt(h,p=>!l[p]),r};let m=[];return r.freeze=function(){m.push({implied:u,conflicting:h})},r.unfreeze=function(){let l=m.pop();ft(l,void 0,n),{implied:u,conflicting:h}=l},r}var hn=[],ae;function ce(e,t,n,s){ae=s;let i={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!="string")return i;let r=/\.json|\..*rc$/.test(e.extends),u=null;if(r)u=gr(t,e.extends);else try{u=import.meta.resolve(e.extends)}catch{return e}mr(u),hn.push(u),i=r?JSON.parse(ae.readFileSync(u,"utf8")):s.require(e.extends),delete e.extends,i=ce(i,ae.path.dirname(u),n,ae)}return hn=[],n?$s(i,e):Object.assign({},i,e)}function mr(e){if(hn.indexOf(e)>-1)throw new nt(`Circular extended configurations: '${e}'.`)}function gr(e,t){return ae.path.resolve(e,t)}function $s(e,t){let n={};function s(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(n,e);for(let i of Object.keys(t))s(t[i])&&s(n[i])?n[i]=$s(e[i],t[i]):n[i]=t[i];return n}var _=function(e,t,n,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n},o=function(e,t,n,s){if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?s:n==="a"?s.call(e):s?s.value:t.get(e)},st,Vt,le,Dt,dt,Pe,Tt,Yt,je,Et,Ie,Ct,xt,pt,bt,ve,Gt,ut,P,Me,$e,Ft,qt,re,Xt,Nt,Te,v,Jt,Zt,Qt,T,Ne,Ot,tt;function ei(e){return(t=[],n=e.process.cwd(),s)=>{let i=new Bn(t,n,s,e);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var Ts=Symbol("copyDoubleDash"),Ns=Symbol("copyDoubleDash"),dn=Symbol("deleteFromParserHintObject"),Ls=Symbol("emitWarning"),Rs=Symbol("freeze"),Ws=Symbol("getDollarZero"),kt=Symbol("getParserConfiguration"),Us=Symbol("getUsageConfiguration"),pn=Symbol("guessLocale"),zs=Symbol("guessVersion"),Hs=Symbol("parsePositionalNumbers"),Fn=Symbol("pkgUp"),Lt=Symbol("populateParserHintArray"),oe=Symbol("populateParserHintSingleValueDictionary"),mn=Symbol("populateParserHintArrayDictionary"),gn=Symbol("populateParserHintDictionary"),En=Symbol("sanitizeKey"),Cn=Symbol("setKey"),bn=Symbol("unfreeze"),Ks=Symbol("validateAsync"),Vs=Symbol("getCommandInstance"),Ys=Symbol("getContext"),Gs=Symbol("getHasOutput"),qs=Symbol("getLoggerInstance"),Xs=Symbol("getParseContext"),Js=Symbol("getUsageInstance"),Zs=Symbol("getValidationInstance"),Le=Symbol("hasParseCallback"),Qs=Symbol("isGlobalContext"),te=Symbol("postProcess"),ks=Symbol("rebase"),yn=Symbol("reset"),fe=Symbol("runYargsParserAndExecuteCommands"),An=Symbol("runValidation"),ti=Symbol("setHasOutput"),ee=Symbol("kTrackManuallySetKeys"),Er="en_US",Bn=class{constructor(t=[],n,s,i){this.customScriptName=!1,this.parsed=!1,st.set(this,void 0),Vt.set(this,void 0),le.set(this,{commands:[],fullCommands:[]}),Dt.set(this,null),dt.set(this,null),Pe.set(this,"show-hidden"),Tt.set(this,null),Yt.set(this,!0),je.set(this,{}),Et.set(this,!0),Ie.set(this,[]),Ct.set(this,void 0),xt.set(this,{}),pt.set(this,!1),bt.set(this,null),ve.set(this,!0),Gt.set(this,void 0),ut.set(this,""),P.set(this,void 0),Me.set(this,void 0),$e.set(this,{}),Ft.set(this,null),qt.set(this,null),re.set(this,{}),Xt.set(this,{}),Nt.set(this,void 0),Te.set(this,!1),v.set(this,void 0),Jt.set(this,!1),Zt.set(this,!1),Qt.set(this,!1),T.set(this,void 0),Ne.set(this,{}),Ot.set(this,null),tt.set(this,void 0),_(this,v,i,"f"),_(this,Nt,t,"f"),_(this,Vt,n,"f"),_(this,Me,s,"f"),_(this,Ct,new xe(this),"f"),this.$0=this[Ws](),this[yn](),_(this,st,o(this,st,"f"),"f"),_(this,T,o(this,T,"f"),"f"),_(this,tt,o(this,tt,"f"),"f"),_(this,P,o(this,P,"f"),"f"),o(this,P,"f").showHiddenOpt=o(this,Pe,"f"),_(this,Gt,this[Ns](),"f"),o(this,v,"f").y18n.setLocale(Er)}addHelpOpt(t,n){let s="help";return w("[string|boolean] [string]",[t,n],arguments.length),o(this,bt,"f")&&(this[dn](o(this,bt,"f")),_(this,bt,null,"f")),t===!1&&n===void 0?this:(_(this,bt,typeof t=="string"?t:s,"f"),this.boolean(o(this,bt,"f")),this.describe(o(this,bt,"f"),n||o(this,T,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(w("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let s=typeof t=="string"?t:o(this,Pe,"f");return this.boolean(s),this.describe(s,n||o(this,T,"f").deferY18nLookup("Show hidden options")),o(this,P,"f").showHiddenOpt=s,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return w("<object|string|array> [string|array]",[t,n],arguments.length),this[mn](this.alias.bind(this),"alias",t,n),this}array(t){return w("<array|string>",[t],arguments.length),this[Lt]("array",t),this[ee](t),this}boolean(t){return w("<array|string>",[t],arguments.length),this[Lt]("boolean",t),this[ee](t),this}check(t,n){return w("<function> [boolean]",[t,n],arguments.length),this.middleware((s,i)=>Kt(()=>t(s,i.getOptions()),r=>(r?(typeof r=="string"||r instanceof Error)&&o(this,T,"f").fail(r.toString(),r):o(this,T,"f").fail(o(this,v,"f").y18n.__("Argument check failed: %s",t.toString())),s),r=>(o(this,T,"f").fail(r.message?r.message:r.toString(),r),s)),!1,n),this}choices(t,n){return w("<object|string|array> [string|array]",[t,n],arguments.length),this[mn](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(w("<object|string|array> [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new nt("coerce callback must be provided");for(let i of t)this.coerce(i,n);return this}else if(typeof t=="object"){for(let i of Object.keys(t))this.coerce(i,t[i]);return this}if(!n)throw new nt("coerce callback must be provided");let s=t;return o(this,P,"f").key[s]=!0,o(this,Ct,"f").addCoerceMiddleware((i,r)=>{var u;let a=(u=r.getAliases()[s])!==null&&u!==void 0?u:[],h=[s,...a].filter(m=>Object.prototype.hasOwnProperty.call(i,m));return h.length===0?i:Kt(()=>n(i[h[0]]),m=>(h.forEach(F=>{i[F]=m}),i),m=>{throw new nt(m.message)})},s),this}conflicts(t,n){return w("<string|object> [string|array]",[t,n],arguments.length),o(this,tt,"f").conflicts(t,n),this}config(t="config",n,s){return w("[object|string] [string|function] [function]",[t,n,s],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=ce(t,o(this,Vt,"f"),this[kt]()["deep-merge-config"]||!1,o(this,v,"f")),o(this,P,"f").configObjects=(o(this,P,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(s=n,n=void 0),this.describe(t,n||o(this,T,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(i=>{o(this,P,"f").config[i]=s||!0}),this)}completion(t,n,s){return w("[string] [string|boolean|function] [function]",[t,n,s],arguments.length),typeof n=="function"&&(s=n,n=void 0),_(this,dt,t||o(this,dt,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(o(this,dt,"f"),n),s&&o(this,Dt,"f").registerFunction(s),this}command(t,n,s,i,r,u){return w("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,s,i,r,u],arguments.length),o(this,st,"f").addHandler(t,n,s,i,r,u),this}commands(t,n,s,i,r,u){return this.command(t,n,s,i,r,u)}commandDir(t,n){w("<string> [object]",[t,n],arguments.length);let s=o(this,Me,"f")||o(this,v,"f").require;return o(this,st,"f").addDirectory(t,s,o(this,v,"f").getCallerFile(),n),this}count(t){return w("<array|string>",[t],arguments.length),this[Lt]("count",t),this[ee](t),this}default(t,n,s){return w("<object|string|array> [*] [string]",[t,n,s],arguments.length),s&&(cn(t,o(this,v,"f")),o(this,P,"f").defaultDescription[t]=s),typeof n=="function"&&(cn(t,o(this,v,"f")),o(this,P,"f").defaultDescription[t]||(o(this,P,"f").defaultDescription[t]=o(this,T,"f").functionDescription(n)),n=n.call()),this[oe](this.default.bind(this),"default",t,n),this}defaults(t,n,s){return this.default(t,n,s)}demandCommand(t=1,n,s,i){return w("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,n,s,i],arguments.length),typeof n!="number"&&(s=n,n=1/0),this.global("_",!1),o(this,P,"f").demandedCommands._={min:t,max:n,minMsg:s,maxMsg:i},this}demand(t,n,s){return Array.isArray(n)?(n.forEach(i=>{ft(s,!0,o(this,v,"f")),this.demandOption(i,s)}),n=1/0):typeof n!="number"&&(s=n,n=1/0),typeof t=="number"?(ft(s,!0,o(this,v,"f")),this.demandCommand(t,n,s,s)):Array.isArray(t)?t.forEach(i=>{ft(s,!0,o(this,v,"f")),this.demandOption(i,s)}):typeof s=="string"?this.demandOption(t,s):(s===!0||typeof s>"u")&&this.demandOption(t),this}demandOption(t,n){return w("<object|string|array> [string]",[t,n],arguments.length),this[oe](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return w("<string> [string|boolean]",[t,n],arguments.length),o(this,P,"f").deprecatedOptions[t]=n,this}describe(t,n){return w("<object|string|array> [string]",[t,n],arguments.length),this[Cn](t,!0),o(this,T,"f").describe(t,n),this}detectLocale(t){return w("<boolean>",[t],arguments.length),_(this,Yt,t,"f"),this}env(t){return w("[string|boolean]",[t],arguments.length),t===!1?delete o(this,P,"f").envPrefix:o(this,P,"f").envPrefix=t||"",this}epilogue(t){return w("<string>",[t],arguments.length),o(this,T,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return w("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(s=>this.example(...s)):o(this,T,"f").example(t,n),this}exit(t,n){_(this,pt,!0,"f"),_(this,Tt,n,"f"),o(this,Et,"f")&&o(this,v,"f").process.exit(t)}exitProcess(t=!0){return w("[boolean]",[t],arguments.length),_(this,Et,t,"f"),this}fail(t){if(w("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new nt("Invalid first argument. Expected function or boolean 'false'");return o(this,T,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return w("<array> [function]",[t,n],arguments.length),n?o(this,Dt,"f").getCompletion(t,n):new Promise((s,i)=>{o(this,Dt,"f").getCompletion(t,(r,u)=>{r?i(r):s(u)})})}getDemandedOptions(){return w([],0),o(this,P,"f").demandedOptions}getDemandedCommands(){return w([],0),o(this,P,"f").demandedCommands}getDeprecatedOptions(){return w([],0),o(this,P,"f").deprecatedOptions}getDetectLocale(){return o(this,Yt,"f")}getExitProcess(){return o(this,Et,"f")}getGroups(){return Object.assign({},o(this,xt,"f"),o(this,Xt,"f"))}getHelp(){if(_(this,pt,!0,"f"),!o(this,T,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[fe](o(this,Nt,"f"),void 0,void 0,0,!0);if(q(n))return n.then(()=>o(this,T,"f").help())}let t=o(this,st,"f").runDefaultBuilderOn(this);if(q(t))return t.then(()=>o(this,T,"f").help())}return Promise.resolve(o(this,T,"f").help())}getOptions(){return o(this,P,"f")}getStrict(){return o(this,Jt,"f")}getStrictCommands(){return o(this,Zt,"f")}getStrictOptions(){return o(this,Qt,"f")}global(t,n){return w("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?o(this,P,"f").local=o(this,P,"f").local.filter(s=>t.indexOf(s)===-1):t.forEach(s=>{o(this,P,"f").local.includes(s)||o(this,P,"f").local.push(s)}),this}group(t,n){w("<string|array> <string>",[t,n],arguments.length);let s=o(this,Xt,"f")[n]||o(this,xt,"f")[n];o(this,Xt,"f")[n]&&delete o(this,Xt,"f")[n];let i={};return o(this,xt,"f")[n]=(s||[]).concat(t).filter(r=>i[r]?!1:i[r]=!0),this}hide(t){return w("<string>",[t],arguments.length),o(this,P,"f").hiddenOptions.push(t),this}implies(t,n){return w("<string|object> [number|string|array]",[t,n],arguments.length),o(this,tt,"f").implies(t,n),this}locale(t){return w("[string]",[t],arguments.length),t===void 0?(this[pn](),o(this,v,"f").y18n.getLocale()):(_(this,Yt,!1,"f"),o(this,v,"f").y18n.setLocale(t),this)}middleware(t,n,s){return o(this,Ct,"f").addMiddleware(t,!!n,s)}nargs(t,n){return w("<string|object|array> [number]",[t,n],arguments.length),this[oe](this.nargs.bind(this),"narg",t,n),this}normalize(t){return w("<array|string>",[t],arguments.length),this[Lt]("normalize",t),this}number(t){return w("<array|string>",[t],arguments.length),this[Lt]("number",t),this[ee](t),this}option(t,n){if(w("<string|object> [object]",[t,n],arguments.length),typeof t=="object")Object.keys(t).forEach(s=>{this.options(s,t[s])});else{typeof n!="object"&&(n={}),this[ee](t),o(this,Ot,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[Ls](['"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(`
`),void 0,"versionWarning"),o(this,P,"f").key[t]=!0,n.alias&&this.alias(t,n.alias);let s=n.deprecate||n.deprecated;s&&this.deprecateOption(t,s);let i=n.demand||n.required||n.require;i&&this.demand(t,i),n.demandOption&&this.demandOption(t,typeof n.demandOption=="string"?n.demandOption:void 0),n.conflicts&&this.conflicts(t,n.conflicts),"default"in n&&this.default(t,n.default),n.implies!==void 0&&this.implies(t,n.implies),n.nargs!==void 0&&this.nargs(t,n.nargs),n.config&&this.config(t,n.configParser),n.normalize&&this.normalize(t),n.choices&&this.choices(t,n.choices),n.coerce&&this.coerce(t,n.coerce),n.group&&this.group(t,n.group),(n.boolean||n.type==="boolean")&&(this.boolean(t),n.alias&&this.boolean(n.alias)),(n.array||n.type==="array")&&(this.array(t),n.alias&&this.array(n.alias)),(n.number||n.type==="number")&&(this.number(t),n.alias&&this.number(n.alias)),(n.string||n.type==="string")&&(this.string(t),n.alias&&this.string(n.alias)),(n.count||n.type==="count")&&this.count(t),typeof n.global=="boolean"&&this.global(t,n.global),n.defaultDescription&&(o(this,P,"f").defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let r=n.describe||n.description||n.desc,u=o(this,T,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(u,t)||typeof r=="string")&&this.describe(t,r),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,s){w("[string|array] [function|boolean|object] [function]",[t,n,s],arguments.length),this[Rs](),typeof t>"u"&&(t=o(this,Nt,"f")),typeof n=="object"&&(_(this,qt,n,"f"),n=s),typeof n=="function"&&(_(this,Ft,n,"f"),n=!1),n||_(this,Nt,t,"f"),o(this,Ft,"f")&&_(this,Et,!1,"f");let i=this[fe](t,!!n),r=this.parsed;return o(this,Dt,"f").setParsed(this.parsed),q(i)?i.then(u=>(o(this,Ft,"f")&&o(this,Ft,"f").call(this,o(this,Tt,"f"),u,o(this,ut,"f")),u)).catch(u=>{throw o(this,Ft,"f")&&o(this,Ft,"f")(u,this.parsed.argv,o(this,ut,"f")),u}).finally(()=>{this[bn](),this.parsed=r}):(o(this,Ft,"f")&&o(this,Ft,"f").call(this,o(this,Tt,"f"),i,o(this,ut,"f")),this[bn](),this.parsed=r,i)}parseAsync(t,n,s){let i=this.parse(t,n,s);return q(i)?i:Promise.resolve(i)}parseSync(t,n,s){let i=this.parse(t,n,s);if(q(i))throw new nt(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(t){return w("<object>",[t],arguments.length),_(this,$e,t,"f"),this}pkgConf(t,n){w("<string> [string]",[t,n],arguments.length);let s=null,i=this[Fn](n||o(this,Vt,"f"));return i[t]&&typeof i[t]=="object"&&(s=ce(i[t],n||o(this,Vt,"f"),this[kt]()["deep-merge-config"]||!1,o(this,v,"f")),o(this,P,"f").configObjects=(o(this,P,"f").configObjects||[]).concat(s)),this}positional(t,n){w("<string> <object>",[t,n],arguments.length);let s=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=Mt(n,(u,a)=>u==="type"&&!["string","number","boolean"].includes(a)?!1:s.includes(u));let i=o(this,le,"f").fullCommands[o(this,le,"f").fullCommands.length-1],r=i?o(this,st,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return se(r).forEach(u=>{let a=r[u];Array.isArray(a)?a.indexOf(t)!==-1&&(n[u]=!0):a[t]&&!(u in n)&&(n[u]=a[t])}),this.group(t,o(this,T,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return w("[boolean]",[t],arguments.length),_(this,Te,t,"f"),this}required(t,n,s){return this.demand(t,n,s)}require(t,n,s){return this.demand(t,n,s)}requiresArg(t){return w("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&o(this,P,"f").narg[t]?this:(this[oe](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return w("[string] [string]",[t,n],arguments.length),t=t||this.$0,o(this,Gt,"f").log(o(this,Dt,"f").generateCompletionScript(t,n||o(this,dt,"f")||"completion")),this}showHelp(t){if(w("[string|function]",[t],arguments.length),_(this,pt,!0,"f"),!o(this,T,"f").hasCachedHelpMessage()){if(!this.parsed){let s=this[fe](o(this,Nt,"f"),void 0,void 0,0,!0);if(q(s))return s.then(()=>{o(this,T,"f").showHelp(t)}),this}let n=o(this,st,"f").runDefaultBuilderOn(this);if(q(n))return n.then(()=>{o(this,T,"f").showHelp(t)}),this}return o(this,T,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return w("[boolean|string] [string]",[t,n],arguments.length),o(this,T,"f").showHelpOnFail(t,n),this}showVersion(t){return w("[string|function]",[t],arguments.length),o(this,T,"f").showVersion(t),this}skipValidation(t){return w("<array|string>",[t],arguments.length),this[Lt]("skipValidation",t),this}strict(t){return w("[boolean]",[t],arguments.length),_(this,Jt,t!==!1,"f"),this}strictCommands(t){return w("[boolean]",[t],arguments.length),_(this,Zt,t!==!1,"f"),this}strictOptions(t){return w("[boolean]",[t],arguments.length),_(this,Qt,t!==!1,"f"),this}string(t){return w("<array|string>",[t],arguments.length),this[Lt]("string",t),this[ee](t),this}terminalWidth(){return w([],0),o(this,v,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return w("<object>",[t],arguments.length),_(this,Yt,!1,"f"),o(this,v,"f").y18n.updateLocale(t),this}usage(t,n,s,i){if(w("<string|null|undefined> [string|boolean] [function|object] [function]",[t,n,s,i],arguments.length),n!==void 0){if(ft(t,null,o(this,v,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,s,i);throw new nt(".usage() description must start with $0 if being used as alias for .command()")}else return o(this,T,"f").usage(t),this}usageConfiguration(t){return w("<object>",[t],arguments.length),_(this,Ne,t,"f"),this}version(t,n,s){let i="version";if(w("[boolean|string] [string] [string]",[t,n,s],arguments.length),o(this,Ot,"f")&&(this[dn](o(this,Ot,"f")),o(this,T,"f").version(void 0),_(this,Ot,null,"f")),arguments.length===0)s=this[zs](),t=i;else if(arguments.length===1){if(t===!1)return this;s=t,t=i}else arguments.length===2&&(s=n,n=void 0);return _(this,Ot,typeof t=="string"?t:i,"f"),n=n||o(this,T,"f").deferY18nLookup("Show version number"),o(this,T,"f").version(s||void 0),this.boolean(o(this,Ot,"f")),this.describe(o(this,Ot,"f"),n),this}wrap(t){return w("<number|null|undefined>",[t],arguments.length),o(this,T,"f").wrap(t),this}[(st=new WeakMap,Vt=new WeakMap,le=new WeakMap,Dt=new WeakMap,dt=new WeakMap,Pe=new WeakMap,Tt=new WeakMap,Yt=new WeakMap,je=new WeakMap,Et=new WeakMap,Ie=new WeakMap,Ct=new WeakMap,xt=new WeakMap,pt=new WeakMap,bt=new WeakMap,ve=new WeakMap,Gt=new WeakMap,ut=new WeakMap,P=new WeakMap,Me=new WeakMap,$e=new WeakMap,Ft=new WeakMap,qt=new WeakMap,re=new WeakMap,Xt=new WeakMap,Nt=new WeakMap,Te=new WeakMap,v=new WeakMap,Jt=new WeakMap,Zt=new WeakMap,Qt=new WeakMap,T=new WeakMap,Ne=new WeakMap,Ot=new WeakMap,tt=new WeakMap,Ts)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch{}return t}[Ns](){return{log:(...t)=>{this[Le]()||console.log(...t),_(this,pt,!0,"f"),o(this,ut,"f").length&&_(this,ut,o(this,ut,"f")+`
`,"f"),_(this,ut,o(this,ut,"f")+t.join(" "),"f")},error:(...t)=>{this[Le]()||console.error(...t),_(this,pt,!0,"f"),o(this,ut,"f").length&&_(this,ut,o(this,ut,"f")+`
`,"f"),_(this,ut,o(this,ut,"f")+t.join(" "),"f")}}}[dn](t){se(o(this,P,"f")).forEach(n=>{if((i=>i==="configObjects")(n))return;let s=o(this,P,"f")[n];Array.isArray(s)?s.includes(t)&&s.splice(s.indexOf(t),1):typeof s=="object"&&delete s[t]}),delete o(this,T,"f").getDescriptions()[t]}[Ls](t,n,s){o(this,je,"f")[s]||(o(this,v,"f").process.emitWarning(t,n),o(this,je,"f")[s]=!0)}[Rs](){o(this,Ie,"f").push({options:o(this,P,"f"),configObjects:o(this,P,"f").configObjects.slice(0),exitProcess:o(this,Et,"f"),groups:o(this,xt,"f"),strict:o(this,Jt,"f"),strictCommands:o(this,Zt,"f"),strictOptions:o(this,Qt,"f"),completionCommand:o(this,dt,"f"),output:o(this,ut,"f"),exitError:o(this,Tt,"f"),hasOutput:o(this,pt,"f"),parsed:this.parsed,parseFn:o(this,Ft,"f"),parseContext:o(this,qt,"f")}),o(this,T,"f").freeze(),o(this,tt,"f").freeze(),o(this,st,"f").freeze(),o(this,Ct,"f").freeze()}[Ws](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(o(this,v,"f").process.argv()[0])?n=o(this,v,"f").process.argv().slice(1,2):n=o(this,v,"f").process.argv().slice(0,1),t=n.map(s=>{let i=this[ks](o(this,Vt,"f"),s);return s.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<s.length?i:s}).join(" ").trim(),o(this,v,"f").getEnv("_")&&o(this,v,"f").getProcessArgvBin()===o(this,v,"f").getEnv("_")&&(t=o(this,v,"f").getEnv("_").replace(`${o(this,v,"f").path.dirname(o(this,v,"f").process.execPath())}/`,"")),t}[kt](){return o(this,$e,"f")}[Us](){return o(this,Ne,"f")}[pn](){if(!o(this,Yt,"f"))return;let t=o(this,v,"f").getEnv("LC_ALL")||o(this,v,"f").getEnv("LC_MESSAGES")||o(this,v,"f").getEnv("LANG")||o(this,v,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[zs](){return this[Fn]().version||"unknown"}[Hs](t){let n=t["--"]?t["--"]:t._;for(let s=0,i;(i=n[s])!==void 0;s++)o(this,v,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(n[s]=Number(i));return t}[Fn](t){let n=t||"*";if(o(this,re,"f")[n])return o(this,re,"f")[n];let s={};try{let i=t||o(this,v,"f").mainFilename;o(this,v,"f").path.extname(i)&&(i=o(this,v,"f").path.dirname(i));let r=o(this,v,"f").findUp(i,(u,a)=>{if(a.includes("package.json"))return"package.json"});ft(r,void 0,o(this,v,"f")),s=JSON.parse(o(this,v,"f").readFileSync(r,"utf8"))}catch{}return o(this,re,"f")[n]=s||{},o(this,re,"f")[n]}[Lt](t,n){n=[].concat(n),n.forEach(s=>{s=this[En](s),o(this,P,"f")[t].push(s)})}[oe](t,n,s,i){this[gn](t,n,s,i,(r,u,a)=>{o(this,P,"f")[r][u]=a})}[mn](t,n,s,i){this[gn](t,n,s,i,(r,u,a)=>{o(this,P,"f")[r][u]=(o(this,P,"f")[r][u]||[]).concat(a)})}[gn](t,n,s,i,r){if(Array.isArray(s))s.forEach(u=>{t(u,i)});else if((u=>typeof u=="object")(s))for(let u of se(s))t(u,s[u]);else r(n,this[En](s),i)}[En](t){return t==="__proto__"?"___proto___":t}[Cn](t,n){return this[oe](this[Cn].bind(this),"key",t,n),this}[bn](){var t,n,s,i,r,u,a,h,m,F,l,p;let g=o(this,Ie,"f").pop();ft(g,void 0,o(this,v,"f"));let C;t=this,n=this,s=this,i=this,r=this,u=this,a=this,h=this,m=this,F=this,l=this,p=this,{options:{set value(b){_(t,P,b,"f")}}.value,configObjects:C,exitProcess:{set value(b){_(n,Et,b,"f")}}.value,groups:{set value(b){_(s,xt,b,"f")}}.value,output:{set value(b){_(i,ut,b,"f")}}.value,exitError:{set value(b){_(r,Tt,b,"f")}}.value,hasOutput:{set value(b){_(u,pt,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){_(a,Jt,b,"f")}}.value,strictCommands:{set value(b){_(h,Zt,b,"f")}}.value,strictOptions:{set value(b){_(m,Qt,b,"f")}}.value,completionCommand:{set value(b){_(F,dt,b,"f")}}.value,parseFn:{set value(b){_(l,Ft,b,"f")}}.value,parseContext:{set value(b){_(p,qt,b,"f")}}.value}=g,o(this,P,"f").configObjects=C,o(this,T,"f").unfreeze(),o(this,tt,"f").unfreeze(),o(this,st,"f").unfreeze(),o(this,Ct,"f").unfreeze()}[Ks](t,n){return Kt(n,s=>(t(s),s))}getInternalMethods(){return{getCommandInstance:this[Vs].bind(this),getContext:this[Ys].bind(this),getHasOutput:this[Gs].bind(this),getLoggerInstance:this[qs].bind(this),getParseContext:this[Xs].bind(this),getParserConfiguration:this[kt].bind(this),getUsageConfiguration:this[Us].bind(this),getUsageInstance:this[Js].bind(this),getValidationInstance:this[Zs].bind(this),hasParseCallback:this[Le].bind(this),isGlobalContext:this[Qs].bind(this),postProcess:this[te].bind(this),reset:this[yn].bind(this),runValidation:this[An].bind(this),runYargsParserAndExecuteCommands:this[fe].bind(this),setHasOutput:this[ti].bind(this)}}[Vs](){return o(this,st,"f")}[Ys](){return o(this,le,"f")}[Gs](){return o(this,pt,"f")}[qs](){return o(this,Gt,"f")}[Xs](){return o(this,qt,"f")||{}}[Js](){return o(this,T,"f")}[Zs](){return o(this,tt,"f")}[Le](){return!!o(this,Ft,"f")}[Qs](){return o(this,ve,"f")}[te](t,n,s,i){return s||q(t)||(n||(t=this[Ts](t)),(this[kt]()["parse-positional-numbers"]||this[kt]()["parse-positional-numbers"]===void 0)&&(t=this[Hs](t)),i&&(t=Ht(t,this,o(this,Ct,"f").getMiddleware(),!1))),t}[yn](t={}){_(this,P,o(this,P,"f")||{},"f");let n={};n.local=o(this,P,"f").local||[],n.configObjects=o(this,P,"f").configObjects||[];let s={};n.local.forEach(u=>{s[u]=!0,(t[u]||[]).forEach(a=>{s[a]=!0})}),Object.assign(o(this,Xt,"f"),Object.keys(o(this,xt,"f")).reduce((u,a)=>{let h=o(this,xt,"f")[a].filter(m=>!(m in s));return h.length>0&&(u[a]=h),u},{})),_(this,xt,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],r=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(u=>{n[u]=(o(this,P,"f")[u]||[]).filter(a=>!s[a])}),r.forEach(u=>{n[u]=Mt(o(this,P,"f")[u],a=>!s[a])}),n.envPrefix=o(this,P,"f").envPrefix,_(this,P,n,"f"),_(this,T,o(this,T,"f")?o(this,T,"f").reset(s):Os(this,o(this,v,"f")),"f"),_(this,tt,o(this,tt,"f")?o(this,tt,"f").reset(s):Ms(this,o(this,T,"f"),o(this,v,"f")),"f"),_(this,st,o(this,st,"f")?o(this,st,"f").reset():ws(o(this,T,"f"),o(this,tt,"f"),o(this,Ct,"f"),o(this,v,"f")),"f"),o(this,Dt,"f")||_(this,Dt,js(this,o(this,T,"f"),o(this,st,"f"),o(this,v,"f")),"f"),o(this,Ct,"f").reset(),_(this,dt,null,"f"),_(this,ut,"","f"),_(this,Tt,null,"f"),_(this,pt,!1,"f"),this.parsed=!1,this}[ks](t,n){return o(this,v,"f").path.relative(t,n)}[fe](t,n,s,i=0,r=!1){var u,a,h,m;let F=!!s||r;t=t||o(this,Nt,"f"),o(this,P,"f").__=o(this,v,"f").y18n.__,o(this,P,"f").configuration=this[kt]();let l=!!o(this,P,"f").configuration["populate--"],p=Object.assign({},o(this,P,"f").configuration,{"populate--":!0}),g=o(this,v,"f").Parser.detailed(t,Object.assign({},o(this,P,"f"),{configuration:{"parse-positional-numbers":!1,...p}})),C=Object.assign(g.argv,o(this,qt,"f")),b,d=g.aliases,$=!1,K=!1;Object.keys(C).forEach(R=>{R===o(this,bt,"f")&&C[R]?$=!0:R===o(this,Ot,"f")&&C[R]&&(K=!0)}),C.$0=this.$0,this.parsed=g,i===0&&o(this,T,"f").clearCachedHelpMessage();try{if(this[pn](),n)return this[te](C,l,!!s,!1);o(this,bt,"f")&&[o(this,bt,"f")].concat(d[o(this,bt,"f")]||[]).filter(G=>G.length>1).includes(""+C._[C._.length-1])&&(C._.pop(),$=!0),_(this,ve,!1,"f");let R=o(this,st,"f").getCommands(),W=!((u=o(this,Dt,"f"))===null||u===void 0)&&u.completionKey?[(a=o(this,Dt,"f"))===null||a===void 0?void 0:a.completionKey,...(m=this.getAliases()[(h=o(this,Dt,"f"))===null||h===void 0?void 0:h.completionKey])!==null&&m!==void 0?m:[]].some(U=>Object.prototype.hasOwnProperty.call(C,U)):!1,V=$||W||r;if(C._.length){if(R.length){let U;for(let G=i||0,ct;C._[G]!==void 0;G++)if(ct=String(C._[G]),R.includes(ct)&&ct!==o(this,dt,"f")){let yt=o(this,st,"f").runCommand(ct,this,g,G+1,r,$||K||r);return this[te](yt,l,!!s,!1)}else if(!U&&ct!==o(this,dt,"f")){U=ct;break}!o(this,st,"f").hasDefaultCommand()&&o(this,Te,"f")&&U&&!V&&o(this,tt,"f").recommendCommands(U,R)}o(this,dt,"f")&&C._.includes(o(this,dt,"f"))&&!W&&(o(this,Et,"f")&&$t(!0),this.showCompletionScript(),this.exit(0))}if(o(this,st,"f").hasDefaultCommand()&&!V){let U=o(this,st,"f").runCommand(null,this,g,0,r,$||K||r);return this[te](U,l,!!s,!1)}if(W){o(this,Et,"f")&&$t(!0),t=[].concat(t);let U=t.slice(t.indexOf(`--${o(this,Dt,"f").completionKey}`)+1);return o(this,Dt,"f").getCompletion(U,(G,ct)=>{if(G)throw new nt(G.message);(ct||[]).forEach(yt=>{o(this,Gt,"f").log(yt)}),this.exit(0)}),this[te](C,!l,!!s,!1)}if(o(this,pt,"f")||($?(o(this,Et,"f")&&$t(!0),F=!0,this.showHelp(U=>{o(this,Gt,"f").log(U),this.exit(0)})):K&&(o(this,Et,"f")&&$t(!0),F=!0,o(this,T,"f").showVersion("log"),this.exit(0))),!F&&o(this,P,"f").skipValidation.length>0&&(F=Object.keys(C).some(U=>o(this,P,"f").skipValidation.indexOf(U)>=0&&C[U]===!0)),!F){if(g.error)throw new nt(g.error.message);if(!W){let U=this[An](d,{},g.error);s||(b=Ht(C,this,o(this,Ct,"f").getMiddleware(),!0)),b=this[Ks](U,b??C),q(b)&&!s&&(b=b.then(()=>Ht(C,this,o(this,Ct,"f").getMiddleware(),!1)))}}}catch(R){if(R instanceof nt)o(this,T,"f").fail(R.message,R);else throw R}return this[te](b??C,l,!!s,!0)}[An](t,n,s,i){let r={...this.getDemandedOptions()};return u=>{if(s)throw new nt(s.message);o(this,tt,"f").nonOptionCount(u),o(this,tt,"f").requiredArguments(u,r);let a=!1;o(this,Zt,"f")&&(a=o(this,tt,"f").unknownCommands(u)),o(this,Jt,"f")&&!a?o(this,tt,"f").unknownArguments(u,t,n,!!i):o(this,Qt,"f")&&o(this,tt,"f").unknownArguments(u,t,{},!1,!1),o(this,tt,"f").limitedChoices(u),o(this,tt,"f").implications(u),o(this,tt,"f").conflicting(u)}}[ti](){_(this,pt,!0,"f")}[ee](t){if(typeof t=="string")o(this,P,"f").key[t]=!0;else for(let n of t)o(this,P,"f").key[n]=!0}};function _s(e){return!!e&&typeof e.getInternalMethods=="function"}var Cr=ei(an),ni=Cr;import*as mt from"node:fs";import*as at from"node:path";var wn=new TextEncoder,yr=new TextDecoder,Ar=1e3,Br=wn.encode("XHWnDAT6ehMVY2zD"),De=class{async deriveKey(t){let n=wn.encode(t),s=await crypto.subtle.importKey("raw",n,{name:"PBKDF2"},!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",hash:{name:"SHA-256"},iterations:Ar,salt:Br},s,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async encryptToBytes(t,n){let s=await this.deriveKey(n),i=wn.encode(t),r=crypto.getRandomValues(new Uint8Array(16)),u=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:r},s,i)),a=new Uint8Array(r.byteLength+u.byteLength);return a.set(r,0),a.set(u,r.byteLength),a}convertToString(t){let n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return n}async encryptToBase64(t,n){let s=await this.encryptToBytes(t,n);return btoa(this.convertToString(s))}stringToArray(t){let n=[];for(let s=0;s<t.length;s++)n.push(t.charCodeAt(s));return new Uint8Array(n)}async decryptFromBytes(t,n){try{let s=t.slice(0,16),i=t.slice(16),r=await this.deriveKey(n),u=await crypto.subtle.decrypt({name:"AES-GCM",iv:s},r,i);return yr.decode(u)}catch{return null}}async decryptFromBase64(t,n){try{let s=this.stringToArray(atob(t));return await this.decryptFromBytes(s,n)}catch{return null}}};var Re=class{constructor(t,n,s){this.vectorSize=t,this.saltSize=n,this.iterations=s}async deriveKey(t,n){let i=new TextEncoder().encode(t),r=await crypto.subtle.importKey("raw",i,"PBKDF2",!1,["deriveKey"]);try{return await crypto.subtle.deriveKey({name:"PBKDF2",hash:"SHA-512",salt:n,iterations:this.iterations},r,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}finally{}}async encryptToBytes(t,n){let s=crypto.getRandomValues(new Uint8Array(this.saltSize)),i=await this.deriveKey(n,s),u=new TextEncoder().encode(t),a=crypto.getRandomValues(new Uint8Array(this.vectorSize)),h=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:a},i,u)),m=new Uint8Array(a.byteLength+s.byteLength+h.byteLength);return m.set(a,0),m.set(s,a.byteLength),m.set(h,a.byteLength+s.byteLength),m}convertToString(t){let n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return n}async encryptToBase64(t,n){let s=await this.encryptToBytes(t,n);return btoa(this.convertToString(s))}stringToArray(t){let n=[];for(let s=0;s<t.length;s++)n.push(t.charCodeAt(s));return new Uint8Array(n)}async decryptFromBytes(t,n){try{let s,i;s=0,i=s+this.vectorSize;let r=t.slice(s,i);s=i,i=s+this.saltSize;let u=t.slice(s,i);s=i,i=void 0;let a=t.slice(s),h=await this.deriveKey(n,u),m=await crypto.subtle.decrypt({name:"AES-GCM",iv:r},h,a);return new TextDecoder().decode(m)}catch{return null}}async decryptFromBase64(t,n){try{let s=this.stringToArray(atob(t));return await this.decryptFromBytes(s,n)}catch{return null}}};var _n={name:"AES-GCM",iv:new Uint8Array([196,190,240,190,188,78,41,132,15,220,84,211]),tagLength:128},We=class{async buildKey(t){let s=new TextEncoder().encode(t),i=await crypto.subtle.digest({name:"SHA-256"},s);return await crypto.subtle.importKey("raw",i,_n,!1,["encrypt","decrypt"])}async encryptToBase64(t,n){let s=await this.buildKey(n),r=new TextEncoder().encode(t),u=new Uint8Array(await crypto.subtle.encrypt(_n,s,r));return btoa(String.fromCharCode(...u))}stringToArray(t){let n=[];for(let s=0;s<t.length;s++)n.push(t.charCodeAt(s));return new Uint8Array(n)}async decryptFromBase64(t,n){try{let s=this.stringToArray(atob(t)),i=await this.buildKey(n),r=await crypto.subtle.decrypt(_n,i,s);return new TextDecoder().decode(r)}catch{return null}}};var he=class he{static BuildDefault(){return this.cryptoHelper2304_v2}static BuildFromFileDataOrThrow(t){let n=he.BuildFromFileDataOrNull(t);if(n!=null)return n;throw new Error(`Unable to determine ICryptoHelper for File ver ${t.version}`)}static BuildFromFileDataOrNull(t){return t.version=="1.0"?new De:t.version=="2.0"?this.cryptoHelper2304_v2:null}static BuildFromDecryptableOrThrow(t){let n=he.BuildFromDecryptableOrNull(t);if(n!=null)return n;throw new Error(`Unable to determine ICryptoHelper for Decryptable ver ${t.version}`)}static BuildFromDecryptableOrNull(t){return t.version==0?new We:t.version==1?new De:t.version==2?this.cryptoHelper2304_v2:null}};he.cryptoHelper2304_v2=new Re(16,16,21e4);var St=he;var Ue=class{constructor(t,n,s){this.version="1.0";this.version=t,this.hint=n,this.encodedData=s}},ze=class ze{static async encrypt(t,n,s){let r=await St.BuildDefault().encryptToBase64(s,t);return new Ue(ze.DEFAULT_VERSION,n,r)}static async decrypt(t,n){return t.encodedData==""?"":await St.BuildFromFileDataOrThrow(t).decryptFromBase64(t.encodedData,n)}};ze.DEFAULT_VERSION="2.0";var xn=ze,de=class{static encode(t){return JSON.stringify(t,null,2)}static isEncoded(t){try{return JSON.parse(t),!0}catch{return!1}}static decode(t){return t===""?new Ue(xn.DEFAULT_VERSION,"",""):JSON.parse(t)}};var wr="encrypted",_r="mdenc";var si=[_r,wr];var On="%%\u{1F510}\u03B2 ",pe="\u{1F510}\u03B2 ",Sn="%%\u{1F510}\u03B1 ",Fe="\u{1F510}\u03B1 ",Pn="%%\u{1F510} ",jn="\u{1F510} ";var He=[On,pe,Sn,Fe,Pn,jn],Or=" \u{1F510}%%",Sr=" \u{1F510}",Ke=[Or,Sr],ne="\u{1F4A1}";var Ve=class{};var me=class{constructor(t){this.process(t)}process(t){if(this.processedText=t,this.isEmpty=t.length===0,this.prefix=He.find(n=>t.startsWith(n))??"",this.suffix=Ke.find(n=>t.endsWith(n))??"",this.hasEncryptedPrefix=this.prefix.length>0,this.hasEncryptedSuffix=this.suffix.length>0,this.hasObsoleteEncryptedPrefix=this.prefix===Pn||this.prefix===jn,this.containsEncryptedMarkers=[...He,...Ke].some(n=>t.includes(n)),this.canDecrypt=this.hasEncryptedPrefix&&this.hasEncryptedSuffix,this.canEncrypt=!this.hasEncryptedPrefix&&!this.containsEncryptedMarkers,this.canDecrypt){let n=this.parseDecryptableContent(t);n!=null?this.decryptable=n:this.canDecrypt=!1}}parseDecryptableContent(t){let n=new Ve;if(!this.hasEncryptedPrefix||!this.hasEncryptedSuffix)return null;this.hasObsoleteEncryptedPrefix?n.version=0:this.prefix==On||this.prefix==pe?n.version=2:(this.prefix==Sn||this.prefix==Fe)&&(n.version=1);let s=t.substring(this.prefix.length,t.length-this.suffix.length);if([...He,...Ke].some(i=>s.includes(i)))return null;if(s.substring(0,ne.length)==ne){let i=s.indexOf(ne,ne.length);if(i<0)return null;n.hint=s.substring(ne.length,i),n.base64CipherText=s.substring(i+ne.length)}else n.base64CipherText=s;return n.showInReadingView=!this.prefix.includes("%%"),n}};var In=class{async argHandler(t){let n=process.cwd(),s,i,r,u=[];t==="csv"?(s=()=>console.log("feature,fullPath,relativePath,extension"),i=a=>console.log(`"${a.featureType}","${a.fullPath}","${a.relativePath}","${a.extension}"`),r=()=>{}):t=="json"?(s=()=>{},i=a=>u.push(a),r=()=>console.log(JSON.stringify(u,null,2))):t==="table"?(s=()=>{},i=a=>u.push(a),r=()=>console.table(u)):(s=()=>{},i=a=>console.log(`${a.relativePath}`),r=()=>{}),await this.output(n,s,i,r)}async output(t,n,s,i){n();for await(let r of ge.listings(t,!1))s(r);i()}},vn=class{async argHandler(t,n){let s=process.cwd();for await(let i of ge.listings(s,!0))if(i.featureType=="InPlace")for await(let r of this.testForInPlaceDecryption(i,t))this.outputResult(r,n);else if(i.featureType=="WholeNote"){let r=await this.testForWholeNoteDecryption(i,t);this.outputResult(r,n)}}async*testForInPlaceDecryption(t,n){if(t.content==null){yield{listing:t,success:!1,message:"no content"};return}let s=t.content.split(`
`);for(let i=0;i<s.length;i++){let r=s[i],u=i+1,a=/🔐(.*?)🔐/g,h=Array.from(r.matchAll(a));for(let m of h){let F=`line ${u}, pos ${m.index+1}`,l=`\u{1F510}${m[1]}\u{1F510}`,p=new me(l);if(!p.canDecrypt||p.decryptable==null){yield{listing:t,success:!1,message:`${F}, cannot decrypt`};continue}let g=St.BuildFromDecryptableOrNull(p.decryptable);if(g==null){yield{listing:t,success:!1,message:`${F}, unknown format`};continue}let C=!1;for(let b=0;b<n.length;b++){let d=n[b],$=b+1;if(await g.decryptFromBase64(p.decryptable.base64CipherText,d)!=null){C=!0,yield{listing:t,success:!0,message:`${F}, password #${$}`};break}}if(C)break}}}async testForWholeNoteDecryption(t,n){if(t.content==null||t.content.length==0)return{listing:t,success:!1,message:"no content"};let s=de.decode(t.content||""),i=St.BuildFromFileDataOrNull(s);if(i==null)return{listing:t,success:!1,message:"Unknown format"};for(let r=0;r<n.length;r++){let u=n[r];if(await i.decryptFromBase64(s.encodedData,u)!=null)return{listing:t,success:!0,message:`password #${r+1}`}}return{listing:t,success:!1,message:"unable to decrypt"}}outputResult(t,n){n&&t.success||console.log(`${t.success?"PASSED":"FAILED"} => ${t.listing.relativePath} => ${t.message} => ${t.listing.featureType}`)}outputResults(t,n){for(let s of t)this.outputResult(s,n)}},Mn=class{async argHandler(t,n,s){console.log(`decrypting${s?" (dry run)":""}...`);let i=process.cwd();for await(let r of ge.listings(i,!0))if(r.featureType=="InPlace"){let u=await this.decryptInPlaceListing(r,t,n,s);this.outputResult(u)}else if(r.featureType=="WholeNote"){let u=await this.decryptWholeNoteListing(r,t,n,s);this.outputResult(u)}}async decryptInPlaceListing(t,n,s,i){let r=t.content.split(`
`),u=[];for(let h=0;h<r.length;h++){let m=r[h],F=h+1,l=[/%%🔐(.*?)🔐%%/g,/🔐(.*?)🔐/g],p=m,g=0,C=0;for(let b of l)for await(let d of p.matchAll(b)){g++;let $=`Line ${F}, pos ${d.index+1}`,K=d[0],R=`\u{1F510}${d[1]}\u{1F510}`,W=new me(R);if(!W.canDecrypt||W.decryptable==null)return{listing:t,success:!1,message:`ERROR: ${$}, cannot decrypt`,outFile:void 0};let V=St.BuildFromDecryptableOrNull(W.decryptable);if(V==null)return{listing:t,success:!1,message:`ERROR: ${$}, unknown format`,outFile:void 0};let U=null;for(let G=0;G<n.length;G++){let ct=n[G];if(U=await V.decryptFromBase64(W.decryptable.base64CipherText,ct),U!=null)break}U!==null&&(C++,p=p.replace(K,U))}if(g!=C)return{listing:t,success:!1,message:`ERROR: Unable to decrypt all matches. Line ${F}, match count ${g} != decrypted count ${C}`,outFile:void 0};u.push(p)}let a=at.join(s,t.relativePath);if(!i){let h=at.dirname(a);mt.existsSync(h)||mt.mkdirSync(h,{recursive:!0}),mt.writeFileSync(a,u.join(`
`))}return Promise.resolve({listing:t,success:!0,message:"Decrypted",outFile:a})}outputResult(t){console.log(`${t.message} : ${t.listing.relativePath}${t.outFile==null?"":" => `"+t.outFile+"`"}`)}async decryptWholeNoteListing(t,n,s,i){let r=at.join(s,t.relativePath),u=at.basename(r),a=at.extname(r),h=u.replace(a,".md");if(r=at.join(at.dirname(r),h),!i){let l=at.dirname(r);mt.existsSync(l)||mt.mkdirSync(l,{recursive:!0})}if(t.content==null||t.content.length==0)return i||mt.writeFileSync(r,""),{listing:t,success:!0,message:"WARN: Empty file",outFile:r};let m=de.decode(t.content||""),F=St.BuildFromFileDataOrNull(m);if(F==null)return{listing:t,success:!1,message:"ERROR: Unknown format",outFile:void 0};for(let l=0;l<n.length;l++){let p=n[l],g=await F.decryptFromBase64(m.encodedData,p);if(g!=null)return i||mt.writeFileSync(r,g),{listing:t,success:!0,message:"Decrypted",outFile:r}}return{listing:t,success:!1,message:"ERROR: Unable to decrypt",outFile:void 0}}},ge=class e{static async*walk(t){for await(let n of await mt.promises.opendir(t)){let s=at.join(t,n.name);n.isDirectory()?yield*e.walk(s):n.isFile()&&(yield s)}}static async*listings(t,n){for await(let s of e.walk(t)){let i=at.extname(s).toLowerCase().slice(1);if(!["md",...si].includes(i))continue;let r="."+at.sep+at.relative(t,s),u=n||i=="md"?await mt.promises.readFile(s,"utf8"):void 0;if(i=="md"){(u.includes(Fe)||u.includes(pe))&&(yield{featureType:"InPlace",fullPath:s,relativePath:r,extension:i,content:n?u:void 0});continue}yield{featureType:"WholeNote",fullPath:s,relativePath:r,extension:i,content:u}}}},ii={demandOption:!0,alias:["p","pw"],describe:"passwords to use",type:"array"},jr={alias:"f",describe:"format of the listing",type:"string",choices:["default","table","json","csv"],default:"default"};ni(rn(process.argv)).scriptName("mdenc").usage("Usage: $0 [command] [options]").command("list","list all encrypted artifacts within the current directory",e=>e.option({format:jr}),e=>new In().argHandler(e.format)).command(["test","check"],"check that all notes can be decrypted with the given password list",e=>e.option({passwords:ii,fails:{alias:["f","fail"],describe:"only list fails",type:"boolean",default:!1}}),e=>new vn().argHandler(e.passwords,e.fails)).command("decrypt","decrypt notes to plain text given a password list and an output directory",e=>e.option({passwords:ii,outdir:{alias:["o","out","to"],describe:"output directory",type:"string",demandOption:!0},dryrun:{alias:["dr","dry"],describe:"dry run",type:"boolean",default:!1}}),e=>new Mn().argHandler(e.passwords,e.outdir,e.dryrun!==!1)).demandCommand().help().wrap(null).example([["$0 list","Processes all *.md and *.mdenc files and list any encrypted artifacts within the current directory"],["$0 test --passwords pw1 pw2","check that all notes can be decrypted with the given password list"],["$0 decrypt --pw pw1 pw2 --outdir \\path\\to\\output\\","decrypt notes to an output directory"]]).parse();
/*! Bundled license information:
yargs-parser/build/lib/string-utils.js:
yargs-parser/build/lib/tokenize-arg-string.js:
yargs-parser/build/lib/yargs-parser-types.js:
yargs-parser/build/lib/yargs-parser.js:
(**
* @license
* Copyright (c) 2016, Contributors
* SPDX-License-Identifier: ISC
*)
yargs-parser/build/lib/index.js:
(**
* @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
*
* @license
* Copyright (c) 2016, Contributors
* SPDX-License-Identifier: ISC
*)
*/