@cartesi/cli 2.0.0-alpha.4 → 2.0.0-alpha.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/index.js +720 -1
  2. package/dist/index.js.map +846 -0
  3. package/package.json +61 -101
  4. package/LICENSE +0 -202
  5. package/bin/dev.cmd +0 -3
  6. package/bin/dev.js +0 -25
  7. package/bin/run.cmd +0 -3
  8. package/bin/run.js +0 -8
  9. package/dist/baseCommand.d.ts +0 -22
  10. package/dist/baseCommand.d.ts.map +0 -1
  11. package/dist/baseCommand.js +0 -92
  12. package/dist/builder/directory.d.ts +0 -3
  13. package/dist/builder/directory.d.ts.map +0 -1
  14. package/dist/builder/directory.js +0 -37
  15. package/dist/builder/docker.d.ts +0 -10
  16. package/dist/builder/docker.d.ts.map +0 -1
  17. package/dist/builder/docker.js +0 -112
  18. package/dist/builder/empty.d.ts +0 -3
  19. package/dist/builder/empty.d.ts.map +0 -1
  20. package/dist/builder/empty.js +0 -21
  21. package/dist/builder/index.d.ts +0 -6
  22. package/dist/builder/index.d.ts.map +0 -1
  23. package/dist/builder/index.js +0 -5
  24. package/dist/builder/none.d.ts +0 -3
  25. package/dist/builder/none.d.ts.map +0 -1
  26. package/dist/builder/none.js +0 -11
  27. package/dist/builder/tar.d.ts +0 -3
  28. package/dist/builder/tar.d.ts.map +0 -1
  29. package/dist/builder/tar.js +0 -30
  30. package/dist/commands/address-book.d.ts +0 -9
  31. package/dist/commands/address-book.d.ts.map +0 -1
  32. package/dist/commands/address-book.js +0 -40
  33. package/dist/commands/build.d.ts +0 -12
  34. package/dist/commands/build.d.ts.map +0 -1
  35. package/dist/commands/build.js +0 -73
  36. package/dist/commands/clean.d.ts +0 -8
  37. package/dist/commands/clean.d.ts.map +0 -1
  38. package/dist/commands/clean.js +0 -11
  39. package/dist/commands/create.d.ts +0 -16
  40. package/dist/commands/create.d.ts.map +0 -1
  41. package/dist/commands/create.js +0 -66
  42. package/dist/commands/deploy/build.d.ts +0 -15
  43. package/dist/commands/deploy/build.d.ts.map +0 -1
  44. package/dist/commands/deploy/build.js +0 -62
  45. package/dist/commands/deploy/index.d.ts +0 -12
  46. package/dist/commands/deploy/index.d.ts.map +0 -1
  47. package/dist/commands/deploy/index.js +0 -78
  48. package/dist/commands/doctor.d.ts +0 -13
  49. package/dist/commands/doctor.d.ts.map +0 -1
  50. package/dist/commands/doctor.js +0 -106
  51. package/dist/commands/hash.d.ts +0 -10
  52. package/dist/commands/hash.d.ts.map +0 -1
  53. package/dist/commands/hash.js +0 -22
  54. package/dist/commands/run.d.ts +0 -22
  55. package/dist/commands/run.d.ts.map +0 -1
  56. package/dist/commands/run.js +0 -200
  57. package/dist/commands/send/erc20.d.ts +0 -14
  58. package/dist/commands/send/erc20.d.ts.map +0 -1
  59. package/dist/commands/send/erc20.js +0 -70
  60. package/dist/commands/send/erc721.d.ts +0 -14
  61. package/dist/commands/send/erc721.d.ts.map +0 -1
  62. package/dist/commands/send/erc721.js +0 -73
  63. package/dist/commands/send/ether.d.ts +0 -13
  64. package/dist/commands/send/ether.d.ts.map +0 -1
  65. package/dist/commands/send/ether.js +0 -32
  66. package/dist/commands/send/generic.d.ts +0 -15
  67. package/dist/commands/send/generic.d.ts.map +0 -1
  68. package/dist/commands/send/generic.js +0 -119
  69. package/dist/commands/send/index.d.ts +0 -28
  70. package/dist/commands/send/index.d.ts.map +0 -1
  71. package/dist/commands/send/index.js +0 -102
  72. package/dist/commands/shell.d.ts +0 -15
  73. package/dist/commands/shell.d.ts.map +0 -1
  74. package/dist/commands/shell.js +0 -65
  75. package/dist/config.d.ts +0 -102
  76. package/dist/config.d.ts.map +0 -1
  77. package/dist/config.js +0 -367
  78. package/dist/contracts.d.ts +0 -4317
  79. package/dist/contracts.d.ts.map +0 -1
  80. package/dist/contracts.js +0 -1799
  81. package/dist/exec/cartesi-machine.d.ts +0 -9
  82. package/dist/exec/cartesi-machine.d.ts.map +0 -1
  83. package/dist/exec/cartesi-machine.js +0 -20
  84. package/dist/exec/crane.d.ts +0 -15
  85. package/dist/exec/crane.d.ts.map +0 -1
  86. package/dist/exec/crane.js +0 -17
  87. package/dist/exec/genext2fs.d.ts +0 -28
  88. package/dist/exec/genext2fs.d.ts.map +0 -1
  89. package/dist/exec/genext2fs.js +0 -44
  90. package/dist/exec/index.d.ts +0 -5
  91. package/dist/exec/index.d.ts.map +0 -1
  92. package/dist/exec/index.js +0 -4
  93. package/dist/exec/mksquashfs.d.ts +0 -21
  94. package/dist/exec/mksquashfs.d.ts.map +0 -1
  95. package/dist/exec/mksquashfs.js +0 -45
  96. package/dist/exec/util.d.ts +0 -36
  97. package/dist/exec/util.d.ts.map +0 -1
  98. package/dist/exec/util.js +0 -80
  99. package/dist/flags.d.ts +0 -17
  100. package/dist/flags.d.ts.map +0 -1
  101. package/dist/flags.js +0 -28
  102. package/dist/index.d.ts +0 -2
  103. package/dist/index.d.ts.map +0 -1
  104. package/dist/machine.d.ts +0 -6
  105. package/dist/machine.d.ts.map +0 -1
  106. package/dist/machine.js +0 -80
  107. package/dist/node/DockerfileDeploy.txt +0 -4
  108. package/dist/node/default.env +0 -27
  109. package/dist/node/docker-compose-anvil.yaml +0 -50
  110. package/dist/node/docker-compose-bundler.yaml +0 -57
  111. package/dist/node/docker-compose-database.yaml +0 -10
  112. package/dist/node/docker-compose-envfile.yaml +0 -4
  113. package/dist/node/docker-compose-espresso.yaml +0 -127
  114. package/dist/node/docker-compose-explorer.yaml +0 -88
  115. package/dist/node/docker-compose-host.yaml +0 -30
  116. package/dist/node/docker-compose-paymaster.yaml +0 -33
  117. package/dist/node/docker-compose-prompt.yaml +0 -17
  118. package/dist/node/docker-compose-proxy.yaml +0 -48
  119. package/dist/node/docker-compose-snapshot-volume.yaml +0 -8
  120. package/dist/node/docker-compose-validator-cpus.yaml +0 -6
  121. package/dist/node/docker-compose-validator-memory.yaml +0 -6
  122. package/dist/node/docker-compose-validator.yaml +0 -59
  123. package/dist/prompts.d.ts +0 -62
  124. package/dist/prompts.d.ts.map +0 -1
  125. package/dist/prompts.js +0 -158
  126. package/dist/types/docker.d.ts +0 -22
  127. package/dist/types/docker.d.ts.map +0 -1
  128. package/dist/types/docker.js +0 -1
  129. package/dist/wallet.d.ts +0 -24
  130. package/dist/wallet.d.ts.map +0 -1
  131. package/dist/wallet.js +0 -204
  132. package/oclif.manifest.json +0 -883
package/dist/index.js CHANGED
@@ -1 +1,720 @@
1
- export { run } from "@oclif/core";
1
+ #!/usr/bin/env node
2
+ import{createRequire as OG}from"node:module";var vG=Object.create;var{getPrototypeOf:SG,defineProperty:QA,getOwnPropertyNames:AG}=Object;var eC=Object.prototype.hasOwnProperty;function CG(e){return this[e]}var DG,IG,ot=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var o=t?DG??=new WeakMap:IG??=new WeakMap,i=o.get(e);if(i)return i}r=e!=null?vG(SG(e)):{};let s=t||!e||!e.__esModule||!eC.call(e,"default")?QA(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of AG(e))if(!eC.call(s,a))QA(s,a,{get:CG.bind(e,a),enumerable:!0})}if(n)o.set(e,s);return s};var _=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var H=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var pe=OG(import.meta.url);var Dm=_(function(b5e,sC){var bw=[],iC=0,jt=(e,t)=>{if(iC>=t)bw.push(e)};jt.WARN=1;jt.INFO=2;jt.DEBUG=3;jt.reset=()=>{bw=[]};jt.setDebugLevel=(e)=>{iC=e};jt.warn=(e)=>jt(e,jt.WARN);jt.info=(e)=>jt(e,jt.INFO);jt.debug=(e)=>jt(e,jt.DEBUG);jt.debugMessages=()=>bw;sC.exports=jt});var cC=_(function(x5e,aC){aC.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var lC=_(function(w5e,uC){var FG=cC();uC.exports=(e)=>typeof e==="string"?e.replace(FG(),""):e});var fC=_(function(T5e,xw){var pC=(e)=>{if(Number.isNaN(e))return!1;if(e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141))return!0;return!1};xw.exports=pC;xw.exports.default=pC});var mC=_(function(E5e,dC){dC.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var yC=_(function(v5e,ww){var MG=lC(),LG=fC(),$G=mC(),hC=(e)=>{if(typeof e!=="string"||e.length===0)return 0;if(e=MG(e),e.length===0)return 0;e=e.replace($G()," ");let t=0;for(let r=0;r<e.length;r++){let n=e.codePointAt(r);if(n<=31||n>=127&&n<=159)continue;if(n>=768&&n<=879)continue;if(n>65535)r++;t+=LG(n)?2:1}return t};ww.exports=hC;ww.exports.default=hC});var Tw=_(function(S5e,wC){var gC=yC();function Im(e){return e?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function to(e){let t=Im();return(""+e).replace(t,"").split(`
3
+ `).reduce(function(o,i){return gC(i)>o?gC(i):o},0)}function pp(e,t){return Array(t+1).join(e)}function UG(e,t,r,n){let o=to(e);if(t+1>=o){let i=t-o;switch(n){case"right":{e=pp(r,i)+e;break}case"center":{let s=Math.ceil(i/2),a=i-s;e=pp(r,a)+e+pp(r,s);break}default:{e=e+pp(r,i);break}}}return e}var nc={};function fp(e,t,r){t="\x1B["+t+"m",r="\x1B["+r+"m",nc[t]={set:e,to:!0},nc[r]={set:e,to:!1},nc[e]={on:t,off:r}}fp("bold",1,22);fp("italics",3,23);fp("underline",4,24);fp("inverse",7,27);fp("strikethrough",9,29);function bC(e,t){let r=t[1]?parseInt(t[1].split(";")[0]):0;if(r>=30&&r<=39||r>=90&&r<=97){e.lastForegroundAdded=t[0];return}if(r>=40&&r<=49||r>=100&&r<=107){e.lastBackgroundAdded=t[0];return}if(r===0){for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o))delete e[o];return}let n=nc[t[0]];if(n)e[n.set]=n.to}function HG(e){let t=Im(!0),r=t.exec(e),n={};while(r!==null)bC(n,r),r=t.exec(e);return n}function xC(e,t){let{lastBackgroundAdded:r,lastForegroundAdded:n}=e;if(delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(o){if(e[o])t+=nc[o].off}),r&&r!="\x1B[49m")t+="\x1B[49m";if(n&&n!="\x1B[39m")t+="\x1B[39m";return t}function jG(e,t){let{lastBackgroundAdded:r,lastForegroundAdded:n}=e;if(delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(o){if(e[o])t=nc[o].on+t}),r&&r!="\x1B[49m")t=r+t;if(n&&n!="\x1B[39m")t=n+t;return t}function qG(e,t){if(e.length===to(e))return e.substr(0,t);while(to(e)>t)e=e.slice(0,-1);return e}function zG(e,t){let r=Im(!0),n=e.split(Im()),o=0,i=0,s="",a,c={};while(i<t){a=r.exec(e);let u=n[o];if(o++,i+to(u)>t)u=qG(u,t-i);if(s+=u,i+=to(u),i<t){if(!a)break;s+=a[0],bC(c,a)}}return xC(c,s)}function GG(e,t,r){if(r=r||"…",to(e)<=t)return e;t-=to(r);let o=zG(e,t);o+=r;let i="\x1B]8;;\x07";if(e.includes(i)&&!o.includes(i))o+=i;return o}function VG(){return{chars:{top:"─","top-mid":"┬","top-left":"┌","top-right":"┐",bottom:"─","bottom-mid":"┴","bottom-left":"└","bottom-right":"┘",left:"│","left-mid":"├",mid:"─","mid-mid":"┼",right:"│","right-mid":"┤",middle:"│"},truncate:"…",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function WG(e,t){e=e||{},t=t||VG();let r=Object.assign({},t,e);return r.chars=Object.assign({},t.chars,e.chars),r.style=Object.assign({},t.style,e.style),r}function KG(e,t){let r=[],n=t.split(/(\s+)/g),o=[],i=0,s;for(let a=0;a<n.length;a+=2){let c=n[a],u=i+to(c);if(i>0&&s)u+=s.length;if(u>e){if(i!==0)r.push(o.join(""));o=[c],i=to(c)}else o.push(s||"",c),i=u;s=n[a+1]}if(i)r.push(o.join(""));return r}function YG(e,t){let r=[],n="";function o(s,a){if(n.length&&a)n+=a;n+=s;while(n.length>e)r.push(n.slice(0,e)),n=n.slice(e)}let i=t.split(/(\s+)/g);for(let s=0;s<i.length;s+=2)o(i[s],s&&i[s-1]);if(n.length)r.push(n);return r}function ZG(e,t,r=!0){let n=[];t=t.split(`
4
+ `);let o=r?KG:YG;for(let i=0;i<t.length;i++)n.push.apply(n,o(e,t[i]));return n}function JG(e){let t={},r=[];for(let n=0;n<e.length;n++){let o=jG(t,e[n]);t=HG(o);let i=Object.assign({},t);r.push(xC(i,o))}return r}function XG(e,t){return["\x1B]","8",";",";",e||t,"\x07",t,"\x1B]","8",";",";","\x07"].join("")}wC.exports={strlen:to,repeat:pp,pad:UG,truncate:GG,mergeOptions:WG,wordWrap:ZG,colorizeLines:JG,hyperlink:XG}});var SC=_(function(A5e,vC){var EC={};vC.exports=EC;var TC={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(TC).forEach(function(e){var t=TC[e],r=EC[e]=[];r.open="\x1B["+t[0]+"m",r.close="\x1B["+t[1]+"m"})});var CC=_(function(C5e,AC){AC.exports=function(e,t){t=t||process.argv;var r=t.indexOf("--"),n=/^-{1,2}/.test(e)?"":"--",o=t.indexOf(n+e);return o!==-1&&(r===-1?!0:o<r)}});var IC=_(function(D5e,DC){var QG=pe("os"),En=CC(),nr=process.env,oc=void 0;if(En("no-color")||En("no-colors")||En("color=false"))oc=!1;else if(En("color")||En("colors")||En("color=true")||En("color=always"))oc=!0;if("FORCE_COLOR"in nr)oc=nr.FORCE_COLOR.length===0||parseInt(nr.FORCE_COLOR,10)!==0;function eV(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function tV(e){if(oc===!1)return 0;if(En("color=16m")||En("color=full")||En("color=truecolor"))return 3;if(En("color=256"))return 2;if(e&&!e.isTTY&&oc!==!0)return 0;var t=oc?1:0;if(process.platform==="win32"){var r=QG.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586)return Number(r[2])>=14931?3:2;return 1}if("CI"in nr){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(o){return o in nr})||nr.CI_NAME==="codeship")return 1;return t}if("TEAMCITY_VERSION"in nr)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(nr.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in nr){var n=parseInt((nr.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(nr.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(nr.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(nr.TERM))return 1;if("COLORTERM"in nr)return 1;if(nr.TERM==="dumb")return t;return t}function Ew(e){var t=tV(e);return eV(t)}DC.exports={supportsColor:Ew,stdout:Ew(process.stdout),stderr:Ew(process.stderr)}});var kC=_(function(I5e,OC){OC.exports=function(t,r){var n="";t=t||"Run the trap, drop the bass",t=t.split("");var o={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","۝","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return t.forEach(function(i){i=i.toLowerCase();var s=o[i]||[" "],a=Math.floor(Math.random()*s.length);if(typeof o[i]<"u")n+=o[i][a];else n+=i}),n}});var PC=_(function(O5e,RC){RC.exports=function(t,r){t=t||" he is here ";var n={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},o=[].concat(n.up,n.down,n.mid);function i(c){var u=Math.floor(Math.random()*c);return u}function s(c){var u=!1;return o.filter(function(l){u=l===c}),u}function a(c,u){var l="",p,f;u=u||{},u.up=typeof u.up<"u"?u.up:!0,u.mid=typeof u.mid<"u"?u.mid:!0,u.down=typeof u.down<"u"?u.down:!0,u.size=typeof u.size<"u"?u.size:"maxi",c=c.split("");for(f in c){if(s(f))continue;switch(l=l+c[f],p={up:0,down:0,mid:0},u.size){case"mini":p.up=i(8),p.mid=i(2),p.down=i(8);break;case"maxi":p.up=i(16)+3,p.mid=i(4)+1,p.down=i(64)+3;break;default:p.up=i(8)+1,p.mid=i(6)/2,p.down=i(8)+1;break}var d=["up","mid","down"];for(var h in d){var m=d[h];for(var y=0;y<=p[m];y++)if(u[m])l=l+n[m][i(n[m].length)]}}return l}return a(t,r)}});var BC=_(function(k5e,_C){_C.exports=function(e){return function(t,r,n){if(t===" ")return t;switch(r%3){case 0:return e.red(t);case 1:return e.white(t);case 2:return e.blue(t)}}}});var FC=_(function(R5e,NC){NC.exports=function(e){return function(t,r,n){return r%2===0?t:e.inverse(t)}}});var LC=_(function(P5e,MC){MC.exports=function(e){var t=["red","yellow","green","blue","magenta"];return function(r,n,o){if(r===" ")return r;else return e[t[n++%t.length]](r)}}});var UC=_(function(_5e,$C){$C.exports=function(e){var t=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,o){return r===" "?r:e[t[Math.round(Math.random()*(t.length-2))]](r)}}});var GC=_(function(N5e,zC){var me={};zC.exports=me;me.themes={};var rV=pe("util"),js=me.styles=SC(),HC=Object.defineProperties,nV=new RegExp(/[\r\n]+/g);me.supportsColor=IC().supportsColor;if(typeof me.enabled>"u")me.enabled=me.supportsColor()!==!1;me.enable=function(){me.enabled=!0};me.disable=function(){me.enabled=!1};me.stripColors=me.strip=function(e){return(""+e).replace(/\x1B\[\d+m/g,"")};var B5e=me.stylize=function(t,r){if(!me.enabled)return t+"";var n=js[r];if(!n&&r in me)return me[r](t);return n.open+t+n.close},oV=/[|\\{}()[\]^$+*?.]/g,iV=function(e){if(typeof e!=="string")throw TypeError("Expected a string");return e.replace(oV,"\\$&")};function jC(e){var t=function r(){return aV.apply(r,arguments)};return t._styles=e,t.__proto__=sV,t}var qC=function(){var e={};return js.grey=js.gray,Object.keys(js).forEach(function(t){js[t].closeRe=new RegExp(iV(js[t].close),"g"),e[t]={get:function(){return jC(this._styles.concat(t))}}}),e}(),sV=HC(function(){},qC);function aV(){var e=Array.prototype.slice.call(arguments),t=e.map(function(s){if(s!=null&&s.constructor===String)return s;else return rV.inspect(s)}).join(" ");if(!me.enabled||!t)return t;var r=t.indexOf(`
5
+ `)!=-1,n=this._styles,o=n.length;while(o--){var i=js[n[o]];if(t=i.open+t.replace(i.closeRe,i.open)+i.close,r)t=t.replace(nV,function(s){return i.close+s+i.open})}return t}me.setTheme=function(e){if(typeof e==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var t in e)(function(r){me[r]=function(n){if(typeof e[r]==="object"){var o=n;for(var i in e[r])o=me[e[r][i]](o);return o}return me[e[r]](n)}})(t)};function cV(){var e={};return Object.keys(qC).forEach(function(t){e[t]={get:function(){return jC([t])}}}),e}var uV=function(t,r){var n=r.split("");return n=n.map(t),n.join("")};me.trap=kC();me.zalgo=PC();me.maps={};me.maps.america=BC()(me);me.maps.zebra=FC()(me);me.maps.rainbow=LC()(me);me.maps.random=UC()(me);for(vw in me.maps)(function(e){me[e]=function(t){return uV(me.maps[e],t)}})(vw);var vw;HC(me,cV())});var WC=_(function(F5e,VC){var lV=GC();VC.exports=lV});var JC=_(function(M5e,Rm){var{info:pV,debug:ZC}=Dm(),Ue=Tw();class dp{constructor(e){this.setOptions(e),this.x=null,this.y=null}setOptions(e){if(["boolean","number","bigint","string"].indexOf(typeof e)!==-1)e={content:""+e};e=e||{},this.options=e;let t=e.content;if(["boolean","number","bigint","string"].indexOf(typeof t)!==-1)this.content=String(t);else if(!t)this.content=this.options.href||"";else throw Error("Content needs to be a primitive, got: "+typeof t);if(this.colSpan=e.colSpan||1,this.rowSpan=e.rowSpan||1,this.options.href)Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(e,t){this.cells=t;let r=this.options.chars||{},n=e.chars,o=this.chars={};dV.forEach(function(a){Sw(r,n,a,o)}),this.truncate=this.options.truncate||e.truncate;let i=this.options.style=this.options.style||{},s=e.style;Sw(i,s,"padding-left",this),Sw(i,s,"padding-right",this),this.head=i.head||s.head,this.border=i.border||s.border,this.fixedWidth=e.colWidths[this.x],this.lines=this.computeLines(e),this.desiredWidth=Ue.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(e){let t=e.wordWrap||e.textWrap,{wordWrap:r=t}=this.options;if(this.fixedWidth&&r){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let i=1;while(i<this.colSpan)this.fixedWidth+=e.colWidths[this.x+i],i++}let{wrapOnWordBoundary:n=!0}=e,{wrapOnWordBoundary:o=n}=this.options;return this.wrapLines(Ue.wordWrap(this.fixedWidth,this.content,o))}return this.wrapLines(this.content.split(`
6
+ `))}wrapLines(e){let t=Ue.colorizeLines(e);if(this.href)return t.map((r)=>Ue.hyperlink(this.href,r));return t}init(e){let t=this.x,r=this.y;this.widths=e.colWidths.slice(t,t+this.colSpan),this.heights=e.rowHeights.slice(r,r+this.rowSpan),this.width=this.widths.reduce(YC,-1),this.height=this.heights.reduce(YC,-1),this.hAlign=this.options.hAlign||e.colAligns[t],this.vAlign=this.options.vAlign||e.rowAligns[r],this.drawRight=t+this.colSpan==e.colWidths.length}draw(e,t){if(e=="top")return this.drawTop(this.drawRight);if(e=="bottom")return this.drawBottom(this.drawRight);let r=Ue.truncate(this.content,10,this.truncate);if(!e)pV(`${this.y}-${this.x}: ${this.rowSpan-e}x${this.colSpan} Cell ${r}`);let n=Math.max(this.height-this.lines.length,0),o;switch(this.vAlign){case"center":o=Math.ceil(n/2);break;case"bottom":o=n;break;default:o=0}if(e<o||e>=o+this.lines.length)return this.drawEmpty(this.drawRight,t);let i=this.lines.length>this.height&&e+1>=this.height;return this.drawLine(e-o,this.drawRight,i,t)}drawTop(e){let t=[];if(this.cells)this.widths.forEach(function(r,n){t.push(this._topLeftChar(n)),t.push(Ue.repeat(this.chars[this.y==0?"top":"mid"],r))},this);else t.push(this._topLeftChar(0)),t.push(Ue.repeat(this.chars[this.y==0?"top":"mid"],this.width));if(e)t.push(this.chars[this.y==0?"topRight":"rightMid"]);return this.wrapWithStyleColors("border",t.join(""))}_topLeftChar(e){let t=this.x+e,r;if(this.y==0)r=t==0?"topLeft":e==0?"topMid":"top";else if(t==0)r="leftMid";else if(r=e==0?"midMid":"bottomMid",this.cells){if(this.cells[this.y-1][t]instanceof dp.ColSpanCell)r=e==0?"topMid":"mid";if(e==0){let o=1;while(this.cells[this.y][t-o]instanceof dp.ColSpanCell)o++;if(this.cells[this.y][t-o]instanceof dp.RowSpanCell)r="leftMid"}}return this.chars[r]}wrapWithStyleColors(e,t){if(this[e]&&this[e].length)try{let r=WC();for(let n=this[e].length-1;n>=0;n--)r=r[this[e][n]];return r(t)}catch(r){return t}else return t}drawLine(e,t,r,n){let o=this.chars[this.x==0?"left":"middle"];if(this.x&&n&&this.cells){let p=this.cells[this.y+n][this.x-1];while(p instanceof Om)p=this.cells[p.y][p.x-1];if(!(p instanceof km))o=this.chars.rightMid}let i=Ue.repeat(" ",this.paddingLeft),s=t?this.chars.right:"",a=Ue.repeat(" ",this.paddingRight),c=this.lines[e],u=this.width-(this.paddingLeft+this.paddingRight);if(r)c+=this.truncate||"…";let l=Ue.truncate(c,u,this.truncate);return l=Ue.pad(l,u," ",this.hAlign),l=i+l+a,this.stylizeLine(o,l,s)}stylizeLine(e,t,r){if(e=this.wrapWithStyleColors("border",e),r=this.wrapWithStyleColors("border",r),this.y===0)t=this.wrapWithStyleColors("head",t);return e+t+r}drawBottom(e){let t=this.chars[this.x==0?"bottomLeft":"bottomMid"],r=Ue.repeat(this.chars.bottom,this.width),n=e?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",t+r+n)}drawEmpty(e,t){let r=this.chars[this.x==0?"left":"middle"];if(this.x&&t&&this.cells){let i=this.cells[this.y+t][this.x-1];while(i instanceof Om)i=this.cells[i.y][i.x-1];if(!(i instanceof km))r=this.chars.rightMid}let n=e?this.chars.right:"",o=Ue.repeat(" ",this.width);return this.stylizeLine(r,o,n)}}class Om{constructor(){}draw(e){if(typeof e==="number")ZC(`${this.y}-${this.x}: 1x1 ColSpanCell`);return""}init(){}mergeTableOptions(){}}class km{constructor(e){this.originalCell=e}init(e){let t=this.y,r=this.originalCell.y;this.cellOffset=t-r,this.offset=fV(e.rowHeights,r,this.cellOffset)}draw(e){if(e=="top")return this.originalCell.draw(this.offset,this.cellOffset);if(e=="bottom")return this.originalCell.draw("bottom");return ZC(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+e)}mergeTableOptions(){}}function KC(...e){return e.filter((t)=>t!==void 0&&t!==null).shift()}function Sw(e,t,r,n){let o=r.split("-");if(o.length>1)o[1]=o[1].charAt(0).toUpperCase()+o[1].substr(1),o=o.join(""),n[o]=KC(e[o],e[r],t[o],t[r]);else n[r]=KC(e[r],t[r])}function fV(e,t,r){let n=e[t];for(let o=1;o<r;o++)n+=1+e[t+o];return n}function YC(e,t){return e+t+1}var dV=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];Rm.exports=dp;Rm.exports.ColSpanCell=Om;Rm.exports.RowSpanCell=km});var eD=_(function(L5e,QC){var{warn:mV,debug:hV}=Dm(),Aw=JC(),{ColSpanCell:yV,RowSpanCell:gV}=Aw;(function(){function e(d,h){if(d[h]>0)return e(d,h+1);return h}function t(d){let h={};d.forEach(function(m,y){let g=0;m.forEach(function(x){x.y=y,x.x=y?e(h,g):g;let b=x.rowSpan||1,w=x.colSpan||1;if(b>1)for(let v=0;v<w;v++)h[x.x+v]=b;g=x.x+w}),Object.keys(h).forEach((x)=>{if(h[x]--,h[x]<1)delete h[x]})})}function r(d){let h=0;return d.forEach(function(m){m.forEach(function(y){h=Math.max(h,y.x+(y.colSpan||1))})}),h}function n(d){return d.length}function o(d,h){let m=d.y,y=d.y-1+(d.rowSpan||1),g=h.y,x=h.y-1+(h.rowSpan||1),b=!(m>x||g>y),w=d.x,v=d.x-1+(d.colSpan||1),D=h.x,O=h.x-1+(h.colSpan||1),T=!(w>O||D>v);return b&&T}function i(d,h,m){let y=Math.min(d.length-1,m),g={x:h,y:m};for(let x=0;x<=y;x++){let b=d[x];for(let w=0;w<b.length;w++)if(o(g,b[w]))return!0}return!1}function s(d,h,m,y){for(let g=m;g<y;g++)if(i(d,g,h))return!1;return!0}function a(d){d.forEach(function(h,m){h.forEach(function(y){for(let g=1;g<y.rowSpan;g++){let x=new gV(y);x.x=y.x,x.y=y.y+g,x.colSpan=y.colSpan,u(x,d[m+g])}})})}function c(d){for(let h=d.length-1;h>=0;h--){let m=d[h];for(let y=0;y<m.length;y++){let g=m[y];for(let x=1;x<g.colSpan;x++){let b=new yV;b.x=g.x+x,b.y=g.y,m.splice(y+1,0,b)}}}}function u(d,h){let m=0;while(m<h.length&&h[m].x<d.x)m++;h.splice(m,0,d)}function l(d){let h=n(d),m=r(d);hV(`Max rows: ${h}; Max cols: ${m}`);for(let y=0;y<h;y++)for(let g=0;g<m;g++)if(!i(d,g,y)){let x={x:g,y,colSpan:1,rowSpan:1};g++;while(g<m&&!i(d,g,y))x.colSpan++,g++;let b=y+1;while(b<h&&s(d,b,x.x,x.x+x.colSpan))x.rowSpan++,b++;let w=new Aw(x);w.x=x.x,w.y=x.y,mV(`Missing cell at ${w.y}-${w.x}.`),u(w,d[y])}}function p(d){return d.map(function(h){if(!Array.isArray(h)){let m=Object.keys(h)[0];if(h=h[m],Array.isArray(h))h=h.slice(),h.unshift(m);else h=[m,h]}return h.map(function(m){return new Aw(m)})})}function f(d){let h=p(d);return t(h),l(h),a(h),c(h),h}QC.exports={makeTableLayout:f,layoutTable:t,addRowSpanCells:a,maxWidth:r,fillInTable:l,computeWidths:XC("colSpan","desiredWidth","x",1),computeHeights:XC("rowSpan","desiredHeight","y",1)}})();function XC(e,t,r,n){return function(o,i){let s=[],a=[],c={};i.forEach(function(u){u.forEach(function(l){if((l[e]||1)>1)a.push(l);else s[l[r]]=Math.max(s[l[r]]||0,l[t]||0,n)})}),o.forEach(function(u,l){if(typeof u==="number")s[l]=u});for(let u=a.length-1;u>=0;u--){let l=a[u],p=l[e],f=l[r],d=s[f],h=typeof o[f]==="number"?0:1;if(typeof d==="number"){for(let m=1;m<p;m++)if(d+=1+s[f+m],typeof o[f+m]!=="number")h++}else if(d=t==="desiredWidth"?l.desiredWidth-1:1,!c[f]||c[f]<d)c[f]=d;if(l[t]>d){let m=0;while(h>0&&l[t]>d){if(typeof o[f+m]!=="number"){let y=Math.round((l[t]-d)/h);d+=y,s[f+m]+=y,h--}m++}}}Object.assign(o,s,c);for(let u=0;u<o.length;u++)o[u]=Math.max(n,o[u]||0)}}});var Iw=_(function($5e,rD){var Et=Dm(),tD=Tw(),ic=eD();class Dw extends Array{constructor(e){super();let t=tD.mergeOptions(e);if(Object.defineProperty(this,"options",{value:t,enumerable:t.debug}),t.debug){switch(typeof t.debug){case"boolean":Et.setDebugLevel(Et.WARN);break;case"number":Et.setDebugLevel(t.debug);break;case"string":Et.setDebugLevel(parseInt(t.debug,10));break;default:Et.setDebugLevel(Et.WARN),Et.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof t.debug}`)}Object.defineProperty(this,"messages",{get(){return Et.debugMessages()}})}}toString(){let e=this,t=this.options.head&&this.options.head.length;if(t){if(e=[this.options.head],this.length)e.push.apply(e,this)}else this.options.style.head=[];let r=ic.makeTableLayout(e);r.forEach(function(o){o.forEach(function(i){i.mergeTableOptions(this.options,r)},this)},this),ic.computeWidths(this.options.colWidths,r),ic.computeHeights(this.options.rowHeights,r),r.forEach(function(o){o.forEach(function(i){i.init(this.options)},this)},this);let n=[];for(let o=0;o<r.length;o++){let i=r[o],s=this.options.rowHeights[o];if(o===0||!this.options.style.compact||o==1&&t)Cw(i,"top",n);for(let a=0;a<s;a++)Cw(i,a,n);if(o+1==r.length)Cw(i,"bottom",n)}return n.join(`
7
+ `)}get width(){return this.toString().split(`
8
+ `)[0].length}}Dw.reset=()=>Et.reset();function Cw(e,t,r){let n=[];e.forEach(function(i){n.push(i.draw(t))});let o=n.join("");if(o.length)r.push(o)}rD.exports=Dw});var Js;var tO=H(()=>{Js=[];Js.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")Js.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")Js.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class rO{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(O1[I1])return O1[I1];GX(O1,I1,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let r=this.listeners[e],n=r.indexOf(t);if(n===-1)return;if(n===0&&r.length===1)r.length=0;else r.splice(n,1)}emit(e,t,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(let o of this.listeners[e])n=o(t,r)===!0||n;if(e==="exit")n=this.emit("afterExit",t,r)||n;return n}}class R1{}var Rh=(e)=>!!e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function",I1,O1,GX,VX=(e)=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),nO,oO,k1,Tc,aOe,cOe;var Ph=H(()=>{tO();I1=Symbol.for("signal-exit emitter"),O1=globalThis,GX=Object.defineProperty.bind(Object);nO=class nO extends R1{onExit(){return()=>{}}load(){}unload(){}};oO=class oO extends R1{#n=k1.platform==="win32"?"SIGINT":"SIGHUP";#r=new rO;#t;#e;#i;#o={};#s=!1;constructor(e){super();this.#t=e,this.#o={};for(let t of Js)this.#o[t]=()=>{let r=this.#t.listeners(t),{count:n}=this.#r,o=e;if(typeof o.__signal_exit_emitter__==="object"&&typeof o.__signal_exit_emitter__.count==="number")n+=o.__signal_exit_emitter__.count;if(r.length===n){this.unload();let i=this.#r.emit("exit",null,t),s=t==="SIGHUP"?this.#n:t;if(!i)e.kill(e.pid,s)}};this.#i=e.reallyExit,this.#e=e.emit}onExit(e,t){if(!Rh(this.#t))return()=>{};if(this.#s===!1)this.load();let r=t?.alwaysLast?"afterExit":"exit";return this.#r.on(r,e),()=>{if(this.#r.removeListener(r,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0)this.unload()}}load(){if(this.#s)return;this.#s=!0,this.#r.count+=1;for(let e of Js)try{let t=this.#o[e];if(t)this.#t.on(e,t)}catch(t){}this.#t.emit=(e,...t)=>this.#p(e,...t),this.#t.reallyExit=(e)=>this.#c(e)}unload(){if(!this.#s)return;this.#s=!1,Js.forEach((e)=>{let t=this.#o[e];if(!t)throw Error("Listener not defined for signal: "+e);try{this.#t.removeListener(e,t)}catch(r){}}),this.#t.emit=this.#e,this.#t.reallyExit=this.#i,this.#r.count-=1}#c(e){if(!Rh(this.#t))return 0;return this.#t.exitCode=e||0,this.#r.emit("exit",this.#t.exitCode,null),this.#i.call(this.#t,this.#t.exitCode)}#p(e,...t){let r=this.#e;if(e==="exit"&&Rh(this.#t)){if(typeof t[0]==="number")this.#t.exitCode=t[0];let n=r.call(this.#t,e,...t);return this.#r.emit("exit",this.#t.exitCode,null),n}else return r.call(this.#t,e,...t)}};k1=globalThis.process,{onExit:Tc,load:aOe,unload:cOe}=VX(Rh(k1)?new oO(k1):new nO)});function Nr(e,t){return e.exec(t)?.groups}var Z1,J1,jh;var Np=H(()=>{Z1=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,J1=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,jh=/^\(.+?\).*?$/});function qh(e){let t=e.type;if(zO.test(e.type)&&"components"in e){t="(";let r=e.components.length;for(let o=0;o<r;o++){let i=e.components[o];if(t+=qh(i),o<r-1)t+=", "}let n=Nr(zO,e.type);return t+=`)${n?.array||""}`,qh({...e,type:t})}if("indexed"in e&&e.indexed)t=`${t} indexed`;if(e.name)return`${t} ${e.name}`;return t}var zO;var GO=H(()=>{Np();zO=/^tuple(?<array>(\[(\d*)\])*)$/});function Cc(e){let t="",r=e.length;for(let n=0;n<r;n++){let o=e[n];if(t+=qh(o),n!==r-1)t+=", "}return t}var VO=H(()=>{GO()});function X1(e){if(e.type==="function")return`function ${e.name}(${Cc(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${Cc(e.outputs)})`:""}`;if(e.type==="event")return`event ${e.name}(${Cc(e.inputs)})`;if(e.type==="error")return`error ${e.name}(${Cc(e.inputs)})`;if(e.type==="constructor")return`constructor(${Cc(e.inputs)})${e.stateMutability==="payable"?" payable":""}`;if(e.type==="fallback")return`fallback() external${e.stateMutability==="payable"?" payable":""}`;return"receive() external payable"}var WO=H(()=>{VO()});function YO(e){return KO.test(e)}function ZO(e){return Nr(KO,e)}function XO(e){return JO.test(e)}function QO(e){return Nr(JO,e)}function tk(e){return ek.test(e)}function rk(e){return Nr(ek,e)}function Dc(e){return nk.test(e)}function ok(e){return Nr(nk,e)}function sk(e){return ik.test(e)}function ak(e){return Nr(ik,e)}function uk(e){return ck.test(e)}function lk(e){return Nr(ck,e)}function pk(e){return xee.test(e)}var KO,JO,ek,nk,ik,ck,xee,Q1,fk,zh;var Fp=H(()=>{Np();KO=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;JO=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;ek=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;nk=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;ik=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;ck=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;xee=/^receive\(\) external payable$/;Q1=new Set(["memory","indexed","storage","calldata"]),fk=new Set(["indexed"]),zh=new Set(["calldata","memory","storage"])});var dk="1.2.3";var it;var Ic=H(()=>{it=class it extends Error{constructor(e,t={}){let r=t.cause instanceof it?t.cause.details:t.cause?.message?t.cause.message:t.details,n=t.cause instanceof it?t.cause.docsPath||t.docsPath:t.docsPath,o=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...n?[`Docs: https://abitype.dev${n}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${dk}`].join(`
9
+ `);super(o);if(Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),t.cause)this.cause=t.cause;this.details=r,this.docsPath=n,this.metaMessages=t.metaMessages,this.shortMessage=e}}});var Gh,e2;var t2=H(()=>{Ic();Gh=class Gh extends it{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}};e2=class e2 extends it{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}});var Vh,Wh,Kh,Yh,Zh,Jh;var Xh=H(()=>{Ic();Vh=class Vh extends it{constructor({params:e}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiparameters-1"});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}};Wh=class Wh extends it{constructor({param:e}){super("Invalid ABI parameter.",{details:e});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}};Kh=class Kh extends it{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}};Yh=class Yh extends it{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}};Zh=class Zh extends it{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}};Jh=class Jh extends it{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}});var ao,Qh,ey;var r2=H(()=>{Ic();ao=class ao extends it{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}};Qh=class Qh extends it{constructor({signature:e}){super("Unknown signature.",{details:e});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}};ey=class ey extends it{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}});var ty;var mk=H(()=>{Ic();ty=class ty extends it{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}});var ry;var hk=H(()=>{Ic();ry=class ry extends it{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}});function yk(e,t,r){let n="";if(r)for(let o of Object.entries(r)){if(!o)continue;let i="";for(let s of o[1])i+=`[${s.type}${s.name?`:${s.name}`:""}]`;n+=`(${o[0]}{${i}})`}if(t)return`${t}:${e}${n}`;return`${e}${n}`}var ny;var gk=H(()=>{ny=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]])});function bk(e,t={}){if(tk(e))return wee(e,t);if(XO(e))return Tee(e,t);if(YO(e))return Eee(e,t);if(sk(e))return vee(e,t);if(uk(e))return See(e);if(pk(e))return{type:"receive",stateMutability:"payable"};throw new Qh({signature:e})}function wee(e,t={}){let r=rk(e);if(!r)throw new ao({signature:e,type:"function"});let n=hr(r.parameters),o=[],i=n.length;for(let a=0;a<i;a++)o.push(Cn(n[a],{modifiers:zh,structs:t,type:"function"}));let s=[];if(r.returns){let a=hr(r.returns),c=a.length;for(let u=0;u<c;u++)s.push(Cn(a[u],{modifiers:zh,structs:t,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:o,outputs:s}}function Tee(e,t={}){let r=QO(e);if(!r)throw new ao({signature:e,type:"event"});let n=hr(r.parameters),o=[],i=n.length;for(let s=0;s<i;s++)o.push(Cn(n[s],{modifiers:fk,structs:t,type:"event"}));return{name:r.name,type:"event",inputs:o}}function Eee(e,t={}){let r=ZO(e);if(!r)throw new ao({signature:e,type:"error"});let n=hr(r.parameters),o=[],i=n.length;for(let s=0;s<i;s++)o.push(Cn(n[s],{structs:t,type:"error"}));return{name:r.name,type:"error",inputs:o}}function vee(e,t={}){let r=ak(e);if(!r)throw new ao({signature:e,type:"constructor"});let n=hr(r.parameters),o=[],i=n.length;for(let s=0;s<i;s++)o.push(Cn(n[s],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:o}}function See(e){let t=lk(e);if(!t)throw new ao({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}function Cn(e,t){let r=yk(e,t?.type,t?.structs);if(ny.has(r))return ny.get(r);let n=jh.test(e),o=Nr(n?Cee:Aee,e);if(!o)throw new Wh({param:e});if(o.name&&Oee(o.name))throw new Kh({param:e,name:o.name});let i=o.name?{name:o.name}:{},s=o.modifier==="indexed"?{indexed:!0}:{},a=t?.structs??{},c,u={};if(n){c="tuple";let p=hr(o.type),f=[],d=p.length;for(let h=0;h<d;h++)f.push(Cn(p[h],{structs:a}));u={components:f}}else if(o.type in a)c="tuple",u={components:a[o.type]};else if(Dee.test(o.type))c=`${o.type}256`;else if(o.type==="address payable")c="address";else if(c=o.type,t?.type!=="struct"&&!n2(c))throw new e2({type:c});if(o.modifier){if(!t?.modifiers?.has?.(o.modifier))throw new Yh({param:e,type:t?.type,modifier:o.modifier});if(zh.has(o.modifier)&&!kee(c,!!o.array))throw new Zh({param:e,type:t?.type,modifier:o.modifier})}let l={type:`${c}${o.array??""}`,...i,...s,...u};return ny.set(r,l),l}function hr(e,t=[],r="",n=0){let o=e.trim().length;for(let i=0;i<o;i++){let s=e[i],a=e.slice(i+1);switch(s){case",":return n===0?hr(a,[...t,r.trim()]):hr(a,t,`${r}${s}`,n);case"(":return hr(a,t,`${r}${s}`,n+1);case")":return hr(a,t,`${r}${s}`,n-1);default:return hr(a,t,`${r}${s}`,n)}}if(r==="")return t;if(n!==0)throw new ry({current:r,depth:n});return t.push(r.trim()),t}function n2(e){return e==="address"||e==="bool"||e==="function"||e==="string"||Z1.test(e)||J1.test(e)}function Oee(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||Z1.test(e)||J1.test(e)||Iee.test(e)}function kee(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}var Aee,Cee,Dee,Iee;var Mp=H(()=>{Np();t2();Xh();r2();hk();gk();Fp();Aee=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Cee=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Dee=/^u?int$/;Iee=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/});function oy(e){let t={},r=e.length;for(let s=0;s<r;s++){let a=e[s];if(!Dc(a))continue;let c=ok(a);if(!c)throw new ao({signature:a,type:"struct"});let u=c.properties.split(";"),l=[],p=u.length;for(let f=0;f<p;f++){let h=u[f].trim();if(!h)continue;let m=Cn(h,{type:"struct"});l.push(m)}if(!l.length)throw new ey({signature:a});t[c.name]=l}let n={},o=Object.entries(t),i=o.length;for(let s=0;s<i;s++){let[a,c]=o[s];n[a]=xk(c,t)}return n}function xk(e=[],t={},r=new Set){let n=[],o=e.length;for(let i=0;i<o;i++){let s=e[i];if(jh.test(s.type))n.push(s);else{let c=Nr(Ree,s.type);if(!c?.type)throw new Jh({abiParameter:s});let{array:u,type:l}=c;if(l in t){if(r.has(l))throw new ty({type:l});n.push({...s,type:`tuple${u??""}`,components:xk(t[l],t,new Set([...r,l]))})}else if(n2(l))n.push(s);else throw new Gh({type:l})}}return n}var Ree;var o2=H(()=>{Np();t2();Xh();r2();mk();Fp();Mp();Ree=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/});function Lp(e){let t=oy(e),r=[],n=e.length;for(let o=0;o<n;o++){let i=e[o];if(Dc(i))continue;r.push(bk(i,t))}return r}var wk=H(()=>{Fp();o2();Mp()});function Xs(e){let t=[];if(typeof e==="string"){let r=hr(e),n=r.length;for(let o=0;o<n;o++)t.push(Cn(r[o],{modifiers:Q1}))}else{let r=oy(e),n=e.length;for(let o=0;o<n;o++){let i=e[o];if(Dc(i))continue;let s=hr(i),a=s.length;for(let c=0;c<a;c++)t.push(Cn(s[c],{modifiers:Q1,structs:r}))}}if(t.length===0)throw new Vh({params:e});return t}var Tk=H(()=>{Xh();Fp();o2();Mp();Mp()});var iy=H(()=>{WO();wk();Tk()});function ee(e){if(typeof e==="string")return{address:e,type:"json-rpc"};return e}var Jr,ly,vk,py,Sk,i2,s2,a2,$p,ze,fy;var _t=H(()=>{Jr=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],ly=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],vk=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],py=[...vk,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Sk=[...vk,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],i2=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],s2=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],a2=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],$p=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],ze=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],fy=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"event",name:"ApprovalForAll",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"operator",type:"address"},{indexed:!1,name:"approved",type:"bool"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"payable",inputs:[{name:"spender",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"getApproved",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"address"}]},{type:"function",name:"isApprovedForAll",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"operator",type:"address"}],outputs:[{type:"bool"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"ownerOf",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"owner",type:"address"}]},{type:"function",name:"safeTransferFrom",stateMutability:"payable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"safeTransferFrom",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"id",type:"uint256"},{name:"data",type:"bytes"}],outputs:[]},{type:"function",name:"setApprovalForAll",stateMutability:"nonpayable",inputs:[{name:"operator",type:"address"},{name:"approved",type:"bool"}],outputs:[]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"index",type:"uint256"}],outputs:[{type:"uint256"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"index",type:"uint256"}],outputs:[{name:"tokenId",type:"uint256"}]},{type:"function",name:"tokenURI",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transferFrom",stateMutability:"payable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]}]});function mt(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new c2(e.type);return`${e.name}(${Up(e.inputs,{includeName:t})})`}function Up(e,{includeName:t=!1}={}){if(!e)return"";return e.map((r)=>Pee(r,{includeName:t})).join(t?", ":",")}function Pee(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${Up(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}var Xo=H(()=>{et()});function oe(e,{strict:t=!0}={}){if(!e)return!1;if(typeof e!=="string")return!1;return t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function fe(e){if(oe(e,{strict:!1}))return Math.ceil((e.length-2)/2);return e.length}var yr=()=>{};var u2="2.57.3";function Ak(e,t){if(t?.(e))return e;if(e&&typeof e==="object"&&"cause"in e&&e.cause!==void 0)return Ak(e.cause,t);return t?null:e}var l2,B;var se=H(()=>{l2={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${u2}`};B=class B extends Error{constructor(e,t={}){let r=(()=>{if(t.cause instanceof B)return t.cause.details;if(t.cause?.message)return t.cause.message;return t.details})(),n=(()=>{if(t.cause instanceof B)return t.cause.docsPath||t.docsPath;return t.docsPath})(),o=l2.getDocsUrl?.({...t,docsPath:n}),i=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...o?[`Docs: ${o}`]:[],...r?[`Details: ${r}`]:[],...l2.version?[`Version: ${l2.version}`]:[]].join(`
10
+ `);super(i,t.cause?{cause:t.cause}:void 0);Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=n,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=u2}walk(e){return Ak(this,e)}}});var p2,dy,Hp,Dn,f2,d2,jp,m2,my,qp,h2,y2,hy,uo,zp,g2,b2,Gp,Wi,Qs,x2,w2,Vp,c2,T2;var et=H(()=>{Xo();yr();se();p2=class p2 extends B{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
11
+ `),{docsPath:e,name:"AbiConstructorNotFoundError"})}};dy=class dy extends B{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
12
+ `),{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}};Hp=class Hp extends B{constructor({data:e,params:t,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
13
+ `),{metaMessages:[`Params: (${Up(t,{includeName:!0})})`,`Data: ${e} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"});Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=r}};Dn=class Dn extends B{constructor({cause:e}={}){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError",cause:e})}};f2=class f2 extends B{constructor({expectedLength:e,givenLength:t,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${e}`,`Given length: ${t}`].join(`
14
+ `),{name:"AbiEncodingArrayLengthMismatchError"})}};d2=class d2 extends B{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${fe(t)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}};jp=class jp extends B{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join(`
15
+ `),{name:"AbiEncodingLengthMismatchError"})}};m2=class m2 extends B{constructor(e,{docsPath:t}){super([`Arguments (\`args\`) were provided to "${e}", but "${e}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
16
+ `),{docsPath:t,name:"AbiErrorInputsNotFoundError"})}};my=class my extends B{constructor(e,{docsPath:t}={}){super([`Error ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
17
+ `),{docsPath:t,name:"AbiErrorNotFoundError"})}};qp=class qp extends B{constructor(e,{docsPath:t,cause:r}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${e}.`].join(`
18
+ `),{docsPath:t,name:"AbiErrorSignatureNotFoundError",cause:r});Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}};h2=class h2 extends B{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}};y2=class y2 extends B{constructor(e,{docsPath:t}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`].join(`
19
+ `),{docsPath:t,name:"AbiEventSignatureNotFoundError"})}};hy=class hy extends B{constructor(e,{docsPath:t}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
20
+ `),{docsPath:t,name:"AbiEventNotFoundError"})}};uo=class uo extends B{constructor(e,{docsPath:t}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
21
+ `),{docsPath:t,name:"AbiFunctionNotFoundError"})}};zp=class zp extends B{constructor(e,{docsPath:t}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
22
+ `),{docsPath:t,name:"AbiFunctionOutputsNotFoundError"})}};g2=class g2 extends B{constructor(e,{docsPath:t}){super([`Encoded function signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`].join(`
23
+ `),{docsPath:t,name:"AbiFunctionSignatureNotFoundError"})}};b2=class b2 extends B{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${mt(e.abiItem)}\`, and`,`\`${t.type}\` in \`${mt(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}};Gp=class Gp extends B{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`,{name:"BytesSizeMismatchError"})}};Wi=class Wi extends B{constructor({abiItem:e,data:t,params:r,size:n}){super([`Data size of ${n} bytes is too small for non-indexed event parameters.`].join(`
24
+ `),{metaMessages:[`Params: (${Up(r,{includeName:!0})})`,`Data: ${t} (${n} bytes)`],name:"DecodeLogDataMismatch"});Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=r,this.size=n}};Qs=class Qs extends B{constructor({abiItem:e,param:t}){super([`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${mt(e,{includeName:!0})}".`].join(`
25
+ `),{name:"DecodeLogTopicsMismatch"});Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}};x2=class x2 extends B{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
26
+ `),{docsPath:t,name:"InvalidAbiEncodingType"})}};w2=class w2 extends B{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
27
+ `),{docsPath:t,name:"InvalidAbiDecodingType"})}};Vp=class Vp extends B{constructor(e){super([`Value "${e}" is not a valid array.`].join(`
28
+ `),{name:"InvalidArrayError"})}};c2=class c2 extends B{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
29
+ `),{name:"InvalidDefinitionTypeError"})}};T2=class T2 extends B{constructor(e){super(`Type "${e}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}});var Me;var In=H(()=>{se();Me=class Me extends B{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}});var yy,gy,by;var xy=H(()=>{se();yy=class yy extends B{constructor({offset:e,position:t,size:r}){super(`Slice ${t==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}};gy=class gy extends B{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}};by=class by extends B{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${t} ${r} long, but is ${e} ${r} long.`,{name:"InvalidBytesLengthError"})}}});function gr(e,{dir:t,size:r=32}={}){if(typeof e==="string")return Qo(e,{dir:t,size:r});return _ee(e,{dir:t,size:r})}function Qo(e,{dir:t,size:r=32}={}){if(r===null)return e;let n=e.replace("0x","");if(n.length>r*2)throw new gy({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[t==="right"?"padEnd":"padStart"](r*2,"0")}`}function _ee(e,{dir:t,size:r=32}={}){if(r===null)return e;if(e.length>r)throw new gy({size:e.length,targetSize:r,type:"bytes"});let n=new Uint8Array(r);for(let o=0;o<r;o++){let i=t==="right";n[i?o:r-o-1]=e[i?o:e.length-o-1]}return n}var Oc=H(()=>{xy()});var ea,E2,v2,S2;var Wp=H(()=>{se();ea=class ea extends B{constructor({max:e,min:t,signed:r,size:n,value:o}){super(`Number "${o}" is not in safe ${n?`${n*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}};E2=class E2 extends B{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};v2=class v2 extends B{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}};S2=class S2 extends B{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}});function Bt(e,{dir:t="left"}={}){let r=typeof e==="string"?e.replace("0x",""):e,n=0;for(let o=0;o<r.length-1;o++)if(r[t==="left"?o:r.length-o-1].toString()==="0")n++;else break;if(r=t==="left"?r.slice(n):r.slice(0,r.length-n),typeof e==="string"){if(r.length===1&&t==="right")r=`${r}0`;return`0x${r.length%2===1?`0${r}`:r}`}return r}function br(e,{size:t}){if(fe(e)>t)throw new S2({givenSize:fe(e),maxSize:t})}function _e(e,t={}){let{signed:r}=t;if(t.size)br(e,{size:t.size});let n=BigInt(e);if(!r)return n;let o=Math.ceil((e.length-2)/2),i=(1n<<BigInt(o)*8n-1n)-1n;if(n<=i)return n;return n-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function wy(e,t={}){let r=e;if(t.size)br(r,{size:t.size}),r=Bt(r);if(Bt(r)==="0x00")return!1;if(Bt(r)==="0x01")return!0;throw new v2(r)}function Oe(e,t={}){let r=_e(e,t),n=Number(r);if(!Number.isSafeInteger(n))throw new ea({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${r}n`});return n}var st=H(()=>{Wp();yr()});function Ce(e,t={}){if(typeof e==="number"||typeof e==="bigint")return M(e,t);if(typeof e==="string")return zt(e,t);if(typeof e==="boolean")return kc(e,t);return be(e,t)}function kc(e,t={}){let r=`0x${Number(e)}`;if(typeof t.size==="number")return br(r,{size:t.size}),gr(r,{size:t.size});return r}function be(e,t={}){let r="";for(let o=0;o<e.length;o++)r+=Bee[e[o]];let n=`0x${r}`;if(typeof t.size==="number")return br(n,{size:t.size}),gr(n,{dir:"right",size:t.size});return n}function M(e,t={}){let{signed:r,size:n}=t,o=BigInt(e),i;if(n)if(r)i=(1n<<BigInt(n)*8n-1n)-1n;else i=2n**(BigInt(n)*8n)-1n;else if(typeof e==="number")i=BigInt(Number.MAX_SAFE_INTEGER);let s=typeof i==="bigint"&&r?-i-1n:0;if(i&&o>i||o<s){let c=typeof e==="bigint"?"n":"";throw new ea({max:i?`${i}${c}`:void 0,min:`${s}${c}`,signed:r,size:n,value:`${e}${c}`})}let a=`0x${(r&&o<0?(1n<<BigInt(n*8))+BigInt(o):o).toString(16)}`;if(n)return gr(a,{size:n});return a}function zt(e,t={}){let r=Nee.encode(e);return be(r,t)}var Bee,Nee;var X=H(()=>{Wp();Oc();st();Bee=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));Nee=new TextEncoder});function Xr(e,t={}){if(typeof e==="number"||typeof e==="bigint")return Lee(e,t);if(typeof e==="boolean")return Mee(e,t);if(oe(e))return ht(e,t);return On(e,t)}function Mee(e,t={}){let r=new Uint8Array(1);if(r[0]=Number(e),typeof t.size==="number")return br(r,{size:t.size}),gr(r,{size:t.size});return r}function Ck(e){if(e>=ei.zero&&e<=ei.nine)return e-ei.zero;if(e>=ei.A&&e<=ei.F)return e-(ei.A-10);if(e>=ei.a&&e<=ei.f)return e-(ei.a-10);return}function ht(e,t={}){let r=e;if(t.size)br(r,{size:t.size}),r=gr(r,{dir:"right",size:t.size});let n=r.slice(2);if(n.length%2)n=`0${n}`;let o=n.length/2,i=new Uint8Array(o);for(let s=0,a=0;s<o;s++){let c=Ck(n.charCodeAt(a++)),u=Ck(n.charCodeAt(a++));if(c===void 0||u===void 0)throw new B(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);i[s]=c*16+u}return i}function Lee(e,t){let r=M(e,t);return ht(r)}function On(e,t={}){let r=Fee.encode(e);if(typeof t.size==="number")return br(r,{size:t.size}),gr(r,{dir:"right",size:t.size});return r}var Fee,ei;var vt=H(()=>{se();Oc();st();X();Fee=new TextEncoder;ei={zero:48,nine:57,A:65,F:70,a:97,f:102}});function $ee(e,t=!1){if(t)return{h:Number(e&Ty),l:Number(e>>Dk&Ty)};return{h:Number(e>>Dk&Ty)|0,l:Number(e&Ty)|0}}function Ey(e,t=!1){let r=e.length,n=new Uint32Array(r),o=new Uint32Array(r);for(let i=0;i<r;i++){let{h:s,l:a}=$ee(e[i],t);[n[i],o[i]]=[s,a]}return[n,o]}function lo(e,t,r,n){let o=(t>>>0)+(n>>>0);return{h:e+r+(o/4294967296|0)|0,l:o|0}}var Ty,Dk,A2=(e,t,r)=>e>>>r,C2=(e,t,r)=>e<<32-r|t>>>r,ta=(e,t,r)=>e>>>r|t<<32-r,ra=(e,t,r)=>e<<32-r|t>>>r,Kp=(e,t,r)=>e<<64-r|t>>>r-32,Yp=(e,t,r)=>e>>>r-32|t<<64-r,Ik=(e,t,r)=>e<<r|t>>>32-r,Ok=(e,t,r)=>t<<r|e>>>32-r,kk=(e,t,r)=>t<<r-32|e>>>64-r,Rk=(e,t,r)=>e<<r-32|t>>>64-r,Pk=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),_k=(e,t,r,n)=>t+r+n+(e/4294967296|0)|0,Bk=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),Nk=(e,t,r,n,o)=>t+r+n+o+(e/4294967296|0)|0,Fk=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),Mk=(e,t,r,n,o,i)=>t+r+n+o+i+(e/4294967296|0)|0;var D2=H(()=>{Ty=BigInt(4294967295),Dk=BigInt(32)});import*as ti from"node:crypto";var na;var Lk=H(()=>{na=ti&&typeof ti==="object"&&"webcrypto"in ti?ti.webcrypto:ti&&typeof ti==="object"&&("randomBytes"in ti)?ti:void 0});function oa(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function xr(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function tt(e,...t){if(!oa(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function Rc(e){if(typeof e!=="function"||typeof e.create!=="function")throw Error("Hash should be wrapped by utils.createHasher");xr(e.outputLen),xr(e.blockLen)}function ni(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function vy(e,t){tt(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function Uk(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Nt(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function po(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function kn(e,t){return e<<32-t|e>>>t}function Zp(e,t){return e<<t|e>>>32-t>>>0}function jee(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function qee(e){for(let t=0;t<e.length;t++)e[t]=jee(e[t]);return e}function Rn(e){if(tt(e),Hk)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=zee[e[r]];return t}function $k(e){if(e>=ri._0&&e<=ri._9)return e-ri._0;if(e>=ri.A&&e<=ri.F)return e-(ri.A-10);if(e>=ri.a&&e<=ri.f)return e-(ri.a-10);return}function oi(e){if(typeof e!=="string")throw Error("hex string expected, got "+typeof e);if(Hk)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){let s=$k(e.charCodeAt(i)),a=$k(e.charCodeAt(i+1));if(s===void 0||a===void 0){let c=e[i]+e[i+1];throw Error('hex string expected, got non-hex character "'+c+'" at index '+i)}n[o]=s*16+a}return n}function Jp(e){if(typeof e!=="string")throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function ia(e){if(typeof e==="string")e=Jp(e);return tt(e),e}function O2(e){if(typeof e==="string")e=Jp(e);return tt(e),e}function St(...e){let t=0;for(let n=0;n<e.length;n++){let o=e[n];tt(o),t+=o.length}let r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){let i=e[n];r.set(i,o),o+=i.length}return r}function jk(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw Error("options should be object or undefined");return Object.assign(e,t)}class Ki{}function sa(e){let t=(n)=>e().update(ia(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Pc(e=32){if(na&&typeof na.getRandomValues==="function")return na.getRandomValues(new Uint8Array(e));if(na&&typeof na.randomBytes==="function")return Uint8Array.from(na.randomBytes(e));throw Error("crypto.getRandomValues must be defined")}var Hee,I2,Hk,zee,ri;var Fr=H(()=>{Lk();/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Hee=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();I2=Hee?(e)=>e:qee,Hk=(()=>typeof Uint8Array.from([]).toHex==="function"&&typeof Uint8Array.fromHex==="function")(),zee=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));ri={_0:48,_9:57,A:65,F:70,a:97,f:102}});function Xee(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,c=(s+2)%10,u=r[c],l=r[c+1],p=qk(u,l,1)^r[a],f=zk(u,l,1)^r[a+1];for(let d=0;d<50;d+=10)e[s+d]^=p,e[s+d+1]^=f}let o=e[2],i=e[3];for(let s=0;s<24;s++){let a=Vk[s],c=qk(o,i,a),u=zk(o,i,a),l=Gk[s];o=e[l],i=e[l+1],e[l]=c,e[l+1]=u}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)r[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=Zee[n],e[1]^=Jee[n]}Nt(r)}var Gee,Xp,Vee,Wee,Kee,Yee,Gk,Vk,Wk,Kk,Zee,Jee,qk=(e,t,r)=>r>32?kk(e,t,r):Ik(e,t,r),zk=(e,t,r)=>r>32?Rk(e,t,r):Ok(e,t,r),k2,Qee=(e,t,r)=>sa(()=>new k2(t,e,r)),Sy;var R2=H(()=>{D2();Fr();Gee=BigInt(0),Xp=BigInt(1),Vee=BigInt(2),Wee=BigInt(7),Kee=BigInt(256),Yee=BigInt(113),Gk=[],Vk=[],Wk=[];for(let e=0,t=Xp,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Gk.push(2*(5*n+r)),Vk.push((e+1)*(e+2)/2%64);let o=Gee;for(let i=0;i<7;i++)if(t=(t<<Xp^(t>>Wee)*Yee)%Kee,t&Vee)o^=Xp<<(Xp<<BigInt(i))-Xp;Wk.push(o)}Kk=Ey(Wk,!0),Zee=Kk[0],Jee=Kk[1];k2=class k2 extends Ki{constructor(e,t,r,n=!1,o=24){super();if(this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=o,xr(r),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Uk(this.state)}clone(){return this._cloneInto()}keccak(){I2(this.state32),Xee(this.state32,this.rounds),I2(this.state32),this.posOut=0,this.pos=0}update(e){ni(this),e=ia(e),tt(e);let{blockLen:t,state:r}=this,n=e.length;for(let o=0;o<n;){let i=Math.min(t-this.pos,n-o);for(let s=0;s<i;s++)r[this.pos++]^=e[o++];if(this.pos===t)this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:r,blockLen:n}=this;if(e[r]^=t,(t&128)!==0&&r===n-1)this.keccak();e[n-1]^=128,this.keccak()}writeInto(e){ni(this,!1),tt(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,o=e.length;n<o;){if(this.posOut>=r)this.keccak();let i=Math.min(r-this.posOut,o-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=i}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return xr(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(vy(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Nt(this.state)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:o,enableXOF:i}=this;return e||(e=new k2(t,r,n,i,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}};Sy=(()=>Qee(1,136,32))()});function ke(e,t){let r=t||"hex",n=Sy(oe(e,{strict:!1})?Xr(e):e);if(r==="bytes")return n;return Ce(n)}var Qr=H(()=>{R2();vt();X()});var Mr;var aa=H(()=>{Mr=class Mr extends Map{constructor(e){super();Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);if(super.has(e))super.delete(e),super.set(e,t);return t}set(e,t){if(super.has(e))super.delete(e);if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let r=super.keys().next().value;if(r!==void 0)super.delete(r)}return this}}});function J(e,t){let{strict:r=!0}=t??{},n=`${e}.${r}`;if(P2.has(n))return P2.get(n);let o=(()=>{if(!ete.test(e))return!1;if(e.toLowerCase()===e)return!0;if(r)return fo(e)===e;return!0})();return P2.set(n,o),o}var ete,P2;var or=H(()=>{aa();Pn();ete=/^0x[a-fA-F0-9]{40}$/,P2=new Mr(8192)});function fo(e,t){if(_2.has(`${e}.${t}`))return _2.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=ke(On(r),"bytes"),o=(t?r.substring(`${t}0x`.length):r).split("");for(let s=0;s<40;s+=2){if(n[s>>1]>>4>=8&&o[s])o[s]=o[s].toUpperCase();if((n[s>>1]&15)>=8&&o[s+1])o[s+1]=o[s+1].toUpperCase()}let i=`0x${o.join("")}`;return _2.set(`${e}.${t}`,i),i}function de(e,t){if(!J(e,{strict:!1}))throw new Me({address:e});return fo(e,t)}var _2;var Pn=H(()=>{In();vt();Qr();aa();or();_2=new Mr(8192)});var Ay,Qp,B2;var N2=H(()=>{se();Ay=class Ay extends B{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}};Qp=class Qp extends B{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}};B2=class B2 extends B{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}});function _c(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(tte);return r.bytes=e,r.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}var tte;var Cy=H(()=>{N2();tte={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new B2({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Qp({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Ay({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Ay({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();if(this.positionReadCount.set(this.position,e+1),e>0)this.recursiveReadCount++}}});function wr(e,t,r,{strict:n}={}){if(oe(e,{strict:!1}))return Dy(e,t,r,{strict:n});return F2(e,t,r,{strict:n})}function Yk(e,t){if(typeof t==="number"&&t>0&&t>fe(e)-1)throw new yy({offset:t,position:"start",size:fe(e)})}function Zk(e,t,r){if(typeof t==="number"&&typeof r==="number"&&fe(e)!==r-t)throw new yy({offset:r,position:"end",size:fe(e)})}function F2(e,t,r,{strict:n}={}){Yk(e,t);let o=e.slice(t,r);if(n)Zk(o,t,r);return o}function Dy(e,t,r,{strict:n}={}){Yk(e,t);let o=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;if(n)Zk(o,t,r);return o}var ii=H(()=>{xy();yr()});function Jk(e,t={}){if(typeof t.size<"u")br(e,{size:t.size});let r=be(e);return _e(r,t)}function Xk(e,t={}){let r=e;if(typeof t.size<"u")br(r,{size:t.size}),r=Bt(r);if(r.length>1||r[0]>1)throw new E2(r);return Boolean(r[0])}function mo(e,t={}){if(typeof t.size<"u")br(e,{size:t.size});let r=be(e);return Oe(r,t)}function Qk(e,t={}){let r=e;if(typeof t.size<"u")br(r,{size:t.size}),r=Bt(r,{dir:"right"});return new TextDecoder().decode(r)}var eR=H(()=>{Wp();st();X()});function yt(e){if(typeof e[0]==="string")return He(e);return rte(e)}function rte(e){let t=0;for(let o of e)t+=o.length;let r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return r}function He(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}var tR,Iy,Bc;var Oy=H(()=>{tR=/^(.*)\[([0-9]*)\]$/,Iy=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Bc=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/});function ct(e,t){if(e.length!==t.length)throw new jp({expectedLength:e.length,givenLength:t.length});let r=nte({params:e,values:t});return $2(r)}function nte({params:e,values:t}){let r=[];for(let n=0;n<e.length;n++)r.push(L2({param:e[n],value:t[n]}));return r}function L2({param:e,value:t}){let r=ef(e.type);if(r){let[n,o]=r;return ite(t,{length:n,param:{...e,type:o}})}if(e.type==="tuple")return lte(t,{param:e});if(e.type==="address")return ote(t);if(e.type==="bool")return ate(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){let n=e.type.startsWith("int"),[,,o="256"]=Bc.exec(e.type)??[];return cte(t,{signed:n,size:Number(o)})}if(e.type.startsWith("bytes"))return ste(t,{param:e});if(e.type==="string")return ute(t);throw new x2(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function $2(e){let t=0;for(let i=0;i<e.length;i++){let{dynamic:s,encoded:a}=e[i];if(s)t+=32;else t+=fe(a)}let r=[],n=[],o=0;for(let i=0;i<e.length;i++){let{dynamic:s,encoded:a}=e[i];if(s)r.push(M(t+o,{size:32})),n.push(a),o+=fe(a);else r.push(a)}return He([...r,...n])}function ote(e){if(!J(e))throw new Me({address:e});return{dynamic:!1,encoded:Qo(e.toLowerCase())}}function ite(e,{length:t,param:r}){let n=t===null;if(!Array.isArray(e))throw new Vp(e);if(!n&&e.length!==t)throw new f2({expectedLength:t,givenLength:e.length,type:`${r.type}[${t}]`});let o=e.length===0&&M2(r),i=[];for(let s=0;s<e.length;s++){let a=L2({param:r,value:e[s]});if(a.dynamic)o=!0;i.push(a)}if(n||o){let s=$2(i);if(n){let a=M(i.length,{size:32});return{dynamic:!0,encoded:He([a,s])}}if(o)return{dynamic:!0,encoded:s}}return{dynamic:!1,encoded:He(i.map(({encoded:s})=>s))}}function ste(e,{param:t}){let[,r]=t.type.split("bytes"),n=fe(e);if(!r){let o=e;if(n%32!==0)o=Qo(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32});return{dynamic:!0,encoded:He([Qo(M(n,{size:32})),o])}}if(n!==Number.parseInt(r,10))throw new d2({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:Qo(e,{dir:"right"})}}function ate(e){if(typeof e!=="boolean")throw new B(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Qo(kc(e))}}function cte(e,{signed:t,size:r=256}){if(typeof r==="number"){let n=2n**(BigInt(r)-(t?1n:0n))-1n,o=t?-n-1n:0n;if(e>n||e<o)throw new ea({max:n.toString(),min:o.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:M(e,{size:32,signed:t})}}function ute(e){let t=zt(e),r=Math.ceil(fe(t)/32),n=[];for(let o=0;o<r;o++)n.push(Qo(wr(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:He([Qo(M(fe(t),{size:32})),...n])}}function lte(e,{param:t}){let r=!1,n=[];for(let o=0;o<t.components.length;o++){let i=t.components[o],s=Array.isArray(e)?o:i.name,a=L2({param:i,value:e[s]});if(n.push(a),a.dynamic)r=!0}return{dynamic:r,encoded:r?$2(n):He(n.map(({encoded:o})=>o))}}function ef(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function M2(e){let{type:t}=e;if(t==="string")return!0;if(t==="bytes")return!0;if(t.endsWith("[]"))return!0;if(t==="tuple")return e.components.some(M2);let r=ef(t);if(r)return M2({...e,type:r[1]});return!1}var ho=H(()=>{et();In();se();Wp();or();Oc();yr();ii();X();Oy()});function si(e,t){let r=typeof t==="string"?ht(t):t,n=_c(r);if(fe(r)===0&&e.length>0)throw new Dn;if(fe(t)&&fe(t)<32)throw new Hp({data:typeof t==="string"?t:be(t),params:e,size:fe(t)});let o=0,i=[];for(let s=0;s<e.length;++s){let a=e[s];if(o<r.length)n.setPosition(o);let[c,u]=Nc(n,a,{staticPosition:0});o+=u,i.push(c)}return i}function Nc(e,t,{staticPosition:r}){let n=ef(t.type);if(n){let[o,i]=n;return fte(e,{...t,type:i},{length:o,staticPosition:r})}if(t.type==="tuple")return yte(e,t,{staticPosition:r});if(t.type==="address")return pte(e);if(t.type==="bool")return dte(e);if(t.type.startsWith("bytes"))return mte(e,t,{staticPosition:r});if(t.type.startsWith("uint")||t.type.startsWith("int"))return hte(e,t);if(t.type==="string")return gte(e,{staticPosition:r});throw new w2(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function pte(e){let t=e.readBytes(32);return[fo(be(F2(t,-20))),32]}function fte(e,t,{length:r,staticPosition:n}){if(r===null){let s=mo(e.readBytes(U2)),a=n+s,c=a+rR;e.setPosition(a);let u=mo(e.readBytes(rR)),l=tf(t),p=0,f=[];for(let d=0;d<u;++d){e.setPosition(c+(l?d*32:p));let[h,m]=Nc(e,t,{staticPosition:c});if(p+=m,f.push(h),m===0)e.assertReadLimit(),e._touch()}return e.setPosition(n+32),[f,32]}if(tf(t)){let s=mo(e.readBytes(U2)),a=n+s,c=[];for(let u=0;u<r;++u){e.setPosition(a+u*32);let[l]=Nc(e,t,{staticPosition:a});c.push(l)}return e.setPosition(n+32),[c,32]}let o=0,i=[];for(let s=0;s<r;++s){let[a,c]=Nc(e,t,{staticPosition:n+o});if(o+=c,i.push(a),c===0)e.assertReadLimit(),e._touch()}return[i,o]}function dte(e){return[Xk(e.readBytes(32),{size:32}),32]}function mte(e,t,{staticPosition:r}){let[n,o]=t.type.split("bytes");if(!o){let s=mo(e.readBytes(32));e.setPosition(r+s);let a=mo(e.readBytes(32));if(a===0)return e.setPosition(r+32),["0x",32];let c=e.readBytes(a);return e.setPosition(r+32),[be(c),32]}return[be(e.readBytes(Number.parseInt(o,10),32)),32]}function hte(e,t){let r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[n>48?Jk(o,{signed:r}):mo(o,{signed:r}),32]}function yte(e,t,{staticPosition:r}){let n=t.components.length===0||t.components.some(({name:s})=>!s),o=n?[]:{},i=0;if(tf(t)){let s=mo(e.readBytes(U2)),a=r+s;for(let c=0;c<t.components.length;++c){let u=t.components[c];e.setPosition(a+i);let[l,p]=Nc(e,u,{staticPosition:a});i+=p,o[n?c:u?.name]=l}return e.setPosition(r+32),[o,32]}for(let s=0;s<t.components.length;++s){let a=t.components[s],[c,u]=Nc(e,a,{staticPosition:r});o[n?s:a?.name]=c,i+=u}return[o,i]}function gte(e,{staticPosition:t}){let r=mo(e.readBytes(32)),n=t+r;e.setPosition(n);let o=mo(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];let i=e.readBytes(o,32),s=Qk(i);return e.setPosition(t+32),[s,32]}function tf(e){let{type:t}=e;if(t==="string")return!0;if(t==="bytes")return!0;if(t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(tf);let r=ef(e.type);if(r&&tf({...e,type:r[1]}))return!0;return!1}var rR=32,U2=32;var rf=H(()=>{et();Pn();Cy();yr();ii();eR();vt();X();ho()});function nR(e){return bte(e)}var bte=(e)=>ke(Xr(e));var oR=H(()=>{vt();Qr()});function iR(e){let t=!0,r="",n=0,o="",i=!1;for(let s=0;s<e.length;s++){let a=e[s];if(["(",")",","].includes(a))t=!0;if(a==="(")n++;if(a===")")n--;if(!t)continue;if(n===0){if(a===" "&&["event","function",""].includes(o))o="";else if(o+=a,a===")"){i=!0;break}continue}if(a===" "){if(e[s-1]!==","&&r!==","&&r!==",(")r="",t=!1;continue}o+=a,r+=a}if(!i)throw new B("Unable to normalize signature.");return o}var sR=H(()=>{se()});var aR=(e)=>{let t=(()=>{if(typeof e==="string")return e;return X1(e)})();return iR(t)};var cR=H(()=>{iy();sR()});function ky(e){return nR(aR(e))}var H2=H(()=>{oR();cR()});var Yi;var nf=H(()=>{H2();Yi=ky});var yo=(e)=>wr(ky(e),0,4);var Fc=H(()=>{ii();H2()});function Tr(e){let{abi:t,args:r=[],name:n}=e,o=oe(n,{strict:!1}),i=t.filter((a)=>{if(o){if(a.type==="function")return yo(a)===n;if(a.type==="event")return Yi(a)===n;return!1}return"name"in a&&a.name===n});if(i.length===0)return;if(i.length===1)return i[0];let s;for(let a of i){if(!("inputs"in a))continue;if(!r||r.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs)continue;if(a.inputs.length===0)continue;if(a.inputs.length!==r.length)continue;if(r.every((u,l)=>{let p="inputs"in a&&a.inputs[l];if(!p)return!1;return j2(u,p)})){if(s&&"inputs"in s&&s.inputs){let u=uR(a.inputs,s.inputs,r);if(u)throw new b2({abiItem:a,type:u[0]},{abiItem:s,type:u[1]})}s=a}}if(s)return s;return i[0]}function j2(e,t){let r=typeof e,n=t.type;switch(n){case"address":return J(e,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:{if(n==="tuple"&&"components"in t)return Object.values(t.components).every((o,i)=>r==="object"&&j2(Object.values(e)[i],o));if(/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n))return r==="number"||r==="bigint";if(/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n))return r==="string"||e instanceof Uint8Array;if(/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n))return Array.isArray(e)&&e.every((o)=>j2(o,{...t,type:n.replace(/(\[[0-9]{0,}\])$/,"")}));return!1}}}function uR(e,t,r){for(let n in e){let o=e[n],i=t[n];if(o.type==="tuple"&&i.type==="tuple"&&"components"in o&&"components"in i)return uR(o.components,i.components,r[n]);let s=[o.type,i.type];if((()=>{if(s.includes("address")&&s.includes("bytes20"))return!0;if(s.includes("address")&&s.includes("string"))return J(r[n],{strict:!1});if(s.includes("address")&&s.includes("bytes"))return J(r[n],{strict:!1});return!1})())return s}return}var Zi=H(()=>{et();or();nf();Fc()});function Gt(e){let{abi:t,args:r,functionName:n,data:o}=e,i=t[0];if(n){let a=Tr({abi:t,args:r,name:n});if(!a)throw new uo(n,{docsPath:q2});i=a}if(i.type!=="function")throw new uo(void 0,{docsPath:q2});if(!i.outputs)throw new zp(i.name,{docsPath:q2});let s=si(i.outputs,o);if(s&&s.length>1)return s;if(s&&s.length===1)return s[0];return}var q2="/docs/contract/decodeFunctionResult";var ai=H(()=>{et();rf();Zi()});function pR(e){let{abi:t,args:r,functionName:n}=e,o=t[0];if(n){let i=Tr({abi:t,args:r,name:n});if(!i)throw new uo(n,{docsPath:lR});o=i}if(o.type!=="function")throw new uo(void 0,{docsPath:lR});return{abi:[o],functionName:yo(mt(o))}}var lR="/docs/contract/encodeFunctionData";var fR=H(()=>{et();Fc();Xo();Zi()});function Be(e){let{args:t}=e,{abi:r,functionName:n}=(()=>{if(e.abi.length===1&&e.functionName?.startsWith("0x"))return e;return pR(e)})(),o=r[0],i=n,s="inputs"in o&&o.inputs?ct(o.inputs,t??[]):void 0;return He([i,s??"0x"])}var Er=H(()=>{ho();fR()});var Mc,z2,G2,Ry,Lc;var of=H(()=>{se();Mc=class Mc extends B{constructor({blockNumber:e,chain:t,contract:r}){super(`Chain "${t.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...e&&r.blockCreated&&r.blockCreated>e?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}};z2=class z2 extends B{constructor({chain:e,currentChainId:t}){super(`The current chain of the wallet (id: ${t}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e.id} – ${e.name}`],name:"ChainMismatchError"})}};G2=class G2 extends B{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
30
+ `),{name:"ChainNotFoundError"})}};Ry=class Ry extends B{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}};Lc=class Lc extends B{constructor({chainId:e}){super(typeof e==="number"?`Chain ID "${e}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}});function en({blockNumber:e,chain:t,contract:r}){let n=t?.contracts?.[r];if(!n)throw new Mc({chain:t,contract:{name:r}});if(e&&n.blockCreated&&n.blockCreated>e)throw new Mc({blockNumber:e,chain:t,contract:{name:r,blockCreated:n.blockCreated}});return n.address}var ca=H(()=>{of()});var dR,Py,mR;var _y=H(()=>{dR={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},Py={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},mR={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}});function By(e){let{abi:t,data:r,cause:n}=e,o=wr(r,0,4);if(o==="0x")throw new Dn({cause:n});let s=[...t||[],Py,mR].find((a)=>a.type==="error"&&o===yo(mt(a)));if(!s)throw new qp(o,{docsPath:"/docs/contract/decodeErrorResult",cause:n});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?si(s.inputs,wr(r,4)):void 0,errorName:s.name}}var V2=H(()=>{_y();et();ii();Fc();rf();Xo()});var ue=(e,t,r)=>JSON.stringify(e,(n,o)=>{let i=typeof o==="bigint"?o.toString():o;return typeof t==="function"?t(n,i):i},r);function W2({abiItem:e,args:t,includeFunctionName:r=!0,includeName:n=!1}){if(!("name"in e))return;if(!("inputs"in e))return;if(!e.inputs)return;return`${r?e.name:""}(${e.inputs.map((o,i)=>`${n&&o.name?`${o.name}: `:""}${typeof t[i]==="object"?ue(t[i]):t[i]}`).join(", ")})`}var hR=()=>{};function Fy(e,t=0){if(!Number.isInteger(t)||t<0)throw new K2({decimals:t});let r=e.toString(),n=r.startsWith("-");if(n)r=r.slice(1);r=r.padStart(t,"0");let[o,i]=[r.slice(0,r.length-t),r.slice(r.length-t)];return i=i.replace(/(0+)$/,""),`${n?"-":""}${o||"0"}${i?`.${i}`:""}`}function yR(e,t="wei"){return Fy(e,Ny.ether-Ny[t])}function gR(e,t="wei"){return Fy(e,Ny.gwei-Ny[t])}function bR(e,t=0){if(!Number.isInteger(t)||t<0)throw new K2({decimals:t});if(!/^-?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)$/.test(e))throw new xR({value:e});let[r="",n="0"]=e.split("."),o=r.startsWith("-");if(o)r=r.slice(1);if(r==="")r="0";if(n=n.replace(/(0+)$/,""),t===0){if(n.length>0&&Number.parseInt(n[0],10)>=5)r=`${BigInt(r)+1n}`;n=""}else if(n.length>t){let i=n.slice(0,t);if(Number.parseInt(n.slice(t,t+1),10)>=5){let a=xte(i);if(a.length>t)n=a.slice(1),r=`${BigInt(r)+1n}`;else n=a}else n=i}else n=n.padEnd(t,"0");return BigInt(`${o?"-":""}${r}${n}`)}function xte(e){let t=e.split(""),r=t.length-1;while(r>=0){let n=Number.parseInt(t[r],10)+1;if(n<10)return t[r]=String(n),t.join("");t[r]="0",r--}return`1${t.join("")}`}var Ny,xR,K2;var sf=H(()=>{Ny={wei:0,gwei:9,szabo:12,finney:15,ether:18};xR=class xR extends Error{constructor({value:e}){super(`Value \`${e}\` is not a valid decimal number.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Value.InvalidDecimalNumberError"})}};K2=class K2 extends Error{constructor({decimals:e}){super(`\`decimals\` must be a non-negative integer. Got \`${e}\`.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Value.InvalidDecimalsError"})}}});function $c(e,t="wei"){return yR(e,t)}var Ly=H(()=>{sf()});function gt(e,t="wei"){return gR(e,t)}var Uc=H(()=>{sf()});function wR(e){return e.reduce((t,{slot:r,value:n})=>`${t} ${r}: ${n}
31
+ `,"")}function TR(e){return e.reduce((t,{address:r,...n})=>{let o=`${t} ${r}:
32
+ `;if(n.nonce)o+=` nonce: ${n.nonce}
33
+ `;if(n.balance)o+=` balance: ${n.balance}
34
+ `;if(n.code)o+=` code: ${n.code}
35
+ `;if(n.state)o+=` state:
36
+ `,o+=wR(n.state);if(n.stateDiff)o+=` stateDiff:
37
+ `,o+=wR(n.stateDiff);return o},` State Override:
38
+ `).slice(0,-1)}var Y2,Z2;var J2=H(()=>{se();Y2=class Y2 extends B{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}};Z2=class Z2 extends B{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}});function ua(e){let t=Object.entries(e).map(([n,o])=>{if(o===void 0||o===!1)return null;return[n,o]}).filter(Boolean),r=t.reduce((n,[o])=>Math.max(n,o.length),0);return t.map(([n,o])=>` ${`${n}:`.padEnd(r+1)} ${o}`).join(`
39
+ `)}var af,X2,Q2,eT,tT,la,cf,Hc,rT;var ir=H(()=>{Ly();Uc();se();af=class af extends B{constructor({filledNonce:e,requestedNonce:t}){super("The filled transaction nonce does not match the requested nonce.",{metaMessages:[`Requested Nonce: ${t}`,`Filled Nonce: ${e}`],name:"FeePayerNonceMismatchError"})}};X2=class X2 extends B{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}};Q2=class Q2 extends B{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",ua(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}};eT=class eT extends B{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}};tT=class tT extends B{constructor(e,{account:t,docsPath:r,chain:n,data:o,gas:i,gasPrice:s,maxFeePerGas:a,maxPriorityFeePerGas:c,nonce:u,to:l,value:p}){let f=ua({chain:n&&`${n?.name} (id: ${n?.id})`,from:t?.address,to:l,value:typeof p<"u"&&`${$c(p)} ${n?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:i,gasPrice:typeof s<"u"&&`${gt(s)} gwei`,maxFeePerGas:typeof a<"u"&&`${gt(a)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${gt(c)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",f].filter(Boolean),name:"TransactionExecutionError"});Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}};la=class la extends B{constructor({blockHash:e,blockNumber:t,blockTag:r,hash:n,index:o}){let i="Transaction";if(r&&o!==void 0)i=`Transaction at block time "${r}" at index "${o}"`;if(e&&o!==void 0)i=`Transaction at block hash "${e}" at index "${o}"`;if(t&&o!==void 0)i=`Transaction at block number "${t}" at index "${o}"`;if(n)i=`Transaction with hash "${n}"`;super(`${i} could not be found.`,{name:"TransactionNotFoundError"})}};cf=class cf extends B{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}};Hc=class Hc extends B{constructor({receipt:e}){super(`Transaction with hash "${e.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"});Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=e}};rT=class rT extends B{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}});function Ft(e){if(e?.reason)return e.reason;if(typeof DOMException==="function")return new DOMException("This operation was aborted","AbortError");let t=Error("This operation was aborted");return t.name="AbortError",t}function vr(e){return typeof e==="object"&&e!==null&&"name"in e&&e.name==="AbortError"}var ER=(e)=>e,pa=(e)=>{try{let t=new URL(e);if(!t.username&&!t.password)return e;return t.username="",t.password="",t.toString()}catch{return e}};var Ji,jc,go,$y,Uy,bo;var xo=H(()=>{_y();V2();Xo();hR();Zi();Ly();Uc();et();se();J2();ir();Ji=class Ji extends B{constructor(e,{account:t,docsPath:r,chain:n,data:o,gas:i,gasPrice:s,maxFeePerGas:a,maxPriorityFeePerGas:c,nonce:u,to:l,value:p,stateOverride:f}){let d=t?ee(t):void 0,h=ua({from:d?.address,to:l,value:typeof p<"u"&&`${$c(p)} ${n?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:i,gasPrice:typeof s<"u"&&`${gt(s)} gwei`,maxFeePerGas:typeof a<"u"&&`${gt(a)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${gt(c)} gwei`,nonce:u});if(f)h+=`
40
+ ${TR(f)}`;super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",h].filter(Boolean),name:"CallExecutionError"});Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}};jc=class jc extends B{constructor(e,{abi:t,args:r,contractAddress:n,docsPath:o,functionName:i,sender:s}){let a=Tr({abi:t,args:r,name:i}),c=a?W2({abiItem:a,args:r,includeFunctionName:!1,includeName:!1}):void 0,u=a?mt(a,{includeName:!0}):void 0,l=ua({address:n&&ER(n),function:u,args:c&&c!=="()"&&`${[...Array(i?.length??0).keys()].map(()=>" ").join("")}${c}`,sender:s});super(e.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:e,docsPath:o,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],l&&"Contract Call:",l].filter(Boolean),name:"ContractFunctionExecutionError"});Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=t,this.args=r,this.cause=e,this.contractAddress=n,this.functionName=i,this.sender=s}};go=class go extends B{constructor({abi:e,data:t,functionName:r,message:n,cause:o}){let i,s,a,c;if(t&&t!=="0x")try{s=By({abi:e,data:t,cause:o});let{abiItem:l,errorName:p,args:f}=s;if(p==="Error")c=f[0];else if(p==="Panic"){let[d]=f;c=dR[d]}else{let d=l?mt(l,{includeName:!0}):void 0,h=l&&f?W2({abiItem:l,args:f,includeFunctionName:!1,includeName:!1}):void 0;a=[d?`Error: ${d}`:"",h&&h!=="()"?` ${[...Array(p?.length??0).keys()].map(()=>" ").join("")}${h}`:""]}}catch(l){i=l}else if(n)c=n;let u;if(i instanceof qp)u=i.signature,a=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${u}.`];super(c&&c!=="execution reverted"||u?[`The contract function "${r}" reverted with the following ${u?"signature":"reason"}:`,c||u].join(`
41
+ `):`The contract function "${r}" reverted.`,{cause:i??o,metaMessages:a,name:"ContractFunctionRevertedError"});Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=s,this.raw=t,this.reason=c,this.signature=u}};$y=class $y extends B{constructor({functionName:e,cause:t}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError",cause:t})}};Uy=class Uy extends B{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}};bo=class bo extends B{constructor({data:e,message:t}){super(t||"",{name:"RawContractError"});Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}});function vR(e){let{abi:t,data:r}=e,n=wr(r,0,4),o=t.find((i)=>i.type==="function"&&n===yo(mt(i)));if(!o)throw new g2(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:o.name,args:"inputs"in o&&o.inputs&&o.inputs.length>0?si(o.inputs,wr(r,4)):void 0}}var SR=H(()=>{et();ii();Fc();rf();Xo()});function oT(e){let{abi:t,errorName:r,args:n}=e,o=t[0];if(r){let c=Tr({abi:t,args:n,name:r});if(!c)throw new my(r,{docsPath:nT});o=c}if(o.type!=="error")throw new my(void 0,{docsPath:nT});let i=mt(o),s=yo(i),a="0x";if(n&&n.length>0){if(!o.inputs)throw new m2(o.name,{docsPath:nT});a=ct(o.inputs,n)}return He([s,a])}var nT="/docs/contract/encodeErrorResult";var AR=H(()=>{et();Fc();ho();Xo();Zi()});function CR(e){let{abi:t,functionName:r,result:n}=e,o=t[0];if(r){let s=Tr({abi:t,name:r});if(!s)throw new uo(r,{docsPath:iT});o=s}if(o.type!=="function")throw new uo(void 0,{docsPath:iT});if(!o.outputs)throw new zp(o.name,{docsPath:iT});let i=(()=>{if(o.outputs.length===0)return[];if(o.outputs.length===1)return[n];if(Array.isArray(n))return n;throw new Vp(n)})();return ct(o.outputs,i)}var iT="/docs/contract/encodeFunctionResult";var DR=H(()=>{et();ho();Zi()});async function sT(e){let{data:t,ccipRequest:r}=e,{args:[n]}=vR({abi:ly,data:t}),o=[],i=[];return await Promise.all(n.map(async(s,a)=>{try{i[a]=s.urls.includes(ci)?await sT({data:s.data,ccipRequest:r}):await r(s),o[a]=!1}catch(c){o[a]=!0,i[a]=wte(c)}})),CR({abi:ly,functionName:"query",result:[o,i]})}function wte(e){if(e.name==="HttpRequestError"&&e.status)return oT({abi:ly,errorName:"HttpError",args:[e.status,e.shortMessage]});return oT({abi:[Py],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}var ci="x-batch-gateway:true";var uf=H(()=>{_t();_y();SR();AR();DR()});var _n,Gc,fa,jy;var da=H(()=>{se();_n=class _n extends B{constructor({body:e,cause:t,details:r,headers:n,status:o,url:i}){super("HTTP request failed.",{cause:t,details:r,metaMessages:[o&&`Status: ${o}`,`URL: ${pa(i)}`,e&&`Request body: ${ue(e)}`].filter(Boolean),name:"HttpRequestError"});Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=o,this.url=i}};Gc=class Gc extends B{constructor({maxSize:e,size:t}){super("HTTP response body exceeded the size limit.",{metaMessages:[`Max: ${e} bytes`,`Received: ${t} bytes`],name:"ResponseBodyTooLargeError"});Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e,this.size=t}};fa=class fa extends B{constructor({body:e,error:t,url:r}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${pa(r)}`,`Request body: ${ue(e)}`],name:"RpcRequestError"});Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code,this.data=t.data,this.url=r}};jy=class jy extends B{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${pa(t)}`,`Request body: ${ue(e)}`],name:"TimeoutError"});Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=t}}});var Tte=-1,sr,ar,Vc,Wc,Kc,Yc,ui,tn,Zc,Jc,Xc,Xi,ma,Qc,ha,eu,tu,ru,nu,ou,Qi,iu,su,au,cu,uu,es,lu,aT;var pu=H(()=>{se();da();sr=class sr extends B{constructor(e,{code:t,docsPath:r,metaMessages:n,name:o,shortMessage:i}){super(i,{cause:e,docsPath:r,metaMessages:n||e?.metaMessages,name:o||"RpcError"});Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=o||e.name,this.code=e instanceof fa?e.code:t??Tte}};ar=class ar extends sr{constructor(e,t){super(e,t);Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}};Vc=class Vc extends sr{constructor(e){super(e,{code:Vc.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}};Object.defineProperty(Vc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});Wc=class Wc extends sr{constructor(e){super(e,{code:Wc.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}};Object.defineProperty(Wc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});Kc=class Kc extends sr{constructor(e,{method:t}={}){super(e,{code:Kc.code,name:"MethodNotFoundRpcError",shortMessage:`The method${t?` "${t}"`:""} does not exist / is not available.`})}};Object.defineProperty(Kc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});Yc=class Yc extends sr{constructor(e){super(e,{code:Yc.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
42
+ `)})}};Object.defineProperty(Yc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});ui=class ui extends sr{constructor(e){super(e,{code:ui.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}};Object.defineProperty(ui,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});tn=class tn extends sr{constructor(e){super(e,{code:tn.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
43
+ `)})}};Object.defineProperty(tn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32000});Zc=class Zc extends sr{constructor(e){super(e,{code:Zc.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}};Object.defineProperty(Zc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});Jc=class Jc extends sr{constructor(e){super(e,{code:Jc.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}};Object.defineProperty(Jc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});Xc=class Xc extends sr{constructor(e){super(e,{code:Xc.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}};Object.defineProperty(Xc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});Xi=class Xi extends sr{constructor(e,{method:t}={}){super(e,{code:Xi.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${t?` "${t}"`:""} is not supported.`})}};Object.defineProperty(Xi,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});ma=class ma extends sr{constructor(e){super(e,{code:ma.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}};Object.defineProperty(ma,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});Qc=class Qc extends sr{constructor(e){super(e,{code:Qc.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}};Object.defineProperty(Qc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});ha=class ha extends ar{constructor(e){super(e,{code:ha.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}};Object.defineProperty(ha,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});eu=class eu extends ar{constructor(e){super(e,{code:eu.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}};Object.defineProperty(eu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});tu=class tu extends ar{constructor(e,{method:t}={}){super(e,{code:tu.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${t?` " ${t}"`:""}.`})}};Object.defineProperty(tu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});ru=class ru extends ar{constructor(e){super(e,{code:ru.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}};Object.defineProperty(ru,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});nu=class nu extends ar{constructor(e){super(e,{code:nu.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}};Object.defineProperty(nu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});ou=class ou extends ar{constructor(e){super(e,{code:ou.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}};Object.defineProperty(ou,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});Qi=class Qi extends ar{constructor(e){super(e,{code:Qi.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}};Object.defineProperty(Qi,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});iu=class iu extends ar{constructor(e){super(e,{code:iu.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}};Object.defineProperty(iu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});su=class su extends ar{constructor(e){super(e,{code:su.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}};Object.defineProperty(su,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});au=class au extends ar{constructor(e){super(e,{code:au.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}};Object.defineProperty(au,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});cu=class cu extends ar{constructor(e){super(e,{code:cu.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}};Object.defineProperty(cu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});uu=class uu extends ar{constructor(e){super(e,{code:uu.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}};Object.defineProperty(uu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});es=class es extends ar{constructor(e){super(e,{code:es.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}};Object.defineProperty(es,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});lu=class lu extends ar{constructor(e){super(e,{code:lu.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}};Object.defineProperty(lu,"code",{enumerable:!0,configurable:!0,writable:!0,value:7000});aT=class aT extends sr{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}});function fu(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function fT(e){if(!fu(e))throw Error("Uint8Array expected")}function du(e,t){if(typeof t!=="boolean")throw Error(e+" boolean expected, got "+t)}function pf(e){let t=e.toString(16);return t.length&1?"0"+t:t}function PR(e){if(typeof e!=="string")throw Error("hex string expected, got "+typeof e);return e===""?pT:BigInt("0x"+e)}function mu(e){if(fT(e),_R)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=vte[e[r]];return t}function kR(e){if(e>=li._0&&e<=li._9)return e-li._0;if(e>=li.A&&e<=li.F)return e-(li.A-10);if(e>=li.a&&e<=li.f)return e-(li.a-10);return}function ff(e){if(typeof e!=="string")throw Error("hex string expected, got "+typeof e);if(_R)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){let s=kR(e.charCodeAt(i)),a=kR(e.charCodeAt(i+1));if(s===void 0||a===void 0){let c=e[i]+e[i+1];throw Error('hex string expected, got non-hex character "'+c+'" at index '+i)}n[o]=s*16+a}return n}function pi(e){return PR(mu(e))}function dT(e){return fT(e),PR(mu(Uint8Array.from(e).reverse()))}function ya(e,t){return ff(e.toString(16).padStart(t*2,"0"))}function mT(e,t){return ya(e,t).reverse()}function Sr(e,t,r){let n;if(typeof t==="string")try{n=ff(t)}catch(i){throw Error(e+" must be hex string or Uint8Array, cause: "+i)}else if(fu(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let o=n.length;if(typeof r==="number"&&o!==r)throw Error(e+" of length "+r+" expected, got "+o);return n}function df(...e){let t=0;for(let n=0;n<e.length;n++){let o=e[n];fT(o),t+=o.length}let r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){let i=e[n];r.set(i,o),o+=i.length}return r}function qy(e,t,r){return cT(e)&&cT(t)&&cT(r)&&t<=e&&e<r}function ga(e,t,r,n){if(!qy(t,r,n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function BR(e){let t;for(t=0;e>pT;e>>=lT,t+=1);return t}function NR(e,t,r){if(typeof e!=="number"||e<2)throw Error("hashLen must be a number");if(typeof t!=="number"||t<2)throw Error("qByteLen must be a number");if(typeof r!=="function")throw Error("hmacFn must be a function");let n=uT(e),o=uT(e),i=0,s=()=>{n.fill(1),o.fill(0),i=0},a=(...p)=>r(o,n,...p),c=(p=uT(0))=>{if(o=a(RR([0]),p),n=a(),p.length===0)return;o=a(RR([1]),p),n=a()},u=()=>{if(i++>=1000)throw Error("drbg: tried 1000 values");let p=0,f=[];while(p<t){n=a();let d=n.slice();f.push(d),p+=n.length}return df(...f)};return(p,f)=>{s(),c(p);let d=void 0;while(!(d=f(u())))c();return s(),d}}function xa(e,t,r={}){let n=(o,i,s)=>{let a=Ste[i];if(typeof a!=="function")throw Error("invalid validator function");let c=e[o];if(s&&c===void 0)return;if(!a(c,e))throw Error("param "+String(o)+" is invalid. Expected "+i+", got "+c)};for(let[o,i]of Object.entries(t))n(o,i,!1);for(let[o,i]of Object.entries(r))n(o,i,!0);return e}function hT(e){let t=new WeakMap;return(r,...n)=>{let o=t.get(r);if(o!==void 0)return o;let i=e(r,...n);return t.set(r,i),i}}var pT,lT,_R,vte,li,cT=(e)=>typeof e==="bigint"&&pT<=e,ba=(e)=>(lT<<BigInt(e))-lT,uT=(e)=>new Uint8Array(e),RR=(e)=>Uint8Array.from(e),Ste;var zy=H(()=>{/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */pT=BigInt(0),lT=BigInt(1);_R=typeof Uint8Array.from([]).toHex==="function"&&typeof Uint8Array.fromHex==="function",vte=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));li={_0:48,_9:57,A:65,F:70,a:97,f:102};Ste={bigint:(e)=>typeof e==="bigint",function:(e)=>typeof e==="function",boolean:(e)=>typeof e==="boolean",string:(e)=>typeof e==="string",stringOrUint8Array:(e)=>typeof e==="string"||fu(e),isSafeInteger:(e)=>Number.isSafeInteger(e),array:(e)=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:(e)=>typeof e==="function"&&Number.isSafeInteger(e.outputLen)}});var FR="0.1.1";function MR(){return FR}var LR=()=>{};function $R(e,t){if(t?.(e))return e;if(e&&typeof e==="object"&&"cause"in e&&e.cause)return $R(e.cause,t);return t?null:e}var Q;var rn=H(()=>{LR();Q=class Q extends Error{static setStaticOptions(e){Q.prototype.docsOrigin=e.docsOrigin,Q.prototype.showVersion=e.showVersion,Q.prototype.version=e.version}constructor(e,t={}){let r=(()=>{if(t.cause instanceof Q){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}if(t.cause&&"details"in t.cause&&typeof t.cause.details==="string")return t.cause.details;if(t.cause?.message)return t.cause.message;return t.details})(),n=(()=>{if(t.cause instanceof Q)return t.cause.docsPath||t.docsPath;return t.docsPath})(),o=t.docsOrigin??Q.prototype.docsOrigin,i=`${o}${n??""}`,s=Boolean(t.version??Q.prototype.showVersion),a=t.version??Q.prototype.version,c=[e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...r||n||s?["",r?`Details: ${r}`:void 0,n?`See: ${i}`:void 0,s?`Version: ${a}`:void 0]:[]].filter((u)=>typeof u==="string").join(`
44
+ `);super(c,t.cause?{cause:t.cause}:void 0);Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=t.cause,this.details=r,this.docs=i,this.docsOrigin=o,this.docsPath=n,this.shortMessage=e,this.showVersion=s,this.version=a}walk(e){return $R(this,e)}};Object.defineProperty(Q,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${MR()}`}});(()=>{Q.setStaticOptions(Q.defaultStaticOptions)})()});function hu(e,t){if(nn(e)>t)throw new bT({givenSize:nn(e),maxSize:t})}function UR(e,t){if(typeof t==="number"&&t>0&&t>nn(e)-1)throw new Gy({offset:t,position:"start",size:nn(e)})}function HR(e,t,r){if(typeof t==="number"&&typeof r==="number"&&nn(e)!==r-t)throw new Gy({offset:r,position:"end",size:nn(e)})}function yT(e){if(e>=fi.zero&&e<=fi.nine)return e-fi.zero;if(e>=fi.A&&e<=fi.F)return e-(fi.A-10);if(e>=fi.a&&e<=fi.f)return e-(fi.a-10);return}function jR(e,t={}){let{dir:r,size:n=32}=t;if(n===0)return e;if(e.length>n)throw new xT({size:e.length,targetSize:n,type:"Bytes"});let o=new Uint8Array(n);for(let i=0;i<n;i++){let s=r==="right";o[s?i:n-i-1]=e[s?i:e.length-i-1]}return o}function gT(e,t={}){let{dir:r="left"}=t,n=e,o=0;for(let i=0;i<n.length-1;i++)if(n[r==="left"?i:n.length-i-1].toString()==="0")o++;else break;return n=r==="left"?n.slice(o):n.slice(0,n.length-o),n}var fi;var qR=H(()=>{yu();fi={zero:48,nine:57,A:65,F:70,a:97,f:102}});function gu(e,t){if(ut(e)>t)throw new ET({givenSize:ut(e),maxSize:t})}function zR(e,t){if(typeof t==="number"&&t>0&&t>ut(e)-1)throw new Vy({offset:t,position:"start",size:ut(e)})}function GR(e,t,r){if(typeof t==="number"&&typeof r==="number"&&ut(e)!==r-t)throw new Vy({offset:r,position:"end",size:ut(e)})}function wT(e,t={}){let{dir:r,size:n=32}=t;if(n===0)return e;let o=e.replace("0x","");if(o.length>n*2)throw new vT({size:Math.ceil(o.length/2),targetSize:n,type:"Hex"});return`0x${o[r==="right"?"padEnd":"padStart"](n*2,"0")}`}var TT=H(()=>{Ar()});function Wy(e,t,r){return JSON.stringify(e,(n,o)=>{if(typeof t==="function")return t(n,o);if(typeof o==="bigint")return o.toString()+"#__bigint";return o},r)}function KR(e){if(e instanceof Uint8Array)return e;if(typeof e==="string")return ST(e);return Ite(e)}function Ite(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function ST(e,t={}){let{size:r}=t,n=e;if(r)gu(e,r),n=To(e,r);let o=n.slice(2);if(o.length%2)o=`0${o}`;let i=o.length/2,s=new Uint8Array(i);for(let a=0,c=0;a<i;a++){let u=yT(o.charCodeAt(c++)),l=yT(o.charCodeAt(c++));if(u===void 0||l===void 0)throw new Q(`Invalid byte sequence ("${o[c-2]}${o[c-1]}" in "${o}").`);s[a]=u<<4|l}return s}function YR(e,t={}){let{size:r}=t,n=Dte.encode(e);if(typeof r==="number")return hu(n,r),Ote(n,r);return n}function Ote(e,t){return jR(e,{dir:"right",size:t})}function nn(e){return e.length}function ZR(e,t,r,n={}){let{strict:o}=n;UR(e,t);let i=e.slice(t,r);if(o)HR(i,t,r);return i}function JR(e,t={}){let{size:r}=t;if(typeof r<"u")hu(e,r);let n=Vt(e,t);return CT(n,t)}function XR(e,t={}){let{size:r}=t,n=e;if(typeof r<"u")hu(n,r),n=AT(n);if(n.length>1||n[0]>1)throw new eP(n);return Boolean(n[0])}function wo(e,t={}){let{size:r}=t;if(typeof r<"u")hu(e,r);let n=Vt(e,t);return Ky(n,t)}function QR(e,t={}){let{size:r}=t,n=e;if(typeof r<"u")hu(n,r),n=kte(n);return Cte.decode(n)}function AT(e){return gT(e,{dir:"left"})}function kte(e){return gT(e,{dir:"right"})}var Cte,Dte,eP,bT,Gy,xT;var yu=H(()=>{rn();Ar();qR();TT();Cte=new TextDecoder,Dte=new TextEncoder;eP=class eP extends Q{constructor(e){super(`Bytes value \`${e}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}};bT=class bT extends Q{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}};Gy=class Gy extends Q{constructor({offset:e,position:t,size:r}){super(`Slice ${t==="start"?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}};xT=class xT extends Q{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}});function _te(e,t={}){let{strict:r=!1}=t;if(!e)throw new DT(e);if(typeof e!=="string")throw new DT(e);if(r){if(!/^0x[0-9a-fA-F]*$/.test(e))throw new IT(e)}if(!e.startsWith("0x"))throw new IT(e)}function At(...e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}function tP(e){if(e instanceof Uint8Array)return Vt(e);if(Array.isArray(e))return Vt(new Uint8Array(e));return e}function Yy(e,t={}){let r=`0x${Number(e)}`;if(typeof t.size==="number")return gu(r,t.size),di(r,t.size);return r}function Vt(e,t={}){let r="";for(let o=0;o<e.length;o++)r+=Pte[e[o]];let n=`0x${r}`;if(typeof t.size==="number")return gu(n,t.size),To(n,t.size);return n}function rt(e,t={}){let{signed:r,size:n}=t,o=BigInt(e),i;if(n)if(r)i=(1n<<BigInt(n)*8n-1n)-1n;else i=2n**(BigInt(n)*8n)-1n;else if(typeof e==="number")i=BigInt(Number.MAX_SAFE_INTEGER);let s=typeof i==="bigint"&&r?-i-1n:0;if(i&&o>i||o<s){let u=typeof e==="bigint"?"n":"";throw new Zy({max:i?`${i}${u}`:void 0,min:`${s}${u}`,signed:r,size:n,value:`${e}${u}`})}let c=`0x${(r&&o<0?BigInt.asUintN(n*8,BigInt(o)):o).toString(16)}`;if(n)return di(c,n);return c}function bu(e,t={}){return Vt(Rte.encode(e),t)}function di(e,t){return wT(e,{dir:"left",size:t})}function To(e,t){return wT(e,{dir:"right",size:t})}function Wt(e,t,r,n={}){let{strict:o}=n;zR(e,t);let i=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;if(o)GR(i,t,r);return i}function ut(e){return Math.ceil((e.length-2)/2)}function CT(e,t={}){let{signed:r}=t;if(t.size)gu(e,t.size);let n=BigInt(e);if(!r)return n;let o=(e.length-2)/2,i=(1n<<BigInt(o)*8n)-1n,s=i>>1n;if(n<=s)return n;return n-i-1n}function Ky(e,t={}){let{signed:r,size:n}=t;if(!r&&!n)return Number(e);return Number(CT(e,t))}function OT(e,t={}){let{strict:r=!1}=t;try{return _te(e,{strict:r}),!0}catch{return!1}}var Rte,Pte,Zy,DT,IT,ET,Vy,vT;var Ar=H(()=>{rn();TT();Rte=new TextEncoder,Pte=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));Zy=class Zy extends Q{constructor({max:e,min:t,signed:r,size:n,value:o}){super(`Number \`${o}\` is not in safe${n?` ${n*8}-bit`:""}${r?" signed":" unsigned"} integer range ${e?`(\`${t}\` to \`${e}\`)`:`(above \`${t}\`)`}`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}};DT=class DT extends Q{constructor(e){super(`Value \`${typeof e==="object"?Wy(e):e}\` of type \`${typeof e}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}};IT=class IT extends Q{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}};ET=class ET extends Q{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}};Vy=class Vy extends Q{constructor({offset:e,position:t,size:r}){super(`Slice ${t==="start"?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}};vT=class vT extends Q{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}});function rP(e){return{address:e.address,amount:rt(e.amount),index:rt(e.index),validatorIndex:rt(e.validatorIndex)}}var nP=H(()=>{Ar()});function Jy(e){return{...typeof e.baseFeePerGas==="bigint"&&{baseFeePerGas:rt(e.baseFeePerGas)},...typeof e.blobBaseFee==="bigint"&&{blobBaseFee:rt(e.blobBaseFee)},...typeof e.feeRecipient==="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit==="bigint"&&{gasLimit:rt(e.gasLimit)},...typeof e.number==="bigint"&&{number:rt(e.number)},...typeof e.prevRandao==="bigint"&&{prevRandao:rt(e.prevRandao)},...typeof e.time==="bigint"&&{time:rt(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(rP)}}}var kT=H(()=>{Ar();nP()});var iP="0x82ad56cb";var Xy="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",sP="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",aP="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",wa="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";function Ta(e){let{abi:t,args:r,bytecode:n}=e;if(!r||r.length===0)return n;let o=t.find((s)=>("type"in s)&&s.type==="constructor");if(!o)throw new p2({docsPath:RT});if(!("inputs"in o))throw new dy({docsPath:RT});if(!o.inputs||o.inputs.length===0)throw new dy({docsPath:RT});let i=ct(o.inputs,r);return He([n,i])}var RT="/docs/contract/encodeDeployData";var Qy=H(()=>{et();ho()});function Ne(e,t){if(!J(e,{strict:!1}))throw new Me({address:e});if(!J(t,{strict:!1}))throw new Me({address:t});return e.toLowerCase()===t.toLowerCase()}var Eo=H(()=>{In();or()});function cr(e){let{blockHash:t,blockNumber:r,blockTag:n,requireCanonical:o}=e;if(o!==void 0&&!t)throw new B("`requireCanonical` can only be provided when `blockHash` is set.");if(t)return o?{blockHash:t,requireCanonical:o}:{blockHash:t};if(typeof r==="bigint")return M(r);return n??"latest"}var ts=H(()=>{se();X()});var vo,Nn,hf,yf,gf,bf,xf,wf,Tf,Ef,mi,Fn;var hi=H(()=>{Uc();se();vo=class vo extends B{constructor({cause:e,message:t}={}){let r=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}};Object.defineProperty(vo,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(vo,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});Nn=class Nn extends B{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${gt(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}};Object.defineProperty(Nn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});hf=class hf extends B{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${gt(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}};Object.defineProperty(hf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});yf=class yf extends B{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}};Object.defineProperty(yf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});gf=class gf extends B{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
45
+ `),{cause:e,name:"NonceTooLowError"})}};Object.defineProperty(gf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});bf=class bf extends B{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}};Object.defineProperty(bf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});xf=class xf extends B{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
46
+ `),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}};Object.defineProperty(xf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});wf=class wf extends B{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}};Object.defineProperty(wf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});Tf=class Tf extends B{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}};Object.defineProperty(Tf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});Ef=class Ef extends B{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}};Object.defineProperty(Ef,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});mi=class mi extends B{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${gt(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${gt(r)} gwei`:""}).`].join(`
47
+ `),{cause:e,name:"TipAboveFeeCapError"})}};Object.defineProperty(mi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});Fn=class Fn extends B{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}});function rs(e,t){let r=(e.details||"").toLowerCase(),n=e instanceof B?e.walk((o)=>o?.code===vo.code):e;if(n instanceof B)return new vo({cause:e,message:n.details});if(vo.nodeMessage.test(r))return new vo({cause:e,message:e.details});if(Nn.nodeMessage.test(r))return new Nn({cause:e,maxFeePerGas:t?.maxFeePerGas});if(hf.nodeMessage.test(r))return new hf({cause:e,maxFeePerGas:t?.maxFeePerGas});if(yf.nodeMessage.test(r))return new yf({cause:e,nonce:t?.nonce});if(gf.nodeMessage.test(r))return new gf({cause:e,nonce:t?.nonce});if(bf.nodeMessage.test(r))return new bf({cause:e,nonce:t?.nonce});if(xf.nodeMessage.test(r))return new xf({cause:e});if(wf.nodeMessage.test(r))return new wf({cause:e,gas:t?.gas});if(Tf.nodeMessage.test(r))return new Tf({cause:e,gas:t?.gas});if(Ef.nodeMessage.test(r))return new Ef({cause:e});if(mi.nodeMessage.test(r))return new mi({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas});return new Fn({cause:e})}var vf=H(()=>{se();hi()});function e0(e,{docsPath:t,...r}){let n=(()=>{let o=rs(e,r);if(o instanceof Fn)return e;return o})();return new Ji(n,{docsPath:t,...r})}var PT=H(()=>{xo();hi();vf()});function Cr(e,{format:t}){if(!t)return{};let r={};function n(i){let s=Object.keys(i);for(let a of s){if(a in e)r[a]=e[a];if(i[a]&&typeof i[a]==="object"&&!Array.isArray(i[a]))n(i[a])}}let o=t(e||{});return n(o),r}function Ct(e,t){let r={};if(typeof e.authorizationList<"u")r.authorizationList=Fte(e.authorizationList);if(typeof e.accessList<"u")r.accessList=e.accessList;if(typeof e.blobVersionedHashes<"u")r.blobVersionedHashes=e.blobVersionedHashes;if(typeof e.blobs<"u")if(typeof e.blobs[0]!=="string")r.blobs=e.blobs.map((n)=>be(n));else r.blobs=e.blobs;if(typeof e.data<"u")r.data=e.data;if(e.account)r.from=e.account.address;if(typeof e.from<"u")r.from=e.from;if(typeof e.gas<"u")r.gas=M(e.gas);if(typeof e.gasPrice<"u")r.gasPrice=M(e.gasPrice);if(typeof e.maxFeePerBlobGas<"u")r.maxFeePerBlobGas=M(e.maxFeePerBlobGas);if(typeof e.maxFeePerGas<"u")r.maxFeePerGas=M(e.maxFeePerGas);if(typeof e.maxPriorityFeePerGas<"u")r.maxPriorityFeePerGas=M(e.maxPriorityFeePerGas);if(typeof e.nonce<"u")r.nonce=M(e.nonce);if(typeof e.to<"u")r.to=e.to;if(typeof e.type<"u")r.type=Nte[e.type];if(typeof e.value<"u")r.value=M(e.value);return r}function Fte(e){return e.map((t)=>({address:t.address,r:t.r?M(BigInt(t.r)):t.r,s:t.s?M(BigInt(t.s)):t.s,chainId:M(t.chainId),nonce:M(t.nonce),...typeof t.yParity<"u"?{yParity:M(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:M(t.v)}:{}}))}var Nte;var So=H(()=>{X();Nte={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"}});function xu(){let e=()=>{return},t=()=>{return};return{promise:new Promise((n,o)=>{e=n,t=o}),resolve:e,reject:t}}function wu({fn:e,id:t,shouldSplitBatch:r,wait:n=0,sort:o}){let i=async()=>{let l=c();s();let p=l.map(({args:f})=>f);if(p.length===0)return;e(p).then((f)=>{if(o&&Array.isArray(f))f.sort(o);for(let d=0;d<l.length;d++){let{resolve:h}=l[d];h?.([f[d],f])}}).catch((f)=>{for(let d=0;d<l.length;d++){let{reject:h}=l[d];h?.(f)}})},s=()=>_T.delete(t),a=()=>c().map(({args:l})=>l),c=()=>_T.get(t)||[],u=(l)=>_T.set(t,[...c(),l]);return{flush:s,async schedule(l){let{promise:p,resolve:f,reject:d}=xu();if(r?.([...a(),l]))i();if(c().length>0)return u({args:l,resolve:f,reject:d}),p;return u({args:l,resolve:f,reject:d}),setTimeout(i,n),p}}}var _T;var t0=H(()=>{_T=new Map});function cP(e){if(!e||e.length===0)return;return e.reduce((t,{slot:r,value:n})=>{if(r.length!==66)throw new by({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new by({size:n.length,targetSize:66,type:"hex"});return t[r]=n,t},{})}function Mte(e){let{balance:t,nonce:r,state:n,stateDiff:o,code:i}=e,s={};if(i!==void 0)s.code=i;if(t!==void 0)s.balance=M(t);if(r!==void 0)s.nonce=M(r);if(n!==void 0)s.state=cP(n);if(o!==void 0){if(s.state)throw new Z2;s.stateDiff=cP(o)}return s}function Tu(e){if(!e)return;let t={};for(let{address:r,...n}of e){if(!J(r,{strict:!1}))throw new Me({address:r});if(t[r])throw new Y2({address:r});t[r]=Mte(n)}return t}var r0=H(()=>{In();xy();J2();or();X()});var IMe,OMe,kMe,RMe,PMe,_Me,BMe,NMe,FMe,MMe,LMe,$Me,UMe,HMe,jMe,qMe,zMe,GMe,VMe,WMe,KMe,YMe,ZMe,JMe,XMe,QMe,e9e,t9e,r9e,n9e,o9e,i9e,s9e,a9e,c9e,u9e,l9e,p9e,f9e,d9e,m9e,h9e,y9e,g9e,b9e,x9e,w9e,T9e,E9e,v9e,S9e,A9e,C9e,D9e,I9e,O9e,k9e,R9e,P9e,_9e,B9e,N9e,F9e,M9e,L9e,$9e,U9e,H9e,j9e,q9e,z9e,G9e,V9e,W9e,K9e,Y9e,Z9e,J9e,X9e,Q9e,eLe,tLe,rLe,nLe,oLe,iLe,sLe,aLe,cLe,uLe,lLe,pLe,fLe,dLe,mLe,Eu;var BT=H(()=>{IMe=2n**(8n-1n)-1n,OMe=2n**(16n-1n)-1n,kMe=2n**(24n-1n)-1n,RMe=2n**(32n-1n)-1n,PMe=2n**(40n-1n)-1n,_Me=2n**(48n-1n)-1n,BMe=2n**(56n-1n)-1n,NMe=2n**(64n-1n)-1n,FMe=2n**(72n-1n)-1n,MMe=2n**(80n-1n)-1n,LMe=2n**(88n-1n)-1n,$Me=2n**(96n-1n)-1n,UMe=2n**(104n-1n)-1n,HMe=2n**(112n-1n)-1n,jMe=2n**(120n-1n)-1n,qMe=2n**(128n-1n)-1n,zMe=2n**(136n-1n)-1n,GMe=2n**(144n-1n)-1n,VMe=2n**(152n-1n)-1n,WMe=2n**(160n-1n)-1n,KMe=2n**(168n-1n)-1n,YMe=2n**(176n-1n)-1n,ZMe=2n**(184n-1n)-1n,JMe=2n**(192n-1n)-1n,XMe=2n**(200n-1n)-1n,QMe=2n**(208n-1n)-1n,e9e=2n**(216n-1n)-1n,t9e=2n**(224n-1n)-1n,r9e=2n**(232n-1n)-1n,n9e=2n**(240n-1n)-1n,o9e=2n**(248n-1n)-1n,i9e=2n**(256n-1n)-1n,s9e=-(2n**(8n-1n)),a9e=-(2n**(16n-1n)),c9e=-(2n**(24n-1n)),u9e=-(2n**(32n-1n)),l9e=-(2n**(40n-1n)),p9e=-(2n**(48n-1n)),f9e=-(2n**(56n-1n)),d9e=-(2n**(64n-1n)),m9e=-(2n**(72n-1n)),h9e=-(2n**(80n-1n)),y9e=-(2n**(88n-1n)),g9e=-(2n**(96n-1n)),b9e=-(2n**(104n-1n)),x9e=-(2n**(112n-1n)),w9e=-(2n**(120n-1n)),T9e=-(2n**(128n-1n)),E9e=-(2n**(136n-1n)),v9e=-(2n**(144n-1n)),S9e=-(2n**(152n-1n)),A9e=-(2n**(160n-1n)),C9e=-(2n**(168n-1n)),D9e=-(2n**(176n-1n)),I9e=-(2n**(184n-1n)),O9e=-(2n**(192n-1n)),k9e=-(2n**(200n-1n)),R9e=-(2n**(208n-1n)),P9e=-(2n**(216n-1n)),_9e=-(2n**(224n-1n)),B9e=-(2n**(232n-1n)),N9e=-(2n**(240n-1n)),F9e=-(2n**(248n-1n)),M9e=-(2n**(256n-1n)),L9e=2n**8n-1n,$9e=2n**16n-1n,U9e=2n**24n-1n,H9e=2n**32n-1n,j9e=2n**40n-1n,q9e=2n**48n-1n,z9e=2n**56n-1n,G9e=2n**64n-1n,V9e=2n**72n-1n,W9e=2n**80n-1n,K9e=2n**88n-1n,Y9e=2n**96n-1n,Z9e=2n**104n-1n,J9e=2n**112n-1n,X9e=2n**120n-1n,Q9e=2n**128n-1n,eLe=2n**136n-1n,tLe=2n**144n-1n,rLe=2n**152n-1n,nLe=2n**160n-1n,oLe=2n**168n-1n,iLe=2n**176n-1n,sLe=2n**184n-1n,aLe=2n**192n-1n,cLe=2n**200n-1n,uLe=2n**208n-1n,lLe=2n**216n-1n,pLe=2n**224n-1n,fLe=2n**232n-1n,dLe=2n**240n-1n,mLe=2n**248n-1n,Eu=2n**256n-1n});function Dt(e){let{account:t,maxFeePerGas:r,maxPriorityFeePerGas:n,to:o}=e,i=t?ee(t):void 0;if(i&&!J(i.address))throw new Me({address:i.address});if(o&&!J(o))throw new Me({address:o});if(r&&r>Eu)throw new Nn({maxFeePerGas:r});if(n&&r&&n>r)throw new mi({maxFeePerGas:r,maxPriorityFeePerGas:n})}var Ao=H(()=>{BT();In();hi();or()});var NT,FT,MT;var uP=H(()=>{se();NT=class NT extends B{constructor({callbackSelector:e,cause:t,data:r,extraData:n,sender:o,urls:i}){super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],t.metaMessages?.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map((s)=>` ${pa(s)}`)],` Sender: ${o}`,` Data: ${r}`,` Callback selector: ${e}`,` Extra data: ${n}`].flat(),name:"OffchainLookupError"})}};FT=class FT extends B{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${pa(t)}`,`Response: ${ue(e)}`],name:"OffchainLookupResponseMalformedError"})}};MT=class MT extends B{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`],name:"OffchainLookupSenderMismatchError"})}}});async function pP(e,{blockNumber:t,blockTag:r,data:n,requestOptions:o,to:i}){let{args:s}=By({data:n,abi:[Lte]}),[a,c,u,l,p]=s,{ccipRead:f}=e,d=f&&typeof f?.request==="function"?f.request:$te;try{if(!Ne(i,a))throw new MT({sender:a,to:i});let h=c.includes(ci)?await sT({data:u,ccipRequest:(y)=>d({...y,requestOptions:o})}):await d({data:u,requestOptions:o,sender:a,urls:c}),{data:m}=await Dr(e,{blockNumber:t,blockTag:r,data:yt([l,ct([{type:"bytes"},{type:"bytes"}],[h,p])]),requestOptions:o,to:i});return m}catch(h){if(o?.signal?.aborted)throw Ft(o.signal);if(vr(h))throw h;throw new NT({callbackSelector:l,cause:h,data:n,extraData:p,sender:a,urls:c})}}async function $te({data:e,requestOptions:t,sender:r,urls:n}){let o=Error("An unknown error occurred.");for(let i=0;i<n.length;i++){if(t?.signal?.aborted)throw Ft(t.signal);let s=n[i],a=s.includes("{data}")?"GET":"POST",c=a==="POST"?{data:e,sender:r}:void 0,u=a==="POST"?{"Content-Type":"application/json"}:{};try{let l=await fetch(s.replace("{sender}",r.toLowerCase()).replace("{data}",e),{body:JSON.stringify(c),headers:u,method:a,...t?.signal?{signal:t.signal}:{}}),p;if(l.headers.get("Content-Type")?.startsWith("application/json"))p=(await l.json()).data;else p=await l.text();if(!l.ok){o=new _n({body:c,details:p?.error?ue(p.error):l.statusText,headers:l.headers,status:l.status,url:s});continue}if(!oe(p)){o=new FT({result:p,url:s});continue}return p}catch(l){if(t?.signal?.aborted)throw Ft(t.signal);if(vr(l))throw l;o=new _n({body:c,details:l.message,url:s})}}throw o}var lP="0x556f1830",Lte;var fP=H(()=>{ns();uP();da();V2();ho();Eo();uf();Lte={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]}});async function Dr(e,t){let{account:r=e.account,authorizationList:n,batch:o=Boolean(e.batch?.multicall),blockHash:i,blockNumber:s,blockTag:a=e.experimental_blockTag??"latest",requireCanonical:c,accessList:u,blobs:l,blockOverrides:p,code:f,data:d,factory:h,factoryData:m,gas:y,gasPrice:g,maxFeePerBlobGas:x,maxFeePerGas:b,maxPriorityFeePerGas:w,nonce:v,requestOptions:D,to:O,value:T,stateOverride:A,...E}=t,R=r?ee(r):void 0;if(f&&(h||m))throw new B("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(f&&O)throw new B("Cannot provide both `code` & `to` as parameters.");let S=f&&d,k=h&&m&&O&&d,I=S||k,C=(()=>{if(S)return hP({code:f,data:d});if(k)return Gte({data:d,factory:h,factoryData:m,to:O});return d})();try{Dt(t);let P=cr({blockHash:i,blockNumber:s,blockTag:a,requireCanonical:c}),N=p?Jy(p):void 0,L=Tu(A),F=e.chain?.formatters?.transactionRequest?.format,V=(F||Ct)({...Cr(E,{format:F}),accessList:u,account:R,authorizationList:n,blobs:l,data:C,gas:y,gasPrice:g,maxFeePerBlobGas:x,maxFeePerGas:b,maxPriorityFeePerGas:w,nonce:v,to:I?void 0:O,value:T},"call");if(o&&Ute({request:V})&&!N&&i===void 0)try{let{deployless:G=!1}=typeof e.batch?.multicall==="object"?e.batch.multicall:{},Y=mP(e,{blockNumber:s,deployless:G});if(!Y||!zte(L,Y))return await qte(e,{...V,blockHash:i,blockNumber:s,blockTag:a,multicallAddress:Y,requestOptions:D,requireCanonical:c,rpcStateOverride:L})}catch(G){if(!(G instanceof Ry)&&!(G instanceof Mc))throw G}let z=(()=>{let G=[V,P];if(L&&N)return[...G,L,N];if(L)return[...G,L];if(N)return[...G,{},N];return G})(),te=await e.request({method:"eth_call",params:z},D);if(te==="0x")return{data:void 0};return{data:te}}catch(P){if(D?.signal?.aborted)throw Ft(D.signal);if(vr(P))throw P;let N=Vte(P);await Promise.resolve().then(() => fP());if(e.ccipRead!==!1&&N?.slice(0,10)===lP&&O)return{data:await pP(e,{data:N,requestOptions:D,to:O})};if(I&&N?.slice(0,10)==="0x101bb98d")throw new Uy({factory:h});throw e0(P,{...t,account:R,chain:e.chain})}}function Ute({request:e}){let{data:t,to:r,...n}=e;if(!t)return!1;if(t.startsWith(iP))return!1;if(!r)return!1;if(Object.values(n).filter((o)=>typeof o<"u").length>0)return!1;return!0}function jte(e){if(!e)return"default";let t=dP.get(e);if(t!==void 0)return t;let r=Hte++;return dP.set(e,r),r}async function qte(e,t){let{batchSize:r=1024,deployless:n=!1,wait:o=0}=typeof e.batch?.multicall==="object"?e.batch.multicall:{},{blockHash:i,blockNumber:s,blockTag:a=e.experimental_blockTag??"latest",requireCanonical:c,data:u,multicallAddress:l,requestOptions:p,rpcStateOverride:f,to:d}=t,h=l!==void 0?l:mP(e,{blockNumber:s,deployless:n}),m=cr({blockHash:i,blockNumber:s,blockTag:a,requireCanonical:c}),y=typeof m==="string"?m:JSON.stringify(m),g=f?`.${JSON.stringify(f)}`:"",{schedule:x}=wu({id:`${e.uid}.${y}.${jte(p)}${g}`,wait:o,shouldSplitBatch(v){return v.reduce((O,{data:T})=>O+(T.length-2),0)>r*2},fn:async(v)=>{let D=v.map((E)=>({allowFailure:!0,callData:E.data,target:E.to})),O=Be({abi:Jr,args:[D],functionName:"aggregate3"}),T={...h===null?{data:hP({code:wa,data:O})}:{to:h,data:O}},A=await e.request({method:"eth_call",params:f?[T,m,f]:[T,m]},p);return Gt({abi:Jr,args:[D],functionName:"aggregate3",data:A||"0x"})}}),[{returnData:b,success:w}]=await x({data:u,to:d});if(!w)throw new bo({data:b});if(b==="0x")return{data:void 0};return{data:b}}function mP(e,t){let{blockNumber:r,deployless:n}=t;if(n)return null;if(e.chain)return en({blockNumber:r,chain:e.chain,contract:"multicall3"});throw new Ry}function zte(e,t){if(!e)return!1;return Object.keys(e).some((r)=>Ne(r,t))}function hP(e){let{code:t,data:r}=e;return Ta({abi:Lp(["constructor(bytes, bytes)"]),bytecode:Xy,args:[t,r]})}function Gte(e){let{data:t,factory:r,factoryData:n,to:o}=e;return Ta({abi:Lp(["constructor(address, bytes, address, bytes)"]),bytecode:sP,args:[o,t,r,n]})}function Vte(e){if(!(e instanceof B))return;let t=e.walk();return typeof t?.data==="object"?t.data?.data:t.data}var Hte=0,dP;var ns=H(()=>{iy();kT();_t();se();of();xo();ai();Qy();Er();Eo();ts();ca();PT();So();t0();r0();Ao();dP=new WeakMap});function ere(e,t,r,n){if(typeof e.setBigUint64==="function")return e.setBigUint64(t,r,n);let o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),a=Number(r&i),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}function qT(e,t,r){return e&t^~e&r}function zT(e,t,r){return e&t^e&r^t&r}var vu,yi,Mt;var GT=H(()=>{Fr();vu=class vu extends Ki{constructor(e,t,r,n){super();this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=po(this.buffer)}update(e){ni(this),e=ia(e),tt(e);let{view:t,buffer:r,blockLen:n}=this,o=e.length;for(let i=0;i<o;){let s=Math.min(n-this.pos,o-i);if(s===n){let a=po(e);for(;n<=o-i;i+=n)this.process(a,i);continue}if(r.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===n)this.process(t,0),this.pos=0}return this.length+=e.length,this.roundClean(),this}digestInto(e){ni(this),vy(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:o}=this,{pos:i}=this;if(t[i++]=128,Nt(this.buffer.subarray(i)),this.padOffset>n-i)this.process(r,0),i=0;for(let l=i;l<n;l++)t[l]=0;ere(r,n-8,BigInt(this.length*8),o),this.process(r,0);let s=po(e),a=this.outputLen;if(a%4)throw Error("_sha2: outputLen should be aligned to 32bit");let c=a/4,u=this.get();if(c>u.length)throw Error("_sha2: outputLen bigger than state");for(let l=0;l<c;l++)s.setUint32(4*l,u[l],o)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:o,destroyed:i,pos:s}=this;if(e.destroyed=i,e.finished=o,e.length=n,e.pos=s,n%t)e.buffer.set(r);return e}clone(){return this._cloneInto()}};yi=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Mt=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])});var tre,is,VT,OP,rre,nre,ss,as,kP,Do,Af;var Su=H(()=>{GT();D2();Fr();tre=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),is=new Uint32Array(64);VT=class VT extends vu{constructor(e=32){super(64,e,8,!1);this.A=yi[0]|0,this.B=yi[1]|0,this.C=yi[2]|0,this.D=yi[3]|0,this.E=yi[4]|0,this.F=yi[5]|0,this.G=yi[6]|0,this.H=yi[7]|0}get(){let{A:e,B:t,C:r,D:n,E:o,F:i,G:s,H:a}=this;return[e,t,r,n,o,i,s,a]}set(e,t,r,n,o,i,s,a){this.A=e|0,this.B=t|0,this.C=r|0,this.D=n|0,this.E=o|0,this.F=i|0,this.G=s|0,this.H=a|0}process(e,t){for(let l=0;l<16;l++,t+=4)is[l]=e.getUint32(t,!1);for(let l=16;l<64;l++){let p=is[l-15],f=is[l-2],d=kn(p,7)^kn(p,18)^p>>>3,h=kn(f,17)^kn(f,19)^f>>>10;is[l]=h+is[l-7]+d+is[l-16]|0}let{A:r,B:n,C:o,D:i,E:s,F:a,G:c,H:u}=this;for(let l=0;l<64;l++){let p=kn(s,6)^kn(s,11)^kn(s,25),f=u+p+qT(s,a,c)+tre[l]+is[l]|0,h=(kn(r,2)^kn(r,13)^kn(r,22))+zT(r,n,o)|0;u=c,c=a,a=s,s=i+f|0,i=o,o=n,n=r,r=f+h|0}r=r+this.A|0,n=n+this.B|0,o=o+this.C|0,i=i+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,o,i,s,a,c,u)}roundClean(){Nt(is)}destroy(){this.set(0,0,0,0,0,0,0,0),Nt(this.buffer)}};OP=(()=>Ey(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e)=>BigInt(e))))(),rre=(()=>OP[0])(),nre=(()=>OP[1])(),ss=new Uint32Array(80),as=new Uint32Array(80);kP=class kP extends vu{constructor(e=64){super(128,e,16,!1);this.Ah=Mt[0]|0,this.Al=Mt[1]|0,this.Bh=Mt[2]|0,this.Bl=Mt[3]|0,this.Ch=Mt[4]|0,this.Cl=Mt[5]|0,this.Dh=Mt[6]|0,this.Dl=Mt[7]|0,this.Eh=Mt[8]|0,this.El=Mt[9]|0,this.Fh=Mt[10]|0,this.Fl=Mt[11]|0,this.Gh=Mt[12]|0,this.Gl=Mt[13]|0,this.Hh=Mt[14]|0,this.Hl=Mt[15]|0}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:o,Cl:i,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:p,Gh:f,Gl:d,Hh:h,Hl:m}=this;return[e,t,r,n,o,i,s,a,c,u,l,p,f,d,h,m]}set(e,t,r,n,o,i,s,a,c,u,l,p,f,d,h,m){this.Ah=e|0,this.Al=t|0,this.Bh=r|0,this.Bl=n|0,this.Ch=o|0,this.Cl=i|0,this.Dh=s|0,this.Dl=a|0,this.Eh=c|0,this.El=u|0,this.Fh=l|0,this.Fl=p|0,this.Gh=f|0,this.Gl=d|0,this.Hh=h|0,this.Hl=m|0}process(e,t){for(let x=0;x<16;x++,t+=4)ss[x]=e.getUint32(t),as[x]=e.getUint32(t+=4);for(let x=16;x<80;x++){let b=ss[x-15]|0,w=as[x-15]|0,v=ta(b,w,1)^ta(b,w,8)^A2(b,w,7),D=ra(b,w,1)^ra(b,w,8)^C2(b,w,7),O=ss[x-2]|0,T=as[x-2]|0,A=ta(O,T,19)^Kp(O,T,61)^A2(O,T,6),E=ra(O,T,19)^Yp(O,T,61)^C2(O,T,6),R=Bk(D,E,as[x-7],as[x-16]),S=Nk(R,v,A,ss[x-7],ss[x-16]);ss[x]=S|0,as[x]=R|0}let{Ah:r,Al:n,Bh:o,Bl:i,Ch:s,Cl:a,Dh:c,Dl:u,Eh:l,El:p,Fh:f,Fl:d,Gh:h,Gl:m,Hh:y,Hl:g}=this;for(let x=0;x<80;x++){let b=ta(l,p,14)^ta(l,p,18)^Kp(l,p,41),w=ra(l,p,14)^ra(l,p,18)^Yp(l,p,41),v=l&f^~l&h,D=p&d^~p&m,O=Fk(g,w,D,nre[x],as[x]),T=Mk(O,y,b,v,rre[x],ss[x]),A=O|0,E=ta(r,n,28)^Kp(r,n,34)^Kp(r,n,39),R=ra(r,n,28)^Yp(r,n,34)^Yp(r,n,39),S=r&o^r&s^o&s,k=n&i^n&a^i&a;y=h|0,g=m|0,h=f|0,m=d|0,f=l|0,d=p|0,{h:l,l:p}=lo(c|0,u|0,T|0,A|0),c=s|0,u=a|0,s=o|0,a=i|0,o=r|0,i=n|0;let I=Pk(A,R,k);r=_k(I,T,E,S),n=I|0}({h:r,l:n}=lo(this.Ah|0,this.Al|0,r|0,n|0)),{h:o,l:i}=lo(this.Bh|0,this.Bl|0,o|0,i|0),{h:s,l:a}=lo(this.Ch|0,this.Cl|0,s|0,a|0),{h:c,l:u}=lo(this.Dh|0,this.Dl|0,c|0,u|0),{h:l,l:p}=lo(this.Eh|0,this.El|0,l|0,p|0),{h:f,l:d}=lo(this.Fh|0,this.Fl|0,f|0,d|0),{h,l:m}=lo(this.Gh|0,this.Gl|0,h|0,m|0),{h:y,l:g}=lo(this.Hh|0,this.Hl|0,y|0,g|0),this.set(r,n,o,i,s,a,c,u,l,p,f,d,h,m,y,g)}roundClean(){Nt(ss,as)}destroy(){Nt(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};Do=sa(()=>new VT),Af=sa(()=>new kP)});var WT,Io=(e,t,r)=>new WT(e,t).update(r).digest();var Cf=H(()=>{Fr();WT=class WT extends Ki{constructor(e,t){super();this.finished=!1,this.destroyed=!1,Rc(e);let r=ia(t);if(this.iHash=e.create(),typeof this.iHash.update!=="function")throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,o=new Uint8Array(n);o.set(r.length>n?e.create().update(r).digest():r);for(let i=0;i<o.length;i++)o[i]^=54;this.iHash.update(o),this.oHash=e.create();for(let i=0;i<o.length;i++)o[i]^=106;this.oHash.update(o),Nt(o)}update(e){return ni(this),this.iHash.update(e),this}digestInto(e){ni(this),tt(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:r,finished:n,destroyed:o,blockLen:i,outputLen:s}=this;return e=e,e.finished=n,e.destroyed=o,e.blockLen=i,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};Io.create=(e,t)=>new WT(e,t)});function Kt(e,t){let r=e%t;return r>=ur?r:t+r}function Ur(e,t,r){let n=e;while(t-- >ur)n*=n,n%=r;return n}function u0(e,t){if(e===ur)throw Error("invert: expected non-zero number");if(t<=ur)throw Error("invert: expected positive modulus, got "+t);let r=Kt(e,t),n=t,o=ur,i=Yt,s=Yt,a=ur;while(r!==ur){let u=n/r,l=n%r,p=o-s*u,f=i-a*u;n=r,r=l,o=s,i=a,s=p,a=f}if(n!==Yt)throw Error("invert: does not exist");return Kt(o,t)}function NP(e,t){let r=(e.ORDER+Yt)/PP,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw Error("Cannot find square root");return n}function ire(e,t){let r=(e.ORDER-_P)/BP,n=e.mul(t,va),o=e.pow(n,r),i=e.mul(t,o),s=e.mul(e.mul(i,va),o),a=e.mul(i,e.sub(s,e.ONE));if(!e.eql(e.sqr(a),t))throw Error("Cannot find square root");return a}function sre(e){if(e<BigInt(3))throw Error("sqrt is not defined for small field");let t=e-Yt,r=0;while(t%va===ur)t/=va,r++;let n=va,o=Df(e);while(RP(o,n)===1)if(n++>1000)throw Error("Cannot find square root: probably non-prime P");if(r===1)return NP;let i=o.pow(n,t),s=(t+Yt)/va;return function(c,u){if(c.is0(u))return u;if(RP(c,u)!==1)throw Error("Cannot find square root");let l=r,p=c.mul(c.ONE,i),f=c.pow(u,t),d=c.pow(u,s);while(!c.eql(f,c.ONE)){if(c.is0(f))return c.ZERO;let h=1,m=c.sqr(f);while(!c.eql(m,c.ONE))if(h++,m=c.sqr(m),h===l)throw Error("Cannot find square root");let y=Yt<<BigInt(l-h-1),g=c.pow(p,y);l=h,p=c.sqr(g),f=c.mul(f,p),d=c.mul(d,g)}return d}}function are(e){if(e%PP===ore)return NP;if(e%BP===_P)return ire;return sre(e)}function KT(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=cre.reduce((n,o)=>(n[o]="function",n),t);return xa(e,r)}function ure(e,t,r){if(r<ur)throw Error("invalid exponent, negatives unsupported");if(r===ur)return e.ONE;if(r===Yt)return t;let n=e.ONE,o=t;while(r>ur){if(r&Yt)n=e.mul(n,o);o=e.sqr(o),r>>=Yt}return n}function YT(e,t,r=!1){let n=Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((s,a,c)=>{if(e.is0(a))return s;return n[c]=s,e.mul(s,a)},e.ONE),i=e.inv(o);return t.reduceRight((s,a,c)=>{if(e.is0(a))return s;return n[c]=e.mul(s,n[c]),e.mul(s,a)},i),n}function RP(e,t){let r=(e.ORDER-Yt)/va,n=e.pow(t,r),o=e.eql(n,e.ONE),i=e.eql(n,e.ZERO),s=e.eql(n,e.neg(e.ONE));if(!o&&!i&&!s)throw Error("invalid Legendre symbol result");return o?1:i?0:-1}function ZT(e,t){if(t!==void 0)xr(t);let r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Df(e,t,r=!1,n={}){if(e<=ur)throw Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:o,nByteLength:i}=ZT(e,t);if(i>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let s,a=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:i,MASK:ba(o),ZERO:ur,ONE:Yt,create:(c)=>Kt(c,e),isValid:(c)=>{if(typeof c!=="bigint")throw Error("invalid field element: expected bigint, got "+typeof c);return ur<=c&&c<e},is0:(c)=>c===ur,isOdd:(c)=>(c&Yt)===Yt,neg:(c)=>Kt(-c,e),eql:(c,u)=>c===u,sqr:(c)=>Kt(c*c,e),add:(c,u)=>Kt(c+u,e),sub:(c,u)=>Kt(c-u,e),mul:(c,u)=>Kt(c*u,e),pow:(c,u)=>ure(a,c,u),div:(c,u)=>Kt(c*u0(u,e),e),sqrN:(c)=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:(c)=>u0(c,e),sqrt:n.sqrt||((c)=>{if(!s)s=are(e);return s(a,c)}),toBytes:(c)=>r?mT(c,i):ya(c,i),fromBytes:(c)=>{if(c.length!==i)throw Error("Field.fromBytes: expected "+i+" bytes, got "+c.length);return r?dT(c):pi(c)},invertBatch:(c)=>YT(a,c),cmov:(c,u,l)=>l?u:c});return Object.freeze(a)}function FP(e){if(typeof e!=="bigint")throw Error("field order must be bigint");let t=e.toString(2).length;return Math.ceil(t/8)}function JT(e){let t=FP(e);return t+Math.ceil(t/2)}function MP(e,t,r=!1){let n=e.length,o=FP(t),i=JT(t);if(n<16||n<i||n>1024)throw Error("expected "+i+"-1024 bytes of input, got "+n);let s=r?dT(e):pi(e),a=Kt(s,t-Yt)+Yt;return r?mT(a,o):ya(a,o)}var ur,Yt,va,ore,PP,_P,BP,cre;var l0=H(()=>{Fr();zy();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ur=BigInt(0),Yt=BigInt(1),va=BigInt(2),ore=BigInt(3),PP=BigInt(4),_P=BigInt(5),BP=BigInt(8);cre=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function XT(e,t){let r=t.negate();return e?r:t}function UP(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function QT(e,t){UP(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),o=2**e,i=ba(e),s=BigInt(e);return{windows:r,windowSize:n,mask:i,maxNumber:o,shiftBy:s}}function $P(e,t,r){let{windowSize:n,mask:o,maxNumber:i,shiftBy:s}=r,a=Number(e&o),c=e>>s;if(a>n)a-=i,c+=rE;let u=t*n,l=u+Math.abs(a)-1,p=a===0,f=a<0,d=t%2!==0;return{nextN:c,offset:l,isZero:p,isNeg:f,isNegF:d,offsetF:u}}function lre(e,t){if(!Array.isArray(e))throw Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw Error("invalid point at index "+n)})}function pre(e,t){if(!Array.isArray(e))throw Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw Error("invalid scalar at index "+n)})}function tE(e){return HP.get(e)||1}function jP(e,t){return{constTimeNegate:XT,hasPrecomputes(r){return tE(r)!==1},unsafeLadder(r,n,o=e.ZERO){let i=r;while(n>LP){if(n&rE)o=o.add(i);i=i.double(),n>>=rE}return o},precomputeWindow(r,n){let{windows:o,windowSize:i}=QT(n,t),s=[],a=r,c=a;for(let u=0;u<o;u++){c=a,s.push(c);for(let l=1;l<i;l++)c=c.add(a),s.push(c);a=c.double()}return s},wNAF(r,n,o){let{ZERO:i,BASE:s}=e,a=QT(r,t);for(let c=0;c<a.windows;c++){let{nextN:u,offset:l,isZero:p,isNeg:f,isNegF:d,offsetF:h}=$P(o,c,a);if(o=u,p)s=s.add(XT(d,n[h]));else i=i.add(XT(f,n[l]))}return{p:i,f:s}},wNAFUnsafe(r,n,o,i=e.ZERO){let s=QT(r,t);for(let a=0;a<s.windows;a++){if(o===LP)break;let{nextN:c,offset:u,isZero:l,isNeg:p}=$P(o,a,s);if(o=c,l)continue;else{let f=n[u];i=i.add(p?f.negate():f)}}return i},getPrecomputes(r,n,o){let i=eE.get(n);if(!i){if(i=this.precomputeWindow(n,r),r!==1)eE.set(n,o(i))}return i},wNAFCached(r,n,o){let i=tE(r);return this.wNAF(i,this.getPrecomputes(i,r,o),n)},wNAFCachedUnsafe(r,n,o,i){let s=tE(r);if(s===1)return this.unsafeLadder(r,n,i);return this.wNAFUnsafe(s,this.getPrecomputes(s,r,o),n,i)},setWindowSize(r,n){UP(n,t),HP.set(r,n),eE.delete(r)}}}function qP(e,t,r,n){lre(r,e),pre(n,t);let o=r.length,i=n.length;if(o!==i)throw Error("arrays of points and scalars must have equal length");let s=e.ZERO,a=BR(BigInt(o)),c=1;if(a>12)c=a-3;else if(a>4)c=a-2;else if(a>0)c=2;let u=ba(c),l=Array(Number(u)+1).fill(s),p=Math.floor((t.BITS-1)/c)*c,f=s;for(let d=p;d>=0;d-=c){l.fill(s);for(let m=0;m<i;m++){let y=n[m],g=Number(y>>BigInt(d)&u);l[g]=l[g].add(r[m])}let h=s;for(let m=l.length-1,y=s;m>0;m--)y=y.add(l[m]),h=h.add(y);if(f=f.add(h),d!==0)for(let m=0;m<c;m++)f=f.double()}return f}function nE(e){return KT(e.Fp),xa(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...ZT(e.n,e.nBitLength),...e,...{p:e.Fp.ORDER}})}var LP,rE,eE,HP;var zP=H(()=>{l0();zy();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */LP=BigInt(0),rE=BigInt(1);eE=new WeakMap,HP=new WeakMap});function GP(e){if(e.lowS!==void 0)du("lowS",e.lowS);if(e.prehash!==void 0)du("prehash",e.prehash)}function fre(e){let t=nE(e);xa(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:n,a:o}=t;if(r){if(!n.eql(o,n.ZERO))throw Error("invalid endo: CURVE.a must be 0");if(typeof r!=="object"||typeof r.beta!=="bigint"||typeof r.splitScalar!=="function")throw Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}function oE(e,t){return mu(ya(e,t))}function mre(e){let t=fre(e),{Fp:r}=t,n=Df(t.n,t.nBitLength),o=t.toBytes||((b,w,v)=>{let D=w.toAffine();return df(Uint8Array.from([4]),r.toBytes(D.x),r.toBytes(D.y))}),i=t.fromBytes||((b)=>{let w=b.subarray(1),v=r.fromBytes(w.subarray(0,r.BYTES)),D=r.fromBytes(w.subarray(r.BYTES,2*r.BYTES));return{x:v,y:D}});function s(b){let{a:w,b:v}=t,D=r.sqr(b),O=r.mul(D,b);return r.add(r.add(O,r.mul(b,w)),v)}function a(b,w){let v=r.sqr(w),D=s(b);return r.eql(v,D)}if(!a(t.Gx,t.Gy))throw Error("bad curve params: generator point");let c=r.mul(r.pow(t.a,iE),dre),u=r.mul(r.sqr(t.b),BigInt(27));if(r.is0(r.add(c,u)))throw Error("bad curve params: a or b");function l(b){return qy(b,It,t.n)}function p(b){let{allowedPrivateKeyLengths:w,nByteLength:v,wrapPrivateKey:D,n:O}=t;if(w&&typeof b!=="bigint"){if(fu(b))b=mu(b);if(typeof b!=="string"||!w.includes(b.length))throw Error("invalid private key");b=b.padStart(v*2,"0")}let T;try{T=typeof b==="bigint"?b:pi(Sr("private key",b,v))}catch(A){throw Error("invalid private key, expected hex or "+v+" bytes, got "+typeof b)}if(D)T=Kt(T,O);return ga("private key",T,It,O),T}function f(b){if(!(b instanceof m))throw Error("ProjectivePoint expected")}let d=hT((b,w)=>{let{px:v,py:D,pz:O}=b;if(r.eql(O,r.ONE))return{x:v,y:D};let T=b.is0();if(w==null)w=T?r.ONE:r.inv(O);let A=r.mul(v,w),E=r.mul(D,w),R=r.mul(O,w);if(T)return{x:r.ZERO,y:r.ZERO};if(!r.eql(R,r.ONE))throw Error("invZ was invalid");return{x:A,y:E}}),h=hT((b)=>{if(b.is0()){if(t.allowInfinityPoint&&!r.is0(b.py))return;throw Error("bad point: ZERO")}let{x:w,y:v}=b.toAffine();if(!r.isValid(w)||!r.isValid(v))throw Error("bad point: x or y not FE");if(!a(w,v))throw Error("bad point: equation left != right");if(!b.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class m{constructor(b,w,v){if(b==null||!r.isValid(b))throw Error("x required");if(w==null||!r.isValid(w)||r.is0(w))throw Error("y required");if(v==null||!r.isValid(v))throw Error("z required");this.px=b,this.py=w,this.pz=v,Object.freeze(this)}static fromAffine(b){let{x:w,y:v}=b||{};if(!b||!r.isValid(w)||!r.isValid(v))throw Error("invalid affine point");if(b instanceof m)throw Error("projective point not allowed");let D=(O)=>r.eql(O,r.ZERO);if(D(w)&&D(v))return m.ZERO;return new m(w,v,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(b){let w=YT(r,b.map((v)=>v.pz));return b.map((v,D)=>v.toAffine(w[D])).map(m.fromAffine)}static fromHex(b){let w=m.fromAffine(i(Sr("pointHex",b)));return w.assertValidity(),w}static fromPrivateKey(b){return m.BASE.multiply(p(b))}static msm(b,w){return qP(m,n,b,w)}_setWindowSize(b){x.setWindowSize(this,b)}assertValidity(){h(this)}hasEvenY(){let{y:b}=this.toAffine();if(r.isOdd)return!r.isOdd(b);throw Error("Field doesn't support isOdd")}equals(b){f(b);let{px:w,py:v,pz:D}=this,{px:O,py:T,pz:A}=b,E=r.eql(r.mul(w,A),r.mul(O,D)),R=r.eql(r.mul(v,A),r.mul(T,D));return E&&R}negate(){return new m(this.px,r.neg(this.py),this.pz)}double(){let{a:b,b:w}=t,v=r.mul(w,iE),{px:D,py:O,pz:T}=this,{ZERO:A,ZERO:E,ZERO:R}=r,S=r.mul(D,D),k=r.mul(O,O),I=r.mul(T,T),C=r.mul(D,O);return C=r.add(C,C),R=r.mul(D,T),R=r.add(R,R),A=r.mul(b,R),E=r.mul(v,I),E=r.add(A,E),A=r.sub(k,E),E=r.add(k,E),E=r.mul(A,E),A=r.mul(C,A),R=r.mul(v,R),I=r.mul(b,I),C=r.sub(S,I),C=r.mul(b,C),C=r.add(C,R),R=r.add(S,S),S=r.add(R,S),S=r.add(S,I),S=r.mul(S,C),E=r.add(E,S),I=r.mul(O,T),I=r.add(I,I),S=r.mul(I,C),A=r.sub(A,S),R=r.mul(I,k),R=r.add(R,R),R=r.add(R,R),new m(A,E,R)}add(b){f(b);let{px:w,py:v,pz:D}=this,{px:O,py:T,pz:A}=b,{ZERO:E,ZERO:R,ZERO:S}=r,k=t.a,I=r.mul(t.b,iE),C=r.mul(w,O),P=r.mul(v,T),N=r.mul(D,A),L=r.add(w,v),F=r.add(O,T);L=r.mul(L,F),F=r.add(C,P),L=r.sub(L,F),F=r.add(w,D);let j=r.add(O,A);return F=r.mul(F,j),j=r.add(C,N),F=r.sub(F,j),j=r.add(v,D),E=r.add(T,A),j=r.mul(j,E),E=r.add(P,N),j=r.sub(j,E),S=r.mul(k,F),E=r.mul(I,N),S=r.add(E,S),E=r.sub(P,S),S=r.add(P,S),R=r.mul(E,S),P=r.add(C,C),P=r.add(P,C),N=r.mul(k,N),F=r.mul(I,F),P=r.add(P,N),N=r.sub(C,N),N=r.mul(k,N),F=r.add(F,N),C=r.mul(P,F),R=r.add(R,C),C=r.mul(j,F),E=r.mul(L,E),E=r.sub(E,C),C=r.mul(L,P),S=r.mul(j,S),S=r.add(S,C),new m(E,R,S)}subtract(b){return this.add(b.negate())}is0(){return this.equals(m.ZERO)}wNAF(b){return x.wNAFCached(this,b,m.normalizeZ)}multiplyUnsafe(b){let{endo:w,n:v}=t;ga("scalar",b,bi,v);let D=m.ZERO;if(b===bi)return D;if(this.is0()||b===It)return this;if(!w||x.hasPrecomputes(this))return x.wNAFCachedUnsafe(this,b,m.normalizeZ);let{k1neg:O,k1:T,k2neg:A,k2:E}=w.splitScalar(b),R=D,S=D,k=this;while(T>bi||E>bi){if(T&It)R=R.add(k);if(E&It)S=S.add(k);k=k.double(),T>>=It,E>>=It}if(O)R=R.negate();if(A)S=S.negate();return S=new m(r.mul(S.px,w.beta),S.py,S.pz),R.add(S)}multiply(b){let{endo:w,n:v}=t;ga("scalar",b,It,v);let D,O;if(w){let{k1neg:T,k1:A,k2neg:E,k2:R}=w.splitScalar(b),{p:S,f:k}=this.wNAF(A),{p:I,f:C}=this.wNAF(R);S=x.constTimeNegate(T,S),I=x.constTimeNegate(E,I),I=new m(r.mul(I.px,w.beta),I.py,I.pz),D=S.add(I),O=k.add(C)}else{let{p:T,f:A}=this.wNAF(b);D=T,O=A}return m.normalizeZ([D,O])[0]}multiplyAndAddUnsafe(b,w,v){let D=m.BASE,O=(A,E)=>E===bi||E===It||!A.equals(D)?A.multiplyUnsafe(E):A.multiply(E),T=O(this,w).add(O(b,v));return T.is0()?void 0:T}toAffine(b){return d(this,b)}isTorsionFree(){let{h:b,isTorsionFree:w}=t;if(b===It)return!0;if(w)return w(m,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:b,clearCofactor:w}=t;if(b===It)return this;if(w)return w(m,this);return this.multiplyUnsafe(t.h)}toRawBytes(b=!0){return du("isCompressed",b),this.assertValidity(),o(m,this,b)}toHex(b=!0){return du("isCompressed",b),mu(this.toRawBytes(b))}}m.BASE=new m(t.Gx,t.Gy,r.ONE),m.ZERO=new m(r.ZERO,r.ONE,r.ZERO);let{endo:y,nBitLength:g}=t,x=jP(m,y?Math.ceil(g/2):g);return{CURVE:t,ProjectivePoint:m,normPrivateKeyToScalar:p,weierstrassEquation:s,isWithinCurveOrder:l}}function hre(e){let t=nE(e);return xa(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function WP(e){let t=hre(e),{Fp:r,n,nByteLength:o,nBitLength:i}=t,s=r.BYTES+1,a=2*r.BYTES+1;function c(C){return Kt(C,n)}function u(C){return u0(C,n)}let{ProjectivePoint:l,normPrivateKeyToScalar:p,weierstrassEquation:f,isWithinCurveOrder:d}=mre({...t,toBytes(C,P,N){let L=P.toAffine(),F=r.toBytes(L.x),j=df;if(du("isCompressed",N),N)return j(Uint8Array.from([P.hasEvenY()?2:3]),F);else return j(Uint8Array.from([4]),F,r.toBytes(L.y))},fromBytes(C){let P=C.length,N=C[0],L=C.subarray(1);if(P===s&&(N===2||N===3)){let F=pi(L);if(!qy(F,It,r.ORDER))throw Error("Point is not on curve");let j=f(F),V;try{V=r.sqrt(j)}catch(G){let Y=G instanceof Error?": "+G.message:"";throw Error("Point is not on curve"+Y)}let z=(V&It)===It;if((N&1)===1!==z)V=r.neg(V);return{x:F,y:V}}else if(P===a&&N===4){let F=r.fromBytes(L.subarray(0,r.BYTES)),j=r.fromBytes(L.subarray(r.BYTES,2*r.BYTES));return{x:F,y:j}}else{let F=s,j=a;throw Error("invalid Point, expected length of "+F+", or uncompressed "+j+", got "+P)}}});function h(C){let P=n>>It;return C>P}function m(C){return h(C)?c(-C):C}let y=(C,P,N)=>pi(C.slice(P,N));class g{constructor(C,P,N){if(ga("r",C,It,n),ga("s",P,It,n),this.r=C,this.s=P,N!=null)this.recovery=N;Object.freeze(this)}static fromCompact(C){let P=o;return C=Sr("compactSignature",C,P*2),new g(y(C,0,P),y(C,P,2*P))}static fromDER(C){let{r:P,s:N}=gi.toSig(Sr("DER",C));return new g(P,N)}assertValidity(){}addRecoveryBit(C){return new g(this.r,this.s,C)}recoverPublicKey(C){let{r:P,s:N,recovery:L}=this,F=O(Sr("msgHash",C));if(L==null||![0,1,2,3].includes(L))throw Error("recovery id invalid");let j=L===2||L===3?P+t.n:P;if(j>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let V=(L&1)===0?"02":"03",z=l.fromHex(V+oE(j,r.BYTES)),te=u(j),G=c(-F*te),Y=c(N*te),ne=l.BASE.multiplyAndAddUnsafe(z,G,Y);if(!ne)throw Error("point at infinify");return ne.assertValidity(),ne}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return ff(this.toDERHex())}toDERHex(){return gi.hexFromSig(this)}toCompactRawBytes(){return ff(this.toCompactHex())}toCompactHex(){let C=o;return oE(this.r,C)+oE(this.s,C)}}let x={isValidPrivateKey(C){try{return p(C),!0}catch(P){return!1}},normPrivateKeyToScalar:p,randomPrivateKey:()=>{let C=JT(t.n);return MP(t.randomBytes(C),t.n)},precompute(C=8,P=l.BASE){return P._setWindowSize(C),P.multiply(BigInt(3)),P}};function b(C,P=!0){return l.fromPrivateKey(C).toRawBytes(P)}function w(C){if(typeof C==="bigint")return!1;if(C instanceof l)return!0;let N=Sr("key",C).length,L=r.BYTES,F=L+1,j=2*L+1;if(t.allowedPrivateKeyLengths||o===F)return;else return N===F||N===j}function v(C,P,N=!0){if(w(C)===!0)throw Error("first arg must be private key");if(w(P)===!1)throw Error("second arg must be public key");return l.fromHex(P).multiply(p(C)).toRawBytes(N)}let D=t.bits2int||function(C){if(C.length>8192)throw Error("input is too large");let P=pi(C),N=C.length*8-i;return N>0?P>>BigInt(N):P},O=t.bits2int_modN||function(C){return c(D(C))},T=ba(i);function A(C){return ga("num < 2^"+i,C,bi,T),ya(C,o)}function E(C,P,N=R){if(["recovered","canonical"].some((ye)=>(ye in N)))throw Error("sign() legacy options not supported");let{hash:L,randomBytes:F}=t,{lowS:j,prehash:V,extraEntropy:z}=N;if(j==null)j=!0;if(C=Sr("msgHash",C),GP(N),V)C=Sr("prehashed msgHash",L(C));let te=O(C),G=p(P),Y=[A(G),A(te)];if(z!=null&&z!==!1){let ye=z===!0?F(r.BYTES):z;Y.push(Sr("extraEntropy",ye))}let ne=df(...Y),he=te;function Te(ye){let mr=D(ye);if(!d(mr))return;let ji=u(mr),qi=l.BASE.multiply(mr).toAffine(),Qn=c(qi.x);if(Qn===bi)return;let lp=c(ji*c(he+Qn*G));if(lp===bi)return;let rc=(qi.x===Qn?0:2)|Number(qi.y&It),XA=lp;if(j&&h(lp))XA=m(lp),rc^=1;return new g(Qn,XA,rc)}return{seed:ne,k2sig:Te}}let R={lowS:t.lowS,prehash:!1},S={lowS:t.lowS,prehash:!1};function k(C,P,N=R){let{seed:L,k2sig:F}=E(C,P,N),j=t;return NR(j.hash.outputLen,j.nByteLength,j.hmac)(L,F)}l.BASE._setWindowSize(8);function I(C,P,N,L=S){let F=C;P=Sr("msgHash",P),N=Sr("publicKey",N);let{lowS:j,prehash:V,format:z}=L;if(GP(L),"strict"in L)throw Error("options.strict was renamed to lowS");if(z!==void 0&&z!=="compact"&&z!=="der")throw Error("format must be compact or der");let te=typeof F==="string"||fu(F),G=!te&&!z&&typeof F==="object"&&F!==null&&typeof F.r==="bigint"&&typeof F.s==="bigint";if(!te&&!G)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");let Y=void 0,ne;try{if(G)Y=new g(F.r,F.s);if(te){try{if(z!=="compact")Y=g.fromDER(F)}catch(rc){if(!(rc instanceof gi.Err))throw rc}if(!Y&&z!=="der")Y=g.fromCompact(F)}ne=l.fromHex(N)}catch(rc){return!1}if(!Y)return!1;if(j&&Y.hasHighS())return!1;if(V)P=t.hash(P);let{r:he,s:Te}=Y,ye=O(P),mr=u(Te),ji=c(ye*mr),qi=c(he*mr),Qn=l.BASE.multiplyAndAddUnsafe(ne,ji,qi)?.toAffine();if(!Qn)return!1;return c(Qn.x)===he}return{CURVE:t,getPublicKey:b,getSharedSecret:v,sign:k,verify:I,ProjectivePoint:l,Signature:g,utils:x}}var VP,gi,bi,It,cUe,iE,dre;var KP=H(()=>{zP();l0();zy();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */VP=class VP extends Error{constructor(e=""){super(e)}};gi={Err:VP,_tlv:{encode:(e,t)=>{let{Err:r}=gi;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length&1)throw new r("tlv.encode: unpadded data");let n=t.length/2,o=pf(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");let i=n>127?pf(o.length/2|128):"";return pf(e)+i+o+t},decode(e,t){let{Err:r}=gi,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let o=t[n++],i=!!(o&128),s=0;if(!i)s=o;else{let c=o&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");let u=t.subarray(n,n+c);if(u.length!==c)throw new r("tlv.decode: length bytes not complete");if(u[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let l of u)s=s<<8|l;if(n+=c,s<128)throw new r("tlv.decode(long): not minimal encoding")}let a=t.subarray(n,n+s);if(a.length!==s)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(n+s)}}},_int:{encode(e){let{Err:t}=gi;if(e<bi)throw new t("integer: negative integers are not allowed");let r=pf(e);if(Number.parseInt(r[0],16)&8)r="00"+r;if(r.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=gi;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return pi(e)}},toSig(e){let{Err:t,_int:r,_tlv:n}=gi,o=Sr("signature",e),{v:i,l:s}=n.decode(48,o);if(s.length)throw new t("invalid signature: left bytes after parsing");let{v:a,l:c}=n.decode(2,i),{v:u,l}=n.decode(2,c);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(u)}},hexFromSig(e){let{_tlv:t,_int:r}=gi,n=t.encode(2,r.encode(e.r)),o=t.encode(2,r.encode(e.s)),i=n+o;return t.encode(48,i)}};bi=BigInt(0),It=BigInt(1),cUe=BigInt(2),iE=BigInt(3),dre=BigInt(4)});function yre(e){return{hash:e,hmac:(t,...r)=>Io(e,t,St(...r)),randomBytes:Pc}}function YP(e,t){let r=(n)=>WP({...e,...yre(n)});return{...r(t),create:r}}var ZP=H(()=>{Cf();Fr();KP();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */});function xre(e){let t=QP,r=BigInt(3),n=BigInt(6),o=BigInt(11),i=BigInt(22),s=BigInt(23),a=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,p=Ur(l,r,t)*l%t,f=Ur(p,r,t)*l%t,d=Ur(f,sE,t)*u%t,h=Ur(d,o,t)*d%t,m=Ur(h,i,t)*h%t,y=Ur(m,a,t)*m%t,g=Ur(y,c,t)*y%t,x=Ur(g,a,t)*m%t,b=Ur(x,r,t)*l%t,w=Ur(b,s,t)*h%t,v=Ur(w,n,t)*u%t,D=Ur(v,sE,t);if(!aE.eql(aE.sqr(D),e))throw Error("Cannot find square root");return D}var QP,JP,gre,bre,sE,XP=(e,t)=>(e+t/sE)/t,aE,xi;var If=H(()=>{Su();ZP();l0();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */QP=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),JP=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),gre=BigInt(0),bre=BigInt(1),sE=BigInt(2);aE=Df(QP,void 0,void 0,{sqrt:xre}),xi=YP({a:gre,b:BigInt(7),Fp:aE,n:JP,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:(e)=>{let t=JP,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-bre*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=r,s=BigInt("0x100000000000000000000000000000000"),a=XP(i*e,t),c=XP(-n*e,t),u=Kt(e-a*r-c*o,t),l=Kt(-a*n-c*i,t),p=u>s,f=l>s;if(p)u=t-u;if(f)l=t-l;if(u>s||l>s)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:p,k1:u,k2neg:f,k2:l}}}},Do)});var bl=_(function(n7t,jF){var Eie=Number.MAX_SAFE_INTEGER||9007199254740991,vie=["major","premajor","minor","preminor","patch","prepatch","prerelease"];jF.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Eie,RELEASE_TYPES:vie,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var rd=_(function(o7t,qF){var Sie=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};qF.exports=Sie});var xl=_(function(_o,zF){var{MAX_SAFE_COMPONENT_LENGTH:w5,MAX_SAFE_BUILD_LENGTH:Aie,MAX_LENGTH:Cie}=bl(),Die=rd();_o=zF.exports={};var Iie=_o.re=[],Oie=_o.safeRe=[],W=_o.src=[],kie=_o.safeSrc=[],K=_o.t={},Rie=0,T5="[a-zA-Z0-9-]",Pie=[["\\s",1],["\\d",Cie],[T5,Aie]],_ie=(e)=>{for(let[t,r]of Pie)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},ae=(e,t,r)=>{let n=_ie(t),o=Rie++;Die(e,o,t),K[e]=o,W[o]=t,kie[o]=n,Iie[o]=new RegExp(t,r?"g":void 0),Oie[o]=new RegExp(n,r?"g":void 0)};ae("NUMERICIDENTIFIER","0|[1-9]\\d*");ae("NUMERICIDENTIFIERLOOSE","\\d+");ae("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${T5}*`);ae("MAINVERSION",`(${W[K.NUMERICIDENTIFIER]})\\.(${W[K.NUMERICIDENTIFIER]})\\.(${W[K.NUMERICIDENTIFIER]})`);ae("MAINVERSIONLOOSE",`(${W[K.NUMERICIDENTIFIERLOOSE]})\\.(${W[K.NUMERICIDENTIFIERLOOSE]})\\.(${W[K.NUMERICIDENTIFIERLOOSE]})`);ae("PRERELEASEIDENTIFIER",`(?:${W[K.NONNUMERICIDENTIFIER]}|${W[K.NUMERICIDENTIFIER]})`);ae("PRERELEASEIDENTIFIERLOOSE",`(?:${W[K.NONNUMERICIDENTIFIER]}|${W[K.NUMERICIDENTIFIERLOOSE]})`);ae("PRERELEASE",`(?:-(${W[K.PRERELEASEIDENTIFIER]}(?:\\.${W[K.PRERELEASEIDENTIFIER]})*))`);ae("PRERELEASELOOSE",`(?:-?(${W[K.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${W[K.PRERELEASEIDENTIFIERLOOSE]})*))`);ae("BUILDIDENTIFIER",`${T5}+`);ae("BUILD",`(?:\\+(${W[K.BUILDIDENTIFIER]}(?:\\.${W[K.BUILDIDENTIFIER]})*))`);ae("FULLPLAIN",`v?${W[K.MAINVERSION]}${W[K.PRERELEASE]}?${W[K.BUILD]}?`);ae("FULL",`^${W[K.FULLPLAIN]}$`);ae("LOOSEPLAIN",`[v=\\s]*${W[K.MAINVERSIONLOOSE]}${W[K.PRERELEASELOOSE]}?${W[K.BUILD]}?`);ae("LOOSE",`^${W[K.LOOSEPLAIN]}$`);ae("GTLT","((?:<|>)?=?)");ae("XRANGEIDENTIFIERLOOSE",`${W[K.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ae("XRANGEIDENTIFIER",`${W[K.NUMERICIDENTIFIER]}|x|X|\\*`);ae("XRANGEPLAIN",`[v=\\s]*(${W[K.XRANGEIDENTIFIER]})(?:\\.(${W[K.XRANGEIDENTIFIER]})(?:\\.(${W[K.XRANGEIDENTIFIER]})(?:${W[K.PRERELEASE]})?${W[K.BUILD]}?)?)?`);ae("XRANGEPLAINLOOSE",`[v=\\s]*(${W[K.XRANGEIDENTIFIERLOOSE]})(?:\\.(${W[K.XRANGEIDENTIFIERLOOSE]})(?:\\.(${W[K.XRANGEIDENTIFIERLOOSE]})(?:${W[K.PRERELEASELOOSE]})?${W[K.BUILD]}?)?)?`);ae("XRANGE",`^${W[K.GTLT]}\\s*${W[K.XRANGEPLAIN]}$`);ae("XRANGELOOSE",`^${W[K.GTLT]}\\s*${W[K.XRANGEPLAINLOOSE]}$`);ae("COERCEPLAIN",`(^|[^\\d])(\\d{1,${w5}})(?:\\.(\\d{1,${w5}}))?(?:\\.(\\d{1,${w5}}))?`);ae("COERCE",`${W[K.COERCEPLAIN]}(?:$|[^\\d])`);ae("COERCEFULL",W[K.COERCEPLAIN]+`(?:${W[K.PRERELEASE]})?(?:${W[K.BUILD]})?(?:$|[^\\d])`);ae("COERCERTL",W[K.COERCE],!0);ae("COERCERTLFULL",W[K.COERCEFULL],!0);ae("LONETILDE","(?:~>?)");ae("TILDETRIM",`(\\s*)${W[K.LONETILDE]}\\s+`,!0);_o.tildeTrimReplace="$1~";ae("TILDE",`^${W[K.LONETILDE]}${W[K.XRANGEPLAIN]}$`);ae("TILDELOOSE",`^${W[K.LONETILDE]}${W[K.XRANGEPLAINLOOSE]}$`);ae("LONECARET","(?:\\^)");ae("CARETTRIM",`(\\s*)${W[K.LONECARET]}\\s+`,!0);_o.caretTrimReplace="$1^";ae("CARET",`^${W[K.LONECARET]}${W[K.XRANGEPLAIN]}$`);ae("CARETLOOSE",`^${W[K.LONECARET]}${W[K.XRANGEPLAINLOOSE]}$`);ae("COMPARATORLOOSE",`^${W[K.GTLT]}\\s*(${W[K.LOOSEPLAIN]})$|^$`);ae("COMPARATOR",`^${W[K.GTLT]}\\s*(${W[K.FULLPLAIN]})$|^$`);ae("COMPARATORTRIM",`(\\s*)${W[K.GTLT]}\\s*(${W[K.LOOSEPLAIN]}|${W[K.XRANGEPLAIN]})`,!0);_o.comparatorTrimReplace="$1$2$3";ae("HYPHENRANGE",`^\\s*(${W[K.XRANGEPLAIN]})\\s+-\\s+(${W[K.XRANGEPLAIN]})\\s*$`);ae("HYPHENRANGELOOSE",`^\\s*(${W[K.XRANGEPLAINLOOSE]})\\s+-\\s+(${W[K.XRANGEPLAINLOOSE]})\\s*$`);ae("STAR","(<|>)?=?\\s*\\*");ae("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ae("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var kg=_(function(i7t,GF){var Bie=Object.freeze({loose:!0}),Nie=Object.freeze({}),Fie=(e)=>{if(!e)return Nie;if(typeof e!=="object")return Bie;return e};GF.exports=Fie});var E5=_(function(s7t,KF){var VF=/^[0-9]+$/,WF=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=VF.test(e),n=VF.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Mie=(e,t)=>WF(t,e);KF.exports={compareIdentifiers:WF,rcompareIdentifiers:Mie}});var $t=_(function(a7t,ZF){var Rg=rd(),{MAX_LENGTH:YF,MAX_SAFE_INTEGER:Pg}=bl(),{safeRe:_g,t:Bg}=xl(),Lie=kg(),{compareIdentifiers:v5}=E5(),$ie=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(v5(e[n],r[n])!==0)return!1;return!0};class qn{constructor(e,t){if(t=Lie(t),e instanceof qn)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>YF)throw TypeError(`version is longer than ${YF} characters`);Rg("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?_g[Bg.LOOSE]:_g[Bg.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Pg||this.major<0)throw TypeError("Invalid major version");if(this.minor>Pg||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Pg||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let o=+n;if(o>=0&&o<Pg)return o}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(Rg("SemVer.compare",this.version,this.options,e),!(e instanceof qn)){if(typeof e==="string"&&e===this.version)return 0;e=new qn(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof qn))e=new qn(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof qn))e=new qn(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(Rg("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return v5(r,n)}while(++t)}compareBuild(e){if(!(e instanceof qn))e=new qn(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(Rg("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return v5(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?_g[Bg.PRERELEASELOOSE]:_g[Bg.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let o=this.prerelease.length;while(--o>=0)if(typeof this.prerelease[o]==="number")this.prerelease[o]++,o=-2;if(o===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let o=[t,n];if(r===!1)o=[t];if($ie(this.prerelease,t)){let i=this.prerelease[t.split(".").length];if(isNaN(i))this.prerelease=o}else this.prerelease=o}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}ZF.exports=qn});var As=_(function(c7t,XF){var JF=$t(),Uie=(e,t,r=!1)=>{if(e instanceof JF)return e;try{return new JF(e,t)}catch(n){if(!r)return null;throw n}};XF.exports=Uie});var eM=_(function(u7t,QF){var Hie=As(),jie=(e,t)=>{let r=Hie(e,t);return r?r.version:null};QF.exports=jie});var rM=_(function(l7t,tM){var qie=As(),zie=(e,t)=>{let r=qie(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};tM.exports=zie});var iM=_(function(p7t,oM){var nM=$t(),Gie=(e,t,r,n,o)=>{if(typeof r==="string")o=n,n=r,r=void 0;try{return new nM(e instanceof nM?e.version:e,r).inc(t,n,o).version}catch(i){return null}};oM.exports=Gie});var cM=_(function(f7t,aM){var sM=As(),Vie=(e,t)=>{let r=sM(e,null,!0),n=sM(t,null,!0),o=r.compare(n);if(o===0)return null;let i=o>0,s=i?r:n,a=i?n:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let l=c?"pre":"";if(r.major!==n.major)return l+"major";if(r.minor!==n.minor)return l+"minor";if(r.patch!==n.patch)return l+"patch";return"prerelease"};aM.exports=Vie});var lM=_(function(d7t,uM){var Wie=$t(),Kie=(e,t)=>new Wie(e,t).major;uM.exports=Kie});var fM=_(function(m7t,pM){var Yie=$t(),Zie=(e,t)=>new Yie(e,t).minor;pM.exports=Zie});var mM=_(function(h7t,dM){var Jie=$t(),Xie=(e,t)=>new Jie(e,t).patch;dM.exports=Xie});var yM=_(function(y7t,hM){var Qie=As(),ese=(e,t)=>{let r=Qie(e,t);return r&&r.prerelease.length?r.prerelease:null};hM.exports=ese});var pn=_(function(g7t,bM){var gM=$t(),tse=(e,t,r)=>new gM(e,r).compare(new gM(t,r));bM.exports=tse});var wM=_(function(b7t,xM){var rse=pn(),nse=(e,t,r)=>rse(t,e,r);xM.exports=nse});var EM=_(function(x7t,TM){var ose=pn(),ise=(e,t)=>ose(e,t,!0);TM.exports=ise});var Ng=_(function(w7t,SM){var vM=$t(),sse=(e,t,r)=>{let n=new vM(e,r),o=new vM(t,r);return n.compare(o)||n.compareBuild(o)};SM.exports=sse});var CM=_(function(T7t,AM){var ase=Ng(),cse=(e,t)=>e.sort((r,n)=>ase(r,n,t));AM.exports=cse});var IM=_(function(E7t,DM){var use=Ng(),lse=(e,t)=>e.sort((r,n)=>use(n,r,t));DM.exports=lse});var nd=_(function(v7t,OM){var pse=pn(),fse=(e,t,r)=>pse(e,t,r)>0;OM.exports=fse});var Fg=_(function(S7t,kM){var dse=pn(),mse=(e,t,r)=>dse(e,t,r)<0;kM.exports=mse});var S5=_(function(A7t,RM){var hse=pn(),yse=(e,t,r)=>hse(e,t,r)===0;RM.exports=yse});var A5=_(function(C7t,PM){var gse=pn(),bse=(e,t,r)=>gse(e,t,r)!==0;PM.exports=bse});var Mg=_(function(D7t,_M){var xse=pn(),wse=(e,t,r)=>xse(e,t,r)>=0;_M.exports=wse});var Lg=_(function(I7t,BM){var Tse=pn(),Ese=(e,t,r)=>Tse(e,t,r)<=0;BM.exports=Ese});var C5=_(function(O7t,NM){var vse=S5(),Sse=A5(),Ase=nd(),Cse=Mg(),Dse=Fg(),Ise=Lg(),Ose=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return vse(e,r,n);case"!=":return Sse(e,r,n);case">":return Ase(e,r,n);case">=":return Cse(e,r,n);case"<":return Dse(e,r,n);case"<=":return Ise(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};NM.exports=Ose});var MM=_(function(k7t,FM){var kse=$t(),Rse=As(),{safeRe:$g,t:Ug}=xl(),Pse=(e,t)=>{if(e instanceof kse)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?$g[Ug.COERCEFULL]:$g[Ug.COERCE]);else{let c=t.includePrerelease?$g[Ug.COERCERTLFULL]:$g[Ug.COERCERTL],u;while((u=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||u.index+u[0].length!==r.index+r[0].length)r=u;c.lastIndex=u.index+u[1].length+u[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],o=r[3]||"0",i=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Rse(`${n}.${o}.${i}${s}${a}`,t)};FM.exports=Pse});var UM=_(function(R7t,$M){var _se=As(),LM=bl(),Bse=$t(),Nse=(e,t,r)=>{if(!LM.RELEASE_TYPES.includes(t))return null;let n=Fse(e,r);return n&&Mse(n,t)},Fse=(e,t)=>{let r=e instanceof Bse?e.version:e;return _se(r,t)},Mse=(e,t)=>{if(Lse(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},Lse=(e)=>e.startsWith("pre");$M.exports=Nse});var qM=_(function(P7t,jM){class HM{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}jM.exports=HM});var fn=_(function(_7t,WM){var $se=/\s+/g;class od{constructor(e,t){if(t=Hse(t),e instanceof od)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new od(e.raw,t);if(e instanceof Hg)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace($se," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!GM(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&Zse(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(Yse,"");let r=((this.options.includePrerelease&&Wse)|(this.options.loose&&Kse))+":"+e,n=zM.get(r);if(n)return n;let o=this.options.loose,i=o?pr[Ut.HYPHENRANGELOOSE]:pr[Ut.HYPHENRANGE];e=e.replace(i,aae(this.options.includePrerelease)),Ge("hyphen replace",e),e=e.replace(pr[Ut.COMPARATORTRIM],zse),Ge("comparator trim",e),e=e.replace(pr[Ut.TILDETRIM],Gse),Ge("tilde trim",e),e=e.replace(pr[Ut.CARETTRIM],Vse),Ge("caret trim",e);let s=e.split(" ").map((l)=>Jse(l,this.options)).join(" ").split(/\s+/).map((l)=>sae(l,this.options));if(o)s=s.filter((l)=>(Ge("loose invalid filter",l,this.options),!!l.match(pr[Ut.COMPARATORLOOSE])));Ge("range list",s);let a=new Map,c=s.map((l)=>new Hg(l,this.options));for(let l of c){if(GM(l))return[l];a.set(l.value,l)}if(a.size>1&&a.has(""))a.delete("");let u=[...a.values()];return zM.set(r,u),u}intersects(e,t){if(!(e instanceof od))throw TypeError("a Range is required");return this.set.some((r)=>VM(r,t)&&e.set.some((n)=>VM(n,t)&&r.every((o)=>n.every((i)=>o.intersects(i,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new jse(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(cae(this.set[t],e,this.options))return!0;return!1}}WM.exports=od;var Use=qM(),zM=new Use,Hse=kg(),Hg=id(),Ge=rd(),jse=$t(),{safeRe:pr,src:qse,t:Ut,comparatorTrimReplace:zse,tildeTrimReplace:Gse,caretTrimReplace:Vse}=xl(),{FLAG_INCLUDE_PRERELEASE:Wse,FLAG_LOOSE:Kse}=bl(),Yse=new RegExp(qse[Ut.BUILD],"g"),GM=(e)=>e.value==="<0.0.0-0",Zse=(e)=>e.value==="",VM=(e,t)=>{let r=!0,n=e.slice(),o=n.pop();while(r&&n.length)r=n.every((i)=>o.intersects(i,t)),o=n.pop();return r},Jse=(e,t)=>(e=e.replace(pr[Ut.BUILD],""),Ge("comp",e,t),e=tae(e,t),Ge("caret",e),e=Qse(e,t),Ge("tildes",e),e=nae(e,t),Ge("xrange",e),e=iae(e,t),Ge("stars",e),e),bt=(e)=>!e||e.toLowerCase()==="x"||e==="*",Xse=(e,t,r)=>bt(e)&&!bt(t)||bt(t)&&r&&!bt(r),Qse=(e,t)=>e.trim().split(/\s+/).map((r)=>eae(r,t)).join(" "),eae=(e,t)=>{let r=t.loose?pr[Ut.TILDELOOSE]:pr[Ut.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(o,i,s,a,c)=>{Ge("tilde",e,o,i,s,a,c);let u;if(bt(i))u="";else if(bt(s))u=`>=${i}.0.0${n} <${+i+1}.0.0-0`;else if(bt(a))u=`>=${i}.${s}.0${n} <${i}.${+s+1}.0-0`;else if(c)Ge("replaceTilde pr",c),u=`>=${i}.${s}.${a}-${c} <${i}.${+s+1}.0-0`;else u=`>=${i}.${s}.${a} <${i}.${+s+1}.0-0`;return Ge("tilde return",u),u})},tae=(e,t)=>e.trim().split(/\s+/).map((r)=>rae(r,t)).join(" "),rae=(e,t)=>{Ge("caret",e,t);let r=t.loose?pr[Ut.CARETLOOSE]:pr[Ut.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(o,i,s,a,c)=>{Ge("caret",e,o,i,s,a,c);let u;if(bt(i))u="";else if(bt(s))u=`>=${i}.0.0${n} <${+i+1}.0.0-0`;else if(bt(a))if(i==="0")u=`>=${i}.${s}.0${n} <${i}.${+s+1}.0-0`;else u=`>=${i}.${s}.0${n} <${+i+1}.0.0-0`;else if(c)if(Ge("replaceCaret pr",c),i==="0")if(s==="0")u=`>=${i}.${s}.${a}-${c} <${i}.${s}.${+a+1}-0`;else u=`>=${i}.${s}.${a}-${c} <${i}.${+s+1}.0-0`;else u=`>=${i}.${s}.${a}-${c} <${+i+1}.0.0-0`;else if(Ge("no pr"),i==="0")if(s==="0")u=`>=${i}.${s}.${a} <${i}.${s}.${+a+1}-0`;else u=`>=${i}.${s}.${a} <${i}.${+s+1}.0-0`;else u=`>=${i}.${s}.${a} <${+i+1}.0.0-0`;return Ge("caret return",u),u})},nae=(e,t)=>(Ge("replaceXRanges",e,t),e.split(/\s+/).map((r)=>oae(r,t)).join(" ")),oae=(e,t)=>{e=e.trim();let r=t.loose?pr[Ut.XRANGELOOSE]:pr[Ut.XRANGE];return e.replace(r,(n,o,i,s,a,c)=>{if(Ge("xRange",e,n,o,i,s,a,c),Xse(i,s,a))return e;let u=bt(i),l=u||bt(s),p=l||bt(a),f=p;if(o==="="&&f)o="";if(c=t.includePrerelease?"-0":"",u)if(o===">"||o==="<")n="<0.0.0-0";else n="*";else if(o&&f){if(l)s=0;if(a=0,o===">")if(o=">=",l)i=+i+1,s=0,a=0;else s=+s+1,a=0;else if(o==="<=")if(o="<",l)i=+i+1;else s=+s+1;if(o==="<")c="-0";n=`${o+i}.${s}.${a}${c}`}else if(l)n=`>=${i}.0.0${c} <${+i+1}.0.0-0`;else if(p)n=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`;return Ge("xRange return",n),n})},iae=(e,t)=>(Ge("replaceStars",e,t),e.trim().replace(pr[Ut.STAR],"")),sae=(e,t)=>(Ge("replaceGTE0",e,t),e.trim().replace(pr[t.includePrerelease?Ut.GTE0PRE:Ut.GTE0],"")),aae=(e)=>(t,r,n,o,i,s,a,c,u,l,p,f)=>{if(bt(n))r="";else if(bt(o))r=`>=${n}.0.0${e?"-0":""}`;else if(bt(i))r=`>=${n}.${o}.0${e?"-0":""}`;else if(s)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(bt(u))c="";else if(bt(l))c=`<${+u+1}.0.0-0`;else if(bt(p))c=`<${u}.${+l+1}.0-0`;else if(f)c=`<=${u}.${l}.${p}-${f}`;else if(e)c=`<${u}.${l}.${+p+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},cae=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(Ge(e[n].semver),e[n].semver===Hg.ANY)continue;if(e[n].semver.prerelease.length>0){let o=e[n].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}}return!1}return!0}});var id=_(function(B7t,QM){var sd=Symbol("SemVer ANY");class jg{static get ANY(){return sd}constructor(e,t){if(t=KM(t),e instanceof jg)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),I5("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===sd)this.value="";else this.value=this.operator+this.semver.version;I5("comp",this)}parse(e){let t=this.options.loose?YM[ZM.COMPARATORLOOSE]:YM[ZM.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=sd;else this.semver=new JM(r[2],this.options.loose)}toString(){return this.value}test(e){if(I5("Comparator.test",e,this.options.loose),this.semver===sd||e===sd)return!0;if(typeof e==="string")try{e=new JM(e,this.options)}catch(t){return!1}return D5(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof jg))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new XM(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new XM(this.value,t).test(e.semver)}if(t=KM(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(D5(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(D5(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}QM.exports=jg;var KM=kg(),{safeRe:YM,t:ZM}=xl(),D5=C5(),I5=rd(),JM=$t(),XM=fn()});var ad=_(function(N7t,e9){var uae=fn(),lae=(e,t,r)=>{try{t=new uae(t,r)}catch(n){return!1}return t.test(e)};e9.exports=lae});var r9=_(function(F7t,t9){var pae=fn(),fae=(e,t)=>new pae(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));t9.exports=fae});var o9=_(function(M7t,n9){var dae=$t(),mae=fn(),hae=(e,t,r)=>{let n=null,o=null,i=null;try{i=new mae(t,r)}catch(s){return null}return e.forEach((s)=>{if(i.test(s)){if(!n||o.compare(s)===-1)n=s,o=new dae(n,r)}}),n};n9.exports=hae});var s9=_(function(L7t,i9){var yae=$t(),gae=fn(),bae=(e,t,r)=>{let n=null,o=null,i=null;try{i=new gae(t,r)}catch(s){return null}return e.forEach((s)=>{if(i.test(s)){if(!n||o.compare(s)===1)n=s,o=new yae(n,r)}}),n};i9.exports=bae});var u9=_(function($7t,c9){var O5=$t(),xae=fn(),a9=nd(),wae=(e,t)=>{e=new xae(e,t);let r=new O5("0.0.0");if(e.test(r))return r;if(r=new O5("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let o=e.set[n],i=null;if(o.forEach((s)=>{let a=new O5(s.semver.version);switch(s.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!i||a9(a,i))i=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${s.operator}`)}}),i&&(!r||a9(r,i)))r=i}if(r&&e.test(r))return r;return null};c9.exports=wae});var p9=_(function(U7t,l9){var Tae=fn(),Eae=(e,t)=>{try{return new Tae(e,t).range||"*"}catch(r){return null}};l9.exports=Eae});var qg=_(function(H7t,h9){var vae=$t(),m9=id(),{ANY:Sae}=m9,Aae=fn(),Cae=ad(),f9=nd(),d9=Fg(),Dae=Lg(),Iae=Mg(),Oae=(e,t,r,n)=>{e=new vae(e,n),t=new Aae(t,n);let o,i,s,a,c;switch(r){case">":o=f9,i=Dae,s=d9,a=">",c=">=";break;case"<":o=d9,i=Iae,s=f9,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(Cae(e,t,n))return!1;for(let u=0;u<t.set.length;++u){let l=t.set[u],p=null,f=null;if(l.forEach((d)=>{if(d.semver===Sae)d=new m9(">=0.0.0");if(p=p||d,f=f||d,o(d.semver,p.semver,n))p=d;else if(s(d.semver,f.semver,n))f=d}),p.operator===a||p.operator===c)return!1;if((!f.operator||f.operator===a)&&i(e,f.semver))return!1;else if(f.operator===c&&s(e,f.semver))return!1}return!0};h9.exports=Oae});var g9=_(function(j7t,y9){var kae=qg(),Rae=(e,t,r)=>kae(e,t,">",r);y9.exports=Rae});var x9=_(function(q7t,b9){var Pae=qg(),_ae=(e,t,r)=>Pae(e,t,"<",r);b9.exports=_ae});var E9=_(function(z7t,T9){var w9=fn(),Bae=(e,t,r)=>(e=new w9(e,r),t=new w9(t,r),e.intersects(t,r));T9.exports=Bae});var S9=_(function(G7t,v9){var Nae=ad(),Fae=pn();v9.exports=(e,t,r)=>{let n=[],o=null,i=null,s=e.sort((l,p)=>Fae(l,p,r));for(let l of s)if(Nae(l,t,r)){if(i=l,!o)o=l}else{if(i)n.push([o,i]);i=null,o=null}if(o)n.push([o,null]);let a=[];for(let[l,p]of n)if(l===p)a.push(l);else if(!p&&l===s[0])a.push("*");else if(!p)a.push(`>=${l}`);else if(l===s[0])a.push(`<=${p}`);else a.push(`${l} - ${p}`);let c=a.join(" || "),u=typeof t.raw==="string"?t.raw:String(t);return c.length<u.length?c:t}});var k9=_(function(V7t,O9){var A9=fn(),P5=id(),{ANY:k5}=P5,R5=ad(),_5=pn(),Mae=(e,t,r={})=>{if(e===t)return!0;e=new A9(e,r),t=new A9(t,r);let n=!1;e:for(let o of e.set){for(let i of t.set){let s=$ae(o,i,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},Lae=[new P5(">=0.0.0-0")],C9=[new P5(">=0.0.0")],$ae=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===k5)if(t.length===1&&t[0].semver===k5)return!0;else if(r.includePrerelease)e=Lae;else e=C9;if(t.length===1&&t[0].semver===k5)if(r.includePrerelease)return!0;else t=C9;let n=new Set,o,i;for(let d of e)if(d.operator===">"||d.operator===">=")o=D9(o,d,r);else if(d.operator==="<"||d.operator==="<=")i=I9(i,d,r);else n.add(d.semver);if(n.size>1)return null;let s;if(o&&i){if(s=_5(o.semver,i.semver,r),s>0)return null;else if(s===0&&(o.operator!==">="||i.operator!=="<="))return null}for(let d of n){if(o&&!R5(d,String(o),r))return null;if(i&&!R5(d,String(i),r))return null;for(let h of t)if(!R5(d,String(h),r))return!1;return!0}let a,c,u,l,p=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;if(p&&p.prerelease.length===1&&i.operator==="<"&&p.prerelease[0]===0)p=!1;for(let d of t){if(l=l||d.operator===">"||d.operator===">=",u=u||d.operator==="<"||d.operator==="<=",o){if(f){if(d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch)f=!1}if(d.operator===">"||d.operator===">="){if(a=D9(o,d,r),a===d&&a!==o)return!1}else if(o.operator===">="&&!d.test(o.semver))return!1}if(i){if(p){if(d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===p.major&&d.semver.minor===p.minor&&d.semver.patch===p.patch)p=!1}if(d.operator==="<"||d.operator==="<="){if(c=I9(i,d,r),c===d&&c!==i)return!1}else if(i.operator==="<="&&!d.test(i.semver))return!1}if(!d.operator&&(i||o)&&s!==0)return!1}if(o&&u&&!i&&s!==0)return!1;if(i&&l&&!o&&s!==0)return!1;if(f||p)return!1;return!0},D9=(e,t,r)=>{if(!e)return t;let n=_5(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},I9=(e,t,r)=>{if(!e)return t;let n=_5(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};O9.exports=Mae});var cd=_(function(W7t,R9){var wl=xl(),zg=bl(),Uae=$t(),Gg=E5(),Hae=As(),jae=eM(),qae=rM(),zae=iM(),Gae=cM(),Vae=lM(),Wae=fM(),Kae=mM(),Yae=yM(),Zae=pn(),Jae=wM(),Xae=EM(),Qae=Ng(),ece=CM(),tce=IM(),rce=nd(),nce=Fg(),oce=S5(),ice=A5(),sce=Mg(),ace=Lg(),cce=C5(),uce=MM(),lce=UM(),pce=id(),fce=fn(),dce=ad(),mce=r9(),hce=o9(),yce=s9(),gce=u9(),bce=p9(),xce=qg(),wce=g9(),Tce=x9(),Ece=E9(),vce=S9(),Sce=k9();R9.exports={parse:Hae,valid:jae,clean:qae,inc:zae,diff:Gae,major:Vae,minor:Wae,patch:Kae,prerelease:Yae,compare:Zae,rcompare:Jae,compareLoose:Xae,compareBuild:Qae,sort:ece,rsort:tce,gt:rce,lt:nce,eq:oce,neq:ice,gte:sce,lte:ace,cmp:cce,coerce:uce,truncate:lce,Comparator:pce,Range:fce,satisfies:dce,toComparators:mce,maxSatisfying:hce,minSatisfying:yce,minVersion:gce,validRange:bce,outside:xce,gtr:wce,ltr:Tce,intersects:Ece,simplifyRange:vce,subset:Sce,SemVer:Uae,re:wl.re,src:wl.src,tokens:wl.t,SEMVER_SPEC_VERSION:zg.SEMVER_SPEC_VERSION,RELEASE_TYPES:zg.RELEASE_TYPES,compareIdentifiers:Gg.compareIdentifiers,rcompareIdentifiers:Gg.rcompareIdentifiers}});var El,mUt,hUt,yUt,gUt,bUt,xUt,wUt,TUt,EUt,hd,vUt,SUt,AUt,CUt,DUt;var Y9=H(()=>{El=globalThis.window?.document!==void 0,mUt=globalThis.process?.versions?.node!==void 0,hUt=globalThis.process?.versions?.bun!==void 0,yUt=globalThis.Deno?.version?.deno!==void 0,gUt=globalThis.process?.versions?.electron!==void 0,bUt=globalThis.navigator?.userAgent?.includes("jsdom")===!0,xUt=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,wUt=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,TUt=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,EUt=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,hd=globalThis.navigator?.userAgentData?.platform,vUt=hd==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",SUt=hd==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",AUt=hd==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",CUt=hd==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),DUt=hd==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android"});import vl from"node:process";import Yce from"node:os";var je="\x1B[",Z9,Zce,PUt,_Ut,Jg=(e=1)=>je+e+"A",q5=(e=1)=>je+e+"B",z5,BUt,NUt,FUt,MUt,LUt,$Ut,UUt,yd=(e)=>{let t="";for(let r=0;r<e;r++)t+=J9+(r<e-1?Jg():"");if(e)t+=z5;return t},Jce,HUt,J9,jUt,qUt,j5,zUt,GUt,VUt,Xce=()=>{if(El||!Zce)return!1;let e=Yce.release().split("."),t=Number(e[0]),r=Number(e[2]??0);if(t<10)return!0;if(t===10&&r<10586)return!0;return!1},WUt,KUt,YUt,ZUt,JUt;var G5=H(()=>{Y9();Z9=!El&&vl.env.TERM_PROGRAM==="Apple_Terminal",Zce=!El&&vl.platform==="win32",PUt=!El&&(vl.env.TERM?.startsWith("screen")||vl.env.TERM?.startsWith("tmux")||vl.env.TMUX!==void 0),_Ut=El?()=>{throw Error("`process.cwd()` only works in Node.js, not the browser.")}:vl.cwd,z5=je+"G",BUt=Z9?"\x1B7":je+"s",NUt=Z9?"\x1B8":je+"u",FUt=je+"6n",MUt=je+"E",LUt=je+"F",$Ut=je+"?25l",UUt=je+"?25h",Jce=je+"K",HUt=je+"1K",J9=je+"2K",jUt=je+"J",qUt=je+"1J",j5=je+"2J",zUt=je+"S",GUt=je+"T",VUt=`${j5}${je}H`,WUt=Xce()?`${j5}${je}0f`:`${j5}${je}3J${je}H`,KUt=je+"?1049h",YUt=je+"?1049l",ZUt=je+"?2026h",JUt=je+"?2026l"});var Q9=H(()=>{G5();G5()});function V5(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let o of Reflect.ownKeys(t))Qce(e,t,o,r);return tue(e,t),iue(e,t,n),e}var Qce=(e,t,r,n)=>{if(r==="length"||r==="prototype")return;if(r==="arguments"||r==="caller")return;let o=Object.getOwnPropertyDescriptor(e,r),i=Object.getOwnPropertyDescriptor(t,r);if(!eue(o,i)&&n)return;Object.defineProperty(e,r,i)},eue=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},tue=(e,t)=>{let r=Object.getPrototypeOf(t);if(r===Object.getPrototypeOf(e))return;Object.setPrototypeOf(e,r)},rue=(e,t)=>`/* Wrapped ${e}*/
48
+ ${t}`,nue,oue,iue=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,o=rue.bind(null,n,t.toString());Object.defineProperty(o,"name",oue);let{writable:i,enumerable:s,configurable:a}=nue;Object.defineProperty(e,"toString",{value:o,writable:i,enumerable:s,configurable:a})};var eL=H(()=>{nue=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),oue=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var Xg,tL=(e,t={})=>{if(typeof e!=="function")throw TypeError("Expected a function");let r,n=0,o=e.displayName||e.name||"<anonymous>",i=function(...s){if(Xg.set(i,++n),n===1)r=e.apply(this,s),e=void 0;else if(t.throw===!0)throw Error(`Function \`${o}\` can only be called once`);return r};return V5(i,e),Xg.set(i,n),i},rL;var nL=H(()=>{eL();Xg=new WeakMap;tL.callCount=(e)=>{if(!Xg.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Xg.get(e)};rL=tL});import Qg from"node:process";var oL,sue,iL;var sL=H(()=>{nL();Ph();oL=Qg.stderr.isTTY?Qg.stderr:Qg.stdout.isTTY?Qg.stdout:void 0,sue=oL?rL(()=>{Tc(()=>{oL.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},iL=sue});import aL from"node:process";var eb=!1,Sl,Al;var W5=H(()=>{sL();Sl={};Sl.show=(e=aL.stderr)=>{if(!e.isTTY)return;eb=!1,e.write("\x1B[?25h")};Sl.hide=(e=aL.stderr)=>{if(!e.isTTY)return;iL(),eb=!0,e.write("\x1B[?25l")};Sl.toggle=(e,t)=>{if(e!==void 0)eb=e;if(eb)Sl.show(t);else Sl.hide(t)};Al=Sl});function K5({onlyFirst:e=!1}={}){return new RegExp("(?:(?:\\u001B\\]|\\u009D)[^\\u0007\\u001B\\u009C\\u009D]*(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",e?void 0:"g")}function Cl(e){if(typeof e!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);if(!e.includes("\x1B")&&!e.includes("›"))return e;return e.replace(aue,"")}var aue;var Y5=H(()=>{aue=K5()});var cL=161,uL=1114109,lL,pL=12288,fL=65510,dL,mL=4352,hL=262141,Z5;var yL=H(()=>{lL=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],dL=[12288,12288,65281,65376,65504,65510],Z5=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101594,101631,101664,101760,101874,101888,102801,102816,102866,110576,110579,110581,110587,110589,110590,110592,110888,110898,110898,110928,110930,110933,110933,110948,110952,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127406,127406,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128729,128732,128735,128747,128748,128756,128764,128986,128986,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129734,129736,129736,129740,129757,129759,129771,129775,129786,131072,196605,196608,262141]});var tb=(e,t)=>{let r=0,n=Math.floor(e.length/2)-1;while(r<=n){let o=Math.floor((r+n)/2),i=o*2;if(t<e[i])n=o-1;else if(t>e[i+1])r=o+1;else return!0}return!1};function lue(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){let o=e[n],i=e[n+1];if(gL>=o&&gL<=i)return[o,i];if(i-o>r-t)t=o,r=i}return[t,r]}var gL=19968,cue,uue,bL=(e)=>{if(e<cL||e>uL)return!1;return tb(lL,e)},Dl=(e)=>{if(e<pL||e>fL)return!1;return tb(dL,e)},gd=(e)=>{if(e>=cue&&e<=uue)return!0;if(e<mL||e>hL)return!1;return tb(Z5,e)};var J5=H(()=>{yL();[cue,uue]=lue(Z5)});function pue(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function bd(e,{ambiguousAsWide:t=!1}={}){if(pue(e),Dl(e)||gd(e)||t&&bL(e))return 2;return 1}var X5=H(()=>{J5();J5()});function gue(e){if(e.length>50)return!1;if(hue.test(e))return!0;if(e.includes("‍")){let t=e.match(yue);return t!==null&&t.length>=2}return!1}function bue(e){let t=e.search(xL);return t===-1?void 0:e.slice(t)}function wL(e){return e>=4352&&e<=4447||e>=43360&&e<=43388}function TL(e){return e>=4448&&e<=4519||e>=55216&&e<=55238}function EL(e){return e>=4520&&e<=4607||e>=55243&&e<=55291}function xue(e){return wL(e)||TL(e)||EL(e)}function wue(e,t){let r=[];for(let o of e){if(!xL.test(o))continue;r.push(o.codePointAt(0))}if(r.length===0)return;let n=0;for(let o=0;o<r.length;o++){let i=r[o];if(!xue(i)){if(n===0)return;for(let s=o;s<r.length;s++)n+=bd(r[s],t);return n}if(wL(i)&&TL(r[o+1])){n+=2,o+=EL(r[o+2])?2:1;continue}n+=bd(i,t)}return n}function Tue(e,t){let r=0,n=!0;for(let o of e){if(n){n=!1;continue}if(due.test(o)||o>="＀"&&o<="￯")r+=bd(o.codePointAt(0),t)}return r}function fr(e,t={}){if(typeof e!=="string"||e.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=t,o=e;if(!n&&(o.includes("\x1B")||o.includes("›")))o=Cl(o);if(o.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(o))return o.length;let i=0,s={ambiguousAsWide:!r};for(let{segment:a}of fue.segment(o)){let c=bue(a);if(c===void 0)continue;if(mue.test(a)||gue(a)){i+=2;continue}let u=wue(c,s);if(u!==void 0){i+=u;continue}let l=c.codePointAt(0);i+=bd(l,s),i+=Tue(c,s)}return i}var fue,xL,due,mue,hue,yue;var xd=H(()=>{Y5();X5();fue=new Intl.Segmenter,xL=/[^\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Nonspacing_Mark}\p{Enclosing_Mark}\p{Surrogate}]/v,due=/\p{Spacing_Mark}/v,mue=/^\p{RGI_Emoji}$/v,hue=/^[\d#*]\u20E3$/,yue=/\p{Extended_Pictographic}/gu});function Sue(){let e=new Map;for(let[t,r]of Object.entries(Ke)){for(let[n,o]of Object.entries(r))Ke[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Ke[n],e.set(o[0],o[1]);Object.defineProperty(Ke,t,{value:r,enumerable:!1})}return Object.defineProperty(Ke,"codes",{value:e,enumerable:!1}),Ke.color.close="\x1B[39m",Ke.bgColor.close="\x1B[49m",Ke.color.ansi=vL(),Ke.color.ansi256=SL(),Ke.color.ansi16m=AL(),Ke.bgColor.ansi=vL(10),Ke.bgColor.ansi256=SL(10),Ke.bgColor.ansi16m=AL(10),Object.defineProperties(Ke,{rgbToAnsi256:{value(t,r,n){if(t===r&&r===n){if(t<8)return 16;if(t>248)return 231;return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;if(n.length===3)n=[...n].map((i)=>i+i).join("");let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:(t)=>Ke.rgbToAnsi256(...Ke.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,o;if(t>=232)r=((t-232)*10+8)/255,n=r,o=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let i=Math.max(r,n,o)*2;if(i===0)return 30;let s=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));if(i===2)s+=60;return s},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>Ke.ansi256ToAnsi(Ke.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:(t)=>Ke.ansi256ToAnsi(Ke.hexToAnsi256(t)),enumerable:!1}}),Ke}var vL=(e=0)=>(t)=>`\x1B[${t+e}m`,SL=(e=0)=>(t)=>`\x1B[${38+e};5;${t}m`,AL=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,Ke,RHt,Eue,vue,PHt,Aue,mn;var Q5=H(()=>{Ke={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]}},RHt=Object.keys(Ke.modifier),Eue=Object.keys(Ke.color),vue=Object.keys(Ke.bgColor),PHt=[...Eue,...vue];Aue=Sue(),mn=Aue});function Td(e,t,r){return Yue(String(e)).replaceAll(`\r
49
+ `,`
50
+ `).split(`
51
+ `).map((n)=>Kue(Vue(n),t,r)).join(`
52
+ `)}var Il="\x1B",PL="\x07",_L="›",BL="[",NL="]",FL="m",nb=0,ML=39,LL=49,$L=59,tv=38,rv=48,nv=58,UL=2,HL=5,Cue,jL,qL,Due,Iue="[0-?]*[ -/]*[@-~]",Oue,zL,GL,kue,Rue,CL,VL,Pue,wd=(e)=>fr(e,{countAnsiEscapeCodes:!0}),DL=8,IL,OL,_ue,WL=(e)=>`${Il}${BL}${e}${FL}`,kL=(e,t="")=>`${Il}${Cue}${t};${e}${PL}`,ov=(e,t)=>{if(!jL.has(e[t]))return;return CL.lastIndex=t,CL.exec(e)??void 0},Ol=(e,t,r=()=>{})=>{let n=0,o=0;while(o<e.length){IL.lastIndex=o;let i=IL.exec(e);if(!i)break;let s=ov(e,i.index);if(!s){o=i.index+1;continue}if(i.index>n)t(e.slice(n,i.index));r(s[0]),o=i.index+s[0].length,n=o}if(n<e.length)t(e.slice(n))},KL=(e)=>{let t="";return Ol(e,(r)=>{t+=r}),wd(t)},Bue=(e)=>{let t=[];return Ol(e,(r)=>{if(_ue.test(r)){for(let n of r)t.push({value:n,width:1});return}for(let{segment:n}of Pue.segment(r))t.push({value:n,width:wd(n)})},(r)=>{t.push({value:r,width:0})}),t},Nue=(e)=>{let t={value:"",plainText:""},r=[t];Ol(e,(n)=>{let o=n.split(" ");t.value+=o[0],t.plainText+=o[0];for(let i=1;i<o.length;i++)t={value:o[i],plainText:o[i]},r.push(t)},(n)=>{t.value+=n});for(let n of r)n.width=wd(n.plainText);return r},Fue=(e)=>{let t=e.split(":"),r=Number.parseInt(t[0],10),n=Number.parseInt(t[1],10);if(![tv,rv,nv].includes(r))return;if(n===HL&&t.length===3&&/^\d+$/.test(t[2]))return{code:r,open:e,hasArguments:!0};if(n!==UL)return;let o=t.length===6?t.slice(3):t.slice(2),i=t.length===6?t[2]:void 0;if(o.length===3&&o.every((s)=>/^\d+$/.test(s))&&(i===void 0||/^\d*$/.test(i)))return{code:r,open:e,hasArguments:!0}},YL=(e)=>{let t=e.split(";"),r=[];for(let n=0;n<t.length;n++){let o=t[n];if(o.includes(":")){let s=Fue(o);if(s)r.push(s);continue}let i=o===""?nb:Number.parseInt(o,10);if(!Number.isFinite(i))continue;if(i===tv||i===rv||i===nv){if(n+1>=t.length)break;let s=Number.parseInt(t[n+1],10),a=Number.parseInt(t[n+2],10);if(s===HL&&Number.isFinite(a)){r.push({code:i,open:[i,s,a].join(";"),hasArguments:!0}),n+=2;continue}let c=Number.parseInt(t[n+2],10),u=Number.parseInt(t[n+3],10),l=Number.parseInt(t[n+4],10);if(s===UL&&Number.isFinite(c)&&Number.isFinite(u)&&Number.isFinite(l)){r.push({code:i,open:[i,s,c,u,l].join(";"),hasArguments:!0}),n+=4;continue}break}r.push({code:i,open:String(i),hasArguments:!1})}return r},rb=(e,t)=>{let r=e.findIndex((n)=>n.family===t);if(r!==-1)e.splice(r,1)},RL=(e,t)=>{rb(e,t.family),e.push(t)},Mue=(e,t)=>{for(let r=e.length-1;r>=0;r--){let n=e[r];if(n.family.startsWith("modifier-")&&n.close===t)e.splice(r,1)}},Lue=(e)=>{let{code:t,open:r,hasArguments:n}=e;if(t>=30&&t<=37||t>=90&&t<=97||t===tv&&n)return{family:"foreground",open:r,close:ML};if(t>=40&&t<=47||t>=100&&t<=107||t===rv&&n)return{family:"background",open:r,close:LL};if(t===nv&&n)return{family:"underlineColor",open:r,close:$L}},ZL=(e,t)=>{if(e===nb)return t.length=0,!0;if(e===ML)return rb(t,"foreground"),!0;if(e===LL)return rb(t,"background"),!0;if(e===$L)return rb(t,"underlineColor"),!0;if(VL.has(e))return Mue(t,e),!0;return!1},$ue=(e,t)=>{let{code:r}=e;if(ZL(r,t))return;let n=Lue(e);if(n){RL(t,n);return}let o=mn.codes.get(r);if(o!==void 0&&o!==nb)RL(t,{family:`modifier-${r}`,open:e.open,close:o})},Uue=(e,t)=>{for(let r of YL(e))$ue(r,t)},Hue=(e,t)=>{for(let{code:r}of YL(e))ZL(r,t)},jue=(e,t,r)=>{let n=t;while(n<e.length){let o=ov(e,n);if(!o)break;if(o.groups.sgr!==void 0)Hue(o.groups.sgr,r);n+=o[0].length}},que=(e)=>[...e].reverse().map((t)=>WL(t.close)).join(""),zue=(e)=>e.map((t)=>WL(t.open)).join(""),ev=(e,t,r,n)=>{let o=Bue(t),i=n;for(let s=0;s<o.length;s++){let a=o[s];if(a.width>0&&i>0&&i+a.width>r)e.push(""),i=0;if(e[e.length-1]+=a.value,i+=a.width,i===r&&s<o.length-1)e.push(""),i=0}if(!i&&e.at(-1).length>0&&e.length>1)e[e.length-2]+=e.pop();return KL(e.at(-1))},Gue=(e)=>{if(!e.includes(" "))return e;let t=[];Ol(e,(r)=>{t.push({value:r,isEscape:!1})},(r)=>{t.push({value:r,isEscape:!0})});for(let r=t.length-1;r>=0;r--){let n=t[r];if(n.isEscape)continue;let o=n.value.length;while(o>0&&n.value[o-1]===" ")o--;if(n.value=n.value.slice(0,o),wd(n.value)>0)break}return t.map((r)=>r.value).join("")},Vue=(e)=>{if(!e.includes("\t"))return e;let t=0,r="",n="";return Ol(e,(i)=>{let s=i.split("\t");for(let[a,c]of s.entries())if(r+=c,n+=c,a<s.length-1){t+=wd(n),n="";let u=DL-t%DL;r+=" ".repeat(u),t+=u}},(i)=>{r+=i}),r},Wue=(e)=>{let t="",r,n=[],o=0,i=0;while(o<e.length){OL.lastIndex=o;let s=OL.exec(e);if(!s)break;if(o=s.index,s[0]!==`
53
+ `){let a=ov(e,o);if(!a){o++;continue}let{groups:c}=a;if(c.sgr!==void 0)Uue(c.sgr,n);else if(c.uri!==void 0)r=c.uri.length===0?void 0:{parameters:c.parameters,uri:c.uri};o+=a[0].length;continue}if(t+=e.slice(i,o),o>i){if(r)t+=kL("");t+=que(n)}if(t+=`
54
+ `,o++,i=o,o<e.length&&e[o]!==`
55
+ `){let a=[...n];if(jue(e,o,a),t+=zue(a),r)t+=kL(r.uri,r.parameters)}}return t+e.slice(i)},Kue=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n=Nue(e),o=[""],i=0,s=-1,a=!0;for(let c of n){let u=o.length-1;if(r.trim!==!1&&s!==u){let l=o[u],p=l.trimStart();if(p.length!==l.length)o[u]=p,i=KL(p);if(p.length>0)s=u}if(a)a=!1;else{if(i>=t&&(r.wordWrap===!1||r.trim===!1))o.push(""),i=0;if(i>0||r.trim===!1)o[o.length-1]+=" ",i++}if(r.hard&&r.wordWrap!==!1&&c.width>t){let l=t-i,p=1+Math.floor((c.width-l-1)/t);if(Math.floor((c.width-1)/t)<p)o.push(""),i=0;i=ev(o,c.value,t,i);continue}if(i+c.width>t&&i>0&&c.width>0){if(r.wordWrap===!1&&i<t){i=ev(o,c.value,t,i);continue}o.push(""),i=0}if(i+c.width>t&&r.wordWrap===!1){i=ev(o,c.value,t,i);continue}o[o.length-1]+=c.value,i+=c.width}if(r.trim!==!1)o=o.map((c)=>Gue(c));return Wue(o.join(`
56
+ `))},Yue=(e)=>{let t="";return Ol(e,(r)=>{t+=r.normalize()},(r)=>{t+=r}),t};var iv=H(()=>{xd();Q5();Cue=`${NL}8;`,jL=new Set([Il,_L]),qL=[...jL].join(""),Due=`(?:${Il}\\${BL}|${_L})`,Oue=`(?<sgr>[0-9;:]*)${FL}`,zL=`(?:${PL}|${Il}\\\\)`,GL=String.raw`[^\u0000-\u001F\u007F-\u009F]*`,kue=String.raw`8;(?<parameters>[^;\u0000-\u001F\u007F-\u009F]*);(?<uri>${GL})${zL}`,Rue=`${GL}${zL}`,CL=new RegExp(`${Due}(?:${Oue}|${Iue})|${Il}\\${NL}(?:${kue}|${Rue})`,"y"),VL=new Set(mn.codes.values());VL.delete(nb);Pue=new Intl.Segmenter,IL=new RegExp(`[${qL}]`,"g"),OL=new RegExp(`[\\n${qL}]`,"g"),_ue=/^[ -~]*$/});function ob(e){if(!Number.isInteger(e))return!1;return Dl(e)||gd(e)}var JL=H(()=>{X5()});function vle(e){return e>=nle&&e<=ole||e===ile||e===sle}function Sle(e){return e>=ale&&e<=cle}function Ale(e){return e>=ule&&e<=lle}function Cle(e){return e>=ple&&e<=fle}function Dle(e){return e>=dle&&e<=mle}function zn(e,t){return{token:{type:"control",code:e},endIndex:t}}function Ile(e){if(Ele.test(e))return!0;for(let t of e){let r=t.codePointAt(0);if(r===wle||r===Tle)return!0}return!1}function p$(e){let t=0;for(let r of e){let n=r.codePointAt(0);if(ob(n))return 2;if(Dle(n))t++}if(t>=1)return 2;if(Ile(e))return 2;return 1}function Ole(e){if(e.startsWith("›"))return"›";return`${kl}${fv}`}function Ed(e,t){return`${e}${t.join(";")}${c$}`}function kle(e){let t=[],r=Ole(e),n;if(e.startsWith(`${kl}${fv}`))n=e.slice(2,-1);else if(e.startsWith("›"))n=e.slice(1,-1);else return t;let o=n.length===0?[String(XL)]:n.split(";"),i=0;while(i<o.length){let s=Number.parseInt(o[i],10);if(Number.isNaN(s)){i++;continue}if(s===XL){t.push({type:"reset"}),i++;continue}if(s===ib||s===hle){let u=Number.parseInt(o[i+1],10);if(u===yle&&i+ble<o.length){let p=Ed(r,o.slice(i,i+QL));t.push({type:"start",code:p,endCode:mn.color.ansi(s===ib?sv:av)}),i+=QL;continue}if(u===gle&&i+xle<o.length){let p=Ed(r,o.slice(i,i+e$));t.push({type:"start",code:p,endCode:mn.color.ansi(s===ib?sv:av)}),i+=e$;continue}let l=Ed(r,[o[i]]);t.push({type:"start",code:l,endCode:mn.color.ansi(s===ib?sv:av)}),i++;continue}if(l$.has(s)){t.push({type:"end",endCode:mn.color.ansi(s)}),i++;continue}let a=mn.codes.get(s);if(a!==void 0){let u=Ed(r,[o[i]]);t.push({type:"start",code:u,endCode:mn.color.ansi(a)}),i++;continue}let c=Ed(r,[o[i]]);t.push({type:"start",code:c,endCode:mn.reset.open}),i++}if(t.length===0)t.push({type:"reset"});return t}function Rle(e,t){let r=e.codePointAt(t),n;if(r===vd){if(e[t+1]!==fv)return;n=t+2}else if(r===n$)n=t+1;else return;let o=!0;for(let i=n;i<e.length;i++){let s=e.codePointAt(i);if(Cle(s)){let c=e.slice(t,i+1);if(e[i]!==c$||!o)return zn(c,i+1);return{token:{type:"sgr",code:c,fragments:kle(c)},endIndex:i+1}}if(Sle(s)){if(!vle(s))o=!1;continue}if(Ale(s)){o=!1;continue}let a=i;return zn(e.slice(t,a),a)}return zn(e.slice(t),e.length)}function Ple(e,t){let r,n,o=e.codePointAt(t);if(o===vd&&e.startsWith(lv,t))r=lv,n=tle;else if(o===cb&&e.startsWith(pv,t))r=pv,n=rle;else return;let i=e.indexOf(";",t+r.length);if(i===-1)return zn(e.slice(t),e.length);for(let s=i+1;s<e.length;s++){let a=e[s];if(a===uv){let c=e.slice(t,s+1),u=s===i+1?"close":"open";return{token:{type:"hyperlink",code:c,action:u,closePrefix:n,terminator:uv},endIndex:s+1}}if(a===kl&&e[s+1]===sb){let c=e.slice(t,s+2),u=s===i+1?"close":"open";return{token:{type:"hyperlink",code:c,action:u,closePrefix:n,terminator:u$},endIndex:s+2}}if(a===ab){let c=e.slice(t,s+1),u=s===i+1?"close":"open";return{token:{type:"hyperlink",code:c,action:u,closePrefix:n,terminator:ab},endIndex:s+1}}}return zn(e.slice(t),e.length)}function _le(e,t){let r=e.codePointAt(t),n,o=!1;switch(r){case vd:{switch(e[t+1]){case a$:{n=t+2,o=!0;break}case Zue:case Jue:case Xue:case Que:{n=t+2;break}case sb:return zn(u$,t+2);default:return}break}case cb:{n=t+1,o=!0;break}case t$:case r$:case i$:case s$:{n=t+1;break}case o$:return zn(ab,t+1);default:return}for(let i=n;i<e.length;i++){if(o&&e[i]===uv)return zn(e.slice(t,i+1),i+1);if(e[i]===kl&&e[i+1]===sb)return zn(e.slice(t,i+2),i+2);if(e[i]===ab)return zn(e.slice(t,i+1),i+1)}return zn(e.slice(t),e.length)}function Ad(e,t){let r=e.codePointAt(t);if(r===vd||r===cb){let o=Ple(e,t);if(o)return o}let n=_le(e,t);if(n)return n;return Rle(e,t)}function f$(e,t,r){while(t<e.length){let n=e.codePointAt(t);if(!Sd.has(n))break;let o=Ad(e,t);if(!o)break;r.push(o.token),t=o.endIndex}return t}function d$(e,t,r){let n=r.containing(t);if(!n||n.index!==t)return;return{token:{type:"character",value:n.segment,visibleWidth:p$(n.segment),isGraphemeContinuation:!1},endIndex:t+n.segment.length}}function Ble(e){let t=[],r=0;while(r<e.length){let n=e.codePointAt(r);if(Sd.has(n)){let i=Ad(e,r);if(i){r=i.endIndex;continue}}let o=String.fromCodePoint(n);t.push({value:o,visibleWidth:1,isGraphemeContinuation:!1}),r+=o.length}return t}function Nle(e){if(e.length===0)return;let t=e.map(({value:i})=>i).join(""),r=[],n=0;for(let i of e)r.push(n),n+=i.value.length;let o=0;for(let i of dv.segment(t)){while(o<e.length&&r[o]<i.index)o++;let s=o,a=!0;while(s<e.length&&r[s]<i.index+i.segment.length)e[s].visibleWidth=a?p$(i.segment):0,e[s].isGraphemeContinuation=!a,a=!1,s++;o=s}}function cv(e,{endCharacter:t=Number.POSITIVE_INFINITY}={}){let r=[],n=Ble(e);Nle(n);let o=0,i=0,s=0;while(o<e.length){let a=e.codePointAt(o);if(Sd.has(a)){let f=Ad(e,o);if(f){r.push(f.token),o=f.endIndex;continue}}let c=String.fromCodePoint(a),u=n[i],l=ob(a)?2:c.length;if(u)l=u.visibleWidth;let p={type:"character",value:c,visibleWidth:l,isGraphemeContinuation:u?u.isGraphemeContinuation:!1};if(r.push(p),o+=c.length,i++,s+=p.visibleWidth,s>=t){let f=n[i];if(!f||!f.isGraphemeContinuation){o=f$(e,o,r);break}}}return r}function m$(e,t){let r=`${e}${t}`,n=e.length;for(let o of dv.segment(r)){if(o.index===n)return!1;if(o.index>n)return!0}return!0}function Fle(e,t,r,n){if(!r)return!1;let o=t,i=!1;while(o<e.length){let s=e.codePointAt(o);if(Sd.has(s)){let c=Ad(e,o);if(c){i=!0,o=c.endIndex;continue}}if(!i)return!1;let a=d$(e,o,n);if(!a)return!0;return m$(r,a.token.value)}return!1}function mv(e,{endCharacter:t=Number.POSITIVE_INFINITY}={}){let r=[],n=dv.segment(e),o=0,i=0,s,a=!1;while(o<e.length){let c=e.codePointAt(o);if(Sd.has(c)){let l=Ad(e,o);if(l){r.push(l.token),o=l.endIndex,a=!0;continue}}let u=d$(e,o,n);if(!u)return cv(e,{endCharacter:t});if(a&&s&&m$(s,u.token.value))return cv(e,{endCharacter:t});if(r.push(u.token),o=u.endIndex,i+=u.token.visibleWidth,a=!1,s=u.token.value,i>=t){if(Fle(e,o,s,n))return cv(e,{endCharacter:t});o=f$(e,o,r);break}}return r}var vd=27,t$=144,r$=152,n$=155,o$=156,cb=157,i$=158,s$=159,Sd,kl="\x1B",uv="\x07",fv="[",a$="]",Zue="P",Jue="X",Xue="^",Que="_",c$="m",sb="\\",u$,ele="",ab="œ",lv,pv,tle,rle,nle,ole,ile,sle,ale,cle,ule,lle,ple,fle,dle=127462,mle=127487,XL=0,ib=38,sv=39,hle=48,av=49,yle=5,gle=2,QL=3,e$=5,ble=2,xle=4,wle=65039,Tle=8419,Ele,dv,l$;var h$=H(()=>{Q5();JL();Sd=new Set([vd,t$,r$,n$,o$,cb,i$,s$]),u$=`${kl}${sb}`,lv=`${kl}${a$}8;`,pv=`${ele}8;`,tle=`${lv};`,rle=`${pv};`,nle="0".codePointAt(0),ole="9".codePointAt(0),ile=";".codePointAt(0),sle=":".codePointAt(0),ale="0".codePointAt(0),cle="?".codePointAt(0),ule=" ".codePointAt(0),lle="/".codePointAt(0),ple="@".codePointAt(0),fle="~".codePointAt(0),Ele=/\p{Emoji_Presentation}/v,dv=new Intl.Segmenter(void 0,{granularity:"grapheme"}),l$=new Set;for(let[,e]of mn.codes)l$.add(e)});function Mle(e,t){for(let r of t)switch(r.type){case"reset":{e.clear();break}case"end":{e.delete(r.endCode);break}case"start":{e.delete(r.endCode),e.set(r.endCode,r.code);break}default:break}return e}function Lle(e){return[...e.keys()].toReversed().join("")}function $le(e){return`${e.closePrefix}${e.terminator}`}function Ule(e,t){let r=!1,n=!1;for(let o of e.fragments){if(o.type==="start"){r=!0;continue}if(o.type==="reset"&&t.size>0){n=!0;continue}if(o.type==="end"&&t.has(o.endCode))n=!0}return n&&!r}function Hle(e){return e.fragments.some((t)=>t.type==="start")}function hv(e){if(e.activeHyperlink&&!e.activeHyperlinkHasVisibleText&&e.activeHyperlinkOutputIndex!==void 0){let t=e.activeHyperlink.code.length;if(e.returnValue=e.returnValue.slice(0,e.activeHyperlinkOutputIndex)+e.returnValue.slice(e.activeHyperlinkOutputIndex+t),e.pendingSgrOutputIndex!==void 0&&e.pendingSgrOutputIndex>e.activeHyperlinkOutputIndex)e.pendingSgrOutputIndex-=t}e.activeHyperlink=void 0,e.activeHyperlinkHasVisibleText=!1,e.activeHyperlinkOutputIndex=void 0}function y$(e){if(e.activeHyperlinkHasVisibleText)e.returnValue+=$le(e.activeHyperlink);else hv(e)}function jle(e){if(e.isPastEnd&&!Ule(e.token,e.activeStyles))return;if(e.include&&Hle(e.token)&&e.pendingSgrOutputIndex===void 0)e.pendingSgrOutputIndex=e.returnValue.length,e.pendingSgrActiveStyles=new Map(e.activeStyles);if(e.activeStyles=Mle(e.activeStyles,e.token.fragments),e.include)e.returnValue+=e.token.code}function qle(e){if(e.isPastEnd&&(e.token.action!=="close"||!e.activeHyperlink))return;if(e.token.action==="open"){if(e.activeHyperlink)y$(e);if(e.activeHyperlink=e.token,e.activeHyperlinkHasVisibleText=!1,e.activeHyperlinkOutputIndex=void 0,e.include)e.activeHyperlinkOutputIndex=e.returnValue.length}else if(e.token.action==="close"){if(e.include&&e.activeHyperlink&&!e.activeHyperlinkHasVisibleText){hv(e);return}e.activeHyperlink=void 0,e.activeHyperlinkHasVisibleText=!1,e.activeHyperlinkOutputIndex=void 0}if(e.include)e.returnValue+=e.token.code}function zle(e){if(!e.isPastEnd&&e.include)e.returnValue+=e.token.code}function Gle(e){if(!e.include&&e.position>=e.start&&!e.token.isGraphemeContinuation){if(e.include=!0,e.returnValue=[...e.activeStyles.values()].join(""),e.activeHyperlink)e.activeHyperlinkOutputIndex=e.returnValue.length,e.returnValue+=e.activeHyperlink.code}if(e.include){if(e.returnValue+=e.token.value,e.pendingSgrOutputIndex=void 0,e.pendingSgrActiveStyles=void 0,e.activeHyperlink)e.activeHyperlinkHasVisibleText=!0}e.position+=e.token.visibleWidth}function Wle(e){Vle[e.token.type]?.(e)}function Kle(e){let t=Array.from({length:e.length},()=>!1),r=!1;for(let n=e.length-1;n>=0;n--){let o=e[n];if(t[n]=r,o.type==="character")r=Boolean(o.isGraphemeContinuation)}return t}function Yle(e,t,r){if(r===void 0)return!1;if(t>=r)return!0;return e.type==="character"&&!e.isGraphemeContinuation&&t+e.visibleWidth>r}function Rr(e,t,r){let n=mv(e,{endCharacter:r}),o=Kle(n),i={start:t,token:void 0,isPastEnd:!1,activeStyles:new Map,activeHyperlink:void 0,activeHyperlinkHasVisibleText:!1,activeHyperlinkOutputIndex:void 0,pendingSgrOutputIndex:void 0,pendingSgrActiveStyles:void 0,position:0,returnValue:"",include:!1};for(let[s,a]of n.entries()){let c=Yle(a,i.position,r);if(c&&a.type!=="character"&&o[s])c=!1;if(c&&a.type==="character"&&!a.isGraphemeContinuation){if(i.activeHyperlink&&!i.activeHyperlinkHasVisibleText)hv(i);if(i.pendingSgrOutputIndex!==void 0)i.returnValue=i.returnValue.slice(0,i.pendingSgrOutputIndex),i.activeStyles=i.pendingSgrActiveStyles,i.pendingSgrOutputIndex=void 0,i.pendingSgrActiveStyles=void 0;break}i.token=a,i.isPastEnd=c,Wle(i)}if(!i.include)return"";if(i.activeHyperlink)y$(i);return i.returnValue+=Lle(i.activeStyles),i.returnValue}var Vle;var yv=H(()=>{h$();Vle={sgr:jle,hyperlink:qle,control:zle,character:Gle}});import g$ from"node:process";function lb(e,{showCursor:t=!1,defaultWidth:r,defaultHeight:n}={}){let o=0,i=ub(e,r),s="",a=e.isTTY===!0,c=(f)=>{if(f==="")return;if(a){e.write(Zle+f+Jle);return}e.write(f)},u=(f,d,h=!0)=>{let m=String(f),y=m.endsWith(`
57
+ `)?m:`${m}
58
+ `,g=Td(y,d,{trim:!1,hard:!0,wordWrap:!1}),{text:x,wasClipped:b}=h?Qle(e,g,n):{text:g,wasClipped:!1},w=x===""?[]:x.split(`
59
+ `);return{wrapped:x,lines:w,wasClipped:b}},l=()=>{s="",i=ub(e,r),o=0},p=(...f)=>{if(!t)Al.hide();let d=ub(e,r),{wrapped:h,lines:m,wasClipped:y}=u(f.join(" "),d);if(m.length===0){if(o>0)c(yd(o));s=h,i=d,o=0;return}if(h===s&&i===d)return;if(o===0){c(h),s=h,i=d,o=m.length;return}if(i!==d||y){c(yd(o)+h),s=h,i=d,o=m.length;return}let g=s===""?[]:s.split(`
60
+ `),{start:x,endPrevious:b,endNext:w}=epe(g,m);if(g.length!==m.length)b=g.length-1,w=m.length-1;if(x===m.length&&o===m.length)return;if(x===0){c(yd(o)+h),s=h,i=d,o=m.length;return}let v=tpe({prevCount:o,start:x,endPrevious:b,endNext:w,nextLines:m,nextWrappedEndsWithNewline:h.endsWith(`
61
+ `)});c(v),s=h,i=d,o=m.length};return p.clear=()=>{c(yd(o)),l()},p.done=()=>{if(l(),!t)Al.show()},p.persist=(...f)=>{let d=o>0?yd(o):"",h=ub(e,r),{wrapped:m}=u(f.join(" "),h,!1);c(d+m),l()},p}var ub=(e,t)=>e.columns??t??80,Zle="\x1B[?2026h",Jle="\x1B[?2026l",Xle=(e)=>e.split(`
62
+ `).length,gv=(e)=>{let t=Cl(e);return t===""?0:t.split(`
63
+ `).length},Qle=(e,t,r)=>{let n=e.rows??r??24;if(n===0)return{text:"",wasClipped:t!==""};let i=Cl(t).split(`
64
+ `),s=Math.max(0,i.length-n);if(s===0)return{text:t,wasClipped:!1};let a=0;for(let l=0;l<s;l++)a+=fr(i[l])+1;let c=Rr(t,a),u=gv(c);while(u>n)a++,c=Rr(t,a),u=gv(c);while(a>0){let l=Rr(t,a-1);if(gv(l)>n)break;a--,c=l}return{text:c,wasClipped:a>0}},epe=(e,t)=>{let r=0;for(;r<e.length&&r<t.length;r++)if(e[r]!==t[r])break;let n=e.length-1,o=t.length-1;while(n>=r&&o>=r&&e[n]===t[o])n--,o--;return{start:r,endPrevious:n,endNext:o}},tpe=({prevCount:e,start:t,endPrevious:r,endNext:n,nextLines:o,nextWrappedEndsWithNewline:i})=>{let s="",a=e-1,c=t-a;if(c>0)s+=q5(c);if(c<0)s+=Jg(-c);s+=z5;let u=Math.max(0,r-t+1);for(let m=0;m<u;m++)if(s+=J9,m<u-1)s+=q5();if(u>1)s+=Jg(u-1);s+=z5;let l=o.slice(t,n+1),p=0;if(l.length>0){let m=l.join(`
65
+ `),y=i&&n<o.length-1&&!m.endsWith(`
66
+ `);if(s+=m,p=Xle(m)-1,s+=Jce,y)s+=`
67
+ `,p++}let f=t+p,h=o.length-1-f;if(h>0)s+=q5(h);if(h<0)s+=Jg(-h);return s},JHt,XHt;var b$=H(()=>{Q9();W5();iv();yv();Y5();xd();JHt=lb(g$.stdout),XHt=lb(g$.stderr)});function pb(e,t,r){if(e.charAt(t)===" ")return t;let n=r?1:-1;for(let o=0;o<=3;o++){let i=t+o*n;if(e.charAt(i)===" ")return i}return t}function npe(e,t,r,n){if(typeof e!=="string")throw TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!=="number")throw TypeError(`Expected \`columns\` to be a number, got ${typeof t}`);if(!Number.isFinite(t))throw TypeError(`Expected \`columns\` to be a finite number, got ${t}`);if(!rpe.has(r))throw TypeError(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${r}`);if(typeof n!=="string")throw TypeError(`Expected \`options.truncationCharacter\` to be a string, got ${typeof n}`)}function bv(e,t,r={}){let{position:n="end",space:o=!1,preferTruncationOnSpace:i=!1}=r,{truncationCharacter:s="…"}=r;if(npe(e,t,n,s),t<1)return"";let a=fr(e);if(a<=t)return e;if(t===1)return s;let c={ESC:27,LEFT_BRACKET:91,LETTER_M:109},u=(h)=>h>=48&&h<=57||h===59;function l(h){let m=0;while(m+2<h.length&&h.codePointAt(m)===c.ESC&&h.codePointAt(m+1)===c.LEFT_BRACKET){let y=m+2;while(y<h.length&&u(h.codePointAt(y)))y++;if(y<h.length&&h.codePointAt(y)===c.LETTER_M){m=y+1;continue}break}return m}function p(h){let m=h.length;while(m>1&&h.codePointAt(m-1)===c.LETTER_M){let y=m-2;while(y>=0&&u(h.codePointAt(y)))y--;if(y>=1&&h.codePointAt(y-1)===c.ESC&&h.codePointAt(y)===c.LEFT_BRACKET){m=y-1;continue}break}return m}function f(h,m){let y=p(h);if(y===h.length)return h+m;return h.slice(0,y)+m+h.slice(y)}function d(h,m){let y=l(m);if(y===0)return h+m;return m.slice(0,y)+h+m.slice(y)}if(n==="start"){if(i){let m=pb(e,a-t+fr(s),!0),y=Rr(e,m,a).trim();return d(s,y)}if(o)s+=" ";let h=Rr(e,a-t+fr(s),a);return d(s,h)}if(n==="middle"){if(o){if(s=` ${s} `,fr(s)>=t)s=s.trim()}let h=fr(s),m=Math.min(Math.floor(t/2),Math.max(0,t-h));if(i){let y=pb(e,m),g=pb(e,a-(t-m)+h,!0);return Rr(e,0,y)+s+Rr(e,g,a).trim()}return Rr(e,0,m)+s+Rr(e,a-(t-m)+h,a)}if(n==="end"){if(i){let m=pb(e,t-fr(s)),y=Rr(e,0,m);return f(y,s)}if(o)s=` ${s}`;let h=Rr(e,0,t-fr(s));return f(h,s)}}var rpe;var x$=H(()=>{yv();xd();rpe=new Set(["start","middle","end"])});var xe=_(function(Zpe){var Sv=Symbol.for("yaml.alias"),k$=Symbol.for("yaml.document"),bb=Symbol.for("yaml.map"),R$=Symbol.for("yaml.pair"),Av=Symbol.for("yaml.scalar"),xb=Symbol.for("yaml.seq"),Oi=Symbol.for("yaml.node.type"),qpe=(e)=>!!e&&typeof e==="object"&&e[Oi]===Sv,zpe=(e)=>!!e&&typeof e==="object"&&e[Oi]===k$,Gpe=(e)=>!!e&&typeof e==="object"&&e[Oi]===bb,Vpe=(e)=>!!e&&typeof e==="object"&&e[Oi]===R$,P$=(e)=>!!e&&typeof e==="object"&&e[Oi]===Av,Wpe=(e)=>!!e&&typeof e==="object"&&e[Oi]===xb;function _$(e){if(e&&typeof e==="object")switch(e[Oi]){case bb:case xb:return!0}return!1}function Kpe(e){if(e&&typeof e==="object")switch(e[Oi]){case Sv:case bb:case Av:case xb:return!0}return!1}var Ype=(e)=>(P$(e)||_$(e))&&!!e.anchor;Zpe.ALIAS=Sv;Zpe.DOC=k$;Zpe.MAP=bb;Zpe.NODE_TYPE=Oi;Zpe.PAIR=R$;Zpe.SCALAR=Av;Zpe.SEQ=xb;Zpe.hasAnchor=Ype;Zpe.isAlias=qpe;Zpe.isCollection=_$;Zpe.isDocument=zpe;Zpe.isMap=Gpe;Zpe.isNode=Kpe;Zpe.isPair=Vpe;Zpe.isScalar=P$;Zpe.isSeq=Wpe});var Od=_(function(dfe){var xt=xe(),Pr=Symbol("break visit"),B$=Symbol("skip children"),Fo=Symbol("remove node");function wb(e,t){let r=N$(t);if(xt.isDocument(e)){if(_l(null,e.contents,r,Object.freeze([e]))===Fo)e.contents=null}else _l(null,e,r,Object.freeze([]))}wb.BREAK=Pr;wb.SKIP=B$;wb.REMOVE=Fo;function _l(e,t,r,n){let o=F$(e,t,r,n);if(xt.isNode(o)||xt.isPair(o))return M$(e,n,o),_l(e,o,r,n);if(typeof o!=="symbol"){if(xt.isCollection(t)){n=Object.freeze(n.concat(t));for(let i=0;i<t.items.length;++i){let s=_l(i,t.items[i],r,n);if(typeof s==="number")i=s-1;else if(s===Pr)return Pr;else if(s===Fo)t.items.splice(i,1),i-=1}}else if(xt.isPair(t)){n=Object.freeze(n.concat(t));let i=_l("key",t.key,r,n);if(i===Pr)return Pr;else if(i===Fo)t.key=null;let s=_l("value",t.value,r,n);if(s===Pr)return Pr;else if(s===Fo)t.value=null}}return o}async function Tb(e,t){let r=N$(t);if(xt.isDocument(e)){if(await Bl(null,e.contents,r,Object.freeze([e]))===Fo)e.contents=null}else await Bl(null,e,r,Object.freeze([]))}Tb.BREAK=Pr;Tb.SKIP=B$;Tb.REMOVE=Fo;async function Bl(e,t,r,n){let o=await F$(e,t,r,n);if(xt.isNode(o)||xt.isPair(o))return M$(e,n,o),Bl(e,o,r,n);if(typeof o!=="symbol"){if(xt.isCollection(t)){n=Object.freeze(n.concat(t));for(let i=0;i<t.items.length;++i){let s=await Bl(i,t.items[i],r,n);if(typeof s==="number")i=s-1;else if(s===Pr)return Pr;else if(s===Fo)t.items.splice(i,1),i-=1}}else if(xt.isPair(t)){n=Object.freeze(n.concat(t));let i=await Bl("key",t.key,r,n);if(i===Pr)return Pr;else if(i===Fo)t.key=null;let s=await Bl("value",t.value,r,n);if(s===Pr)return Pr;else if(s===Fo)t.value=null}}return o}function N$(e){if(typeof e==="object"&&(e.Collection||e.Node||e.Value))return Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e);return e}function F$(e,t,r,n){if(typeof r==="function")return r(e,t,n);if(xt.isMap(t))return r.Map?.(e,t,n);if(xt.isSeq(t))return r.Seq?.(e,t,n);if(xt.isPair(t))return r.Pair?.(e,t,n);if(xt.isScalar(t))return r.Scalar?.(e,t,n);if(xt.isAlias(t))return r.Alias?.(e,t,n);return}function M$(e,t,r){let n=t[t.length-1];if(xt.isCollection(n))n.items[e]=r;else if(xt.isPair(n))if(e==="key")n.key=r;else n.value=r;else if(xt.isDocument(n))n.contents=r;else{let o=xt.isAlias(n)?"alias":"scalar";throw Error(`Cannot replace node with ${o} parent`)}}dfe.visit=wb;dfe.visitAsync=Tb});var Cv=_(function(xfe){var L$=xe(),yfe=Od(),gfe={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},bfe=(e)=>e.replace(/[!,[\]{}]/g,(t)=>gfe[t]);class hn{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},hn.defaultYaml,e),this.tags=Object.assign({},hn.defaultTags,t)}clone(){let e=new hn(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new hn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:hn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},hn.defaultTags);break}return e}add(e,t){if(this.atNextDocument)this.yaml={explicit:hn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},hn.defaultTags),this.atNextDocument=!1;let r=e.trim().split(/[ \t]+/),n=r.shift();switch(n){case"%TAG":{if(r.length!==2){if(t(0,"%TAG directive should contain exactly two parts"),r.length<2)return!1}let[o,i]=r;return this.tags[o]=i,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[o]=r;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;else{let i=/^\d+\.\d+$/.test(o);return t(6,`Unsupported YAML version ${o}`,i),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let i=e.slice(2,-1);if(i==="!"||i==="!!")return t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null;if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return i}let[,r,n]=e.match(/^(.*!)([^!]*)$/s);if(!n)t(`The ${e} tag has no suffix`);let o=this.tags[r];if(o)try{return o+decodeURIComponent(n)}catch(i){return t(String(i)),null}if(r==="!")return e;return t(`Could not resolve tag: ${e}`),null}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+bfe(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),n;if(e&&r.length>0&&L$.isNode(e.contents)){let o={};yfe.visit(e.contents,(i,s)=>{if(L$.isNode(s)&&s.tag)o[s.tag]=!0}),n=Object.keys(o)}else n=[];for(let[o,i]of r){if(o==="!!"&&i==="tag:yaml.org,2002:")continue;if(!e||n.some((s)=>s.startsWith(i)))t.push(`%TAG ${o} ${i}`)}return t.join(`
68
+ `)}}hn.defaultYaml={explicit:!1,version:"1.2"};hn.defaultTags={"!!":"tag:yaml.org,2002:"};xfe.Directives=hn});var Eb=_(function(Sfe){var $$=xe(),Tfe=Od();function Efe(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(r)}return!0}function U$(e){let t=new Set;return Tfe.visit(e,{Value(r,n){if(n.anchor)t.add(n.anchor)}}),t}function H$(e,t){for(let r=1;;++r){let n=`${e}${r}`;if(!t.has(n))return n}}function vfe(e,t){let r=[],n=new Map,o=null;return{onAnchor:(i)=>{r.push(i),o??(o=U$(e));let s=H$(t,o);return o.add(s),s},setAnchors:()=>{for(let i of r){let s=n.get(i);if(typeof s==="object"&&s.anchor&&($$.isScalar(s.node)||$$.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:n}}Sfe.anchorIsValid=Efe;Sfe.anchorNames=U$;Sfe.createNodeAnchors=vfe;Sfe.findNewAnchor=H$});var Dv=_(function(Ofe){function kd(e,t,r,n){if(n&&typeof n==="object")if(Array.isArray(n))for(let o=0,i=n.length;o<i;++o){let s=n[o],a=kd(e,n,String(o),s);if(a===void 0)delete n[o];else if(a!==s)n[o]=a}else if(n instanceof Map)for(let o of Array.from(n.keys())){let i=n.get(o),s=kd(e,n,o,i);if(s===void 0)n.delete(o);else if(s!==i)n.set(o,s)}else if(n instanceof Set)for(let o of Array.from(n)){let i=kd(e,n,o,o);if(i===void 0)n.delete(o);else if(i!==o)n.delete(o),n.add(i)}else for(let[o,i]of Object.entries(n)){let s=kd(e,n,o,i);if(s===void 0)delete n[o];else if(s!==i)n[o]=s}return e.call(t,r,n)}Ofe.applyReviver=kd});var Cs=_(function(Pfe){var Rfe=xe();function j$(e,t,r){if(Array.isArray(e))return e.map((n,o)=>j$(n,String(o),r));if(e&&typeof e.toJSON==="function"){if(!r||!Rfe.hasAnchor(e))return e.toJSON(t,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(e,n),r.onCreate=(i)=>{n.res=i,delete r.onCreate};let o=e.toJSON(t,r);if(r.onCreate)r.onCreate(o);return o}if(typeof e==="bigint"&&!r?.keep)return Number(e);return e}Pfe.toJS=j$});var vb=_(function(Ffe){var Bfe=Dv(),q$=xe(),Nfe=Cs();class z${constructor(e){Object.defineProperty(this,q$.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)e.range=this.range.slice();return e}toJS(e,{mapAsMap:t,maxAliasCount:r,onAnchor:n,reviver:o}={}){if(!q$.isDocument(e))throw TypeError("A document argument is required");let i={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof r==="number"?r:100},s=Nfe.toJS(this,"",i);if(typeof n==="function")for(let{count:a,res:c}of i.anchors.values())n(c,a);return typeof o==="function"?Bfe.applyReviver(o,{"":s},"",s):s}}Ffe.NodeBase=z$});var Rd=_(function(jfe){var Lfe=Eb(),$fe=Od(),Nl=xe(),Ufe=vb(),Hfe=Cs();class G$ extends Ufe.NodeBase{constructor(e){super(Nl.ALIAS);this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let r;if(t?.aliasResolveCache)r=t.aliasResolveCache;else if(r=[],$fe.visit(e,{Node:(o,i)=>{if(Nl.isAlias(i)||Nl.hasAnchor(i))r.push(i)}}),t)t.aliasResolveCache=r;let n=void 0;for(let o of r){if(o===this)break;if(o.anchor===this.source)n=o}if(n&&t){let{anchors:o,doc:i,maxAliasCount:s}=t,a=o.get(n);if(!a)Hfe.toJS(n,null,t),a=o.get(n);if(a?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(s>=0){if(a.count+=1,a.aliasCount===0)a.aliasCount=Sb(i,n,o);if(a.count*a.aliasCount>s)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}}return n}toJSON(e,t){if(!t)return{source:this.source};let r=this.resolve(t.doc,t);if(!r){let n=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(n)}return t.anchors.get(r).res}toString(e,t,r){let n=`*${this.source}`;if(e){if(Lfe.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(o)}if(e.implicitKey)return`${n} `}return n}}function Sb(e,t,r){if(Nl.isAlias(t)){let n=t.resolve(e),o=r&&n&&r.get(n);return o?o.count*o.aliasCount:0}else if(Nl.isCollection(t)){let n=0;for(let o of t.items){let i=Sb(e,o,r);if(i>n)n=i}return n}else if(Nl.isPair(t)){let n=Sb(e,t.key,r),o=Sb(e,t.value,r);return Math.max(n,o)}return 1}jfe.Alias=G$});var ft=_(function(Kfe){var zfe=xe(),Gfe=vb(),Vfe=Cs(),Wfe=(e)=>!e||typeof e!=="function"&&typeof e!=="object";class Ua extends Gfe.NodeBase{constructor(e){super(zfe.SCALAR);this.value=e}toJSON(e,t){return t?.keep?this.value:Vfe.toJS(this.value,e,t)}toString(){return String(this.value)}}Ua.BLOCK_FOLDED="BLOCK_FOLDED";Ua.BLOCK_LITERAL="BLOCK_LITERAL";Ua.PLAIN="PLAIN";Ua.QUOTE_DOUBLE="QUOTE_DOUBLE";Ua.QUOTE_SINGLE="QUOTE_SINGLE";Kfe.Scalar=Ua;Kfe.isScalarValue=Wfe});var Pd=_(function(tde){var Jfe=Rd(),Ha=xe(),V$=ft(),Xfe="tag:yaml.org,2002:";function Qfe(e,t,r){if(t){let n=r.filter((i)=>i.tag===t),o=n.find((i)=>!i.format)??n[0];if(!o)throw Error(`Tag ${t} not found`);return o}return r.find((n)=>n.identify?.(e)&&!n.format)}function ede(e,t,r){if(Ha.isDocument(e))e=e.contents;if(Ha.isNode(e))return e;if(Ha.isPair(e)){let p=r.schema[Ha.MAP].createNode?.(r.schema,null,r);return p.items.push(e),p}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)e=e.valueOf();let{aliasDuplicateObjects:n,onAnchor:o,onTagObj:i,schema:s,sourceObjects:a}=r,c=void 0;if(n&&e&&typeof e==="object")if(c=a.get(e),c)return c.anchor??(c.anchor=o(e)),new Jfe.Alias(c.anchor);else c={anchor:null,node:null},a.set(e,c);if(t?.startsWith("!!"))t=Xfe+t.slice(2);let u=Qfe(e,t,s.tags);if(!u){if(e&&typeof e.toJSON==="function")e=e.toJSON();if(!e||typeof e!=="object"){let p=new V$.Scalar(e);if(c)c.node=p;return p}u=e instanceof Map?s[Ha.MAP]:(Symbol.iterator in Object(e))?s[Ha.SEQ]:s[Ha.MAP]}if(i)i(u),delete r.onTagObj;let l=u?.createNode?u.createNode(r.schema,e,r):typeof u?.nodeClass?.from==="function"?u.nodeClass.from(r.schema,e,r):new V$.Scalar(e);if(t)l.tag=t;else if(!u.default)l.tag=u.tag;if(c)c.node=l;return l}tde.createNode=ede});var Ab=_(function(ide){var nde=Pd(),Mo=xe(),ode=vb();function Iv(e,t,r){let n=r;for(let o=t.length-1;o>=0;--o){let i=t[o];if(typeof i==="number"&&Number.isInteger(i)&&i>=0){let s=[];s[i]=n,n=s}else n=new Map([[i,n]])}return nde.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var W$=(e)=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;class K$ extends ode.NodeBase{constructor(e,t){super(e);Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(e)t.schema=e;if(t.items=t.items.map((r)=>Mo.isNode(r)||Mo.isPair(r)?r.clone(e):r),this.range)t.range=this.range.slice();return t}addIn(e,t){if(W$(e))this.add(t);else{let[r,...n]=e,o=this.get(r,!0);if(Mo.isCollection(o))o.addIn(n,t);else if(o===void 0&&this.schema)this.set(r,Iv(this.schema,n,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let n=this.get(t,!0);if(Mo.isCollection(n))return n.deleteIn(r);else throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...n]=e,o=this.get(r,!0);if(n.length===0)return!t&&Mo.isScalar(o)?o.value:o;else return Mo.isCollection(o)?o.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every((t)=>{if(!Mo.isPair(t))return!1;let r=t.value;return r==null||e&&Mo.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let n=this.get(t,!0);return Mo.isCollection(n)?n.hasIn(r):!1}setIn(e,t){let[r,...n]=e;if(n.length===0)this.set(r,t);else{let o=this.get(r,!0);if(Mo.isCollection(o))o.setIn(n,t);else if(o===void 0&&this.schema)this.set(r,Iv(this.schema,n,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}}ide.Collection=K$;ide.collectionFromPath=Iv;ide.isEmptyPath=W$});var _d=_(function(pde){var ude=(e)=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ov(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}var lde=(e,t,r)=>e.endsWith(`
69
+ `)?Ov(r,t):r.includes(`
70
+ `)?`
71
+ `+Ov(r,t):(e.endsWith(" ")?"":" ")+r;pde.indentComment=Ov;pde.lineComment=lde;pde.stringifyComment=ude});var Z$=_(function(yde){function hde(e,t,r="flow",{indentAtStart:n,lineWidth:o=80,minContentWidth:i=20,onFold:s,onOverflow:a}={}){if(!o||o<0)return e;if(o<i)i=0;let c=Math.max(1+i,1+o-t.length);if(e.length<=c)return e;let u=[],l={},p=o-t.length;if(typeof n==="number")if(n>o-Math.max(2,i))u.push(0);else p=o-n;let f=void 0,d=void 0,h=!1,m=-1,y=-1,g=-1;if(r==="block"){if(m=Y$(e,m,t.length),m!==-1)p=m+c}for(let b;b=e[m+=1];){if(r==="quoted"&&b==="\\"){switch(y=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}g=m}if(b===`
72
+ `){if(r==="block")m=Y$(e,m,t.length);p=m+t.length+c,f=void 0}else{if(b===" "&&d&&d!==" "&&d!==`
73
+ `&&d!=="\t"){let w=e[m+1];if(w&&w!==" "&&w!==`
74
+ `&&w!=="\t")f=m}if(m>=p)if(f)u.push(f),p=f+c,f=void 0;else if(r==="quoted"){while(d===" "||d==="\t")d=b,b=e[m+=1],h=!0;let w=m>g+1?m-2:y-1;if(l[w])return e;u.push(w),l[w]=!0,p=w+c,f=void 0}else h=!0}d=b}if(h&&a)a();if(u.length===0)return e;if(s)s();let x=e.slice(0,u[0]);for(let b=0;b<u.length;++b){let w=u[b],v=u[b+1]||e.length;if(w===0)x=`
75
+ ${t}${e.slice(0,v)}`;else{if(r==="quoted"&&l[w])x+=`${e[w]}\\`;x+=`
76
+ ${t}${e.slice(w+1,v)}`}}return x}function Y$(e,t,r){let n=t,o=t+1,i=e[o];while(i===" "||i==="\t")if(t<o+r)i=e[++t];else{do i=e[++t];while(i&&i!==`
77
+ `);n=t,o=t+1,i=e[o]}return n}yde.FOLD_BLOCK="block";yde.FOLD_FLOW="flow";yde.FOLD_QUOTED="quoted";yde.foldFlowLines=hde});var Nd=_(function(Sde){var Gn=ft(),Ds=Z$(),Db=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Ib=(e)=>/^(%|---|\.\.\.)/m.test(e);function Tde(e,t,r){if(!t||t<0)return!1;let n=t-r,o=e.length;if(o<=n)return!1;for(let i=0,s=0;i<o;++i)if(e[i]===`
78
+ `){if(i-s>n)return!0;if(s=i+1,o-s<=n)return!1}return!0}function Bd(e,t){let r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=t,o=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(Ib(e)?" ":""),s="",a=0;for(let c=0,u=r[c];u;u=r[++c]){if(u===" "&&r[c+1]==="\\"&&r[c+2]==="n")s+=r.slice(a,c)+"\\ ",c+=1,a=c,u="\\";if(u==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let l=r.substr(c+2,4);switch(l){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:if(l.substr(0,2)==="00")s+="\\x"+l.substr(2);else s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length<o)c+=1;else{s+=r.slice(a,c)+`
79
+
80
+ `;while(r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"')s+=`
81
+ `,c+=2;if(s+=i,r[c+2]===" ")s+="\\";c+=1,a=c+1}break;default:c+=1}}return s=a?s+r.slice(a):r,n?s:Ds.foldFlowLines(s,i,Ds.FOLD_QUOTED,Db(t,!1))}function kv(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
82
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Bd(e,t);let r=t.indent||(Ib(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
83
+ ${r}`)+"'";return t.implicitKey?n:Ds.foldFlowLines(n,r,Ds.FOLD_FLOW,Db(t,!1))}function Fl(e,t){let{singleQuote:r}=t.options,n;if(r===!1)n=Bd;else{let o=e.includes('"'),i=e.includes("'");if(o&&!i)n=kv;else if(i&&!o)n=Bd;else n=r?kv:Bd}return n(e,t)}var Rv;try{Rv=new RegExp(`(^|(?<!
84
+ ))
85
+ +(?!
86
+ |$)`,"g")}catch{Rv=/\n+(?!\n|$)/g}function Cb({comment:e,type:t,value:r},n,o,i){let{blockQuote:s,commentString:a,lineWidth:c}=n.options;if(!s||/\n[\t ]+$/.test(r))return Fl(r,n);let u=n.indent||(n.forceBlockIndent||Ib(r)?" ":""),l=s==="literal"?!0:s==="folded"||t===Gn.Scalar.BLOCK_FOLDED?!1:t===Gn.Scalar.BLOCK_LITERAL?!0:!Tde(r,c,u.length);if(!r)return l?`|
87
+ `:`>
88
+ `;let p,f;for(f=r.length;f>0;--f){let v=r[f-1];if(v!==`
89
+ `&&v!=="\t"&&v!==" ")break}let d=r.substring(f),h=d.indexOf(`
90
+ `);if(h===-1)p="-";else if(r===d||h!==d.length-1){if(p="+",i)i()}else p="";if(d){if(r=r.slice(0,-d.length),d[d.length-1]===`
91
+ `)d=d.slice(0,-1);d=d.replace(Rv,`$&${u}`)}let m=!1,y,g=-1;for(y=0;y<r.length;++y){let v=r[y];if(v===" ")m=!0;else if(v===`
92
+ `)g=y;else break}let x=r.substring(0,g<y?g+1:y);if(x)r=r.substring(x.length),x=x.replace(/\n+/g,`$&${u}`);let w=(m?u?"2":"1":"")+p;if(e){if(w+=" "+a(e.replace(/ ?[\r\n]+/g," ")),o)o()}if(!l){let v=r.replace(/\n+/g,`
93
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`),D=!1,O=Db(n,!0);if(s!=="folded"&&t!==Gn.Scalar.BLOCK_FOLDED)O.onOverflow=()=>{D=!0};let T=Ds.foldFlowLines(`${x}${v}${d}`,u,Ds.FOLD_BLOCK,O);if(!D)return`>${w}
94
+ ${u}${T}`}return r=r.replace(/\n+/g,`$&${u}`),`|${w}
95
+ ${u}${x}${r}${d}`}function Ede(e,t,r,n){let{type:o,value:i}=e,{actualString:s,implicitKey:a,indent:c,indentStep:u,inFlow:l}=t;if(a&&i.includes(`
96
+ `)||l&&/[[\]{},]/.test(i))return Fl(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||l||!i.includes(`
97
+ `)?Fl(i,t):Cb(e,t,r,n);if(!a&&!l&&o!==Gn.Scalar.PLAIN&&i.includes(`
98
+ `))return Cb(e,t,r,n);if(Ib(i)){if(c==="")return t.forceBlockIndent=!0,Cb(e,t,r,n);else if(a&&c===u)return Fl(i,t)}let p=i.replace(/\n+/g,`$&
99
+ ${c}`);if(s){let f=(m)=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(p),{compat:d,tags:h}=t.doc.schema;if(h.some(f)||d?.some(f))return Fl(i,t)}return a?p:Ds.foldFlowLines(p,c,Ds.FOLD_FLOW,Db(t,!1))}function vde(e,t,r,n){let{implicitKey:o,inFlow:i}=t,s=typeof e.value==="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;if(a!==Gn.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value))a=Gn.Scalar.QUOTE_DOUBLE}let c=(l)=>{switch(l){case Gn.Scalar.BLOCK_FOLDED:case Gn.Scalar.BLOCK_LITERAL:return o||i?Fl(s.value,t):Cb(s,t,r,n);case Gn.Scalar.QUOTE_DOUBLE:return Bd(s.value,t);case Gn.Scalar.QUOTE_SINGLE:return kv(s.value,t);case Gn.Scalar.PLAIN:return Ede(s,t,r,n);default:return null}},u=c(a);if(u===null){let{defaultKeyType:l,defaultStringType:p}=t.options,f=o&&l||p;if(u=c(f),u===null)throw Error(`Unsupported default string type ${f}`)}return u}Sde.stringifyString=vde});var Fd=_(function(_de){var Cde=Eb(),Is=xe(),Dde=_d(),Ide=Nd();function Ode(e,t){let r=Object.assign({blockQuote:!0,commentString:Dde.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent==="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function kde(e,t){if(t.tag){let o=e.filter((i)=>i.tag===t.tag);if(o.length>0)return o.find((i)=>i.format===t.format)??o[0]}let r=void 0,n;if(Is.isScalar(t)){n=t.value;let o=e.filter((i)=>i.identify?.(n));if(o.length>1){let i=o.filter((s)=>s.test);if(i.length>0)o=i}r=o.find((i)=>i.format===t.format)??o.find((i)=>!i.format)}else n=t,r=e.find((o)=>o.nodeClass&&n instanceof o.nodeClass);if(!r){let o=n?.constructor?.name??(n===null?"null":typeof n);throw Error(`Tag not resolved for ${o} value`)}return r}function Rde(e,t,{anchors:r,doc:n}){if(!n.directives)return"";let o=[],i=(Is.isScalar(e)||Is.isCollection(e))&&e.anchor;if(i&&Cde.anchorIsValid(i))r.add(i),o.push(`&${i}`);let s=e.tag??(t.default?null:t.tag);if(s)o.push(n.directives.tagString(s));return o.join(" ")}function Pde(e,t,r,n){if(Is.isPair(e))return e.toString(t,r,n);if(Is.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(t.resolvedAliases)t.resolvedAliases.add(e);else t.resolvedAliases=new Set([e]);e=e.resolve(t.doc)}}let o=void 0,i=Is.isNode(e)?e:t.doc.createNode(e,{onTagObj:(c)=>o=c});o??(o=kde(t.doc.schema.tags,i));let s=Rde(i,o,t);if(s.length>0)t.indentAtStart=(t.indentAtStart??0)+s.length+1;let a=typeof o.stringify==="function"?o.stringify(i,t,r,n):Is.isScalar(i)?Ide.stringifyString(i,t,r,n):i.toString(t,r,n);if(!s)return a;return Is.isScalar(i)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
100
+ ${t.indent}${a}`}_de.createStringifyContext=Ode;_de.stringify=Pde});var Q$=_(function(Mde){var ki=xe(),J$=ft(),X$=Fd(),Md=_d();function Fde({key:e,value:t},r,n,o){let{allNullValues:i,doc:s,indent:a,indentStep:c,options:{commentString:u,indentSeq:l,simpleKeys:p}}=r,f=ki.isNode(e)&&e.comment||null;if(p){if(f)throw Error("With simple keys, key nodes cannot have comments");if(ki.isCollection(e)||!ki.isNode(e)&&typeof e==="object")throw Error("With simple keys, collection cannot be used as a key value")}let d=!p&&(!e||f&&t==null&&!r.inFlow||ki.isCollection(e)||(ki.isScalar(e)?e.type===J$.Scalar.BLOCK_FOLDED||e.type===J$.Scalar.BLOCK_LITERAL:typeof e==="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!d&&(p||!i),indent:a+c});let h=!1,m=!1,y=X$.stringify(e,r,()=>h=!0,()=>m=!0);if(!d&&!r.inFlow&&y.length>1024){if(p)throw Error("With simple keys, single line scalar must not span more than 1024 characters");d=!0}if(r.inFlow){if(i||t==null){if(h&&n)n();return y===""?"?":d?`? ${y}`:y}}else if(i&&!p||t==null&&d){if(y=`? ${y}`,f&&!h)y+=Md.lineComment(y,r.indent,u(f));else if(m&&o)o();return y}if(h)f=null;if(d){if(f)y+=Md.lineComment(y,r.indent,u(f));y=`? ${y}
101
+ ${a}:`}else if(y=`${y}:`,f)y+=Md.lineComment(y,r.indent,u(f));let g,x,b;if(ki.isNode(t))g=!!t.spaceBefore,x=t.commentBefore,b=t.comment;else if(g=!1,x=null,b=null,t&&typeof t==="object")t=s.createNode(t);if(r.implicitKey=!1,!d&&!f&&ki.isScalar(t))r.indentAtStart=y.length+1;if(m=!1,!l&&c.length>=2&&!r.inFlow&&!d&&ki.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor)r.indent=r.indent.substring(2);let w=!1,v=X$.stringify(t,r,()=>w=!0,()=>m=!0),D=" ";if(f||g||x){if(D=g?`
102
+ `:"",x){let O=u(x);D+=`
103
+ ${Md.indentComment(O,r.indent)}`}if(v===""&&!r.inFlow){if(D===`
104
+ `&&b)D=`
105
+
106
+ `}else D+=`
107
+ ${r.indent}`}else if(!d&&ki.isCollection(t)){let O=v[0],T=v.indexOf(`
108
+ `),A=T!==-1,E=r.inFlow??t.flow??t.items.length===0;if(A||!E){let R=!1;if(A&&(O==="&"||O==="!")){let S=v.indexOf(" ");if(O==="&"&&S!==-1&&S<T&&v[S+1]==="!")S=v.indexOf(" ",S+1);if(S===-1||T<S)R=!0}if(!R)D=`
109
+ ${r.indent}`}}else if(v===""||v[0]===`
110
+ `)D="";if(y+=D+v,r.inFlow){if(w&&n)n()}else if(b&&!w)y+=Md.lineComment(y,r.indent,u(b));else if(m&&o)o();return y}Mde.stringifyPair=Fde});var Pv=_(function(Hde){var e7=pe("process");function $de(e,...t){if(e==="debug")console.log(...t)}function Ude(e,t){if(e==="debug"||e==="warn")if(typeof e7.emitWarning==="function")e7.emitWarning(t);else console.warn(t)}Hde.debug=$de;Hde.warn=Ude});var Pb=_(function(Gde){var Rb=xe(),t7=ft(),Ob="<<",kb={identify:(e)=>e===Ob||typeof e==="symbol"&&e.description===Ob,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new t7.Scalar(Symbol(Ob)),{addToJSMap:r7}),stringify:()=>Ob},zde=(e,t)=>(kb.identify(t)||Rb.isScalar(t)&&(!t.type||t.type===t7.Scalar.PLAIN)&&kb.identify(t.value))&&e?.doc.schema.tags.some((r)=>r.tag===kb.tag&&r.default);function r7(e,t,r){let n=n7(e,r);if(Rb.isSeq(n))for(let o of n.items)_v(e,t,o);else if(Array.isArray(n))for(let o of n)_v(e,t,o);else _v(e,t,n)}function _v(e,t,r){let n=n7(e,r);if(!Rb.isMap(n))throw Error("Merge sources must be maps or map aliases");let o=n.toJSON(null,e,Map);for(let[i,s]of o)if(t instanceof Map){if(!t.has(i))t.set(i,s)}else if(t instanceof Set)t.add(i);else if(!Object.prototype.hasOwnProperty.call(t,i))Object.defineProperty(t,i,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function n7(e,t){return e&&Rb.isAlias(t)?t.resolve(e.doc,e):t}Gde.addMergeToJSMap=r7;Gde.isMergeKey=zde;Gde.merge=kb});var Nv=_(function(Qde){var Yde=Pv(),o7=Pb(),Zde=Fd(),i7=xe(),Bv=Cs();function Jde(e,t,{key:r,value:n}){if(i7.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,n);else if(o7.isMergeKey(e,r))o7.addMergeToJSMap(e,t,n);else{let o=Bv.toJS(r,"",e);if(t instanceof Map)t.set(o,Bv.toJS(n,o,e));else if(t instanceof Set)t.add(o);else{let i=Xde(r,o,e),s=Bv.toJS(n,i,e);if(i in t)Object.defineProperty(t,i,{value:s,writable:!0,enumerable:!0,configurable:!0});else t[i]=s}}return t}function Xde(e,t,r){if(t===null)return"";if(typeof t!=="object")return String(t);if(i7.isNode(e)&&r?.doc){let n=Zde.createStringifyContext(r.doc,{});n.anchors=new Set;for(let i of r.anchors.keys())n.anchors.add(i.anchor);n.inFlow=!0,n.inStringifyKey=!0;let o=e.toString(n);if(!r.mapKeyWarned){let i=JSON.stringify(o);if(i.length>40)i=i.substring(0,36)+'..."';Yde.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return o}return JSON.stringify(t)}Qde.addPairToJSMap=Jde});var Os=_(function(ome){var s7=Pd(),tme=Q$(),rme=Nv(),_b=xe();function nme(e,t,r){let n=s7.createNode(e,void 0,r),o=s7.createNode(t,void 0,r);return new Bb(n,o)}class Bb{constructor(e,t=null){Object.defineProperty(this,_b.NODE_TYPE,{value:_b.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;if(_b.isNode(t))t=t.clone(e);if(_b.isNode(r))r=r.clone(e);return new Bb(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return rme.addPairToJSMap(t,r,this)}toString(e,t,r){return e?.doc?tme.stringifyPair(this,e,t,r):JSON.stringify(this)}}ome.Pair=Bb;ome.createPair=nme});var Fv=_(function(lme){var ja=xe(),a7=Fd(),Nb=_d();function ame(e,t,r){return(t.inFlow??e.flow?ume:cme)(e,t,r)}function cme({comment:e,items:t},r,{blockItemPrefix:n,flowChars:o,itemIndent:i,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:u}}=r,l=Object.assign({},r,{indent:i,type:null}),p=!1,f=[];for(let h=0;h<t.length;++h){let m=t[h],y=null;if(ja.isNode(m)){if(!p&&m.spaceBefore)f.push("");if(Fb(r,f,m.commentBefore,p),m.comment)y=m.comment}else if(ja.isPair(m)){let x=ja.isNode(m.key)?m.key:null;if(x){if(!p&&x.spaceBefore)f.push("");Fb(r,f,x.commentBefore,p)}}p=!1;let g=a7.stringify(m,l,()=>y=null,()=>p=!0);if(y)g+=Nb.lineComment(g,i,u(y));if(p&&y)p=!1;f.push(n+g)}let d;if(f.length===0)d=o.start+o.end;else{d=f[0];for(let h=1;h<f.length;++h){let m=f[h];d+=m?`
111
+ ${c}${m}`:`
112
+ `}}if(e){if(d+=`
113
+ `+Nb.indentComment(u(e),c),a)a()}else if(p&&s)s();return d}function ume({items:e},t,{flowChars:r,itemIndent:n}){let{indent:o,indentStep:i,flowCollectionPadding:s,options:{commentString:a}}=t;n+=i;let c=Object.assign({},t,{indent:n,inFlow:!0,type:null}),u=!1,l=0,p=[];for(let h=0;h<e.length;++h){let m=e[h],y=null;if(ja.isNode(m)){if(m.spaceBefore)p.push("");if(Fb(t,p,m.commentBefore,!1),m.comment)y=m.comment}else if(ja.isPair(m)){let x=ja.isNode(m.key)?m.key:null;if(x){if(x.spaceBefore)p.push("");if(Fb(t,p,x.commentBefore,!1),x.comment)u=!0}let b=ja.isNode(m.value)?m.value:null;if(b){if(b.comment)y=b.comment;if(b.commentBefore)u=!0}else if(m.value==null&&x?.comment)y=x.comment}if(y)u=!0;let g=a7.stringify(m,c,()=>y=null);if(u||(u=p.length>l||g.includes(`
114
+ `)),h<e.length-1)g+=",";else if(t.options.trailingComma){if(t.options.lineWidth>0)u||(u=p.reduce((x,b)=>x+b.length+2,2)+(g.length+2)>t.options.lineWidth);if(u)g+=","}if(y)g+=Nb.lineComment(g,n,a(y));p.push(g),l=p.length}let{start:f,end:d}=r;if(p.length===0)return f+d;else{if(!u){let h=p.reduce((m,y)=>m+y.length+2,2);u=t.options.lineWidth>0&&h>t.options.lineWidth}if(u){let h=f;for(let m of p)h+=m?`
115
+ ${i}${o}${m}`:`
116
+ `;return`${h}
117
+ ${o}${d}`}else return`${f}${s}${p.join(" ")}${s}${d}`}}function Fb({indent:e,options:{commentString:t}},r,n,o){if(n&&o)n=n.replace(/^\n+/,"");if(n){let i=Nb.indentComment(t(n),e);r.push(i.trimStart())}}lme.stringifyCollection=ame});var Rs=_(function(yme){var fme=Fv(),dme=Nv(),mme=Ab(),ks=xe(),Mb=Os(),hme=ft();function Ld(e,t){let r=ks.isScalar(t)?t.value:t;for(let n of e)if(ks.isPair(n)){if(n.key===t||n.key===r)return n;if(ks.isScalar(n.key)&&n.key.value===r)return n}return}class c7 extends mme.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ks.MAP,e);this.items=[]}static from(e,t,r){let{keepUndefined:n,replacer:o}=r,i=new this(e),s=(a,c)=>{if(typeof o==="function")c=o.call(t,a,c);else if(Array.isArray(o)&&!o.includes(a))return;if(c!==void 0||n)i.items.push(Mb.createPair(a,c,r))};if(t instanceof Map)for(let[a,c]of t)s(a,c);else if(t&&typeof t==="object")for(let a of Object.keys(t))s(a,t[a]);if(typeof e.sortMapEntries==="function")i.items.sort(e.sortMapEntries);return i}add(e,t){let r;if(ks.isPair(e))r=e;else if(!e||typeof e!=="object"||!("key"in e))r=new Mb.Pair(e,e?.value);else r=new Mb.Pair(e.key,e.value);let n=Ld(this.items,r.key),o=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${r.key} already set`);if(ks.isScalar(n.value)&&hme.isScalarValue(r.value))n.value.value=r.value;else n.value=r.value}else if(o){let i=this.items.findIndex((s)=>o(r,s)<0);if(i===-1)this.items.push(r);else this.items.splice(i,0,r)}else this.items.push(r)}delete(e){let t=Ld(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let n=Ld(this.items,e)?.value;return(!t&&ks.isScalar(n)?n.value:n)??void 0}has(e){return!!Ld(this.items,e)}set(e,t){this.add(new Mb.Pair(e,t),!0)}toJSON(e,t,r){let n=r?new r:t?.mapAsMap?new Map:{};if(t?.onCreate)t.onCreate(n);for(let o of this.items)dme.addPairToJSMap(t,n,o);return n}toString(e,t,r){if(!e)return JSON.stringify(this);for(let n of this.items)if(!ks.isPair(n))throw Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);if(!e.allNullValues&&this.hasAllNullValues(!1))e=Object.assign({},e,{allNullValues:!0});return fme.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}}yme.YAMLMap=c7;yme.findPair=Ld});var Ml=_(function(Tme){var xme=xe(),u7=Rs(),wme={collection:"map",default:!0,nodeClass:u7.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){if(!xme.isMap(e))t("Expected a mapping for this tag");return e},createNode:(e,t,r)=>u7.YAMLMap.from(e,t,r)};Tme.map=wme});var Ps=_(function(Ime){var vme=Pd(),Sme=Fv(),Ame=Ab(),$b=xe(),Cme=ft(),Dme=Cs();class l7 extends Ame.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super($b.SEQ,e);this.items=[]}add(e){this.items.push(e)}delete(e){let t=Lb(e);if(typeof t!=="number")return!1;return this.items.splice(t,1).length>0}get(e,t){let r=Lb(e);if(typeof r!=="number")return;let n=this.items[r];return!t&&$b.isScalar(n)?n.value:n}has(e){let t=Lb(e);return typeof t==="number"&&t<this.items.length}set(e,t){let r=Lb(e);if(typeof r!=="number")throw Error(`Expected a valid index, not ${e}.`);let n=this.items[r];if($b.isScalar(n)&&Cme.isScalarValue(t))n.value=t;else this.items[r]=t}toJSON(e,t){let r=[];if(t?.onCreate)t.onCreate(r);let n=0;for(let o of this.items)r.push(Dme.toJS(o,String(n++),t));return r}toString(e,t,r){if(!e)return JSON.stringify(this);return Sme.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:t})}static from(e,t,r){let{replacer:n}=r,o=new this(e);if(t&&Symbol.iterator in Object(t)){let i=0;for(let s of t){if(typeof n==="function"){let a=t instanceof Set?s:String(i++);s=n.call(t,a,s)}o.items.push(vme.createNode(s,void 0,r))}}return o}}function Lb(e){let t=$b.isScalar(e)?e.value:e;if(t&&typeof t==="string")t=Number(t);return typeof t==="number"&&Number.isInteger(t)&&t>=0?t:null}Ime.YAMLSeq=l7});var Ll=_(function(Pme){var kme=xe(),p7=Ps(),Rme={collection:"seq",default:!0,nodeClass:p7.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){if(!kme.isSeq(e))t("Expected a sequence for this tag");return e},createNode:(e,t,r)=>p7.YAMLSeq.from(e,t,r)};Pme.seq=Rme});var $d=_(function(Fme){var Bme=Nd(),Nme={identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify(e,t,r,n){return t=Object.assign({actualString:!0},t),Bme.stringifyString(e,t,r,n)}};Fme.string=Nme});var Ub=_(function(Lme){var f7=ft(),d7={identify:(e)=>e==null,createNode:()=>new f7.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new f7.Scalar(null),stringify:({source:e},t)=>typeof e==="string"&&d7.test.test(e)?e:t.options.nullStr};Lme.nullTag=d7});var Mv=_(function(Hme){var Ume=ft(),m7={identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(e)=>new Ume.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},r){if(e&&m7.test.test(e)){let n=e[0]==="t"||e[0]==="T";if(t===n)return e}return t?r.options.trueStr:r.options.falseStr}};Hme.boolTag=m7});var $l=_(function(zme){function qme({format:e,minFractionDigits:t,tag:r,value:n}){if(typeof n==="bigint")return String(n);let o=typeof n==="number"?n:Number(n);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let i=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let s=i.indexOf(".");if(s<0)s=i.length,i+=".";let a=t-(i.length-s-1);while(a-- >0)i+="0"}return i}zme.stringifyNumber=qme});var $v=_(function(Zme){var Vme=ft(),Lv=$l(),Wme={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Lv.stringifyNumber},Kme={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Lv.stringifyNumber(e)}},Yme={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new Vme.Scalar(parseFloat(e)),r=e.indexOf(".");if(r!==-1&&e[e.length-1]==="0")t.minFractionDigits=e.length-r-1;return t},stringify:Lv.stringifyNumber};Zme.float=Yme;Zme.floatExp=Kme;Zme.floatNaN=Wme});var Hv=_(function(nhe){var h7=$l(),Hb=(e)=>typeof e==="bigint"||Number.isInteger(e),Uv=(e,t,r,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),r);function y7(e,t,r){let{value:n}=e;if(Hb(n)&&n>=0)return r+n.toString(t);return h7.stringifyNumber(e)}var ehe={identify:(e)=>Hb(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>Uv(e,2,8,r),stringify:(e)=>y7(e,8,"0o")},the={identify:Hb,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>Uv(e,0,10,r),stringify:h7.stringifyNumber},rhe={identify:(e)=>Hb(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>Uv(e,2,16,r),stringify:(e)=>y7(e,16,"0x")};nhe.int=the;nhe.intHex=rhe;nhe.intOct=ehe});var g7=_(function(dhe){var ahe=Ml(),che=Ub(),uhe=Ll(),lhe=$d(),phe=Mv(),jv=$v(),qv=Hv(),fhe=[ahe.map,uhe.seq,lhe.string,che.nullTag,phe.boolTag,qv.intOct,qv.int,qv.intHex,jv.floatNaN,jv.floatExp,jv.float];dhe.schema=fhe});var x7=_(function(The){var hhe=ft(),yhe=Ml(),ghe=Ll();function b7(e){return typeof e==="bigint"||Number.isInteger(e)}var jb=({value:e})=>JSON.stringify(e),bhe=[{identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify:jb},{identify:(e)=>e==null,createNode:()=>new hhe.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:jb},{identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(e)=>e==="true",stringify:jb},{identify:b7,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:r})=>r?BigInt(e):parseInt(e,10),stringify:({value:e})=>b7(e)?e.toString():JSON.stringify(e)},{identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(e)=>parseFloat(e),stringify:jb}],xhe={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},whe=[yhe.map,ghe.seq].concat(bhe,xhe);The.schema=whe});var Gv=_(function(Ahe){var Ud=pe("buffer"),zv=ft(),vhe=Nd(),She={identify:(e)=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof Ud.Buffer==="function")return Ud.Buffer.from(e,"base64");else if(typeof atob==="function"){let r=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let o=0;o<r.length;++o)n[o]=r.charCodeAt(o);return n}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:r},n,o,i){if(!r)return"";let s=r,a;if(typeof Ud.Buffer==="function")a=s instanceof Ud.Buffer?s.toString("base64"):Ud.Buffer.from(s.buffer).toString("base64");else if(typeof btoa==="function"){let c="";for(let u=0;u<s.length;++u)c+=String.fromCharCode(s[u]);a=btoa(c)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=zv.Scalar.BLOCK_LITERAL),t!==zv.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),u=Math.ceil(a.length/c),l=Array(u);for(let p=0,f=0;p<u;++p,f+=c)l[p]=a.substr(f,c);a=l.join(t===zv.Scalar.BLOCK_LITERAL?`
118
+ `:" ")}return vhe.stringifyString({comment:e,type:t,value:a},n,o,i)}};Ahe.binary=She});var zb=_(function(khe){var qb=xe(),Vv=Os(),Dhe=ft(),Ihe=Ps();function w7(e,t){if(qb.isSeq(e))for(let r=0;r<e.items.length;++r){let n=e.items[r];if(qb.isPair(n))continue;else if(qb.isMap(n)){if(n.items.length>1)t("Each pair must have its own sequence indicator");let o=n.items[0]||new Vv.Pair(new Dhe.Scalar(null));if(n.commentBefore)o.key.commentBefore=o.key.commentBefore?`${n.commentBefore}
119
+ ${o.key.commentBefore}`:n.commentBefore;if(n.comment){let i=o.value??o.key;i.comment=i.comment?`${n.comment}
120
+ ${i.comment}`:n.comment}n=o}e.items[r]=qb.isPair(n)?n:new Vv.Pair(n)}else t("Expected a sequence for this tag");return e}function T7(e,t,r){let{replacer:n}=r,o=new Ihe.YAMLSeq(e);o.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let s of t){if(typeof n==="function")s=n.call(t,String(i++),s);let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let u=Object.keys(s);if(u.length===1)a=u[0],c=s[a];else throw TypeError(`Expected tuple with one key, not ${u.length} keys`)}else a=s;o.items.push(Vv.createPair(a,c,r))}return o}var Ohe={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:w7,createNode:T7};khe.createPairs=T7;khe.pairs=Ohe;khe.resolvePairs=w7});var Kv=_(function(Fhe){var E7=xe(),Wv=Cs(),Hd=Rs(),Bhe=Ps(),v7=zb();class qa extends Bhe.YAMLSeq{constructor(){super();this.add=Hd.YAMLMap.prototype.add.bind(this),this.delete=Hd.YAMLMap.prototype.delete.bind(this),this.get=Hd.YAMLMap.prototype.get.bind(this),this.has=Hd.YAMLMap.prototype.has.bind(this),this.set=Hd.YAMLMap.prototype.set.bind(this),this.tag=qa.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;if(t?.onCreate)t.onCreate(r);for(let n of this.items){let o,i;if(E7.isPair(n))o=Wv.toJS(n.key,"",t),i=Wv.toJS(n.value,o,t);else o=Wv.toJS(n,"",t);if(r.has(o))throw Error("Ordered maps must not include duplicate keys");r.set(o,i)}return r}static from(e,t,r){let n=v7.createPairs(e,t,r),o=new this;return o.items=n.items,o}}qa.tag="tag:yaml.org,2002:omap";var Nhe={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:qa,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let r=v7.resolvePairs(e,t),n=[];for(let{key:o}of r.items)if(E7.isScalar(o))if(n.includes(o.value))t(`Ordered maps must not include duplicate keys: ${o.value}`);else n.push(o.value);return Object.assign(new qa,r)},createNode:(e,t,r)=>qa.from(e,t,r)};Fhe.YAMLOMap=qa;Fhe.omap=Nhe});var I7=_(function($he){var S7=ft();function A7({value:e,source:t},r){if(t&&(e?C7:D7).test.test(t))return t;return e?r.options.trueStr:r.options.falseStr}var C7={identify:(e)=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new S7.Scalar(!0),stringify:A7},D7={identify:(e)=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new S7.Scalar(!1),stringify:A7};$he.falseTag=D7;$he.trueTag=C7});var O7=_(function(Vhe){var jhe=ft(),Yv=$l(),qhe={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Yv.stringifyNumber},zhe={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Yv.stringifyNumber(e)}},Ghe={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new jhe.Scalar(parseFloat(e.replace(/_/g,""))),r=e.indexOf(".");if(r!==-1){let n=e.substring(r+1).replace(/_/g,"");if(n[n.length-1]==="0")t.minFractionDigits=n.length}return t},stringify:Yv.stringifyNumber};Vhe.float=Ghe;Vhe.floatExp=zhe;Vhe.floatNaN=qhe});var R7=_(function(eye){var k7=$l(),jd=(e)=>typeof e==="bigint"||Number.isInteger(e);function Gb(e,t,r,{intAsBigInt:n}){let o=e[0];if(o==="-"||o==="+")t+=1;if(e=e.substring(t).replace(/_/g,""),n){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return o==="-"?BigInt(-1)*s:s}let i=parseInt(e,r);return o==="-"?-1*i:i}function Zv(e,t,r){let{value:n}=e;if(jd(n)){let o=n.toString(t);return n<0?"-"+r+o.substr(1):r+o}return k7.stringifyNumber(e)}var Zhe={identify:jd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>Gb(e,2,2,r),stringify:(e)=>Zv(e,2,"0b")},Jhe={identify:jd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>Gb(e,1,8,r),stringify:(e)=>Zv(e,8,"0")},Xhe={identify:jd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>Gb(e,0,10,r),stringify:k7.stringifyNumber},Qhe={identify:jd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>Gb(e,2,16,r),stringify:(e)=>Zv(e,16,"0x")};eye.int=Xhe;eye.intBin=Zhe;eye.intHex=Qhe;eye.intOct=Jhe});var Jv=_(function(sye){var Kb=xe(),Vb=Os(),Wb=Rs();class za extends Wb.YAMLMap{constructor(e){super(e);this.tag=za.tag}add(e){let t;if(Kb.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new Vb.Pair(e.key,null);else t=new Vb.Pair(e,null);if(!Wb.findPair(this.items,t.key))this.items.push(t)}get(e,t){let r=Wb.findPair(this.items,e);return!t&&Kb.isPair(r)?Kb.isScalar(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=Wb.findPair(this.items,e);if(r&&!t)this.items.splice(this.items.indexOf(r),1);else if(!r&&t)this.items.push(new Vb.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);else throw Error("Set items must all have null values")}static from(e,t,r){let{replacer:n}=r,o=new this(e);if(t&&Symbol.iterator in Object(t))for(let i of t){if(typeof n==="function")i=n.call(t,i,i);o.items.push(Vb.createPair(i,null,r))}return o}}za.tag="tag:yaml.org,2002:set";var iye={collection:"map",identify:(e)=>e instanceof Set,nodeClass:za,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,r)=>za.from(e,t,r),resolve(e,t){if(Kb.isMap(e))if(e.hasAllNullValues(!0))return Object.assign(new za,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};sye.YAMLSet=za;sye.set=iye});var Qv=_(function(fye){var uye=$l();function Xv(e,t){let r=e[0],n=r==="-"||r==="+"?e.substring(1):e,o=(s)=>t?BigInt(s):Number(s),i=n.replace(/_/g,"").split(":").reduce((s,a)=>s*o(60)+o(a),o(0));return r==="-"?o(-1)*i:i}function P7(e){let{value:t}=e,r=(s)=>s;if(typeof t==="bigint")r=(s)=>BigInt(s);else if(isNaN(t)||!isFinite(t))return uye.stringifyNumber(e);let n="";if(t<0)n="-",t*=r(-1);let o=r(60),i=[t%o];if(t<60)i.unshift(0);else if(t=(t-i[0])/o,i.unshift(t%o),t>=60)t=(t-i[0])/o,i.unshift(t);return n+i.map((s)=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var lye={identify:(e)=>typeof e==="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>Xv(e,r),stringify:P7},pye={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(e)=>Xv(e,!1),stringify:P7},_7={identify:(e)=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(_7.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,o,i,s,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,u=Date.UTC(r,n-1,o,i||0,s||0,a||0,c),l=t[8];if(l&&l!=="Z"){let p=Xv(l,!1);if(Math.abs(p)<30)p*=60;u-=60000*p}return new Date(u)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};fye.floatTime=pye;fye.intTime=lye;fye.timestamp=_7});var N7=_(function(Cye){var yye=Ml(),gye=Ub(),bye=Ll(),xye=$d(),wye=Gv(),B7=I7(),eS=O7(),Yb=R7(),Tye=Pb(),Eye=Kv(),vye=zb(),Sye=Jv(),tS=Qv(),Aye=[yye.map,bye.seq,xye.string,gye.nullTag,B7.trueTag,B7.falseTag,Yb.intBin,Yb.intOct,Yb.int,Yb.intHex,eS.floatNaN,eS.floatExp,eS.float,wye.binary,Tye.merge,Eye.omap,vye.pairs,Sye.set,tS.intTime,tS.floatTime,tS.timestamp];Cye.schema=Aye});var G7=_(function(Nye){var $7=Ml(),Iye=Ub(),U7=Ll(),Oye=$d(),kye=Mv(),rS=$v(),nS=Hv(),Rye=g7(),Pye=x7(),H7=Gv(),qd=Pb(),j7=Kv(),q7=zb(),F7=N7(),z7=Jv(),Zb=Qv(),M7=new Map([["core",Rye.schema],["failsafe",[$7.map,U7.seq,Oye.string]],["json",Pye.schema],["yaml11",F7.schema],["yaml-1.1",F7.schema]]),L7={binary:H7.binary,bool:kye.boolTag,float:rS.float,floatExp:rS.floatExp,floatNaN:rS.floatNaN,floatTime:Zb.floatTime,int:nS.int,intHex:nS.intHex,intOct:nS.intOct,intTime:Zb.intTime,map:$7.map,merge:qd.merge,null:Iye.nullTag,omap:j7.omap,pairs:q7.pairs,seq:U7.seq,set:z7.set,timestamp:Zb.timestamp},_ye={"tag:yaml.org,2002:binary":H7.binary,"tag:yaml.org,2002:merge":qd.merge,"tag:yaml.org,2002:omap":j7.omap,"tag:yaml.org,2002:pairs":q7.pairs,"tag:yaml.org,2002:set":z7.set,"tag:yaml.org,2002:timestamp":Zb.timestamp};function Bye(e,t,r){let n=M7.get(t);if(n&&!e)return r&&!n.includes(qd.merge)?n.concat(qd.merge):n.slice();let o=n;if(!o)if(Array.isArray(e))o=[];else{let i=Array.from(M7.keys()).filter((s)=>s!=="yaml11").map((s)=>JSON.stringify(s)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${i} or define customTags array`)}if(Array.isArray(e))for(let i of e)o=o.concat(i);else if(typeof e==="function")o=e(o.slice());if(r)o=o.concat(qd.merge);return o.reduce((i,s)=>{let a=typeof s==="string"?L7[s]:s;if(!a){let c=JSON.stringify(s),u=Object.keys(L7).map((l)=>JSON.stringify(l)).join(", ");throw Error(`Unknown custom tag ${c}; use one of ${u}`)}if(!i.includes(a))i.push(a);return i},[])}Nye.coreKnownTags=_ye;Nye.getTags=Bye});var sS=_(function(jye){var oS=xe(),Lye=Ml(),$ye=Ll(),Uye=$d(),Jb=G7(),Hye=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class iS{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:n,schema:o,sortMapEntries:i,toStringDefaults:s}){this.compat=Array.isArray(e)?Jb.getTags(e,"compat"):e?Jb.getTags(null,e):null,this.name=typeof o==="string"&&o||"core",this.knownTags=n?Jb.coreKnownTags:{},this.tags=Jb.getTags(t,this.name,r),this.toStringOptions=s??null,Object.defineProperty(this,oS.MAP,{value:Lye.map}),Object.defineProperty(this,oS.SCALAR,{value:Uye.string}),Object.defineProperty(this,oS.SEQ,{value:$ye.seq}),this.sortMapEntries=typeof i==="function"?i:i===!0?Hye:null}clone(){let e=Object.create(iS.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}jye.Schema=iS});var V7=_(function(Vye){var zye=xe(),aS=Fd(),zd=_d();function Gye(e,t){let r=[],n=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);if(c)r.push(c),n=!0;else if(e.directives.docStart)n=!0}if(n)r.push("---");let o=aS.createStringifyContext(e,t),{commentString:i}=o.options;if(e.commentBefore){if(r.length!==1)r.unshift("");let c=i(e.commentBefore);r.unshift(zd.indentComment(c,""))}let s=!1,a=null;if(e.contents){if(zye.isNode(e.contents)){if(e.contents.spaceBefore&&n)r.push("");if(e.contents.commentBefore){let l=i(e.contents.commentBefore);r.push(zd.indentComment(l,""))}o.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>s=!0,u=aS.stringify(e.contents,o,()=>a=null,c);if(a)u+=zd.lineComment(u,"",i(a));if((u[0]==="|"||u[0]===">")&&r[r.length-1]==="---")r[r.length-1]=`--- ${u}`;else r.push(u)}else r.push(aS.stringify(e.contents,o));if(e.directives?.docEnd)if(e.comment){let c=i(e.comment);if(c.includes(`
121
+ `))r.push("..."),r.push(zd.indentComment(c,""));else r.push(`... ${c}`)}else r.push("...");else{let c=e.comment;if(c&&s)c=c.replace(/^\n+/,"");if(c){if((!s||a)&&r[r.length-1]!=="")r.push("");r.push(zd.indentComment(i(c),""))}}return r.join(`
122
+ `)+`
123
+ `}Vye.stringifyDocument=Gye});var Gd=_(function(t0e){var Kye=Rd(),Ul=Ab(),yn=xe(),Yye=Os(),Zye=Cs(),Jye=sS(),Xye=V7(),cS=Eb(),Qye=Dv(),e0e=Pd(),uS=Cv();class lS{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,yn.NODE_TYPE,{value:yn.DOC});let n=null;if(typeof t==="function"||Array.isArray(t))n=t;else if(r===void 0&&t)r=t,t=void 0;let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=o;let{version:i}=o;if(r?._directives){if(this.directives=r._directives.atDocument(),this.directives.yaml.explicit)i=this.directives.yaml.version}else this.directives=new uS.Directives({version:i});this.setSchema(i,r),this.contents=e===void 0?null:this.createNode(e,n,r)}clone(){let e=Object.create(lS.prototype,{[yn.NODE_TYPE]:{value:yn.DOC}});if(e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives)e.directives=this.directives.clone();if(e.schema=this.schema.clone(),e.contents=yn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range)e.range=this.range.slice();return e}add(e){if(Hl(this.contents))this.contents.add(e)}addIn(e,t){if(Hl(this.contents))this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=cS.anchorNames(this);e.anchor=!t||r.has(t)?cS.findNewAnchor(t||"a",r):t}return new Kye.Alias(e.anchor)}createNode(e,t,r){let n=void 0;if(typeof t==="function")e=t.call({"":e},"",e),n=t;else if(Array.isArray(t)){let m=(g)=>typeof g==="number"||g instanceof String||g instanceof Number,y=t.filter(m).map(String);if(y.length>0)t=t.concat(y);n=t}else if(r===void 0&&t)r=t,t=void 0;let{aliasDuplicateObjects:o,anchorPrefix:i,flow:s,keepUndefined:a,onTagObj:c,tag:u}=r??{},{onAnchor:l,setAnchors:p,sourceObjects:f}=cS.createNodeAnchors(this,i||"a"),d={aliasDuplicateObjects:o??!0,keepUndefined:a??!1,onAnchor:l,onTagObj:c,replacer:n,schema:this.schema,sourceObjects:f},h=e0e.createNode(e,u,d);if(s&&yn.isCollection(h))h.flow=!0;return p(),h}createPair(e,t,r={}){let n=this.createNode(e,null,r),o=this.createNode(t,null,r);return new Yye.Pair(n,o)}delete(e){return Hl(this.contents)?this.contents.delete(e):!1}deleteIn(e){if(Ul.isEmptyPath(e)){if(this.contents==null)return!1;return this.contents=null,!0}return Hl(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return yn.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){if(Ul.isEmptyPath(e))return!t&&yn.isScalar(this.contents)?this.contents.value:this.contents;return yn.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return yn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){if(Ul.isEmptyPath(e))return this.contents!==void 0;return yn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){if(this.contents==null)this.contents=Ul.collectionFromPath(this.schema,[e],t);else if(Hl(this.contents))this.contents.set(e,t)}setIn(e,t){if(Ul.isEmptyPath(e))this.contents=t;else if(this.contents==null)this.contents=Ul.collectionFromPath(this.schema,Array.from(e),t);else if(Hl(this.contents))this.contents.setIn(e,t)}setSchema(e,t={}){if(typeof e==="number")e=String(e);let r;switch(e){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new uS.Directives({version:"1.1"});r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=e;else this.directives=new uS.Directives({version:e});r={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;r=null;break;default:{let n=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new Jye.Schema(Object.assign(r,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:n,onAnchor:o,reviver:i}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n==="number"?n:100},a=Zye.toJS(this.contents,t??"",s);if(typeof o==="function")for(let{count:c,res:u}of s.anchors.values())o(u,c);return typeof i==="function"?Qye.applyReviver(i,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return Xye.stringifyDocument(this,e)}}function Hl(e){if(yn.isCollection(e))return!0;throw Error("Expected a YAML collection as document contents")}t0e.Document=lS});var Vd=_(function(o0e){class Xb extends Error{constructor(e,t,r,n){super();this.name=e,this.code=r,this.message=n,this.pos=t}}class W7 extends Xb{constructor(e,t,r){super("YAMLParseError",e,t,r)}}class K7 extends Xb{constructor(e,t,r){super("YAMLWarning",e,t,r)}}var n0e=(e,t)=>(r)=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map((a)=>t.linePos(a));let{line:n,col:o}=r.linePos[0];r.message+=` at line ${n}, column ${o}`;let i=o-1,s=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(i>=60&&s.length>80){let a=Math.min(i-39,s.length-79);s="…"+s.substring(a),i-=a-1}if(s.length>80)s=s.substring(0,79)+"…";if(n>1&&/^ *$/.test(s.substring(0,i))){let a=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);if(a.length>80)a=a.substring(0,79)+`…
124
+ `;s=a+s}if(/[^ ]/.test(s)){let a=1,c=r.linePos[1];if(c?.line===n&&c.col>o)a=Math.max(1,Math.min(c.col-o,80-i));let u=" ".repeat(i)+"^".repeat(a);r.message+=`:
125
+
126
+ ${s}
127
+ ${u}
128
+ `}};o0e.YAMLError=Xb;o0e.YAMLParseError=W7;o0e.YAMLWarning=K7;o0e.prettifyError=n0e});var Wd=_(function(l0e){function u0e(e,{flow:t,indicator:r,next:n,offset:o,onError:i,parentIndent:s,startOnNewline:a}){let c=!1,u=a,l=a,p="",f="",d=!1,h=!1,m=null,y=null,g=null,x=null,b=null,w=null,v=null;for(let T of e){if(h){if(T.type!=="space"&&T.type!=="newline"&&T.type!=="comma")i(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");h=!1}if(m){if(u&&T.type!=="comment"&&T.type!=="newline")i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation");m=null}switch(T.type){case"space":if(!t&&(r!=="doc-start"||n?.type!=="flow-collection")&&T.source.includes("\t"))m=T;l=!0;break;case"comment":{if(!l)i(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=T.source.substring(1)||" ";if(!p)p=A;else p+=f+A;f="",u=!1;break}case"newline":if(u){if(p)p+=T.source;else if(!w||r!=="seq-item-ind")c=!0}else f+=T.source;if(u=!0,d=!0,y||g)x=T;l=!0;break;case"anchor":if(y)i(T,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(T.source.endsWith(":"))i(T.offset+T.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);y=T,v??(v=T.offset),u=!1,l=!1,h=!0;break;case"tag":{if(g)i(T,"MULTIPLE_TAGS","A node can have at most one tag");g=T,v??(v=T.offset),u=!1,l=!1,h=!0;break}case r:if(y||g)i(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`);if(w)i(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${t??"collection"}`);w=T,u=r==="seq-item-ind"||r==="explicit-key-ind",l=!1;break;case"comma":if(t){if(b)i(T,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);b=T,u=!1,l=!1;break}default:i(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),u=!1,l=!1}}let D=e[e.length-1],O=D?D.offset+D.source.length:o;if(h&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!==""))i(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(m&&(u&&m.indent<=s||n?.type==="block-map"||n?.type==="block-seq"))i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:b,found:w,spaceBefore:c,comment:p,hasNewline:d,anchor:y,tag:g,newlineAfterProp:x,end:O,start:v??O}}l0e.resolveProps=u0e});var Qb=_(function(f0e){function pS(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
129
+ `))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let r of t.start)if(r.type==="newline")return!0;if(t.sep){for(let r of t.sep)if(r.type==="newline")return!0}if(pS(t.key)||pS(t.value))return!0}return!1;default:return!0}}f0e.containsNewline=pS});var fS=_(function(y0e){var m0e=Qb();function h0e(e,t,r){if(t?.type==="flow-collection"){let n=t.end[0];if(n.indent===e&&(n.source==="]"||n.source==="}")&&m0e.containsNewline(t))r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}y0e.flowIndentCheck=h0e});var dS=_(function(x0e){var Y7=xe();function b0e(e,t,r){let{uniqueKeys:n}=e.options;if(n===!1)return!1;let o=typeof n==="function"?n:(i,s)=>i===s||Y7.isScalar(i)&&Y7.isScalar(s)&&i.value===s.value;return t.some((i)=>o(i.key,r))}x0e.mapIncludes=b0e});var eU=_(function(A0e){var Z7=Os(),T0e=Rs(),J7=Wd(),E0e=Qb(),X7=fS(),v0e=dS(),Q7="All mapping items must start at the same column";function S0e({composeNode:e,composeEmptyNode:t},r,n,o,i){let a=new(i?.nodeClass??T0e.YAMLMap)(r.schema);if(r.atRoot)r.atRoot=!1;let c=n.offset,u=null;for(let l of n.items){let{start:p,key:f,sep:d,value:h}=l,m=J7.resolveProps(p,{indicator:"explicit-key-ind",next:f??d?.[0],offset:c,onError:o,parentIndent:n.indent,startOnNewline:!0}),y=!m.found;if(y){if(f){if(f.type==="block-seq")o(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in f&&f.indent!==n.indent)o(c,"BAD_INDENT",Q7)}if(!m.anchor&&!m.tag&&!d){if(u=m.end,m.comment)if(a.comment)a.comment+=`
130
+ `+m.comment;else a.comment=m.comment;continue}if(m.newlineAfterProp||E0e.containsNewline(f))o(f??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(m.found?.indent!==n.indent)o(c,"BAD_INDENT",Q7);r.atKey=!0;let g=m.end,x=f?e(r,f,m,o):t(r,g,p,null,m,o);if(r.schema.compat)X7.flowIndentCheck(n.indent,f,o);if(r.atKey=!1,v0e.mapIncludes(r,a.items,x))o(g,"DUPLICATE_KEY","Map keys must be unique");let b=J7.resolveProps(d??[],{indicator:"map-value-ind",next:h,offset:x.range[2],onError:o,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=b.end,b.found){if(y){if(h?.type==="block-map"&&!b.hasNewline)o(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(r.options.strict&&m.start<b.found.offset-1024)o(x.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let w=h?e(r,h,b,o):t(r,c,d,null,b,o);if(r.schema.compat)X7.flowIndentCheck(n.indent,h,o);c=w.range[2];let v=new Z7.Pair(x,w);if(r.options.keepSourceTokens)v.srcToken=l;a.items.push(v)}else{if(y)o(x.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(b.comment)if(x.comment)x.comment+=`
131
+ `+b.comment;else x.comment=b.comment;let w=new Z7.Pair(x);if(r.options.keepSourceTokens)w.srcToken=l;a.items.push(w)}}if(u&&u<c)o(u,"IMPOSSIBLE","Map comment with trailing content");return a.range=[n.offset,c,u??c],a}A0e.resolveBlockMap=S0e});var tU=_(function(R0e){var D0e=Ps(),I0e=Wd(),O0e=fS();function k0e({composeNode:e,composeEmptyNode:t},r,n,o,i){let a=new(i?.nodeClass??D0e.YAMLSeq)(r.schema);if(r.atRoot)r.atRoot=!1;if(r.atKey)r.atKey=!1;let c=n.offset,u=null;for(let{start:l,value:p}of n.items){let f=I0e.resolveProps(l,{indicator:"seq-item-ind",next:p,offset:c,onError:o,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||p)if(p?.type==="block-seq")o(f.end,"BAD_INDENT","All sequence items must start at the same column");else o(c,"MISSING_CHAR","Sequence item without - indicator");else{if(u=f.end,f.comment)a.comment=f.comment;continue}let d=p?e(r,p,f,o):t(r,f.end,l,null,f,o);if(r.schema.compat)O0e.flowIndentCheck(n.indent,p,o);c=d.range[2],a.items.push(d)}return a.range=[n.offset,c,u??c],a}R0e.resolveBlockSeq=k0e});var jl=_(function(B0e){function _0e(e,t,r,n){let o="";if(e){let i=!1,s="";for(let a of e){let{source:c,type:u}=a;switch(u){case"space":i=!0;break;case"comment":{if(r&&!i)n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let l=c.substring(1)||" ";if(!o)o=l;else o+=s+l;s="";break}case"newline":if(o)s+=c;i=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}t+=c.length}}return{comment:o,offset:t}}B0e.resolveEnd=_0e});var oU=_(function(q0e){var F0e=xe(),M0e=Os(),rU=Rs(),L0e=Ps(),$0e=jl(),nU=Wd(),U0e=Qb(),H0e=dS(),mS="Block collections are not allowed within flow collections",hS=(e)=>e&&(e.type==="block-map"||e.type==="block-seq");function j0e({composeNode:e,composeEmptyNode:t},r,n,o,i){let s=n.start.source==="{",a=s?"flow map":"flow sequence",u=new(i?.nodeClass??(s?rU.YAMLMap:L0e.YAMLSeq))(r.schema);u.flow=!0;let l=r.atRoot;if(l)r.atRoot=!1;if(r.atKey)r.atKey=!1;let p=n.offset+n.start.source.length;for(let y=0;y<n.items.length;++y){let g=n.items[y],{start:x,key:b,sep:w,value:v}=g,D=nU.resolveProps(x,{flow:a,indicator:"explicit-key-ind",next:b??w?.[0],offset:p,onError:o,parentIndent:n.indent,startOnNewline:!1});if(!D.found){if(!D.anchor&&!D.tag&&!w&&!v){if(y===0&&D.comma)o(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(y<n.items.length-1)o(D.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`);if(D.comment)if(u.comment)u.comment+=`
132
+ `+D.comment;else u.comment=D.comment;p=D.end;continue}if(!s&&r.options.strict&&U0e.containsNewline(b))o(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(y===0){if(D.comma)o(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`)}else{if(!D.comma)o(D.start,"MISSING_CHAR",`Missing , between ${a} items`);if(D.comment){let O="";e:for(let T of x)switch(T.type){case"comma":case"space":break;case"comment":O=T.source.substring(1);break e;default:break e}if(O){let T=u.items[u.items.length-1];if(F0e.isPair(T))T=T.value??T.key;if(T.comment)T.comment+=`
133
+ `+O;else T.comment=O;D.comment=D.comment.substring(O.length+1)}}}if(!s&&!w&&!D.found){let O=v?e(r,v,D,o):t(r,D.end,w,null,D,o);if(u.items.push(O),p=O.range[2],hS(v))o(O.range,"BLOCK_IN_FLOW",mS)}else{r.atKey=!0;let O=D.end,T=b?e(r,b,D,o):t(r,O,x,null,D,o);if(hS(b))o(T.range,"BLOCK_IN_FLOW",mS);r.atKey=!1;let A=nU.resolveProps(w??[],{flow:a,indicator:"map-value-ind",next:v,offset:T.range[2],onError:o,parentIndent:n.indent,startOnNewline:!1});if(A.found){if(!s&&!D.found&&r.options.strict){if(w)for(let S of w){if(S===A.found)break;if(S.type==="newline"){o(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(D.start<A.found.offset-1024)o(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(v)if("source"in v&&v.source?.[0]===":")o(v,"MISSING_CHAR",`Missing space after : in ${a}`);else o(A.start,"MISSING_CHAR",`Missing , or : between ${a} items`);let E=v?e(r,v,A,o):A.found?t(r,A.end,w,null,A,o):null;if(E){if(hS(v))o(E.range,"BLOCK_IN_FLOW",mS)}else if(A.comment)if(T.comment)T.comment+=`
134
+ `+A.comment;else T.comment=A.comment;let R=new M0e.Pair(T,E);if(r.options.keepSourceTokens)R.srcToken=g;if(s){let S=u;if(H0e.mapIncludes(r,S.items,T))o(O,"DUPLICATE_KEY","Map keys must be unique");S.items.push(R)}else{let S=new rU.YAMLMap(r.schema);S.flow=!0,S.items.push(R);let k=(E??T).range;S.range=[T.range[0],k[1],k[2]],u.items.push(S)}p=E?E.range[2]:A.end}}let f=s?"}":"]",[d,...h]=n.end,m=p;if(d?.source===f)m=d.offset+d.source.length;else{let y=a[0].toUpperCase()+a.substring(1),g=l?`${y} must end with a ${f}`:`${y} in block collection must be sufficiently indented and end with a ${f}`;if(o(p,l?"MISSING_CHAR":"BAD_INDENT",g),d&&d.source.length!==1)h.unshift(d)}if(h.length>0){let y=$0e.resolveEnd(h,m,r.options.strict,o);if(y.comment)if(u.comment)u.comment+=`
135
+ `+y.comment;else u.comment=y.comment;u.range=[n.offset,m,y.offset]}else u.range=[n.offset,m,m];return u}q0e.resolveFlowCollection=j0e});var iU=_(function(Q0e){var G0e=xe(),V0e=ft(),W0e=Rs(),K0e=Ps(),Y0e=eU(),Z0e=tU(),J0e=oU();function yS(e,t,r,n,o,i){let s=r.type==="block-map"?Y0e.resolveBlockMap(e,t,r,n,i):r.type==="block-seq"?Z0e.resolveBlockSeq(e,t,r,n,i):J0e.resolveFlowCollection(e,t,r,n,i),a=s.constructor;if(o==="!"||o===a.tagName)return s.tag=a.tagName,s;if(o)s.tag=o;return s}function X0e(e,t,r,n,o){let i=n.tag,s=!i?null:t.directives.tagName(i.source,(f)=>o(i,"TAG_RESOLVE_FAILED",f));if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:d}=n,h=f&&i?f.offset>i.offset?f:i:f??i;if(h&&(!d||d.offset<h.offset))o(h,"MISSING_CHAR","Missing newline after block sequence props")}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!i||!s||s==="!"||s===W0e.YAMLMap.tagName&&a==="map"||s===K0e.YAMLSeq.tagName&&a==="seq")return yS(e,t,r,o,s);let c=t.schema.tags.find((f)=>f.tag===s&&f.collection===a);if(!c){let f=t.schema.knownTags[s];if(f?.collection===a)t.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else{if(f)o(i,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0);else o(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0);return yS(e,t,r,o,s)}}let u=yS(e,t,r,o,s,c),l=c.resolve?.(u,(f)=>o(i,"TAG_RESOLVE_FAILED",f),t.options)??u,p=G0e.isNode(l)?l:new V0e.Scalar(l);if(p.range=u.range,p.tag=s,c?.format)p.format=c.format;return p}Q0e.composeCollection=X0e});var bS=_(function(oge){var gS=ft();function tge(e,t,r){let n=t.offset,o=rge(t,e.options.strict,r);if(!o)return{value:"",type:null,comment:"",range:[n,n,n]};let i=o.mode===">"?gS.Scalar.BLOCK_FOLDED:gS.Scalar.BLOCK_LITERAL,s=t.source?nge(t.source):[],a=s.length;for(let m=s.length-1;m>=0;--m){let y=s[m][1];if(y===""||y==="\r")a=m;else break}if(a===0){let m=o.chomp==="+"&&s.length>0?`
136
+ `.repeat(Math.max(1,s.length-1)):"",y=n+o.length;if(t.source)y+=t.source.length;return{value:m,type:i,comment:o.comment,range:[n,y,y]}}let c=t.indent+o.indent,u=t.offset+o.length,l=0;for(let m=0;m<a;++m){let[y,g]=s[m];if(g===""||g==="\r"){if(o.indent===0&&y.length>c)c=y.length}else{if(y.length<c)r(u+y.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(o.indent===0)c=y.length;if(l=m,c===0&&!e.atRoot)r(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=y.length+g.length+1}for(let m=s.length-1;m>=a;--m)if(s[m][0].length>c)a=m+1;let p="",f="",d=!1;for(let m=0;m<l;++m)p+=s[m][0].slice(c)+`
137
+ `;for(let m=l;m<a;++m){let[y,g]=s[m];u+=y.length+g.length+1;let x=g[g.length-1]==="\r";if(x)g=g.slice(0,-1);if(g&&y.length<c){let w=`Block scalar lines must not be less indented than their ${o.indent?"explicit indentation indicator":"first line"}`;r(u-g.length-(x?2:1),"BAD_INDENT",w),y=""}if(i===gS.Scalar.BLOCK_LITERAL)p+=f+y.slice(c)+g,f=`
138
+ `;else if(y.length>c||g[0]==="\t"){if(f===" ")f=`
139
+ `;else if(!d&&f===`
140
+ `)f=`
141
+
142
+ `;p+=f+y.slice(c)+g,f=`
143
+ `,d=!0}else if(g==="")if(f===`
144
+ `)p+=`
145
+ `;else f=`
146
+ `;else p+=f+g,f=" ",d=!1}switch(o.chomp){case"-":break;case"+":for(let m=a;m<s.length;++m)p+=`
147
+ `+s[m][0].slice(c);if(p[p.length-1]!==`
148
+ `)p+=`
149
+ `;break;default:p+=`
150
+ `}let h=n+o.length+t.source.length;return{value:p,type:i,comment:o.comment,range:[n,h,h]}}function rge({offset:e,props:t},r,n){if(t[0].type!=="block-scalar-header")return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:o}=t[0],i=o[0],s=0,a="",c=-1;for(let f=1;f<o.length;++f){let d=o[f];if(!a&&(d==="-"||d==="+"))a=d;else{let h=Number(d);if(!s&&h)s=h;else if(c===-1)c=e+f}}if(c!==-1)n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${o}`);let u=!1,l="",p=o.length;for(let f=1;f<t.length;++f){let d=t[f];switch(d.type){case"space":u=!0;case"newline":p+=d.source.length;break;case"comment":if(r&&!u)n(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");p+=d.source.length,l=d.source.substring(1);break;case"error":n(d,"UNEXPECTED_TOKEN",d.message),p+=d.source.length;break;default:{let h=`Unexpected token in block scalar header: ${d.type}`;n(d,"UNEXPECTED_TOKEN",h);let m=d.source;if(m&&typeof m==="string")p+=m.length}}}return{mode:i,indent:s,chomp:a,comment:l,length:p}}function nge(e){let t=e.split(/\n( *)/),r=t[0],n=r.match(/^( *)/),i=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let s=1;s<t.length;s+=2)i.push([t[s],t[s+1]]);return i}oge.resolveBlockScalar=tge});var wS=_(function(mge){var xS=ft(),sge=jl();function age(e,t,r){let{offset:n,type:o,source:i,end:s}=e,a,c,u=(f,d,h)=>r(n+f,d,h);switch(o){case"scalar":a=xS.Scalar.PLAIN,c=cge(i,u);break;case"single-quoted-scalar":a=xS.Scalar.QUOTE_SINGLE,c=uge(i,u);break;case"double-quoted-scalar":a=xS.Scalar.QUOTE_DOUBLE,c=lge(i,u);break;default:return r(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[n,n+i.length,n+i.length]}}let l=n+i.length,p=sge.resolveEnd(s,l,t,r);return{value:c,type:a,comment:p.comment,range:[n,l,p.offset]}}function cge(e,t){let r="";switch(e[0]){case"\t":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${e[0]}`;break}case"@":case"`":{r=`reserved character ${e[0]}`;break}}if(r)t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`);return sU(e)}function uge(e,t){if(e[e.length-1]!=="'"||e.length===1)t(e.length,"MISSING_CHAR","Missing closing 'quote");return sU(e.slice(1,-1)).replace(/''/g,"'")}function sU(e){let t=/(.*?)\r?\n/sy,r=t.exec(e);if(!r)return e;let n,o;try{n=new RegExp("(?<![ \t])[ \t]+$"),o=new RegExp("^[ \t]+|(?<![ \t])[ \t]+$","g")}catch{n=/[ \t]+$/,o=/^[ \t]+|[ \t]+$/g}let i=r[1].replace(n,""),s=" ",a=t.lastIndex;while(r=t.exec(e)){let u=r[1].replace(o,"");if(u==="")if(s===`
151
+ `)i+=s;else s=`
152
+ `;else i+=s+u,s=" ";a=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=a,r=c.exec(e),i+s+(r?.[1]??"")}function lge(e,t){let r="";for(let n=1;n<e.length-1;++n){let o=e[n];if(o==="\r"&&e[n+1]===`
153
+ `)continue;if(o===`
154
+ `){let{fold:i,offset:s}=pge(e,n);r+=i,n=s}else if(o==="\\"){let i=e[++n],s=fge[i];if(s)r+=s;else if(i===`
155
+ `){i=e[n+1];while(i===" "||i==="\t")i=e[++n+1]}else if(i==="\r"&&e[n+1]===`
156
+ `){i=e[++n+1];while(i===" "||i==="\t")i=e[++n+1]}else if(i==="x"||i==="u"||i==="U"){let a=i==="x"?2:i==="u"?4:8;r+=dge(e,n+1,a,t),n+=a}else{let a=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),r+=a}}else if(o===" "||o==="\t"){let i=n,s=e[n+1];while(s===" "||s==="\t")s=e[++n+1];if(s!==`
157
+ `&&!(s==="\r"&&e[n+2]===`
158
+ `))r+=n>i?e.slice(i,n+1):o}else r+=o}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return r}function pge(e,t){let r="",n=e[t+1];while(n===" "||n==="\t"||n===`
159
+ `||n==="\r"){if(n==="\r"&&e[t+2]!==`
160
+ `)break;if(n===`
161
+ `)r+=`
162
+ `;t+=1,n=e[t+1]}if(!r)r=" ";return{fold:r,offset:t}}var fge={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
163
+ `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function dge(e,t,r,n){let o=e.substr(t,r),s=o.length===r&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;try{return String.fromCodePoint(s)}catch{let a=e.substr(t-2,r+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}mge.resolveFlowScalar=age});var cU=_(function(Tge){var Ga=xe(),aU=ft(),yge=bS(),gge=wS();function bge(e,t,r,n){let{value:o,type:i,comment:s,range:a}=t.type==="block-scalar"?yge.resolveBlockScalar(e,t,n):gge.resolveFlowScalar(t,e.options.strict,n),c=r?e.directives.tagName(r.source,(p)=>n(r,"TAG_RESOLVE_FAILED",p)):null,u;if(e.options.stringKeys&&e.atKey)u=e.schema[Ga.SCALAR];else if(c)u=xge(e.schema,o,c,r,n);else if(t.type==="scalar")u=wge(e,o,t,n);else u=e.schema[Ga.SCALAR];let l;try{let p=u.resolve(o,(f)=>n(r??t,"TAG_RESOLVE_FAILED",f),e.options);l=Ga.isScalar(p)?p:new aU.Scalar(p)}catch(p){let f=p instanceof Error?p.message:String(p);n(r??t,"TAG_RESOLVE_FAILED",f),l=new aU.Scalar(o)}if(l.range=a,l.source=o,i)l.type=i;if(c)l.tag=c;if(u.format)l.format=u.format;if(s)l.comment=s;return l}function xge(e,t,r,n,o){if(r==="!")return e[Ga.SCALAR];let i=[];for(let a of e.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)i.push(a);else return a;for(let a of i)if(a.test?.test(t))return a;let s=e.knownTags[r];if(s&&!s.collection)return e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s;return o(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),e[Ga.SCALAR]}function wge({atKey:e,directives:t,schema:r},n,o,i){let s=r.tags.find((a)=>(a.default===!0||e&&a.default==="key")&&a.test?.test(n))||r[Ga.SCALAR];if(r.compat){let a=r.compat.find((c)=>c.default&&c.test?.test(n))??r[Ga.SCALAR];if(s.tag!==a.tag){let c=t.tagString(s.tag),u=t.tagString(a.tag),l=`Value may be parsed as either ${c} or ${u}`;i(o,"TAG_RESOLVE_FAILED",l,!0)}}return s}Tge.composeScalar=bge});var uU=_(function(Sge){function vge(e,t,r){if(t){r??(r=t.length);for(let n=r-1;n>=0;--n){let o=t[n];switch(o.type){case"space":case"comment":case"newline":e-=o.source.length;continue}o=t[++n];while(o?.type==="space")e+=o.source.length,o=t[++n];break}}return e}Sge.emptyScalarPosition=vge});var fU=_(function(_ge){var Cge=Rd(),Dge=xe(),Ige=iU(),lU=cU(),Oge=jl(),kge=uU(),Rge={composeNode:pU,composeEmptyNode:TS};function pU(e,t,r,n){let o=e.atKey,{spaceBefore:i,comment:s,anchor:a,tag:c}=r,u,l=!0;switch(t.type){case"alias":if(u=Pge(e,t,n),a||c)n(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(u=lU.composeScalar(e,t,c,n),a)u.anchor=a.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(u=Ige.composeCollection(Rge,e,t,r,n),a)u.anchor=a.source.substring(1)}catch(p){let f=p instanceof Error?p.message:String(p);n(t,"RESOURCE_EXHAUSTION",f)}break;default:{let p=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",p),l=!1}}if(u??(u=TS(e,t.offset,void 0,null,r,n)),a&&u.anchor==="")n(a,"BAD_ALIAS","Anchor cannot be an empty string");if(o&&e.options.stringKeys&&(!Dge.isScalar(u)||typeof u.value!=="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str"))n(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(i)u.spaceBefore=!0;if(s)if(t.type==="scalar"&&t.source==="")u.comment=s;else u.commentBefore=s;if(e.options.keepSourceTokens&&l)u.srcToken=t;return u}function TS(e,t,r,n,{spaceBefore:o,comment:i,anchor:s,tag:a,end:c},u){let l={type:"scalar",offset:kge.emptyScalarPosition(t,r,n),indent:-1,source:""},p=lU.composeScalar(e,l,a,u);if(s){if(p.anchor=s.source.substring(1),p.anchor==="")u(s,"BAD_ALIAS","Anchor cannot be an empty string")}if(o)p.spaceBefore=!0;if(i)p.comment=i,p.range[2]=c;return p}function Pge({options:e},{offset:t,source:r,end:n},o){let i=new Cge.Alias(r.substring(1));if(i.source==="")o(t,"BAD_ALIAS","Alias cannot be an empty string");if(i.source.endsWith(":"))o(t+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+r.length,a=Oge.resolveEnd(n,s,e.strict,o);if(i.range=[t,s,a.offset],a.comment)i.comment=a.comment;return i}_ge.composeEmptyNode=TS;_ge.composeNode=pU});var mU=_(function(Uge){var Fge=Gd(),dU=fU(),Mge=jl(),Lge=Wd();function $ge(e,t,{offset:r,start:n,value:o,end:i},s){let a=Object.assign({_directives:t},e),c=new Fge.Document(void 0,a),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},l=Lge.resolveProps(n,{indicator:"doc-start",next:o??i?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});if(l.found){if(c.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!l.hasNewline)s(l.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}c.contents=o?dU.composeNode(u,o,l,s):dU.composeEmptyNode(u,l.end,n,null,l,s);let p=c.contents.range[2],f=Mge.resolveEnd(i,p,!1,s);if(f.comment)c.comment=f.comment;return c.range=[r,p,f.offset],c}Uge.composeDoc=$ge});var ES=_(function(Wge){var jge=pe("process"),qge=Cv(),zge=Gd(),Kd=Vd(),hU=xe(),Gge=mU(),Vge=jl();function Yd(e){if(typeof e==="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:r}=e;return[t,t+(typeof r==="string"?r.length:1)]}function yU(e){let t="",r=!1,n=!1;for(let o=0;o<e.length;++o){let i=e[o];switch(i[0]){case"#":t+=(t===""?"":n?`
164
+
165
+ `:`
166
+ `)+(i.substring(1)||" "),r=!0,n=!1;break;case"%":if(e[o+1]?.[0]!=="#")o+=1;r=!1;break;default:if(!r)n=!0;r=!1}}return{comment:t,afterEmptyLine:n}}class gU{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,r,n,o)=>{let i=Yd(t);if(o)this.warnings.push(new Kd.YAMLWarning(i,r,n));else this.errors.push(new Kd.YAMLParseError(i,r,n))},this.directives=new qge.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:n}=yU(this.prelude);if(r){let o=e.contents;if(t)e.comment=e.comment?`${e.comment}
167
+ ${r}`:r;else if(n||e.directives.docStart||!o)e.commentBefore=r;else if(hU.isCollection(o)&&!o.flow&&o.items.length>0){let i=o.items[0];if(hU.isPair(i))i=i.key;let s=i.commentBefore;i.commentBefore=s?`${r}
168
+ ${s}`:r}else{let i=o.commentBefore;o.commentBefore=i?`${r}
169
+ ${i}`:r}}if(t){for(let o=0;o<this.errors.length;++o)e.errors.push(this.errors[o]);for(let o=0;o<this.warnings.length;++o)e.warnings.push(this.warnings[o])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:yU(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(let n of e)yield*this.next(n);yield*this.end(t,r)}*next(e){if(jge.env.LOG_STREAM)console.dir(e,{depth:null});switch(e.type){case"directive":this.directives.add(e.source,(t,r,n)=>{let o=Yd(e);o[0]+=t,this.onError(o,"BAD_DIRECTIVE",r,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Gge.composeDoc(this.options,this.directives,e,this.onError);if(this.atDirectives&&!t.directives.docStart)this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(t,!1),this.doc)yield this.doc;this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new Kd.YAMLParseError(Yd(e),"UNEXPECTED_TOKEN",t);if(this.atDirectives||!this.doc)this.errors.push(r);else this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){this.errors.push(new Kd.YAMLParseError(Yd(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=Vge.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
170
+ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Kd.YAMLParseError(Yd(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),n=new zge.Document(void 0,r);if(this.atDirectives)this.onError(t,"MISSING_CHAR","Missing directives-end indicator line");n.range=[0,t,t],this.decorate(n,!1),yield n}}}Wge.Composer=gU});var wU=_(function(rbe){var Yge=bS(),Zge=wS(),Jge=Vd(),bU=Nd();function Xge(e,t=!0,r){if(e){let n=(o,i,s)=>{let a=typeof o==="number"?o:Array.isArray(o)?o[0]:o.offset;if(r)r(a,i,s);else throw new Jge.YAMLParseError([a,a+1],i,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Zge.resolveFlowScalar(e,t,n);case"block-scalar":return Yge.resolveBlockScalar({options:{strict:t}},e,n)}}return null}function Qge(e,t){let{implicitKey:r=!1,indent:n,inFlow:o=!1,offset:i=-1,type:s="PLAIN"}=t,a=bU.stringifyString({type:s,value:e},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:n,source:`
171
+ `}];switch(a[0]){case"|":case">":{let u=a.indexOf(`
172
+ `),l=a.substring(0,u),p=a.substring(u+1)+`
173
+ `,f=[{type:"block-scalar-header",offset:i,indent:n,source:l}];if(!xU(f,c))f.push({type:"newline",offset:-1,indent:n,source:`
174
+ `});return{type:"block-scalar",offset:i,indent:n,props:f,source:p}}case'"':return{type:"double-quoted-scalar",offset:i,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:n,source:a,end:c};default:return{type:"scalar",offset:i,indent:n,source:a,end:c}}}function ebe(e,t,r={}){let{afterKey:n=!1,implicitKey:o=!1,inFlow:i=!1,type:s}=r,a="indent"in e?e.indent:null;if(n&&typeof a==="number")a+=2;if(!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let u=e.props[0];if(u.type!=="block-scalar-header")throw Error("Invalid block scalar header");s=u.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=bU.stringifyString({type:s,value:t},{implicitKey:o||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":tbe(e,c);break;case'"':vS(e,c,"double-quoted-scalar");break;case"'":vS(e,c,"single-quoted-scalar");break;default:vS(e,c,"scalar")}}function tbe(e,t){let r=t.indexOf(`
175
+ `),n=t.substring(0,r),o=t.substring(r+1)+`
176
+ `;if(e.type==="block-scalar"){let i=e.props[0];if(i.type!=="block-scalar-header")throw Error("Invalid block scalar header");i.source=n,e.source=o}else{let{offset:i}=e,s="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:s,source:n}];if(!xU(a,"end"in e?e.end:void 0))a.push({type:"newline",offset:-1,indent:s,source:`
177
+ `});for(let c of Object.keys(e))if(c!=="type"&&c!=="offset")delete e[c];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:o})}}function xU(e,t){if(t)for(let r of t)switch(r.type){case"space":case"comment":e.push(r);break;case"newline":return e.push(r),!0}return!1}function vS(e,t,r){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=r,e.source=t;break;case"block-scalar":{let n=e.props.slice(1),o=t.length;if(e.props[0].type==="block-scalar-header")o-=e.props[0].source.length;for(let i of n)i.offset+=o;delete e.props,Object.assign(e,{type:r,source:t,end:n});break}case"block-map":case"block-seq":{let o={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
178
+ `};delete e.items,Object.assign(e,{type:r,source:t,end:[o]});break}default:{let n="indent"in e?e.indent:-1,o="end"in e&&Array.isArray(e.end)?e.end.filter((i)=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(e))if(i!=="type"&&i!=="offset")delete e[i];Object.assign(e,{type:r,indent:n,source:t,end:o})}}}rbe.createScalarToken=Qge;rbe.resolveAsScalar=Xge;rbe.setScalarValue=ebe});var TU=_(function(abe){var sbe=(e)=>("type"in e)?tx(e):ex(e);function tx(e){switch(e.type){case"block-scalar":{let t="";for(let r of e.props)t+=tx(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(let r of e.items)t+=ex(r);return t}case"flow-collection":{let t=e.start.source;for(let r of e.items)t+=ex(r);for(let r of e.end)t+=r.source;return t}case"document":{let t=ex(e);if(e.end)for(let r of e.end)t+=r.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let r of e.end)t+=r.source;return t}}}function ex({start:e,key:t,sep:r,value:n}){let o="";for(let i of e)o+=i.source;if(t)o+=tx(t);if(r)for(let i of r)o+=i.source;if(n)o+=tx(n);return o}abe.stringify=sbe});var SU=_(function(lbe){var SS=Symbol("break visit"),ube=Symbol("skip children"),EU=Symbol("remove item");function Va(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};vU(Object.freeze([]),e,t)}Va.BREAK=SS;Va.SKIP=ube;Va.REMOVE=EU;Va.itemAtPath=(e,t)=>{let r=e;for(let[n,o]of t){let i=r?.[n];if(i&&"items"in i)r=i.items[o];else return}return r};Va.parentCollection=(e,t)=>{let r=Va.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],o=r?.[n];if(o&&"items"in o)return o;throw Error("Parent collection not found")};function vU(e,t,r){let n=r(t,e);if(typeof n==="symbol")return n;for(let o of["key","value"]){let i=t[o];if(i&&"items"in i){for(let s=0;s<i.items.length;++s){let a=vU(Object.freeze(e.concat([[o,s]])),i.items[s],r);if(typeof a==="number")s=a-1;else if(a===SS)return SS;else if(a===EU)i.items.splice(s,1),s-=1}if(typeof n==="function"&&o==="key")n=n(t,e)}}return typeof n==="function"?n(t,e):n}lbe.visit=Va});var rx=_(function(bbe){var AS=wU(),fbe=TU(),dbe=SU(),CS="\uFEFF",DS="\x02",IS="\x18",OS="\x1F",mbe=(e)=>!!e&&("items"in e),hbe=(e)=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function ybe(e){switch(e){case CS:return"<BOM>";case DS:return"<DOC>";case IS:return"<FLOW_END>";case OS:return"<SCALAR>";default:return JSON.stringify(e)}}function gbe(e){switch(e){case CS:return"byte-order-mark";case DS:return"doc-mode";case IS:return"flow-error-end";case OS:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
179
+ `:case`\r
180
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}bbe.createScalarToken=AS.createScalarToken;bbe.resolveAsScalar=AS.resolveAsScalar;bbe.setScalarValue=AS.setScalarValue;bbe.stringify=fbe.stringify;bbe.visit=dbe.visit;bbe.BOM=CS;bbe.DOCUMENT=DS;bbe.FLOW_END=IS;bbe.SCALAR=OS;bbe.isCollection=mbe;bbe.isScalar=hbe;bbe.prettyToken=ybe;bbe.tokenType=gbe});var RS=_(function(Bbe){var Zd=rx();function Vn(e){switch(e){case void 0:case" ":case`
181
+ `:case"\r":case"\t":return!0;default:return!1}}var AU=new Set("0123456789ABCDEFabcdef"),Pbe=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),nx=new Set(",[]{}"),_be=new Set(` ,[]{}
182
+ \r `),kS=(e)=>!e||_be.has(e);class CU{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let r=this.next??"stream";while(r&&(t||this.hasChars(1)))r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];while(t===" "||t==="\t")t=this.buffer[++e];if(!t||t==="#"||t===`
183
+ `)return!0;if(t==="\r")return this.buffer[e+1]===`
184
+ `;return!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;while(t===" ")t=this.buffer[++r+e];if(t==="\r"){let n=this.buffer[r+e+1];if(n===`
185
+ `||!n&&!this.atEnd)return e+r+1}return t===`
186
+ `||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&Vn(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;if(typeof e!=="number"||e!==-1&&e<this.pos)e=this.buffer.indexOf(`
187
+ `,this.pos),this.lineEndPos=e;if(e===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[e-1]==="\r")e-=1;return this.buffer.substring(this.pos,e)}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Zd.BOM)yield*this.pushCount(1),e=e.substring(1);if(e[0]==="%"){let t=e.length,r=e.indexOf("#");while(r!==-1){let o=e[r-1];if(o===" "||o==="\t"){t=r-1;break}else r=e.indexOf("#",r+1)}while(!0){let o=e[t-1];if(o===" "||o==="\t")t-=1;else break}let n=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Zd.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&Vn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Vn(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Vn(t)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(kS),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,r=-1;do{if(e=yield*this.pushNewline(),e>0)t=yield*this.pushSpaces(!1),this.indentValue=r=t;else t=0;t+=yield*this.pushSpaces(!0)}while(e+t>0);let n=this.getLine();if(n===null)return this.setNext("flow");if(r!==-1&&r<this.indentNext&&n[0]!=="#"||r===0&&(n.startsWith("---")||n.startsWith("..."))&&Vn(n[3])){if(!(r===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield Zd.FLOW_END,yield*this.parseLineStart()}let o=0;while(n[o]===",")o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),n[o]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(kS),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let i=this.charAt(1);if(this.flowKey||Vn(i)||i===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")while(t!==-1&&this.buffer[t+1]==="'")t=this.buffer.indexOf("'",t+2);else while(t!==-1){let o=0;while(this.buffer[t-1-o]==="\\")o+=1;if(o%2===0)break;t=this.buffer.indexOf('"',t+1)}let r=this.buffer.substring(0,t),n=r.indexOf(`
188
+ `,this.pos);if(n!==-1){while(n!==-1){let o=this.continueScalar(n+1);if(o===-1)break;n=r.indexOf(`
189
+ `,o)}if(n!==-1)t=n-(r[n-1]==="\r"?2:1)}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;while(!0){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil((t)=>Vn(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,r;e:for(let o=this.pos;r=this.buffer[o];++o)switch(r){case" ":t+=1;break;case`
190
+ `:e=o,t=0;break;case"\r":{let i=this.buffer[o+1];if(!i&&!this.atEnd)return this.setNext("block-scalar");if(i===`
191
+ `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=t;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(e+1);if(o===-1)break;e=this.buffer.indexOf(`
192
+ `,o)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;r=this.buffer[n];while(r===" ")r=this.buffer[++n];if(r==="\t"){while(r==="\t"||r===" "||r==="\r"||r===`
193
+ `)r=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let o=e-1,i=this.buffer[o];if(i==="\r")i=this.buffer[--o];let s=o;while(i===" ")i=this.buffer[--o];if(i===`
194
+ `&&o>=this.pos&&o+1+t>s)e=o;else break}while(!0);return yield Zd.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,r=this.pos-1,n;while(n=this.buffer[++r])if(n===":"){let o=this.buffer[r+1];if(Vn(o)||e&&nx.has(o))break;t=r}else if(Vn(n)){let o=this.buffer[r+1];if(n==="\r")if(o===`
195
+ `)r+=1,n=`
196
+ `,o=this.buffer[r+1];else t=r;if(o==="#"||e&&nx.has(o))break;if(n===`
197
+ `){let i=this.continueScalar(r+1);if(i===-1)break;r=Math.max(r,i-2)}}else{if(e&&nx.has(n))break;t=r}if(!n&&!this.atEnd)return this.setNext("plain-scalar");return yield Zd.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc"}*pushCount(e){if(e>0)return yield this.buffer.substr(this.pos,e),this.pos+=e,e;return 0}*pushToIndex(e,t){let r=this.buffer.slice(this.pos,e);if(r)return yield r,this.pos+=r.length,r.length;else if(t)yield"";return 0}*pushIndicators(){let e=0;e:while(!0){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(kS),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,r=this.charAt(1);if(Vn(r)||t&&nx.has(r)){if(!t)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];while(!Vn(t)&&t!==">")t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];while(t)if(Pbe.has(t))t=this.buffer[++e];else if(t==="%"&&AU.has(this.buffer[e+1])&&AU.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];if(e===`
198
+ `)return yield*this.pushCount(1);else if(e==="\r"&&this.charAt(1)===`
199
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r==="\t");let n=t-this.pos;if(n>0)yield this.buffer.substr(this.pos,n),this.pos=t;return n}*pushUntil(e){let t=this.pos,r=this.buffer[t];while(!e(r))r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}Bbe.Lexer=CU});var PS=_(function(Fbe){class DU{constructor(){this.lineStarts=[],this.addNewLine=(e)=>this.lineStarts.push(e),this.linePos=(e)=>{let t=0,r=this.lineStarts.length;while(t<r){let o=t+r>>1;if(this.lineStarts[o]<e)t=o+1;else r=o}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}}Fbe.LineCounter=DU});var _S=_(function(Ube){var Lbe=pe("process"),IU=rx(),$be=RS();function _s(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}function OU(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function RU(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function ox(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function ql(e){if(e.length===0)return[];let t=e.length;e:while(--t>=0)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}while(e[++t]?.type==="space");return e.splice(t,e.length)}function ix(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let r=0;r<t.length;++r)e.push(t[r])}function kU(e){if(e.start.type==="flow-seq-start"){for(let t of e.items)if(t.sep&&!t.value&&!_s(t.start,"explicit-key-ind")&&!_s(t.sep,"map-value-ind")){if(t.key)t.value=t.key;if(delete t.key,RU(t.value))if(t.value.end)ix(t.value.end,t.sep);else t.value.end=t.sep;else ix(t.start,t.sep);delete t.sep}}}class PU{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new $be.Lexer,this.onNewLine=e}*parse(e,t=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let r of this.lexer.lex(e,t))yield*this.next(r);if(!t)yield*this.end()}*next(e){if(this.source=e,Lbe.env.LOG_TOKENS)console.log("|",IU.prettyToken(e));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=IU.tokenType(e);if(!t){let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}else if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+e.length);break;case"space":if(this.atNewLine&&e[0]===" ")this.indent+=e.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=e.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let r=this.peek(1);if(t.type==="block-scalar")t.indent="indent"in r?r.indent:0;else if(t.type==="flow-collection"&&r.type==="document")t.indent=0;if(t.type==="flow-collection")kU(t);switch(r.type){case"document":r.value=t;break;case"block-scalar":r.props.push(t);break;case"block-map":{let n=r.items[r.items.length-1];if(n.value){r.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=r.items[r.items.length-1];if(n.value)r.items.push({start:[],value:t});else n.value=t;break}case"flow-collection":{let n=r.items[r.items.length-1];if(!n||n.value)r.items.push({start:[],key:t,sep:[]});else if(n.sep)n.value=t;else Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let n=t.items[t.items.length-1];if(n&&!n.sep&&!n.value&&n.start.length>0&&OU(n.start)===-1&&(t.indent===0||n.start.every((o)=>o.type!=="comment"||o.indent<t.indent))){if(r.type==="document")r.end=n.start;else r.items.push({start:n.start});t.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")e.start.push(this.sourceToken);this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{if(OU(e.start)!==-1)yield*this.pop(),yield*this.step();else e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);if(t)this.stack.push(t);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=ox(this.peek(2)),r=ql(t),n;if(e.end)n=e.end,n.push(this.sourceToken),delete e.end;else n=[this.sourceToken];let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
200
+ `)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
201
+ `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let r="end"in t.value?t.value.end:void 0;if((Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment")r?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){ix(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,n=r&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",o=[];if(n&&t.sep&&!t.value){let i=[];for(let s=0;s<t.sep.length;++s){let a=t.sep[s];switch(a.type){case"newline":i.push(s);break;case"space":break;case"comment":if(a.indent>e.indent)i.length=0;break;default:i.length=0}}if(i.length>=2)o=t.sep.splice(i[1])}switch(this.type){case"anchor":case"tag":if(n||t.value)o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0;else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"explicit-key-ind":if(!t.sep&&!t.explicitKey)t.start.push(this.sourceToken),t.explicitKey=!0;else if(n||t.value)o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(!t.sep)if(_s(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let i=ql(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(_s(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(RU(t.key)&&!_s(t.sep,"newline")){let i=ql(t.start),{key:s,sep:a}=t;a.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:s,sep:a}]})}else if(o.length>0)t.sep=t.sep.concat(o,this.sourceToken);else t.sep.push(this.sourceToken);else if(!t.sep)Object.assign(t,{key:null,sep:[this.sourceToken]});else if(t.value||n)e.items.push({start:o,key:null,sep:[this.sourceToken]});else if(_s(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else t.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);if(n||t.value)e.items.push({start:o,key:i,sep:[]}),this.onKeyLine=!0;else if(t.sep)this.stack.push(i);else Object.assign(t,{key:i,sep:[]}),this.onKeyLine=!0;return}default:{let i=this.startBlockValue(e);if(i){if(i.type==="block-seq"){if(!t.explicitKey&&t.sep&&!_s(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(r)e.items.push({start:o});this.stack.push(i);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let r="end"in t.value?t.value.end:void 0;if((Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment")r?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){ix(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;if(t.value||_s(t.start,"seq-item-ind"))e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!t||t.sep)e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return;case"map-value-ind":if(!t||t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!t||t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);if(!t||t.value)e.items.push({start:[],key:n,sep:[]});else if(t.sep)this.stack.push(n);else Object.assign(t,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);if(r)this.stack.push(r);else yield*this.pop(),yield*this.step()}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let n=ox(r),o=ql(n);kU(e);let i=e.end.splice(1,e.end.length);i.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
202
+ `)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
203
+ `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=ox(e),r=ql(t);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=ox(e),r=ql(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return!1;if(this.indent<=t)return!1;return e.every((r)=>r.type==="newline"||r.type==="space")}*documentEnd(e){if(this.type!=="doc-mode"){if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}Ube.Parser=PU});var MU=_(function(Ybe){var _U=ES(),jbe=Gd(),Jd=Vd(),qbe=Pv(),zbe=xe(),Gbe=PS(),BU=_S();function NU(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Gbe.LineCounter||null,prettyErrors:t}}function Vbe(e,t={}){let{lineCounter:r,prettyErrors:n}=NU(t),o=new BU.Parser(r?.addNewLine),i=new _U.Composer(t),s=Array.from(i.compose(o.parse(e)));if(n&&r)for(let a of s)a.errors.forEach(Jd.prettifyError(e,r)),a.warnings.forEach(Jd.prettifyError(e,r));if(s.length>0)return s;return Object.assign([],{empty:!0},i.streamInfo())}function FU(e,t={}){let{lineCounter:r,prettyErrors:n}=NU(t),o=new BU.Parser(r?.addNewLine),i=new _U.Composer(t),s=null;for(let a of i.compose(o.parse(e),!0,e.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Jd.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(n&&r)s.errors.forEach(Jd.prettifyError(e,r)),s.warnings.forEach(Jd.prettifyError(e,r));return s}function Wbe(e,t,r){let n=void 0;if(typeof t==="function")n=t;else if(r===void 0&&t&&typeof t==="object")r=t;let o=FU(e,r);if(!o)return null;if(o.warnings.forEach((i)=>qbe.warn(o.options.logLevel,i)),o.errors.length>0)if(o.options.logLevel!=="silent")throw o.errors[0];else o.errors=[];return o.toJS(Object.assign({reviver:n},r))}function Kbe(e,t,r){let n=null;if(typeof t==="function"||Array.isArray(t))n=t;else if(r===void 0&&t)r=t;if(typeof r==="string")r=r.length;if(typeof r==="number"){let o=Math.round(r);r=o<1?void 0:o>8?{indent:8}:{indent:o}}if(e===void 0){let{keepUndefined:o}=r??t??{};if(!o)return}if(zbe.isDocument(e)&&!n)return e.toString(r);return new jbe.Document(e,n,r).toString(r)}Ybe.parse=Wbe;Ybe.parseAllDocuments=Vbe;Ybe.parseDocument=FU;Ybe.stringify=Kbe});var Rt=_(function(vwe){vwe.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]==="function")e.apply(this,t);else return new Promise((r,n)=>{t.push((o,i)=>o!=null?n(o):r(i)),e.apply(this,t)})},"name",{value:e.name})};vwe.fromPromise=function(e){return Object.defineProperty(function(...t){let r=t[t.length-1];if(typeof r!=="function")return e.apply(this,t);else t.pop(),e.apply(this,t).then((n)=>r(null,n),r)},"name",{value:e.name})}});var gH=_(function(sGt,yH){var Fs=pe("constants"),Cwe=process.cwd,yx=null,Dwe=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!yx)yx=Cwe.call(process);return yx};try{process.cwd()}catch(e){}if(typeof process.chdir==="function"){if(gx=process.chdir,process.chdir=function(e){yx=null,gx.call(process,e)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,gx)}var gx;yH.exports=Iwe;function Iwe(e){if(Fs.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))t(e);if(!e.lutimes)r(e);if(e.chown=i(e.chown),e.fchown=i(e.fchown),e.lchown=i(e.lchown),e.chmod=n(e.chmod),e.fchmod=n(e.fchmod),e.lchmod=n(e.lchmod),e.chownSync=s(e.chownSync),e.fchownSync=s(e.fchownSync),e.lchownSync=s(e.lchownSync),e.chmodSync=o(e.chmodSync),e.fchmodSync=o(e.fchmodSync),e.lchmodSync=o(e.lchmodSync),e.stat=a(e.stat),e.fstat=a(e.fstat),e.lstat=a(e.lstat),e.statSync=c(e.statSync),e.fstatSync=c(e.fstatSync),e.lstatSync=c(e.lstatSync),e.chmod&&!e.lchmod)e.lchmod=function(l,p,f){if(f)process.nextTick(f)},e.lchmodSync=function(){};if(e.chown&&!e.lchown)e.lchown=function(l,p,f,d){if(d)process.nextTick(d)},e.lchownSync=function(){};if(Dwe==="win32")e.rename=typeof e.rename!=="function"?e.rename:function(l){function p(f,d,h){var m=Date.now(),y=0;l(f,d,function g(x){if(x&&(x.code==="EACCES"||x.code==="EPERM"||x.code==="EBUSY")&&Date.now()-m<60000){if(setTimeout(function(){e.stat(d,function(b,w){if(b&&b.code==="ENOENT")l(f,d,g);else h(x)})},y),y<100)y+=10;return}if(h)h(x)})}if(Object.setPrototypeOf)Object.setPrototypeOf(p,l);return p}(e.rename);e.read=typeof e.read!=="function"?e.read:function(l){function p(f,d,h,m,y,g){var x;if(g&&typeof g==="function"){var b=0;x=function(w,v,D){if(w&&w.code==="EAGAIN"&&b<10)return b++,l.call(e,f,d,h,m,y,x);g.apply(this,arguments)}}return l.call(e,f,d,h,m,y,x)}if(Object.setPrototypeOf)Object.setPrototypeOf(p,l);return p}(e.read),e.readSync=typeof e.readSync!=="function"?e.readSync:function(l){return function(p,f,d,h,m){var y=0;while(!0)try{return l.call(e,p,f,d,h,m)}catch(g){if(g.code==="EAGAIN"&&y<10){y++;continue}throw g}}}(e.readSync);function t(l){l.lchmod=function(p,f,d){l.open(p,Fs.O_WRONLY|Fs.O_SYMLINK,f,function(h,m){if(h){if(d)d(h);return}l.fchmod(m,f,function(y){l.close(m,function(g){if(d)d(y||g)})})})},l.lchmodSync=function(p,f){var d=l.openSync(p,Fs.O_WRONLY|Fs.O_SYMLINK,f),h=!0,m;try{m=l.fchmodSync(d,f),h=!1}finally{if(h)try{l.closeSync(d)}catch(y){}else l.closeSync(d)}return m}}function r(l){if(Fs.hasOwnProperty("O_SYMLINK")&&l.futimes)l.lutimes=function(p,f,d,h){l.open(p,Fs.O_SYMLINK,function(m,y){if(m){if(h)h(m);return}l.futimes(y,f,d,function(g){l.close(y,function(x){if(h)h(g||x)})})})},l.lutimesSync=function(p,f,d){var h=l.openSync(p,Fs.O_SYMLINK),m,y=!0;try{m=l.futimesSync(h,f,d),y=!1}finally{if(y)try{l.closeSync(h)}catch(g){}else l.closeSync(h)}return m};else if(l.futimes)l.lutimes=function(p,f,d,h){if(h)process.nextTick(h)},l.lutimesSync=function(){}}function n(l){if(!l)return l;return function(p,f,d){return l.call(e,p,f,function(h){if(u(h))h=null;if(d)d.apply(this,arguments)})}}function o(l){if(!l)return l;return function(p,f){try{return l.call(e,p,f)}catch(d){if(!u(d))throw d}}}function i(l){if(!l)return l;return function(p,f,d,h){return l.call(e,p,f,d,function(m){if(u(m))m=null;if(h)h.apply(this,arguments)})}}function s(l){if(!l)return l;return function(p,f,d){try{return l.call(e,p,f,d)}catch(h){if(!u(h))throw h}}}function a(l){if(!l)return l;return function(p,f,d){if(typeof f==="function")d=f,f=null;function h(m,y){if(y){if(y.uid<0)y.uid+=4294967296;if(y.gid<0)y.gid+=4294967296}if(d)d.apply(this,arguments)}return f?l.call(e,p,f,h):l.call(e,p,h)}}function c(l){if(!l)return l;return function(p,f){var d=f?l.call(e,p,f):l.call(e,p);if(d){if(d.uid<0)d.uid+=4294967296;if(d.gid<0)d.gid+=4294967296}return d}}function u(l){if(!l)return!0;if(l.code==="ENOSYS")return!0;var p=!process.getuid||process.getuid()!==0;if(p){if(l.code==="EINVAL"||l.code==="EPERM")return!0}return!1}}});var wH=_(function(aGt,xH){var bH=pe("stream").Stream;xH.exports=Owe;function Owe(e){return{ReadStream:t,WriteStream:r};function t(n,o){if(!(this instanceof t))return new t(n,o);bH.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,o=o||{};var s=Object.keys(o);for(var a=0,c=s.length;a<c;a++){var u=s[a];this[u]=o[u]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){i._read()});return}e.open(this.path,this.flags,this.mode,function(l,p){if(l){i.emit("error",l),i.readable=!1;return}i.fd=p,i.emit("open",p),i._read()})}function r(n,o){if(!(this instanceof r))return new r(n,o);bH.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,o=o||{};var i=Object.keys(o);for(var s=0,a=i.length;s<a;s++){var c=i[s];this[c]=o[c]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var EH=_(function(cGt,TH){TH.exports=Rwe;var kwe=Object.getPrototypeOf||function(e){return e.__proto__};function Rwe(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var t={__proto__:kwe(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}});var Yl=_(function(uGt,VS){var Je=pe("fs"),Pwe=gH(),_we=wH(),Bwe=EH(),bx=pe("util"),Ht,wx;if(typeof Symbol==="function"&&typeof Symbol.for==="function")Ht=Symbol.for("graceful-fs.queue"),wx=Symbol.for("graceful-fs.previous");else Ht="___graceful-fs.queue",wx="___graceful-fs.previous";function Nwe(){}function SH(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}var Za=Nwe;if(bx.debuglog)Za=bx.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))Za=function(){var e=bx.format.apply(bx,arguments);e="GFS4: "+e.split(/\n/).join(`
204
+ GFS4: `),console.error(e)};if(!Je[Ht]){if(qS=global[Ht]||[],SH(Je,qS),Je.close=function(e){function t(r,n){return e.call(Je,r,function(o){if(!o)vH();if(typeof n==="function")n.apply(this,arguments)})}return Object.defineProperty(t,wx,{value:e}),t}(Je.close),Je.closeSync=function(e){function t(r){e.apply(Je,arguments),vH()}return Object.defineProperty(t,wx,{value:e}),t}(Je.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){Za(Je[Ht]),pe("assert").equal(Je[Ht].length,0)})}var qS;if(!global[Ht])SH(global,Je[Ht]);VS.exports=zS(Bwe(Je));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Je.__patched)VS.exports=zS(Je),Je.__patched=!0;function zS(e){Pwe(e),e.gracefulify=zS,e.createReadStream=v,e.createWriteStream=D;var t=e.readFile;e.readFile=r;function r(A,E,R){if(typeof E==="function")R=E,E=null;return S(A,E,R);function S(k,I,C,P){return t(k,I,function(N){if(N&&(N.code==="EMFILE"||N.code==="ENFILE"))Kl([S,[k,I,C],N,P||Date.now(),Date.now()]);else if(typeof C==="function")C.apply(this,arguments)})}}var n=e.writeFile;e.writeFile=o;function o(A,E,R,S){if(typeof R==="function")S=R,R=null;return k(A,E,R,S);function k(I,C,P,N,L){return n(I,C,P,function(F){if(F&&(F.code==="EMFILE"||F.code==="ENFILE"))Kl([k,[I,C,P,N],F,L||Date.now(),Date.now()]);else if(typeof N==="function")N.apply(this,arguments)})}}var i=e.appendFile;if(i)e.appendFile=s;function s(A,E,R,S){if(typeof R==="function")S=R,R=null;return k(A,E,R,S);function k(I,C,P,N,L){return i(I,C,P,function(F){if(F&&(F.code==="EMFILE"||F.code==="ENFILE"))Kl([k,[I,C,P,N],F,L||Date.now(),Date.now()]);else if(typeof N==="function")N.apply(this,arguments)})}}var a=e.copyFile;if(a)e.copyFile=c;function c(A,E,R,S){if(typeof R==="function")S=R,R=0;return k(A,E,R,S);function k(I,C,P,N,L){return a(I,C,P,function(F){if(F&&(F.code==="EMFILE"||F.code==="ENFILE"))Kl([k,[I,C,P,N],F,L||Date.now(),Date.now()]);else if(typeof N==="function")N.apply(this,arguments)})}}var u=e.readdir;e.readdir=p;var l=/^v[0-5]\./;function p(A,E,R){if(typeof E==="function")R=E,E=null;var S=l.test(process.version)?function(C,P,N,L){return u(C,k(C,P,N,L))}:function(C,P,N,L){return u(C,P,k(C,P,N,L))};return S(A,E,R);function k(I,C,P,N){return function(L,F){if(L&&(L.code==="EMFILE"||L.code==="ENFILE"))Kl([S,[I,C,P],L,N||Date.now(),Date.now()]);else{if(F&&F.sort)F.sort();if(typeof P==="function")P.call(this,L,F)}}}}if(process.version.substr(0,4)==="v0.8"){var f=_we(e);g=f.ReadStream,b=f.WriteStream}var d=e.ReadStream;if(d)g.prototype=Object.create(d.prototype),g.prototype.open=x;var h=e.WriteStream;if(h)b.prototype=Object.create(h.prototype),b.prototype.open=w;Object.defineProperty(e,"ReadStream",{get:function(){return g},set:function(A){g=A},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return b},set:function(A){b=A},enumerable:!0,configurable:!0});var m=g;Object.defineProperty(e,"FileReadStream",{get:function(){return m},set:function(A){m=A},enumerable:!0,configurable:!0});var y=b;Object.defineProperty(e,"FileWriteStream",{get:function(){return y},set:function(A){y=A},enumerable:!0,configurable:!0});function g(A,E){if(this instanceof g)return d.apply(this,arguments),this;else return g.apply(Object.create(g.prototype),arguments)}function x(){var A=this;T(A.path,A.flags,A.mode,function(E,R){if(E){if(A.autoClose)A.destroy();A.emit("error",E)}else A.fd=R,A.emit("open",R),A.read()})}function b(A,E){if(this instanceof b)return h.apply(this,arguments),this;else return b.apply(Object.create(b.prototype),arguments)}function w(){var A=this;T(A.path,A.flags,A.mode,function(E,R){if(E)A.destroy(),A.emit("error",E);else A.fd=R,A.emit("open",R)})}function v(A,E){return new e.ReadStream(A,E)}function D(A,E){return new e.WriteStream(A,E)}var O=e.open;e.open=T;function T(A,E,R,S){if(typeof R==="function")S=R,R=null;return k(A,E,R,S);function k(I,C,P,N,L){return O(I,C,P,function(F,j){if(F&&(F.code==="EMFILE"||F.code==="ENFILE"))Kl([k,[I,C,P,N],F,L||Date.now(),Date.now()]);else if(typeof N==="function")N.apply(this,arguments)})}}return e}function Kl(e){Za("ENQUEUE",e[0].name,e[1]),Je[Ht].push(e),GS()}var xx;function vH(){var e=Date.now();for(var t=0;t<Je[Ht].length;++t)if(Je[Ht][t].length>2)Je[Ht][t][3]=e,Je[Ht][t][4]=e;GS()}function GS(){if(clearTimeout(xx),xx=void 0,Je[Ht].length===0)return;var e=Je[Ht].shift(),t=e[0],r=e[1],n=e[2],o=e[3],i=e[4];if(o===void 0)Za("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-o>=60000){Za("TIMEOUT",t.name,r);var s=r.pop();if(typeof s==="function")s.call(null,n)}else{var a=Date.now()-i,c=Math.max(i-o,1),u=Math.min(c*1.2,100);if(a>=u)Za("RETRY",t.name,r),t.apply(null,r.concat([o]));else Je[Ht].push(e)}if(xx===void 0)xx=setTimeout(GS,0)}});var dr=_(function(WS){var AH=Rt().fromCallback,Le=Yl(),Fwe=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter((e)=>typeof Le[e]==="function");Object.assign(WS,Le);Fwe.forEach((e)=>{WS[e]=AH(Le[e])});WS.exists=function(e,t){if(typeof t==="function")return Le.exists(e,t);return new Promise((r)=>Le.exists(e,r))};WS.read=function(e,t,r,n,o,i){if(typeof i==="function")return Le.read(e,t,r,n,o,i);return new Promise((s,a)=>{Le.read(e,t,r,n,o,(c,u,l)=>{if(c)return a(c);s({bytesRead:u,buffer:l})})})};WS.write=function(e,t,...r){if(typeof r[r.length-1]==="function")return Le.write(e,t,...r);return new Promise((n,o)=>{Le.write(e,t,...r,(i,s,a)=>{if(i)return o(i);n({bytesWritten:s,buffer:a})})})};WS.readv=function(e,t,...r){if(typeof r[r.length-1]==="function")return Le.readv(e,t,...r);return new Promise((n,o)=>{Le.readv(e,t,...r,(i,s,a)=>{if(i)return o(i);n({bytesRead:s,buffers:a})})})};WS.writev=function(e,t,...r){if(typeof r[r.length-1]==="function")return Le.writev(e,t,...r);return new Promise((n,o)=>{Le.writev(e,t,...r,(i,s,a)=>{if(i)return o(i);n({bytesWritten:s,buffers:a})})})};if(typeof Le.realpath.native==="function")WS.realpath.native=AH(Le.realpath.native);else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var IH=_(function(jwe,DH){var CH=pe("path");jwe.checkPath=function(t){if(process.platform==="win32"){if(/[<>:"|?*]/.test(t.replace(CH.parse(t).root,""))){let n=Error(`Path contains invalid characters: ${t}`);throw n.code="EINVAL",n}}}});var RH=_(function(zwe,KS){var Tx=dr(),{checkPath:OH}=IH(),kH=(e)=>{let t={mode:511};if(typeof e==="number")return e;return{...t,...e}.mode};zwe.makeDir=async(e,t)=>(OH(e),Tx.mkdir(e,{mode:kH(t),recursive:!0}));zwe.makeDirSync=(e,t)=>(OH(e),Tx.mkdirSync(e,{mode:kH(t),recursive:!0}))});var Wn=_(function(fGt,PH){var Wwe=Rt().fromPromise,{makeDir:Kwe,makeDirSync:YS}=RH(),ZS=Wwe(Kwe);PH.exports={mkdirs:ZS,mkdirsSync:YS,mkdirp:ZS,mkdirpSync:YS,ensureDir:ZS,ensureDirSync:YS}});var Ms=_(function(dGt,_H){var Ywe=Rt().fromPromise,Ex=dr();function Zwe(e){return Ex.access(e).then(()=>!0).catch(()=>!1)}_H.exports={pathExists:Ywe(Zwe),pathExistsSync:Ex.existsSync}});var JS=_(function(mGt,BH){var xn=dr(),Jwe=Rt().fromPromise;async function Xwe(e,t,r){let n=await xn.open(e,"r+"),o=null;try{await xn.futimes(n,t,r)}catch(i){o=i}finally{try{await xn.close(n)}catch(i){if(!o)o=i}}if(o)throw o}function Qwe(e,t,r){let n=xn.openSync(e,"r+"),o=null;try{xn.futimesSync(n,t,r)}catch(i){o=i}finally{try{xn.closeSync(n)}catch(i){if(!o)o=i}}if(o)throw o}BH.exports={utimesMillis:Jwe(Xwe),utimesMillisSync:Qwe}});var Ja=_(function(hGt,MH){var wn=dr(),ge=pe("path"),NH=Rt().fromPromise;function e1e(e,t,r){let n=r.dereference?(o)=>wn.stat(o,{bigint:!0}):(o)=>wn.lstat(o,{bigint:!0});return Promise.all([n(e),n(t).catch((o)=>{if(o.code==="ENOENT")return null;throw o})]).then(([o,i])=>({srcStat:o,destStat:i}))}function t1e(e,t,r){let n,o=r.dereference?(s)=>wn.statSync(s,{bigint:!0}):(s)=>wn.lstatSync(s,{bigint:!0}),i=o(e);try{n=o(t)}catch(s){if(s.code==="ENOENT")return{srcStat:i,destStat:null};throw s}return{srcStat:i,destStat:n}}async function r1e(e,t,r,n){let{srcStat:o,destStat:i}=await e1e(e,t,n);if(i){if(tm(o,i)){let s=ge.basename(e),a=ge.basename(t);if(r==="move"&&s!==a&&FH(s,a))return{srcStat:o,destStat:i,isChangingCase:!0};throw Error("Source and destination must not be the same.")}if(o.isDirectory()&&!i.isDirectory())throw Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!o.isDirectory()&&i.isDirectory())throw Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(o.isDirectory()&&eA(e,t))throw Error(vx(e,t,r));return{srcStat:o,destStat:i}}function n1e(e,t,r,n){let{srcStat:o,destStat:i}=t1e(e,t,n);if(i){if(tm(o,i)){let s=ge.basename(e),a=ge.basename(t);if(r==="move"&&s!==a&&FH(s,a))return{srcStat:o,destStat:i,isChangingCase:!0};throw Error("Source and destination must not be the same.")}if(o.isDirectory()&&!i.isDirectory())throw Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!o.isDirectory()&&i.isDirectory())throw Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(o.isDirectory()&&eA(e,t))throw Error(vx(e,t,r));return{srcStat:o,destStat:i}}function FH(e,t){return e.toLowerCase().normalize("NFC")===t.toLowerCase().normalize("NFC")}async function XS(e,t,r,n){let o=ge.resolve(ge.dirname(e)),i=ge.resolve(ge.dirname(r));if(i===o||i===ge.parse(i).root)return;let s;try{s=await wn.stat(i,{bigint:!0})}catch(a){if(a.code==="ENOENT")return XS(e,t,i,n);throw a}if(tm(t,s))throw Error(vx(e,r,n));return XS(e,t,i,n)}function QS(e,t,r,n){let o=ge.resolve(ge.dirname(e)),i=ge.resolve(ge.dirname(r));if(i===o||i===ge.parse(i).root)return;let s;try{s=wn.statSync(i,{bigint:!0})}catch(a){if(a.code==="ENOENT")return QS(e,t,i,n);throw a}if(tm(t,s))throw Error(vx(e,r,n));return QS(e,t,i,n)}function tm(e,t){return t.ino!==void 0&&t.dev!==void 0&&t.ino===e.ino&&t.dev===e.dev}function eA(e,t){let r=ge.resolve(e).split(ge.sep).filter((o)=>o),n=ge.resolve(t).split(ge.sep).filter((o)=>o);return r.every((o,i)=>n[i]===o)}function vx(e,t,r){return`Cannot ${r} '${e}' to a subdirectory of itself, '${t}'.`}MH.exports={checkPaths:NH(r1e),checkPathsSync:n1e,checkParentPaths:NH(XS),checkParentPathsSync:QS,isSrcSubdir:eA,areIdentical:tm}});var $H=_(function(yGt,LH){async function o1e(e,t){let r=[];for await(let n of e)r.push(t(n).then(()=>null,(o)=>o??Error("unknown error")));await Promise.all(r.map((n)=>n.then((o)=>{if(o!==null)throw o})))}LH.exports={asyncIteratorConcurrentProcess:o1e}});var zH=_(function(gGt,qH){var ve=dr(),Lo=pe("path"),{mkdirs:i1e}=Wn(),{pathExists:s1e}=Ms(),{utimesMillis:a1e}=JS(),$o=Ja(),{asyncIteratorConcurrentProcess:c1e}=$H();async function u1e(e,t,r={}){if(typeof r==="function")r={filter:r};if(r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
205
+
206
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:o}=await $o.checkPaths(e,t,"copy",r);if(await $o.checkParentPaths(e,n,t,"copy"),!await HH(e,t,r))return;let s=Lo.dirname(t);if(!await s1e(s))await i1e(s);await jH(o,e,t,r)}async function HH(e,t,r){if(!r.filter)return!0;return r.filter(e,t)}async function jH(e,t,r,n){let i=await(n.dereference?ve.stat:ve.lstat)(t);if(i.isDirectory())return d1e(i,e,t,r,n);if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return l1e(i,e,t,r,n);if(i.isSymbolicLink())return m1e(e,t,r,n);if(i.isSocket())throw Error(`Cannot copy a socket file: ${t}`);if(i.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${t}`);throw Error(`Unknown file: ${t}`)}async function l1e(e,t,r,n,o){if(!t)return UH(e,r,n,o);if(o.overwrite)return await ve.unlink(n),UH(e,r,n,o);if(o.errorOnExist)throw Error(`'${n}' already exists`)}async function UH(e,t,r,n){if(await ve.copyFile(t,r),n.preserveTimestamps){if(p1e(e.mode))await f1e(r,e.mode);let o=await ve.stat(t);await a1e(r,o.atime,o.mtime)}return ve.chmod(r,e.mode)}function p1e(e){return(e&128)===0}function f1e(e,t){return ve.chmod(e,t|128)}async function d1e(e,t,r,n,o){if(!t)await ve.mkdir(n);if(await c1e(await ve.opendir(r),async(i)=>{let s=Lo.join(r,i.name),a=Lo.join(n,i.name);if(await HH(s,a,o)){let{destStat:u}=await $o.checkPaths(s,a,"copy",o);await jH(u,s,a,o)}}),!t)await ve.chmod(n,e.mode)}async function m1e(e,t,r,n){let o=await ve.readlink(t);if(n.dereference)o=Lo.resolve(process.cwd(),o);if(!e)return ve.symlink(o,r);let i=null;try{i=await ve.readlink(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return ve.symlink(o,r);throw s}if(n.dereference)i=Lo.resolve(process.cwd(),i);if(o!==i){if($o.isSrcSubdir(o,i))throw Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`);if($o.isSrcSubdir(i,o))throw Error(`Cannot overwrite '${i}' with '${o}'.`)}return await ve.unlink(r),ve.symlink(o,r)}qH.exports=u1e});var YH=_(function(bGt,KH){var Ie=Yl(),Uo=pe("path"),h1e=Wn().mkdirsSync,y1e=JS().utimesMillisSync,Ho=Ja();function g1e(e,t,r){if(typeof r==="function")r={filter:r};if(r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
207
+
208
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:o}=Ho.checkPathsSync(e,t,"copy",r);if(Ho.checkParentPathsSync(e,n,t,"copy"),r.filter&&!r.filter(e,t))return;let i=Uo.dirname(t);if(!Ie.existsSync(i))h1e(i);return GH(o,e,t,r)}function GH(e,t,r,n){let i=(n.dereference?Ie.statSync:Ie.lstatSync)(t);if(i.isDirectory())return S1e(i,e,t,r,n);else if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return b1e(i,e,t,r,n);else if(i.isSymbolicLink())return D1e(e,t,r,n);else if(i.isSocket())throw Error(`Cannot copy a socket file: ${t}`);else if(i.isFIFO())throw Error(`Cannot copy a FIFO pipe: ${t}`);throw Error(`Unknown file: ${t}`)}function b1e(e,t,r,n,o){if(!t)return VH(e,r,n,o);return x1e(e,r,n,o)}function x1e(e,t,r,n){if(n.overwrite)return Ie.unlinkSync(r),VH(e,t,r,n);else if(n.errorOnExist)throw Error(`'${r}' already exists`)}function VH(e,t,r,n){if(Ie.copyFileSync(t,r),n.preserveTimestamps)w1e(e.mode,t,r);return tA(r,e.mode)}function w1e(e,t,r){if(T1e(e))E1e(r,e);return v1e(t,r)}function T1e(e){return(e&128)===0}function E1e(e,t){return tA(e,t|128)}function tA(e,t){return Ie.chmodSync(e,t)}function v1e(e,t){let r=Ie.statSync(e);return y1e(t,r.atime,r.mtime)}function S1e(e,t,r,n,o){if(!t)return A1e(e.mode,r,n,o);return WH(r,n,o)}function A1e(e,t,r,n){return Ie.mkdirSync(r),WH(t,r,n),tA(r,e)}function WH(e,t,r){let n=Ie.opendirSync(e);try{let o;while((o=n.readSync())!==null)C1e(o.name,e,t,r)}finally{n.closeSync()}}function C1e(e,t,r,n){let o=Uo.join(t,e),i=Uo.join(r,e);if(n.filter&&!n.filter(o,i))return;let{destStat:s}=Ho.checkPathsSync(o,i,"copy",n);return GH(s,o,i,n)}function D1e(e,t,r,n){let o=Ie.readlinkSync(t);if(n.dereference)o=Uo.resolve(process.cwd(),o);if(!e)return Ie.symlinkSync(o,r);else{let i;try{i=Ie.readlinkSync(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return Ie.symlinkSync(o,r);throw s}if(n.dereference)i=Uo.resolve(process.cwd(),i);if(o!==i){if(Ho.isSrcSubdir(o,i))throw Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`);if(Ho.isSrcSubdir(i,o))throw Error(`Cannot overwrite '${i}' with '${o}'.`)}return I1e(o,r)}}function I1e(e,t){return Ie.unlinkSync(t),Ie.symlinkSync(e,t)}KH.exports=g1e});var Sx=_(function(xGt,ZH){var O1e=Rt().fromPromise;ZH.exports={copy:O1e(zH()),copySync:YH()}});var rm=_(function(wGt,JH){var Ax=Yl(),k1e=Rt().fromCallback;function R1e(e,t){Ax.rm(e,{recursive:!0,force:!0},t)}function P1e(e){Ax.rmSync(e,{recursive:!0,force:!0})}JH.exports={remove:k1e(R1e),removeSync:P1e}});var tj=_(function(TGt,ej){var _1e=Rt().fromPromise,Cx=dr(),Dx=pe("path"),Ix=Wn(),Ox=rm(),XH=_1e(async function(t){let r;try{r=await Cx.readdir(t)}catch(n){if(n.code!=="ENOENT")throw n;return Ix.mkdirs(t)}return Promise.all(r.map((n)=>Ox.remove(Dx.join(t,n))))});function QH(e){let t;try{t=Cx.readdirSync(e)}catch(r){if(r.code!=="ENOENT")throw r;return Ix.mkdirsSync(e)}t.forEach((r)=>{r=Dx.join(e,r),Ox.removeSync(r)})}ej.exports={emptyDirSync:QH,emptydirSync:QH,emptyDir:XH,emptydir:XH}});var nj=_(function(EGt,rj){var B1e=Rt().fromPromise,kx=pe("path"),Pt=dr(),Rx=Wn();async function N1e(e){let t;try{t=await Pt.stat(e)}catch{}if(t&&t.isFile())return;let r=kx.dirname(e),n=null;try{n=await Pt.stat(r)}catch(o){if(o.code==="ENOENT"){await Rx.mkdirs(r),await Pt.writeFile(e,"");return}else throw o}if(n.isDirectory())await Pt.writeFile(e,"");else await Pt.readdir(r)}function F1e(e){let t;try{t=Pt.statSync(e)}catch{}if(t&&t.isFile())return;let r=kx.dirname(e);try{if(!Pt.statSync(r).isDirectory())Pt.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")Rx.mkdirsSync(r);else throw n}Pt.writeFileSync(e,"")}rj.exports={createFile:B1e(N1e),createFileSync:F1e}});var sj=_(function(vGt,ij){var M1e=Rt().fromPromise,Px=pe("path"),er=dr(),_x=Wn(),{pathExists:L1e}=Ms(),{areIdentical:oj}=Ja();async function $1e(e,t){let r;try{r=await er.lstat(t,{bigint:!0})}catch{}let n;try{n=await er.lstat(e,{bigint:!0})}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}if(r&&oj(n,r))return;let o=Px.dirname(t);if(!await L1e(o))await _x.mkdirs(o);await er.link(e,t)}function U1e(e,t){let r;try{r=er.lstatSync(t,{bigint:!0})}catch{}try{let i=er.lstatSync(e,{bigint:!0});if(r&&oj(i,r))return}catch(i){throw i.message=i.message.replace("lstat","ensureLink"),i}let n=Px.dirname(t);if(er.existsSync(n))return er.linkSync(e,t);return _x.mkdirsSync(n),er.linkSync(e,t)}ij.exports={createLink:M1e($1e),createLinkSync:U1e}});var cj=_(function(SGt,aj){var tr=pe("path"),jo=dr(),{pathExists:H1e}=Ms(),j1e=Rt().fromPromise;async function q1e(e,t){if(tr.isAbsolute(e)){try{await jo.lstat(e)}catch(i){throw i.message=i.message.replace("lstat","ensureSymlink"),i}return{toCwd:e,toDst:e}}let r=tr.dirname(t),n=tr.join(r,e);if(await H1e(n))return{toCwd:n,toDst:e};try{await jo.lstat(e)}catch(i){throw i.message=i.message.replace("lstat","ensureSymlink"),i}return{toCwd:e,toDst:tr.relative(r,e)}}function z1e(e,t){if(tr.isAbsolute(e)){if(!jo.existsSync(e))throw Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}let r=tr.dirname(t),n=tr.join(r,e);if(jo.existsSync(n))return{toCwd:n,toDst:e};if(!jo.existsSync(e))throw Error("relative srcpath does not exist");return{toCwd:e,toDst:tr.relative(r,e)}}aj.exports={symlinkPaths:j1e(q1e),symlinkPathsSync:z1e}});var lj=_(function(AGt,uj){var Bx=dr(),G1e=Rt().fromPromise;async function V1e(e,t){if(t)return t;let r;try{r=await Bx.lstat(e)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}function W1e(e,t){if(t)return t;let r;try{r=Bx.lstatSync(e)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}uj.exports={symlinkType:G1e(V1e),symlinkTypeSync:W1e}});var dj=_(function(CGt,fj){var K1e=Rt().fromPromise,rr=pe("path"),Fe=dr(),{mkdirs:Y1e,mkdirsSync:Z1e}=Wn(),{symlinkPaths:J1e,symlinkPathsSync:X1e}=cj(),{symlinkType:Q1e,symlinkTypeSync:e2e}=lj(),{pathExists:t2e}=Ms(),{areIdentical:pj}=Ja();async function r2e(e,t,r){let n;try{n=await Fe.lstat(t)}catch{}if(n&&n.isSymbolicLink()){let a;if(rr.isAbsolute(e))a=await Fe.stat(e,{bigint:!0});else{let u=rr.dirname(t),l=rr.join(u,e);try{a=await Fe.stat(l,{bigint:!0})}catch{a=await Fe.stat(e,{bigint:!0})}}let c;try{c=await Fe.stat(t,{bigint:!0})}catch(u){if(u.code!=="ENOENT")throw u}if(c&&pj(a,c))return}let o=await J1e(e,t);e=o.toDst;let i=await Q1e(o.toCwd,r),s=rr.dirname(t);if(!await t2e(s))await Y1e(s);return Fe.symlink(e,t,i)}function n2e(e,t,r){let n;try{n=Fe.lstatSync(t)}catch{}if(n&&n.isSymbolicLink()){let a;if(rr.isAbsolute(e))a=Fe.statSync(e,{bigint:!0});else{let u=rr.dirname(t),l=rr.join(u,e);try{a=Fe.statSync(l,{bigint:!0})}catch{a=Fe.statSync(e,{bigint:!0})}}let c;try{c=Fe.statSync(t,{bigint:!0})}catch(u){if(u.code!=="ENOENT")throw u}if(c&&pj(a,c))return}let o=X1e(e,t);e=o.toDst,r=e2e(o.toCwd,r);let i=rr.dirname(t);if(Fe.existsSync(i))return Fe.symlinkSync(e,t,r);return Z1e(i),Fe.symlinkSync(e,t,r)}fj.exports={createSymlink:K1e(r2e),createSymlinkSync:n2e}});var Tj=_(function(DGt,wj){var{createFile:mj,createFileSync:hj}=nj(),{createLink:yj,createLinkSync:gj}=sj(),{createSymlink:bj,createSymlinkSync:xj}=dj();wj.exports={createFile:mj,createFileSync:hj,ensureFile:mj,ensureFileSync:hj,createLink:yj,createLinkSync:gj,ensureLink:yj,ensureLinkSync:gj,createSymlink:bj,createSymlinkSync:xj,ensureSymlink:bj,ensureSymlinkSync:xj}});var Nx=_(function(IGt,Ej){function o2e(e,{EOL:t=`
209
+ `,finalEOL:r=!0,replacer:n=null,spaces:o}={}){let i=r?t:"",s=JSON.stringify(e,n,o);if(s===void 0)throw TypeError(`Converting ${typeof e} value to JSON is not supported`);return s.replace(/\n/g,t)+i}function i2e(e){if(Buffer.isBuffer(e))e=e.toString("utf8");return e.replace(/^\uFEFF/,"")}Ej.exports={stringify:o2e,stripBom:i2e}});var Cj=_(function(OGt,Aj){var Zl;try{Zl=Yl()}catch(e){Zl=pe("fs")}var Ls=Rt(),{stringify:vj,stripBom:Sj}=Nx();async function s2e(e,t={}){if(typeof t==="string")t={encoding:t};let r=t.fs||Zl,n="throws"in t?t.throws:!0,o=await Ls.fromCallback(r.readFile)(e,t);o=Sj(o);let i;try{i=JSON.parse(o,t?t.reviver:null)}catch(s){if(n)throw s.message=`${e}: ${s.message}`,s;else return null}return i}var a2e=Ls.fromPromise(s2e);function c2e(e,t={}){if(typeof t==="string")t={encoding:t};let r=t.fs||Zl,n="throws"in t?t.throws:!0;try{let o=r.readFileSync(e,t);return o=Sj(o),JSON.parse(o,t.reviver)}catch(o){if(n)throw o.message=`${e}: ${o.message}`,o;else return null}}async function u2e(e,t,r={}){let n=r.fs||Zl,o=vj(t,r);await Ls.fromCallback(n.writeFile)(e,o,r)}var l2e=Ls.fromPromise(u2e);function p2e(e,t,r={}){let n=r.fs||Zl,o=vj(t,r);return n.writeFileSync(e,o,r)}Aj.exports={readFile:a2e,readFileSync:c2e,writeFile:l2e,writeFileSync:p2e}});var Ij=_(function(kGt,Dj){var $s=Cj();Dj.exports={readJson:$s.readFile,readJsonSync:$s.readFileSync,writeJson:$s.writeFile,writeJsonSync:$s.writeFileSync}});var Lx=_(function(RGt,Oj){var f2e=Rt().fromPromise,Jl=dr(),Fx=pe("path"),Mx=Wn(),d2e=Ms().pathExists;async function m2e(e,t,r="utf-8"){let n=Fx.dirname(e);if(!await d2e(n))await Mx.mkdirs(n);return Jl.writeFile(e,t,r)}function h2e(e,...t){let r=Fx.dirname(e);if(!Jl.existsSync(r))Mx.mkdirsSync(r);Jl.writeFileSync(e,...t)}Oj.exports={outputFile:f2e(m2e),outputFileSync:h2e}});var Rj=_(function(PGt,kj){var{stringify:y2e}=Nx(),{outputFile:g2e}=Lx();async function b2e(e,t,r={}){let n=y2e(t,r);await g2e(e,n,r)}kj.exports=b2e});var _j=_(function(_Gt,Pj){var{stringify:x2e}=Nx(),{outputFileSync:w2e}=Lx();function T2e(e,t,r){let n=x2e(t,r);w2e(e,n,r)}Pj.exports=T2e});var Nj=_(function(BGt,Bj){var E2e=Rt().fromPromise,at=Ij();at.outputJson=E2e(Rj());at.outputJsonSync=_j();at.outputJSON=at.outputJson;at.outputJSONSync=at.outputJsonSync;at.writeJSON=at.writeJson;at.writeJSONSync=at.writeJsonSync;at.readJSON=at.readJson;at.readJSONSync=at.readJsonSync;Bj.exports=at});var $j=_(function(NGt,Lj){var Fj=dr(),$x=pe("path"),{copy:v2e}=Sx(),{remove:Mj}=rm(),{mkdirp:S2e}=Wn(),{pathExists:A2e}=Ms(),Ux=Ja();async function C2e(e,t,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:i=!1}=await Ux.checkPaths(e,t,"move",r);await Ux.checkParentPaths(e,o,t,"move");let s=$x.dirname(t);if($x.parse(s).root!==s)await S2e(s);return D2e(e,t,n,i)}async function D2e(e,t,r,n){if(!n){if(r)await Mj(t);else if(await A2e(t))throw Error("dest already exists.")}try{await Fj.rename(e,t)}catch(o){if(o.code!=="EXDEV")throw o;await I2e(e,t,r)}}async function I2e(e,t,r){return await v2e(e,t,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Mj(e)}Lj.exports=C2e});var jj=_(function(FGt,Hj){var jx=Yl(),Xl=pe("path"),O2e=Sx().copySync,Uj=rm().removeSync,k2e=Wn().mkdirpSync,Hx=Ja();function R2e(e,t,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:i=!1}=Hx.checkPathsSync(e,t,"move",r);if(Hx.checkParentPathsSync(e,o,t,"move"),!P2e(t))k2e(Xl.dirname(t));return _2e(e,t,n,i)}function P2e(e){let t=Xl.dirname(e);return Xl.parse(t).root===t}function _2e(e,t,r,n){if(n)return rA(e,t,r);if(r)return Uj(t),rA(e,t,r);if(jx.existsSync(t))throw Error("dest already exists.");return rA(e,t,r)}function rA(e,t,r){try{jx.renameSync(e,t)}catch(n){if(n.code!=="EXDEV")throw n;return B2e(e,t,r)}}function B2e(e,t,r){return O2e(e,t,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Uj(e)}Hj.exports=R2e});var zj=_(function(MGt,qj){var N2e=Rt().fromPromise;qj.exports={move:N2e($j()),moveSync:jj()}});var Kr=_(function(LGt,Gj){Gj.exports={...dr(),...Sx(),...tj(),...Tj(),...Nj(),...Wn(),...zj(),...Lx(),...Ms(),...rm()}});var Qj=_(function(dVt,ep){var Gx=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Jj=Gx((e,t)=>{function r(o){return typeof o=="string"?!["false","0","no","off",""].includes(o.toLowerCase()):!!o}function n(o=process.env){let i={};for(let s of["ENCODING","PATH","QUIET","DEBUG","OVERRIDE","FAST"]){let a=o[`DOTENV_${s}`]!=null?o[`DOTENV_${s}`]:o[`DOTENV_CONFIG_${s}`];a!=null&&(i[s.toLowerCase()]=s==="ENCODING"||s==="PATH"?a:r(a))}return i}t.exports={parseBoolean:r,optionsFromEnv:n}}),Xj=Gx((e,t)=>{var r=pe("fs"),n=pe("path"),o=pe("os"),{URL:i,fileURLToPath:s}=pe("url"),{parseBoolean:a,optionsFromEnv:c}=Jj(),u=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg,l=new Uint8Array(256);for(let T=48;T<=57;T++)l[T]=1;for(let T=65;T<=90;T++)l[T]=1;for(let T=97;T<=122;T++)l[T]=1;l[45]=1,l[46]=1,l[95]=1;function p(T){let A={},E=T.toString();E=E.replace(/\r\n?/mg,`
210
+ `);let R;for(;(R=u.exec(E))!=null;){let S=R[1],k=R[2]||"";k=k.trim();let I=k[0];k=k.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),I==='"'&&(k=k.replace(/\\n/g,`
211
+ `),k=k.replace(/\\r/g,"\r")),A[S]=k}return A}function f(T){return T<=32?T===32||T>=9&&T<=13:T>=160&&(T===160||T===5760||T>=8192&&T<=8202||T===8232||T===8233||T===8239||T===8287||T===12288||T===65279)}function d(T){return T===10||T===8232||T===8233}function h(T){let A={},E=typeof T=="string"?T:T.toString();E.indexOf("\r")!==-1&&(E=E.replace(/\r\n?/g,`
212
+ `));let R=E.length,S=0;for(;S<R;){let k=E.charCodeAt(S);for(;S<R&&f(k);)S++,k=E.charCodeAt(S);if(S>=R)break;if(k===35){for(;S<R&&!d(E.charCodeAt(S));)S++;continue}let I=-1;if(k===101&&S+6<R&&E.charCodeAt(S+1)===120&&E.charCodeAt(S+2)===112&&E.charCodeAt(S+3)===111&&E.charCodeAt(S+4)===114&&E.charCodeAt(S+5)===116){let G=E.charCodeAt(S+6);if(f(G)){let Y=S+7;for(;Y<R&&f(E.charCodeAt(Y));)Y++;l[E.charCodeAt(Y)]&&(I=S+6,S=Y)}else k=E.charCodeAt(S)}let C=S,P=0;for(;S<R&&(P=E.charCodeAt(S),l[P]);)S++;if(S===C){for(;S<R&&!d(E.charCodeAt(S));)S++;continue}let N=E.slice(C,S),L=S;if(S>=R&&(P=0),f(P))do S++,P=S<R?E.charCodeAt(S):0;while(f(P));if(P===61)S++;else if(P===58&&S===L&&S+1<R&&f(E.charCodeAt(S+1)))S+=2;else{for(S=I===-1?L:I;S<R&&!d(E.charCodeAt(S));)S++;continue}let F=S,j=S;for(;j<R&&f(E.charCodeAt(j));)j++;let V=E.charCodeAt(j),z,te=!1;if(V===39||V===34||V===96){let G=E[j],Y=E.indexOf(G,j+1),ne=-1,he=-1;for(;Y!==-1;){let Te=E.charCodeAt(Y-1)===92,ye=Y+1;for(;ye<R&&!d(E.charCodeAt(ye))&&f(E.charCodeAt(ye));)ye++;if((ye===R||d(E.charCodeAt(ye))||E.charCodeAt(ye)===35)&&(ne=Y,he=ye),!Te)break;Y=E.indexOf(G,Y+1)}if(ne!==-1){if(z=E.slice(j+1,ne),S=he,E.charCodeAt(S)===35)for(;S<R&&!d(E.charCodeAt(S));)S++;te=!0}}if(!te){let G=E.indexOf(`
213
+ `,F);G===-1&&(G=R);let Y;if(R<4096)Y=E.indexOf("#",F),(Y===-1||Y>G)&&(Y=G);else for(Y=F;Y<G&&E.charCodeAt(Y)!==35;)Y++;let ne=F,he=Y;for(;ne<he&&f(E.charCodeAt(ne));)ne++;for(;he>ne&&f(E.charCodeAt(he-1));)he--;let Te=E.charCodeAt(ne);if(he-ne>=2&&(Te===39||Te===34||Te===96)&&E.charCodeAt(he-1)===Te?z=E.slice(ne+1,he-1):z=E.slice(ne,he),S=Y,Y<G)for(;S<R&&!d(E.charCodeAt(S));)S++}V===34&&(te||j<S)&&z.indexOf("\\")!==-1&&(z=z.replace(/\\n/g,`
214
+ `).replace(/\\r/g,"\r")),A[N]=z}return A}function m(T,A){return A&&a(A.fast)?h(T):p(T)}function y(T){console.log(`┆ ${T}`)}function g(T){console.error(`◇ ${T}`)}function x(T){return T[0]==="~"?n.join(o.homedir(),T.slice(1)):T}function b(T={}){return{...c(),...T}}function w(T){T=b(T);let A=n.resolve(process.cwd(),".env"),E="utf8",R=process.env;T&&T.processEnv!=null&&(R=T.processEnv);let S=a(T&&T.debug);T&&T.encoding?E=T.encoding:S&&y("no encoding is specified (UTF-8 is used by default)");let k=[A];if(T&&T.path)if(!Array.isArray(T.path))k=[x(T.path)];else{k=[];for(let F of T.path)k.push(x(F))}let I,C={},P={fast:T.fast};for(let F of k)try{let j=O.parse(r.readFileSync(F,{encoding:E}),P);O.populate(C,j,T)}catch(j){S&&y(`failed to load ${F} ${j.message}`),I=j}let N=O.populate(R,C,T),L=a(Object.prototype.hasOwnProperty.call(T,"quiet")?T.quiet:c(R).quiet);if(S||!L){let F=Object.keys(N).length,j=[];for(let V of k)try{let z=n.relative(process.cwd(),V instanceof i?s(V):V);j.push(z)}catch(z){S&&y(`failed to load ${V} ${z.message}`),I=z}g(`injected env (${F}) from ${j.join(",")}`)}return I?{parsed:C,error:I}:{parsed:C}}function v(T){return O.configDotenv(T)}function D(T,A,E={}){let R=!!(E&&E.debug),S=!!(E&&E.override),k={};if(T===null||typeof T!="object"||A===null||typeof A!="object"){let I=Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw I.code="OBJECT_REQUIRED",I}for(let I of Object.keys(A))Object.prototype.hasOwnProperty.call(T,I)?(S===!0&&(T[I]=A[I],k[I]=A[I]),R&&y(S===!0?`"${I}" is already defined and WAS overwritten`:`"${I}" is already defined and was NOT overwritten`)):(T[I]=A[I],k[I]=A[I]);return k}var O={configDotenv:w,config:v,parse:m,populate:D};t.exports.configDotenv=O.configDotenv,t.exports.config=O.config,t.exports.parse=O.parse,t.exports.populate=O.populate,t.exports=O}),j2e=Gx((e,t)=>{var r=pe("child_process"),n=pe("fs"),o=pe("path");function i(l){let p=['"'],f=0;for(let d of l){if(d==="\\"){f++;continue}d==='"'?p.push("\\".repeat(f*2+1),'"'):p.push("\\".repeat(f),d),f=0}return p.push("\\".repeat(f*2),'"'),p.join("")}function s(l,p=1){for(let f=0;f<p;f++){let d=[];for(let h of l){let m=h.charCodeAt(0),y=m>=48&&m<=57||m>=65&&m<=90||m>=97&&m<=122,g="\\/:._-".includes(h);!y&&!g&&m<128&&d.push("^"),d.push(h)}l=d.join("")}return l}function a(l,p){let f=Object.keys(l).reverse().find((d)=>d.toUpperCase()===p);return f===void 0?void 0:l[f]}function c(l,p,f){let d=(a(p,"PATHEXT")||".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean),h=d.some((y)=>l.toLowerCase().endsWith(y.toLowerCase()))?["",...d]:[...d,""],m=/[\\/]/.test(l)?[f]:[f,...(a(p,"PATH")||"").split(";")];for(let y of m)for(let g of h){let x=o.resolve(f,y.replace(/^"|"$/g,""),l+g);try{if(n.statSync(x).isFile())return x}catch{}}}function u(l,p,f){if(process.platform!=="win32")return r.spawn(l,p,f);let d=f.env||process.env,h=c(l,d,f.cwd||process.cwd());if(h&&/\.(?:exe|com)$/i.test(h))return r.spawn(h,p,f);let m=/\.(?:bat|cmd)$/i.test(h||l),y=[s(o.normalize(h||l))];for(let x of p)y.push(s(i(x),m?2:1));let g=y.join(" ");return r.spawn(a(d,"COMSPEC")||"cmd.exe",["/d","/v:off","/s","/c",`"${g}"`],{...f,windowsVerbatimArguments:!0})}t.exports=u}),q2e=Gx((e,t)=>{var r=pe("fs"),n=pe("os"),o=pe("path"),i=pe("child_process"),s=j2e(),a=Xj(),{optionsFromEnv:c}=Jj();function u(){console.log(["Usage: dotenv run [--help] [-q|--quiet] [--debug] [--override] [--fast] [-f|--file <paths>] [--] <command> [args...]","","Run a command with environment variables from a .env file.","Place dotenv options before the command; all following arguments go to the command.","","Options:"," -f, --file <paths> .env paths, comma-separated or repeated (default: .env)"," -q, --quiet suppress the injected env message"," --debug enable debug logging"," --override override existing environment variables"," --fast use the faster character-scanner parser","","Environment variables (DOTENV_CONFIG_* names remain as fallbacks):"," DOTENV_PATH, DOTENV_ENCODING, DOTENV_QUIET,"," DOTENV_DEBUG, DOTENV_OVERRIDE,"," DOTENV_FAST"].join(`
215
+ `))}function l(m){let y=[],g=!1,x,b,w,v,D=-1;for(let T=0;T<m.length;T++){let A=m[T];if(A==="--"){D=T+1;break}if(A==="--help"||A==="-h")return{help:!0};if(A==="--quiet"||A==="-q"){x=!0;continue}if(A==="--debug"){b=!0;continue}if(A==="--override"){w=!0;continue}if(A==="--fast"){v=!0;continue}if(A==="-f"||A==="--file"||A.startsWith("-f=")||A.startsWith("--file=")){let E=A.indexOf("="),R=E===-1?A:A.slice(0,E),S=E===-1?m[++T]:A.slice(E+1);if(!S||S==="--")return{error:`${R} requires a path`};let k=S.split(",").map((I)=>I.trim()).filter(Boolean);if(k.length===0)return{error:`${R} requires a path`};y.push(...k),g=!0;continue}if(A.startsWith("-"))return{error:`unknown option: ${A}`};D=T;break}let O=D===-1?[]:m.slice(D);return{paths:y,pathSet:g,quiet:x,debug:b,override:w,fast:v,command:O}}function p(m){return m[0]==="~"?o.join(n.homedir(),m.slice(1)):m}function f(m){let y=c(),g={encoding:y.encoding||"utf8",quiet:y.quiet===!0,debug:y.debug===!0,override:y.override===!0,fast:y.fast===!0,paths:[".env"],defaultPath:!0};return y.path!=null&&(g.paths=[y.path],g.defaultPath=!1),m.pathSet&&(g.paths=m.paths,g.defaultPath=!1),m.quiet!=null&&(g.quiet=m.quiet),m.debug!=null&&(g.debug=m.debug),m.override!=null&&(g.override=m.override),m.fast!=null&&(g.fast=m.fast),g}function d(m){let y={},g=[],x={override:m.override,debug:m.debug};for(let b of m.paths){let w=o.resolve(process.cwd(),p(b));try{let v=a.parse(r.readFileSync(w,{encoding:m.encoding}),{fast:m.fast});a.populate(y,v,x),g.push(b)}catch(v){if(m.debug&&console.log(`┆ failed to load ${b} ${v.message}`),!(m.defaultPath&&v.code==="ENOENT"))throw v}}return{injected:a.populate(process.env,y,x),loadedPaths:g}}function h(m){let y=m[0];if(y==="--help"||y==="-h"){u();return}if(y!=="run"){u(),process.exitCode=1;return}let g=l(m.slice(1));if(g.help){u();return}if(g.error){console.error(`dotenv: ${g.error}`),u(),process.exitCode=1;return}if(g.command.length===0){u(),process.exitCode=1;return}let x=f(g);try{let E=d(x);if(!x.quiet){let R=`◇ injected env (${Object.keys(E.injected).length})`;E.loadedPaths.length>0&&(R+=` from ${E.loadedPaths.join(", ")}`),console.error(R)}}catch(E){console.error(`dotenv: ${E.message}`),process.exitCode=1;return}let b=!!process.stdin.isTTY,w=process.platform!=="win32"&&!b,v=s(g.command[0],g.command.slice(1),{stdio:"inherit",detached:w}),D=new Map,O=0;function T(E){if(!(!v.pid||v.exitCode!==null||v.signalCode!==null)){if(process.platform==="win32"){i.spawnSync("taskkill",["/pid",String(v.pid),"/T","/F"],{stdio:"ignore"});return}try{process.kill(w?-v.pid:v.pid,E)}catch(R){if(R.code!=="ESRCH")throw R}}}function A(){for(let[E,R]of D)process.removeListener(E,R)}for(let E of["SIGINT","SIGTERM","SIGHUP","SIGQUIT"]){let R=()=>{if(E==="SIGINT"){if(O++,b&&process.platform!=="win32"&&O===1)return;if(O>1){T(O===2?"SIGTERM":"SIGKILL");return}}T(E)};D.set(E,R),process.on(E,R)}v.on("error",function(E){A(),console.error(`dotenv: ${E.message}`),process.exitCode=1}),v.on("exit",function(E,R){A(),typeof E=="number"?process.exit(E):(setInterval(()=>{},1000),process.kill(process.pid,R))})}t.exports=h,t===pe.main&&h(process.argv.slice(2))}),om=Xj(),fVt=q2e();ep.exports=om;ep.exports.config=om.config;ep.exports.configDotenv=om.configDotenv;ep.exports.parse=om.parse;ep.exports.populate=om.populate});var ez=_(function(wKt,Qq){Qq.exports=hEe;function mEe(e){let t={defaultWidth:0,output:process.stdout,tty:pe("tty")};if(!e)return t;return Object.keys(t).forEach(function(r){if(!e[r])e[r]=t[r]}),e}function hEe(e){let t=mEe(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let r=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(r)&&r!==0)return r}return t.defaultWidth}});var wz=_(function(NKt,xz){var kEe=pe("stream");class bz extends kEe{#n=null;constructor(e={}){super(e);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=e.replace,this._prompt=e.prompt||null,this._hadControl=!1}#r(e,t){if(this._dest)return this._dest[e];if(this._src)return this._src[e];return t}#t(e,...t){if(typeof this._dest?.[e]==="function")this._dest[e](...t);if(typeof this._src?.[e]==="function")this._src[e](...t)}get isTTY(){if(this.#n!==null)return this.#n;return this.#r("isTTY",!1)}set isTTY(e){this.#n=e}get rows(){return this.#r("rows")}get columns(){return this.#r("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(e){this._src=e}pipe(e,t){return this._dest=e,super.pipe(e,t)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(e){if(this.muted){if(!this.replace)return!0;if(e.match(/^\u001b/)){if(e.indexOf(this._prompt)===0)e=e.slice(this._prompt.length),e=e.replace(/./g,this.replace),e=this._prompt+e;return this._hadControl=!0,this.emit("data",e)}else{if(this._prompt&&this._hadControl&&e.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),e=e.slice(this._prompt.length);e=e.toString().replace(/./g,this.replace)}}this.emit("data",e)}end(e){if(this.muted)if(e&&this.replace)e=e.toString().replace(/./g,this.replace);else e=null;if(e)this.emit("data",e);this.emit("end")}destroy(...e){return this.#t("destroy",...e)}destroySoon(...e){return this.#t("destroySoon",...e)}close(...e){return this.#t("close",...e)}}xz.exports=bz});class Hs extends Error{constructor(e,t,r){super(r);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}class eo extends Hs{constructor(e){super(1,"commander.invalidArgument",e);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}class vm{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(e,t){if(t===this.defaultValue||!Array.isArray(t))return[e];return t.push(e),t}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new eo(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(t,r);return t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function Sm(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}import{EventEmitter as _G}from"node:events";import gw from"node:child_process";import Vo from"node:path";import Cm from"node:fs";import Se from"node:process";import{stripVTControlCharacters as BG}from"node:util";import{stripVTControlCharacters as kG}from"node:util";class Am{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter((n)=>!n._hidden),r=e._getHelpCommand();if(r&&!r._hidden)t.push(r);if(this.sortSubcommands)t.sort((n,o)=>n.name().localeCompare(o.name()));return t}compareOptions(e,t){let r=(n)=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return r(e).localeCompare(r(t))}visibleOptions(e){let t=e.options.filter((n)=>!n.hidden),r=e._getHelpOption();if(r&&!r.hidden){let n=r.short&&e._findOption(r.short),o=r.long&&e._findOption(r.long);if(!n&&!o)t.push(r);else if(r.long&&!o)t.push(e.createOption(r.long,r.description));else if(r.short&&!n)t.push(e.createOption(r.short,r.description))}if(this.sortOptions)t.sort(this.compareOptions);return t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let r=e.parent;r;r=r.parent){let n=r.options.filter((o)=>!o.hidden);t.push(...n)}if(this.sortOptions)t.sort(this.compareOptions);return t}visibleArguments(e){if(e._argsDescription)e.registeredArguments.forEach((t)=>{t.description=t.description||e._argsDescription[t.name()]||""});if(e.registeredArguments.find((t)=>t.description))return e.registeredArguments;return[]}subcommandTerm(e){let t=e.registeredArguments.map((r)=>Sm(r)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;if(e._aliases[0])t=t+"|"+e._aliases[0];let r="";for(let n=e.parent;n;n=n.parent)r=n.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices)t.push(`choices: ${e.argChoices.map((r)=>JSON.stringify(r)).join(", ")}`);if(e.defaultValue!==void 0){if(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==="boolean")t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}if(e.presetArg!==void 0&&e.optional)t.push(`preset: ${JSON.stringify(e.presetArg)}`);if(e.envVar!==void 0)t.push(`env: ${e.envVar}`);if(t.length>0){let r=`(${t.join(", ")})`;if(e.description)return`${e.description} ${r}`;return r}return e.description}argumentDescription(e){let t=[];if(e.argChoices)t.push(`choices: ${e.argChoices.map((r)=>JSON.stringify(r)).join(", ")}`);if(e.defaultValue!==void 0)t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`);if(t.length>0){let r=`(${t.join(", ")})`;if(e.description)return`${e.description} ${r}`;return r}return e.description}formatItemList(e,t,r){if(t.length===0)return[];return[r.styleTitle(e),...t,""]}groupItems(e,t,r){let n=new Map;return e.forEach((o)=>{let i=r(o);if(!n.has(i))n.set(i,[])}),t.forEach((o)=>{let i=r(o);if(!n.has(i))n.set(i,[]);n.get(i).push(o)}),n}formatHelp(e,t){let r=t.padWidth(e,t),n=t.helpWidth??80;function o(l,p){return t.formatItem(l,r,p,t)}let i=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],s=t.commandDescription(e);if(s.length>0)i=i.concat([t.boxWrap(t.styleCommandDescription(s),n),""]);let a=t.visibleArguments(e).map((l)=>o(t.styleArgumentTerm(t.argumentTerm(l)),t.styleArgumentDescription(t.argumentDescription(l))));if(i=i.concat(this.formatItemList("Arguments:",a,t)),this.groupItems(e.options,t.visibleOptions(e),(l)=>l.helpGroupHeading??"Options:").forEach((l,p)=>{let f=l.map((d)=>o(t.styleOptionTerm(t.optionTerm(d)),t.styleOptionDescription(t.optionDescription(d))));i=i.concat(this.formatItemList(p,f,t))}),t.showGlobalOptions){let l=t.visibleGlobalOptions(e).map((p)=>o(t.styleOptionTerm(t.optionTerm(p)),t.styleOptionDescription(t.optionDescription(p))));i=i.concat(this.formatItemList("Global Options:",l,t))}return this.groupItems(e.commands,t.visibleCommands(e),(l)=>l.helpGroup()||"Commands:").forEach((l,p)=>{let f=l.map((d)=>o(t.styleSubcommandTerm(t.subcommandTerm(d)),t.styleSubcommandDescription(t.subcommandDescription(d))));i=i.concat(this.formatItemList(p,f,t))}),i.join(`
216
+ `)}displayWidth(e){return kG(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map((t)=>{if(t==="[options]")return this.styleOptionText(t);if(t==="[command]")return this.styleSubcommandText(t);if(t[0]==="["||t[0]==="<")return this.styleArgumentText(t);return this.styleCommandText(t)}).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map((t)=>{if(t==="[options]")return this.styleOptionText(t);if(t[0]==="["||t[0]==="<")return this.styleArgumentText(t);return this.styleSubcommandText(t)}).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,r,n){let i=" ".repeat(2);if(!r)return i+e;let s=e.padEnd(t+e.length-n.displayWidth(e)),a=2,u=(this.helpWidth??80)-t-a-2,l;if(u<this.minWidthToWrap||n.preformatted(r))l=r;else l=n.boxWrap(r,u).replace(/\n/g,`
217
+ `+" ".repeat(t+a));return i+s+" ".repeat(a)+l.replace(/\n/g,`
218
+ ${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let r=e.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,o=[];return r.forEach((i)=>{let s=i.match(n);if(s===null){o.push("");return}let a=[s.shift()],c=this.displayWidth(a[0]);s.forEach((u)=>{let l=this.displayWidth(u);if(c+l<=t){a.push(u),c+=l;return}o.push(a.join(""));let p=u.trimStart();a=[p],c=this.displayWidth(p)}),o.push(a.join(""))}),o.join(`
219
+ `)}}class $e{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let r=RG(e);if(this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;if(typeof e==="string")t={[e]:!0};return this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){if(t===this.defaultValue||!Array.isArray(t))return[e];return t.push(e),t}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new eo(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(t,r);return t},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return tC(this.name().replace(/^no-/,""));return tC(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class hw{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach((t)=>{if(t.negate)this.negativeOptions.set(t.attributeName(),t);else this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,r)=>{if(this.positiveOptions.has(r))this.dualOptions.add(r)})}valueFromOption(e,t){let r=t.attributeName();if(!this.dualOptions.has(r))return!0;let n=this.negativeOptions.get(r).presetArg,o=n!==void 0?n:!1;return t.negate===(o===e)}}function tC(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function RG(e){let t,r,n=/^-[^-]$/,o=/^--[^-]/,i=e.split(/[ |,]+/).concat("guard");if(n.test(i[0]))t=i.shift();if(o.test(i[0]))r=i.shift();if(!t&&n.test(i[0]))t=i.shift();if(!t&&o.test(i[0]))t=r,r=i.shift();if(i[0].startsWith("-")){let s=i[0],a=`option creation failed due to '${s}' in option flags '${e}'`;if(/^-[^-][^-]/.test(s))throw Error(`${a}
220
+ - a short flag is a single dash and a single character
221
+ - either use a single dash and a single character (for a short flag)
222
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(n.test(s))throw Error(`${a}
223
+ - too many short flags`);if(o.test(s))throw Error(`${a}
224
+ - too many long flags`);throw Error(`${a}
225
+ - unrecognised flag format`)}if(t===void 0&&r===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}function PG(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let n=0;n<=e.length;n++)r[n]=[n];for(let n=0;n<=t.length;n++)r[0][n]=n;for(let n=1;n<=t.length;n++)for(let o=1;o<=e.length;o++){let i;if(e[o-1]===t[n-1])i=0;else i=1;if(r[o][n]=Math.min(r[o-1][n]+1,r[o][n-1]+1,r[o-1][n-1]+i),o>1&&n>1&&e[o-1]===t[n-2]&&e[o-2]===t[n-1])r[o][n]=Math.min(r[o][n],r[o-2][n-2]+1)}return r[e.length][t.length]}function yw(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");if(r)e=e.slice(2),t=t.map((s)=>s.slice(2));let n=[],o=3,i=0.4;if(t.forEach((s)=>{if(s.length<=1)return;let a=PG(e,s),c=Math.max(e.length,s.length);if((c-a)/c>i){if(a<o)o=a,n=[s];else if(a===o)n.push(s)}}),n.sort((s,a)=>s.localeCompare(a)),r)n=n.map((s)=>`--${s}`);if(n.length>1)return`
226
+ (Did you mean one of ${n.join(", ")}?)`;if(n.length===1)return`
227
+ (Did you mean ${n[0]}?)`;return""}class re extends _G{constructor(e){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(t)=>Se.stdout.write(t),writeErr:(t)=>Se.stderr.write(t),outputError:(t,r)=>r(t),getOutHelpWidth:()=>Se.stdout.isTTY?Se.stdout.columns:void 0,getErrHelpWidth:()=>Se.stderr.isTTY?Se.stderr.columns:void 0,getOutHasColors:()=>nC()??(Se.stdout.isTTY&&Se.stdout.hasColors?.()),getErrHasColors:()=>nC()??(Se.stderr.isTTY&&Se.stderr.hasColors?.()),stripColor:(t)=>BG(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,r){let n=t,o=r;if(typeof n==="object"&&n!==null)o=n,n=null;o=o||{};let[,i,s]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(i);if(n)a.description(n),a._executableHandler=!0;if(o.isDefault)this._defaultCommandName=a._name;if(a._hidden=!!(o.noHelp||o.hidden),a._executableFile=o.executableFile||null,s)a.arguments(s);if(this._registerCommand(a),a.parent=this,a.copyInheritedSettings(this),n)return this;return a}createCommand(e){return new re(e)}createHelp(){return Object.assign(new Am,this.configureHelp())}configureHelp(e){if(e===void 0)return this._helpConfiguration;return this._helpConfiguration=e,this}configureOutput(e){if(e===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...e},this}showHelpAfterError(e=!0){if(typeof e!=="string")e=!!e;return this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
228
+ - specify the name in Command constructor or using .name()`);if(t=t||{},t.isDefault)this._defaultCommandName=e._name;if(t.noHelp||t.hidden)e._hidden=!0;return this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new vm(e,t)}argument(e,t,r,n){let o=this.createArgument(e,t);if(typeof r==="function")o.default(n).argParser(r);else o.default(r);return this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach((t)=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==="boolean"){if(this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let r=e??"help [command]",[,n,o]=r.match(/([^ ]+) *(.*)/),i=t??"display help for command",s=this.createCommand(n);if(s.helpOption(!1),o)s.arguments(o);if(i)s.description(i);if(this._addImplicitHelpCommand=!0,this._helpCommand=s,e||t)this._initCommandGroup(s);return this}addHelpCommand(e,t){if(typeof e!=="object")return this.helpCommand(e,t),this;return this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(e,t){let r=["preSubcommand","preAction","postAction"];if(!r.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
229
+ Expecting one of '${r.join("', '")}'`);if(this._lifeCycleHooks[e])this._lifeCycleHooks[e].push(t);else this._lifeCycleHooks[e]=[t];return this}exitOverride(e){if(e)this._exitCallback=e;else this._exitCallback=(t)=>{if(t.code!=="commander.executeSubCommandAsync")throw t};return this}_exit(e,t,r){if(this._exitCallback)this._exitCallback(new Hs(e,t,r));Se.exit(e)}action(e){let t=(r)=>{let n=this.registeredArguments.length,o=r.slice(0,n);if(this._storeOptionsAsProperties)o[n]=this;else o[n]=this.opts();return o.push(this),e.apply(this,o)};return this._actionHandler=t,this}createOption(e,t){return new $e(e,t)}_callParseArg(e,t,r,n){try{return e.parseArg(t,r)}catch(o){if(o.code==="commander.invalidArgument"){let i=`${n} ${o.message}`;this.error(i,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let r=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${r}'
230
+ - already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=(n)=>[n.name()].concat(n.aliases()),r=t(e).find((n)=>this._findCommand(n));if(r){let n=t(this._findCommand(r)).join("|"),o=t(e).join("|");throw Error(`cannot add command '${o}' as already have command '${n}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),r=e.attributeName();if(e.defaultValue!==void 0)this.setOptionValueWithSource(r,e.defaultValue,"default");let n=(o,i,s)=>{if(o==null&&e.presetArg!==void 0)o=e.presetArg;let a=this.getOptionValue(r);if(o!==null&&e.parseArg)o=this._callParseArg(e,o,a,i);else if(o!==null&&e.variadic)o=e._collectValue(o,a);if(o==null)if(e.negate)o=!1;else if(e.isBoolean()||e.optional)o=!0;else o="";this.setOptionValueWithSource(r,o,s)};if(this.on("option:"+t,(o)=>{let i=`error: option '${e.flags}' argument '${o}' is invalid.`;n(o,i,"cli")}),e.envVar)this.on("optionEnv:"+t,(o)=>{let i=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;n(o,i,"env")});return this}_optionEx(e,t,r,n,o){if(typeof t==="object"&&t instanceof $e)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let i=this.createOption(t,r);if(i.makeOptionMandatory(!!e.mandatory),typeof n==="function")i.default(o).argParser(n);else if(n instanceof RegExp){let s=n;n=(a,c)=>{let u=s.exec(a);return u?u[0]:c},i.default(o).argParser(n)}else i.default(n);return this.addOption(i)}option(e,t,r,n){return this._optionEx({},e,t,r,n)}requiredOption(e,t,r,n){return this._optionEx({mandatory:!0},e,t,r,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){if(this._storeOptionsAsProperties)return this[e];return this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,r){if(this._storeOptionsAsProperties)this[e]=t;else this._optionValues[e]=t;return this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach((r)=>{if(r.getOptionValueSource(e)!==void 0)t=r.getOptionValueSource(e)}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){if(Se.versions?.electron)t.from="electron";let n=Se.execArgv??[];if(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))t.from="eval"}if(e===void 0)e=Se.argv;this.rawArgs=e.slice();let r;switch(t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":if(Se.defaultApp)this._scriptPath=e[1],r=e.slice(2);else r=e.slice(1);break;case"user":r=e.slice(0);break;case"eval":r=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",r}parse(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return this._parseCommand([],r),this}async parseAsync(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return await this._parseCommand([],r),this}_prepareForParse(){if(this._savedState===null)this.options.filter((e)=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach((e)=>{let t=e.long.replace(/^--no-/,"--");if(!this._findOption(t))this.setOptionValueWithSource(e.attributeName(),!0,"default")}),this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
231
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,r){if(Cm.existsSync(e))return;let n=t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
232
+ - if '${r}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
233
+ - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
234
+ - ${n}`;throw Error(o)}_executeSubCommand(e,t){t=t.slice();let r=[".js",".ts",".tsx",".mjs",".cjs"];function n(u,l){let p=Vo.resolve(u,l);if(Cm.existsSync(p))return p;if(r.includes(Vo.extname(l)))return;let f=r.find((d)=>Cm.existsSync(`${p}${d}`));if(f)return`${p}${f}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,i=this._executableDir||"";if(this._scriptPath){let u;try{u=Cm.realpathSync(this._scriptPath)}catch{u=this._scriptPath}i=Vo.resolve(Vo.dirname(u),i)}if(i){let u=n(i,o);if(!u&&!e._executableFile&&this._scriptPath){let l=Vo.basename(this._scriptPath,Vo.extname(this._scriptPath));if(l!==this._name)u=n(i,`${l}-${e._name}`)}o=u||o}let s=r.includes(Vo.extname(o)),a;if(Se.platform!=="win32")if(s)t.unshift(o),t=rC(Se.execArgv).concat(t),a=gw.spawn(Se.argv[0],t,{stdio:"inherit"});else a=gw.spawn(o,t,{stdio:"inherit"});else this._checkForMissingExecutable(o,i,e._name),t.unshift(o),t=rC(Se.execArgv).concat(t),a=gw.spawn(Se.execPath,t,{stdio:"inherit"});if(!a.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((l)=>{Se.on(l,()=>{if(a.killed===!1&&a.exitCode===null)a.kill(l)})});let c=this._exitCallback;a.on("close",(u)=>{if(u=u??1,!c)Se.exit(u);else c(new Hs(u,"commander.executeSubCommandAsync","(close)"))}),a.on("error",(u)=>{if(u.code==="ENOENT")this._checkForMissingExecutable(o,i,e._name);else if(u.code==="EACCES")throw Error(`'${o}' not executable`);if(!c)Se.exit(1);else{let l=new Hs(1,"commander.executeSubCommandAsync","(error)");l.nestedError=u,c(l)}}),this.runningCommand=a}_dispatchSubcommand(e,t,r){let n=this._findCommand(e);if(!n)this.help({error:!0});n._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,n,"preSubcommand"),o=this._chainOrCall(o,()=>{if(n._executableHandler)this._executeSubCommand(n,t.concat(r));else return n._parseCommand(t,r)}),o}_dispatchHelpCommand(e){if(!e)this.help();let t=this._findCommand(e);if(t&&!t._executableHandler)t.help();return this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((e,t)=>{if(e.required&&this.args[t]==null)this.missingArgument(e.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let e=(r,n,o)=>{let i=n;if(n!==null&&r.parseArg){let s=`error: command-argument value '${n}' is invalid for argument '${r.name()}'.`;i=this._callParseArg(r,n,o,s)}return i};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((r,n)=>{let o=r.defaultValue;if(r.variadic){if(n<this.args.length){if(o=this.args.slice(n),r.parseArg)o=o.reduce((i,s)=>e(r,s,i),r.defaultValue)}else if(o===void 0)o=[]}else if(n<this.args.length){if(o=this.args[n],r.parseArg)o=e(r,o,r.defaultValue)}t[n]=o}),this.processedArgs=t}_chainOrCall(e,t){if(e?.then&&typeof e.then==="function")return e.then(()=>t());return t()}_chainOrCallHooks(e,t){let r=e,n=[];if(this._getCommandAndAncestors().reverse().filter((o)=>o._lifeCycleHooks[t]!==void 0).forEach((o)=>{o._lifeCycleHooks[t].forEach((i)=>{n.push({hookedCommand:o,callback:i})})}),t==="postAction")n.reverse();return n.forEach((o)=>{r=this._chainOrCall(r,()=>o.callback(o.hookedCommand,this))}),r}_chainOrCallSubCommandHook(e,t,r){let n=e;if(this._lifeCycleHooks[r]!==void 0)this._lifeCycleHooks[r].forEach((o)=>{n=this._chainOrCall(n,()=>o(this,t))});return n}_parseCommand(e,t){let r=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(r.operands),t=r.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{if(r.unknown.length>0)this.unknownOption(r.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let i;if(i=this._chainOrCallHooks(i,"preAction"),i=this._chainOrCall(i,()=>this._actionHandler(this.processedArgs)),this.parent)i=this._chainOrCall(i,()=>{this.parent.emit(o,e,t)});return i=this._chainOrCallHooks(i,"postAction"),i}if(this.parent?.listenerCount(o))n(),this._processArguments(),this.parent.emit(o,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);if(this.listenerCount("command:*"))this.emit("command:*",e,t);else if(this.commands.length)this.unknownCommand();else n(),this._processArguments()}else if(this.commands.length)n(),this.help({error:!0});else n(),this._processArguments()}_findCommand(e){if(!e)return;return this.commands.find((t)=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find((t)=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((e)=>{e.options.forEach((t)=>{if(t.mandatory&&e.getOptionValue(t.attributeName())===void 0)e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter((r)=>{let n=r.attributeName();if(this.getOptionValue(n)===void 0)return!1;return this.getOptionValueSource(n)!=="default"});e.filter((r)=>r.conflictsWith.length>0).forEach((r)=>{let n=e.find((o)=>r.conflictsWith.includes(o.attributeName()));if(n)this._conflictingOption(r,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((e)=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],r=[],n=t;function o(u){return u.length>1&&u[0]==="-"}let i=(u)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(u))return!1;return!this._getCommandAndAncestors().some((l)=>l.options.map((p)=>p.short).some((p)=>/^-\d$/.test(p)))},s=null,a=null,c=0;while(c<e.length||a){let u=a??e[c++];if(a=null,u==="--"){if(n===r)n.push(u);n.push(...e.slice(c));break}if(s&&(!o(u)||i(u))){this.emit(`option:${s.name()}`,u);continue}if(s=null,o(u)){let l=this._findOption(u);if(l){if(l.required){let p=e[c++];if(p===void 0)this.optionMissingArgument(l);this.emit(`option:${l.name()}`,p)}else if(l.optional){let p=null;if(c<e.length&&(!o(e[c])||i(e[c])))p=e[c++];this.emit(`option:${l.name()}`,p)}else this.emit(`option:${l.name()}`);s=l.variadic?l:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let l=this._findOption(`-${u[1]}`);if(l){if(l.required||l.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${l.name()}`,u.slice(2));else this.emit(`option:${l.name()}`),a=`-${u.slice(2)}`;continue}}if(/^--[^=]+=/.test(u)){let l=u.indexOf("="),p=this._findOption(u.slice(0,l));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,u.slice(l+1));continue}}if(n===t&&o(u)&&!(this.commands.length===0&&i(u)))n=r;if((this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&r.length===0){if(this._findCommand(u)){t.push(u),r.push(...e.slice(c));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){t.push(u,...e.slice(c));break}else if(this._defaultCommandName){r.push(u,...e.slice(c));break}}if(this._passThroughOptions){n.push(u,...e.slice(c));break}n.push(u)}return{operands:t,unknown:r}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let r=0;r<t;r++){let n=this.options[r].attributeName();e[n]=n===this._versionOptionName?this._version:this[n]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){if(this._outputConfiguration.outputError(`${e}
235
+ `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
236
+ `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
237
+ `),this.outputHelp({error:!0});let r=t||{},n=r.exitCode||1,o=r.code||"commander.error";this._exit(n,o,e)}_parseOptionsEnv(){this.options.forEach((e)=>{if(e.envVar&&e.envVar in Se.env){let t=e.attributeName();if(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))if(e.required||e.optional)this.emit(`optionEnv:${e.name()}`,Se.env[e.envVar]);else this.emit(`optionEnv:${e.name()}`)}})}_parseOptionsImplied(){let e=new hw(this.options),t=(r)=>this.getOptionValue(r)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(r));this.options.filter((r)=>r.implied!==void 0&&t(r.attributeName())&&e.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach((r)=>{Object.keys(r.implied).filter((n)=>!t(n)).forEach((n)=>{this.setOptionValueWithSource(n,r.implied[n],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let r=(i)=>{let s=i.attributeName(),a=this.getOptionValue(s),c=this.options.find((l)=>l.negate&&s===l.attributeName()),u=this.options.find((l)=>!l.negate&&s===l.attributeName());if(c&&(c.presetArg===void 0&&a===!1||c.presetArg!==void 0&&a===c.presetArg))return c;return u||i},n=(i)=>{let s=r(i),a=s.attributeName();if(this.getOptionValueSource(a)==="env")return`environment variable '${s.envVar}'`;return`option '${s.flags}'`},o=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],o=this;do{let i=o.createHelp().visibleOptions(o).filter((s)=>s.long).map((s)=>s.long);n=n.concat(i),o=o.parent}while(o&&!o._enablePositionalOptions);t=yw(e,n)}let r=`error: unknown option '${e}'${t}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,r=t===1?"":"s",n=e.length,o=this.parent?` for '${this.name()}'`:"",i=e.join(", "),s=`error: too many arguments${o}. Expected ${t} argument${r} but got ${n}: ${i}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach((o)=>{if(n.push(o.name()),o.alias())n.push(o.alias())}),t=yw(e,n)}let r=`error: unknown command '${e}'${t}`;this.error(r,{code:"commander.unknownCommand"})}version(e,t,r){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",r=r||"output the version number";let n=this.createOption(t,r);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
238
+ `),this._exit(0,"commander.version",e)}),this}description(e,t){if(e===void 0&&t===void 0)return this._description;if(this._description=e,t)this._argsDescription=t;return this}summary(e){if(e===void 0)return this._summary;return this._summary=e,this}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)t=this.commands[this.commands.length-1];if(e===t._name)throw Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(e);if(r){let n=[r.name()].concat(r.aliases()).join("|");throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return t._aliases.push(e),this}aliases(e){if(e===void 0)return this._aliases;return e.forEach((t)=>this.alias(t)),this}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map((r)=>Sm(r));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){if(e===void 0)return this._name;return this._name=e,this}helpGroup(e){if(e===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=e,this}commandsGroup(e){if(e===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=e,this}optionsGroup(e){if(e===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=e,this}_initOptionGroup(e){if(this._defaultOptionGroup&&!e.helpGroupHeading)e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){if(this._defaultCommandGroup&&!e.helpGroup())e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=Vo.basename(e,Vo.extname(e)),this}executableDir(e){if(e===void 0)return this._executableDir;return this._executableDir=e,this}helpInformation(e){let t=this.createHelp(),r=this._getOutputContext(e);t.prepareContext({error:r.error,helpWidth:r.helpWidth,outputHasColors:r.hasColors});let n=t.formatHelp(this,t);if(r.hasColors)return n;return this._outputConfiguration.stripColor(n)}_getOutputContext(e){e=e||{};let t=!!e.error,r,n,o;if(t)r=(s)=>this._outputConfiguration.writeErr(s),n=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth();else r=(s)=>this._outputConfiguration.writeOut(s),n=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth();return{error:t,write:(s)=>{if(!n)s=this._outputConfiguration.stripColor(s);return r(s)},hasColors:n,helpWidth:o}}outputHelp(e){let t;if(typeof e==="function")t=e,e=void 0;let r=this._getOutputContext(e),n={error:r.error,write:r.write,command:this};this._getCommandAndAncestors().reverse().forEach((i)=>i.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let o=this.helpInformation({error:r.error});if(t){if(o=t(o),typeof o!=="string"&&!Buffer.isBuffer(o))throw Error("outputHelp callback must return a string or a Buffer")}if(r.write(o),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",n),this._getCommandAndAncestors().forEach((i)=>i.emit("afterAllHelp",n))}helpOption(e,t){if(typeof e==="boolean"){if(e){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(e??"-h, --help",t??"display help for command"),e||t)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(Se.exitCode??0);if(t===0&&e&&typeof e!=="function"&&e.error)t=1;this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw Error(`Unexpected value for position to addHelpText.
239
+ Expecting one of '${r.join("', '")}'`);let n=`${e}Help`;return this.on(n,(o)=>{let i;if(typeof t==="function")i=t({error:o.error,command:o.command});else i=t;if(i)o.write(`${i}
240
+ `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();if(t&&e.find((n)=>t.is(n)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function rC(e){return e.map((t)=>{if(!t.startsWith("--inspect"))return t;let r,n="127.0.0.1",o="9229",i;if((i=t.match(/^(--inspect(-brk)?)$/))!==null)r=i[1];else if((i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(r=i[1],/^\d+$/.test(i[3]))o=i[3];else n=i[3];else if((i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)r=i[1],n=i[3],o=i[4];if(r&&o!=="0")return`${r}=${n}:${parseInt(o)+1}`;return t})}function nC(){if(Se.env.NO_COLOR||Se.env.FORCE_COLOR==="0"||Se.env.FORCE_COLOR==="false")return!1;if(Se.env.FORCE_COLOR||Se.env.CLICOLOR_FORCE!==void 0)return!0;return}var d5e=new re;var oC={name:"@cartesi/cli",version:"2.0.0-alpha.40",description:"Cartesi CLI",author:"Danilo Tuler <tuler@pobox.com>",bin:{cartesi:"./dist/index.js"},type:"module",homepage:"https://github.com/cartesi/cli",license:"Apache-2.0",repository:"cartesi/cli",files:["/dist"],devDependencies:{"@cartesi/wagmi-plugin":"1.0.0-alpha.7","@commander-js/extra-typings":"^15.0.0","@inquirer/confirm":"^6.3.3","@inquirer/core":"^12.0.4","@inquirer/input":"^5.1.7","@inquirer/select":"^5.2.6","@types/bun":"^1.4.3","@types/fs-extra":"^11.0.4","@types/node":"^26.6.4","@types/semver":"^7.8.0","@wagmi/cli":"^2.10.0",chalk:"^6.0.1","cli-table3":"^0.6.5",commander:"^15.0.0",dotenv:"^18.0.5",execa:"^10.0.1","fs-extra":"^11.4.1","get-port":"^7.2.0",listr2:"^11.1.1","modern-tar":"^0.8.5","npm-run-all":"^4.1.5",ora:"^9.4.1","p-retry":"^8.0.1",rimraf:"^6.1.3",semver:"^7.8.5","smol-toml":"^1.9.0",typescript:"^7.0.2",viem:"^2.57.3",yaml:"^2.9.1"},scripts:{build:"run-s clean codegen compile",clean:"rimraf dist",codegen:"run-p codegen:wagmi","codegen:wagmi":"wagmi generate",compile:"bun build.ts",lint:"biome lint",posttest:"bun lint",test:"bun test",typecheck:"run-s codegen typecheck:tsc","typecheck:tsc":"tsc"},engines:{node:">=24.0.0"},bugs:"https://github.com/cartesi/cli/issues"};var mH=ot(Iw(),1);function Qe(e){if(typeof e!=="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}import{fileURLToPath as bV}from"node:url";var sc=(e,t)=>{let r=kw(xV(e));if(typeof r!=="string")throw TypeError(`${t} must be a string or a file URL: ${r}.`);return r},xV=(e)=>Ow(e)?e.toString():e,Ow=(e)=>typeof e!=="string"&&e&&Object.getPrototypeOf(e)===String.prototype,kw=(e)=>e instanceof URL?bV(e):e;var Pm=(e,t=[],r={})=>{let n=sc(e,"First argument"),[o,i]=Qe(t)?[[],t]:[t,r];if(!Array.isArray(o))throw TypeError(`Second argument must be either an array of arguments or an options object: ${o}`);if(o.some((c)=>typeof c==="object"&&c!==null))throw TypeError(`Second argument must be an array of strings: ${o}`);let s=o.map(String),a=s.find((c)=>c.includes("\x00"));if(a!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!Qe(i))throw TypeError(`Last argument must be an options object: ${i}`);return[n,s,{__proto__:null,...i}]};import{ChildProcess as CV}from"node:child_process";import{StringDecoder as wV}from"node:string_decoder";var{toString:nD}=Object.prototype,oD=(e)=>nD.call(e)==="[object ArrayBuffer]",dt=(e)=>nD.call(e)==="[object Uint8Array]",Wo=(e)=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),TV=new TextEncoder,iD=(e)=>TV.encode(e),EV=new TextDecoder,_m=(e)=>EV.decode(e),sD=(e,t)=>vV(e,t).join(""),vV=(e,t)=>{if(t==="utf8"&&e.every((i)=>typeof i==="string"))return e;let r=new wV(t),n=e.map((i)=>typeof i==="string"?iD(i):i).map((i)=>r.write(i)),o=r.end();return o===""?n:[...n,o]},mp=(e)=>{if(e.length===1&&dt(e[0]))return e[0];return Rw(SV(e))},SV=(e)=>e.map((t)=>typeof t==="string"?iD(t):t),Rw=(e)=>{let t=new Uint8Array(AV(e)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t},AV=(e)=>{let t=0;for(let r of e)t+=r.length;return t};var lD=(e)=>Array.isArray(e)&&Array.isArray(e.raw),pD=(e,t)=>{let r=[];for(let[i,s]of e.entries())r=DV({templates:e,expressions:t,tokens:r,index:i,template:s});if(r.length===0)throw TypeError("Template script must not be empty");let[n,...o]=r;return[n,o,{}]},DV=({templates:e,expressions:t,tokens:r,index:n,template:o})=>{if(o===void 0)throw TypeError(`Invalid backslash sequence: ${e.raw[n]}`);let{nextTokens:i,leadingWhitespaces:s,trailingWhitespaces:a}=IV(o,e.raw[n]),c=cD(r,i,s);if(n===t.length)return c;let u=t[n],l=Array.isArray(u)?u.map((p)=>uD(p)):[uD(u)];return cD(c,l,a)},IV=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,o=aD.has(t[0]);for(let s=0,a=0;s<e.length;s+=1,a+=1){let c=t[a];if(aD.has(c)){if(n!==s)r.push(e.slice(n,s));n=s+1}else if(c==="\\"){let u=t[a+1];if(u===`
241
+ `)s-=1,a+=1;else if(u==="u"&&t[a+2]==="{")a=t.indexOf("}",a+3);else a+=OV[u]??1}}let i=n===e.length;if(!i)r.push(e.slice(n));return{nextTokens:r,leadingWhitespaces:o,trailingWhitespaces:i}},aD=new Set([" ","\t","\r",`
242
+ `]),OV={x:3,u:5},cD=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],uD=(e)=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(Qe(e)&&(("stdout"in e)||("isMaxBuffer"in e)))return kV(e);if(e instanceof CV||Object.prototype.toString.call(e)==="[object Promise]")throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${t}" in template expression`)},kV=({stdout:e})=>{if(typeof e==="string")return e;if(dt(e))return _m(e);if(e===void 0)throw TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`);throw TypeError(`Unexpected "${typeof e}" stdout in template expression`)};import{spawnSync as zJ}from"node:child_process";import{debuglog as RV}from"node:util";import Pw from"node:process";var vn=(e)=>Bm.includes(e),Bm=[Pw.stdin,Pw.stdout,Pw.stderr],Yr=["stdin","stdout","stderr"],Nm=(e)=>Yr[e]??`stdio[${e}]`;var dD=(e)=>{let t={...e};for(let r of Nw)t[r]=_w(e,r);return t},_w=(e,t)=>{let r=PV(e),n=Array.from({length:r+1}),o=_V(e[t],n,t,r);return LV(o,t)},PV=({stdio:e})=>Array.isArray(e)?Math.max(e.length,Yr.length):Yr.length,_V=(e,t,r,n)=>Qe(e)?BV(e,t,r,n):t.fill(e),BV=(e,t,r,n)=>{for(let o of Object.keys(e).sort(NV))for(let i of FV(o,r,n))t[i]=e[o];return t},NV=(e,t)=>fD(e)<fD(t)?1:-1,fD=(e)=>{if(e==="stdout"||e==="stderr")return 0;return e==="all"?2:1},FV=(e,t,r)=>{if(e==="ipc")return[r];let n=Bw(e);if(n===void 0||n===0)throw TypeError(`"${t}.${e}" is invalid.
243
+ It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(n!=="all"&&n>=r)throw TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
244
+ Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},Bw=(e)=>{if(e==="all")return e;if(Yr.includes(e))return Yr.indexOf(e);let t=MV.exec(e);if(t!==null)return Number(t.groups.fdNumber)},MV=/^fd(?<fdNumber>\d+)$/,LV=(e,t)=>e.map((r)=>r===void 0?UV[t]:r),$V=RV("execa").enabled?"full":"none",UV={lines:!1,buffer:!0,maxBuffer:1e8,verbose:$V,stripFinalNewline:!0},Nw=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Ko=(e,t)=>t==="ipc"?e.at(-1):e[t];var ac=({verbose:e},t)=>Fw(e,t)!=="none",cc=({verbose:e},t)=>!["none","short"].includes(Fw(e,t)),mD=({verbose:e},t)=>{let r=Fw(e,t);return Fm(r)?r:void 0},Fw=(e,t)=>t===void 0?HV(e):Ko(e,t),HV=(e)=>e.find((t)=>Fm(t))??Mm.findLast((t)=>e.includes(t)),Fm=(e)=>typeof e==="function",Mm=["none","short","full"];import{inspect as uW}from"node:util";import{platform as jV}from"node:process";import{stripVTControlCharacters as qV}from"node:util";var hD=(e,t)=>{let r=[e,...t],n=r.join(" "),o=r.map((i)=>YV(yD(i))).join(" ");return{command:n,escapedCommand:o}},hp=(e)=>qV(e).split(`
245
+ `).map((t)=>yD(t)).join(`
246
+ `),yD=(e)=>e.replaceAll(VV,(t)=>zV(t)),zV=(e)=>{let t=WV[e];if(t!==void 0)return t;let r=e.codePointAt(0),n=r.toString(16);return r<=KV?`\\u${n.padStart(4,"0")}`:`\\U${n}`},GV=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},VV=GV(),WV={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},KV=65535,YV=(e)=>{if(ZV.test(e))return e;return jV==="win32"?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`},ZV=/^[\w\-./]+$/;import gD from"node:process";function qs(){let{env:e}=gD,{TERM:t,TERM_PROGRAM:r}=e;if(gD.platform!=="win32")return t!=="linux";return Boolean(e.WT_SESSION)||Boolean(e.TERMINUS_SUBLIME)||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var bD={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},xD={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},JV={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},XV={...bD,...xD},QV={...bD,...JV},eW=qs(),tW=eW?XV:QV,Lm=tW,fve=Object.entries(xD);import rW from"node:tty";var nW=rW?.WriteStream?.prototype?.hasColors?.()??!1,Z=(e,t)=>{if(!nW)return(o)=>o;let r=`\x1B[${e}m`,n=`\x1B[${t}m`;return(o)=>{let i=o+"",s=i.indexOf(n);if(s===-1)return r+i+n;let a=r,c=0,l=(t===22?n:"")+r;while(s!==-1)a+=i.slice(c,s)+l,c=s+n.length,s=i.indexOf(n,c);return a+=i.slice(c)+n,a}},hve=Z(0,0),wD=Z(1,22),yve=Z(2,22),gve=Z(3,23),bve=Z(4,24),xve=Z("4:2",24),wve=Z("4:3",24),Tve=Z("4:4",24),Eve=Z("4:5",24),vve=Z(53,55),Sve=Z(7,27),Ave=Z(8,28),Cve=Z(9,29),Dve=Z(30,39),TD=Z(31,39),ED=Z(32,39),vD=Z(33,39),SD=Z(34,39),Ive=Z(35,39),Ove=Z(36,39),kve=Z(37,39),$m=Z(90,39),Rve=Z(40,49),Pve=Z(41,49),_ve=Z(42,49),Bve=Z(43,49),Nve=Z(44,49),Fve=Z(45,49),Mve=Z(46,49),Lve=Z(47,49),$ve=Z(100,49),AD=Z(91,39),Uve=Z(92,39),CD=Z(93,39),Hve=Z(94,39),jve=Z(95,39),qve=Z(96,39),zve=Z(97,39),Gve=Z(101,49),Vve=Z(102,49),Wve=Z(103,49),Kve=Z(104,49),Yve=Z(105,49),Zve=Z(106,49),Jve=Z(107,49),Xve=Z("58;5;0",59),Qve=Z("58;5;1",59),eSe=Z("58;5;2",59),tSe=Z("58;5;3",59),rSe=Z("58;5;4",59),nSe=Z("58;5;5",59),oSe=Z("58;5;6",59),iSe=Z("58;5;7",59),sSe=Z("58;5;8",59),aSe=Z("58;5;9",59),cSe=Z("58;5;10",59),uSe=Z("58;5;11",59),lSe=Z("58;5;12",59),pSe=Z("58;5;13",59),fSe=Z("58;5;14",59),dSe=Z("58;5;15",59);var OD=({type:e,message:t,timestamp:r,piped:n,commandId:o,result:{failed:i=!1}={},options:{reject:s=!0}})=>{let a=oW(r),c=iW[e]({failed:i,reject:s,piped:n}),u=sW[e]({reject:s});return`${$m(`[${a}]`)} ${$m(`[${o}]`)} ${u(c)} ${u(t)}`},oW=(e)=>`${Um(e.getHours(),2)}:${Um(e.getMinutes(),2)}:${Um(e.getSeconds(),2)}.${Um(e.getMilliseconds(),3)}`,Um=(e,t)=>String(e).padStart(t,"0"),DD=({failed:e,reject:t})=>{if(!e)return Lm.tick;return t?Lm.cross:Lm.warning},iW={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:DD,duration:DD},ID=(e)=>e,sW={command:()=>wD,output:()=>ID,ipc:()=>ID,error:({reject:e})=>e?AD:CD,duration:()=>$m};var kD=(e,t,r)=>{let n=mD(t,r);return e.map(({verboseLine:o,verboseObject:i})=>aW(o,i,n)).filter((o)=>o!==void 0).map((o)=>cW(o)).join("")},aW=(e,t,r)=>{if(r===void 0)return e;let n=r(e,t);if(typeof n==="string")return n},cW=(e)=>e.endsWith(`
247
+ `)?e:`${e}
248
+ `;var ro=({type:e,verboseMessage:t,fdNumber:r,verboseInfo:n,result:o})=>{let i=lW({type:e,result:o,verboseInfo:n}),s=pW(t,i),a=kD(s,n,r);if(a!=="")console.warn(a.slice(0,-1))},lW=({type:e,result:t,verboseInfo:r})=>{let{escapedCommand:n,commandId:o,rawOptions:i}=r,{piped:s=!1,...a}=i;return{type:e,escapedCommand:n,commandId:`${o}`,timestamp:new Date,piped:s,result:t,options:a}},pW=(e,t)=>e.split(`
249
+ `).map((r)=>fW({...t,message:r})),fW=(e)=>({verboseLine:OD(e),verboseObject:e}),Hm=(e)=>{let t=typeof e==="string"?e:uW(e);return hp(t).replaceAll("\t",()=>" ".repeat(dW))},dW=2;var RD=(e,t)=>{if(!ac(t))return;ro({type:"command",verboseMessage:e,verboseInfo:t})};var PD=(e,t,r)=>{yW(e);let n=mW(e);return{verbose:e,escapedCommand:t,commandId:n,rawOptions:r}},mW=(e)=>ac({verbose:e})?hW++:void 0,hW=0n,yW=(e)=>{for(let t of e){if(t===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!Mm.includes(t)&&!Fm(t)){let r=Mm.map((n)=>`'${n}'`).join(", ");throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${r} or a function.`)}}};import{hrtime as _D}from"node:process";var jm=()=>_D.bigint(),Mw=(e)=>Number(_D.bigint()-e)/1e6;var qm=(e,t,r)=>{let n=jm(),{command:o,escapedCommand:i}=hD(e,t),s=_w(r,"verbose"),a=PD(s,i,{...r});return RD(i,a),{command:o,escapedCommand:i,startTime:n,verboseInfo:a}};import YK from"node:path";import GI from"node:process";import Vm from"node:process";import zs from"node:path";function zm(e={}){let{env:t=process.env,platform:r=process.platform}=e;if(r!=="win32")return"PATH";return Object.keys(t).reverse().find((n)=>n.toUpperCase()==="PATH")||"Path"}import{promisify as gW}from"node:util";import{execFile as bW,execFileSync as HSe}from"node:child_process";import BD from"node:path";import{fileURLToPath as xW}from"node:url";var zSe=gW(bW);function Gm(e){return e instanceof URL?xW(e):e}function ND(e){return{*[Symbol.iterator](){let t=BD.resolve(Gm(e)),r;while(r!==t)yield t,r=t,t=BD.resolve(t,"..")}}}var wW=({cwd:e=Vm.cwd(),path:t=Vm.env[zm()],preferLocal:r=!0,execPath:n=Vm.execPath,addExecPath:o=!0}={})=>{let i=zs.resolve(Gm(e)),s=[],a=t.split(zs.delimiter);if(r)TW(s,a,i);if(o)EW(s,a,n,i);return t===""||t===zs.delimiter?`${s.join(zs.delimiter)}${t}`:[...s,t].join(zs.delimiter)},TW=(e,t,r)=>{for(let n of ND(r)){let o=zs.join(n,"node_modules/.bin");if(!t.includes(o))e.push(o)}},EW=(e,t,r,n)=>{let o=zs.resolve(n,Gm(r),"..");if(!t.includes(o))e.push(o)},FD=({env:e=Vm.env,...t}={})=>{e={...e};let r=zm({env:e});return t.path=e[r],e[r]=wW(t),e};import{setTimeout as MW}from"node:timers/promises";var MD=(e,t,r)=>{let n=r?yp:qt,o=e instanceof no?{}:{cause:e};return new n(t,o)};class no extends Error{}var LD=(e,t)=>{Object.defineProperties(e.prototype,{name:{value:t,writable:!0,enumerable:!1,configurable:!0},[UD]:{value:!0,writable:!1,enumerable:!1,configurable:!1}})},$D=(e)=>Wm(e)&&(UD in e),UD=Symbol("isExecaError"),Wm=(e)=>Object.prototype.toString.call(e)==="[object Error]";class qt extends Error{}LD(qt,qt.name);class yp extends Error{}LD(yp,yp.name);import{constants as gp}from"node:os";import{constants as CW}from"node:os";var HD=()=>{let e=Lw-jD+1;return Array.from({length:e},vW)},vW=(e,t)=>({name:`SIGRT${t+1}`,number:jD+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),jD=34,Lw=64;import{constants as SW}from"node:os";var qD=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var $w=()=>{let e=HD();return[...qD,...e].map(AW)},AW=({name:e,number:t,description:r,action:n,forced:o=!1,standard:i})=>{let{signals:{[e]:s}}=SW,a=s!==void 0;return{name:e,number:a?s:t,description:r,supported:a,action:n,forced:o,standard:i}};var DW=()=>{let e=$w();return Object.fromEntries(e.map(IW))},IW=({name:e,number:t,description:r,supported:n,action:o,forced:i,standard:s})=>[e,{name:e,number:t,description:r,supported:n,action:o,forced:i,standard:s}],zD=DW(),OW=()=>{let e=$w(),t=Lw+1,r=Array.from({length:t},(n,o)=>kW(o,e));return Object.assign({},...r)},kW=(e,t)=>{let r=RW(e,t);if(r===void 0)return{};let{name:n,description:o,supported:i,action:s,forced:a,standard:c}=r;return{[e]:{name:n,number:e,description:o,supported:i,action:s,forced:a,standard:c}}},RW=(e,t)=>{let r=t.find(({name:n})=>CW.signals[n]===e);if(r!==void 0)return r;return t.find((n)=>n.number===e)},cAe=OW();var VD=(e)=>{if(e===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return KD(e,"option `killSignal`")},WD=(e)=>e===0?e:KD(e,"`subprocess.kill()`'s argument"),KD=(e,t)=>{if(Number.isInteger(e))return PW(e,t);if(typeof e==="string")return BW(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
250
+ ${Uw()}`)},PW=(e,t)=>{if(GD.has(e))return GD.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.
251
+ ${Uw()}`)},_W=()=>new Map(Object.entries(gp.signals).reverse().map(([e,t])=>[t,e])),GD=_W(),BW=(e,t)=>{if(e in gp.signals)return e;if(e.toUpperCase()in gp.signals)throw TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`);throw TypeError(`Invalid ${t} '${e}': this signal name does not exist.
252
+ ${Uw()}`)},Uw=()=>`Available signal names: ${NW()}.
253
+ Available signal numbers: ${FW()}.`,NW=()=>Object.keys(gp.signals).sort().map((e)=>`'${e}'`).join(", "),FW=()=>[...new Set(Object.values(gp.signals).sort((e,t)=>e-t))].join(", "),Km=(e)=>zD[e].description;var YD=(e)=>{if(e===!1)return e;if(e===!0)return LW;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},LW=5000,ZD=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:n,context:o,controller:i},s,a)=>{let{signal:c,error:u}=$W(s,a,r);UW(u,n);let l=e(c);return HW({kill:e,signal:c,forceKillAfterDelay:t,killSignal:r,killResult:l,context:o,controller:i}),l},$W=(e,t,r)=>{let[n=r,o]=Wm(e)?[void 0,e]:[e,t];if(typeof n!=="string"&&!Number.isInteger(n))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(o!==void 0&&!Wm(o))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${o}`);return{signal:WD(n),error:o}},UW=(e,t)=>{if(e!==void 0)t.reject(e)},HW=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:n,killResult:o,context:i,controller:s})=>{if(t===n&&o)Hw({kill:e,forceKillAfterDelay:r,context:i,controllerSignal:s.signal})},Hw=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:n})=>{if(t===!1)return;try{if(await MW(t,void 0,{signal:n}),e("SIGKILL"))r.isForcefullyTerminated??=!0}catch{}};import{once as jW}from"node:events";var Ym=async(e,t)=>{if(!e.aborted)await jW(e,"abort",{signal:t})};var JD=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},XD=({kill:e,cancelSignal:t,gracefulCancel:r,context:n,controller:o})=>t===void 0||r?[]:[qW(e,t,n,o)],qW=async(e,t,r,{signal:n})=>{throw await Ym(t,n),r.terminationReason??="cancel",e(),t.reason};import{scheduler as aK}from"node:timers/promises";import{promisify as oK}from"node:util";var uc=({methodName:e,isSubprocess:t,ipc:r,isConnected:n})=>{zW(e,t,r),jw(e,t,n)},zW=(e,t,r)=>{if(!r)throw Error(`${Sn(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},jw=(e,t,r)=>{if(!r)throw Error(`${Sn(e,t)} cannot be used: the ${zi(t)} has already exited or disconnected.`)},QD=(e)=>{throw Error(`${Sn("getOneMessage",e)} could not complete: the ${zi(e)} exited or disconnected.`)},eI=(e)=>{throw Error(`${Sn("sendMessage",e)} failed: the ${zi(e)} is sending a message too, instead of listening to incoming messages.
254
+ This can be fixed by both sending a message and listening to incoming messages at the same time:
255
+
256
+ const [receivedMessage] = await Promise.all([
257
+ ${Sn("getOneMessage",e)},
258
+ ${Sn("sendMessage",e,"message, {strict: true}")},
259
+ ]);`)},Zm=(e,t)=>Error(`${Sn("sendMessage",t)} failed when sending an acknowledgment response to the ${zi(t)}.`,{cause:e}),tI=(e)=>{throw Error(`${Sn("sendMessage",e)} failed: the ${zi(e)} is not listening to incoming messages.`)},rI=(e)=>{throw Error(`${Sn("sendMessage",e)} failed: the ${zi(e)} exited without listening to incoming messages.`)},nI=()=>Error(`\`cancelSignal\` aborted: the ${zi(!0)} disconnected.`),oI=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},iI=({error:e,methodName:t,isSubprocess:r})=>{if(e.code==="EPIPE")throw Error(`${Sn(t,r)} cannot be used: the ${zi(r)} is disconnecting.`,{cause:e})},sI=({error:e,methodName:t,isSubprocess:r,message:n})=>{if(GW(e))throw Error(`${Sn(t,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:e})},GW=({code:e,message:t})=>VW.has(e)||WW.some((r)=>t.includes(r)),VW=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),WW=["could not be cloned","circular structure","call stack size exceeded"],Sn=(e,t,r="")=>e==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${KW(t)}${e}(${r})`,KW=(e)=>e?"":"subprocess.",zi=(e)=>e?"parent process":"subprocess",lc=(e)=>{if(e.connected)e.disconnect()};var oo=()=>{let e={},t=new Promise((r,n)=>{Object.assign(e,{resolve:r,reject:n})});return Object.assign(t,e)};import{once as eK}from"node:events";import{addAbortListener as YW}from"node:events";var Gs=(e,t,r)=>{let n=e.getMaxListeners();if(n===0||n===1/0)return;e.setMaxListeners(n+t),YW(r,()=>{e.setMaxListeners(e.getMaxListeners()-t)})};import{EventEmitter as XW}from"node:events";import{once as ZW}from"node:events";import{scheduler as JW}from"node:timers/promises";var Jm=(e,t)=>{if(t)qw(e)},qw=(e)=>{e.refCounted()},Xm=(e,t)=>{if(t)zw(e)},zw=(e)=>{e.unrefCounted()},aI=(e,t)=>{if(!t)return;zw(e),zw(e)},cI=(e,t)=>{if(!t)return;qw(e),qw(e)};var uI=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n},o)=>{if(fI(o)||mI(o))return;if(!Qm.has(e))Qm.set(e,[]);let i=Qm.get(e);if(i.push(o),i.length>1)return;while(i.length>0){await dI(e,n,o),await JW.yield();let s=await pI({wrappedMessage:i[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n});i.shift(),n.emit("message",s),n.emit("message:done")}},lI=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n,boundOnMessage:o})=>{Gw();let i=Qm.get(e);while(i?.length>0)await ZW(n,"message:done");e.removeListener("message",o),cI(t,r),n.connected=!1,n.emit("disconnect")},Qm=new WeakMap;var Gi=(e,t,r)=>{if(eh.has(e))return eh.get(e);let n=new XW;return n.connected=!0,eh.set(e,n),QW({ipcEmitter:n,anyProcess:e,channel:t,isSubprocess:r}),n},eh=new WeakMap,QW=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:n})=>{let o=uI.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e});t.on("message",o),t.once("disconnect",lI.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e,boundOnMessage:o})),aI(r,n)},th=(e)=>{let t=eh.get(e);return t===void 0?e.channel!==void 0&&e.channel!==null:t.connected};var hI=({anyProcess:e,channel:t,isSubprocess:r,message:n,strict:o})=>{if(!o)return n;let i=Gi(e,t,r),s=oh(e,i);return{id:tK++,type:nh,message:n,hasListeners:s}},tK=0n,yI=(e,t)=>{if(t?.type!==nh||t.hasListeners)return;for(let{id:r}of e)if(r!==void 0)rh[r].resolve({isDeadlock:!0,hasListeners:!1})},pI=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:o})=>{if(e?.type!==nh||!t.connected)return e;let{id:i,message:s}=e,a={id:i,type:bI,message:oh(t,o)};try{await pc({anyProcess:t,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){o.emit("strict:error",c)}return s},fI=(e)=>{if(e?.type!==bI)return!1;let{id:t,message:r}=e;return rh[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},gI=async(e,t,r)=>{if(e?.type!==nh)return;let n=oo();rh[e.id]=n;let o=new AbortController;try{let{isDeadlock:i,hasListeners:s}=await Promise.race([n,rK(t,r,o)]);if(i)eI(r);if(!s)tI(r)}finally{o.abort(),delete rh[e.id]}},rh={},rK=async(e,t,{signal:r})=>{Gs(e,1,r),await eK(e,"disconnect",{signal:r}),rI(t)},nh="execa:ipc:request",bI="execa:ipc:response";var wI=(e,t,r)=>{if(!bp.has(e))bp.set(e,new Set);let n=bp.get(e),o=oo(),i=r?t.id:void 0,s={onMessageSent:o,id:i};return n.add(s),{outgoingMessages:n,outgoingMessage:s}},TI=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},dI=async(e,t,r)=>{while(!oh(e,t)&&bp.get(e)?.size>0){let n=[...bp.get(e)];yI(n,r),await Promise.all(n.map(({onMessageSent:o})=>o))}},bp=new WeakMap,EI=new WeakMap,vI=(e,t)=>{EI.set(e,t)},oh=(e,t)=>t.listenerCount("message")>nK(e),nK=(e)=>xI(e)!==void 0&&!Ko(xI(e).buffer,"ipc")?1:0,xI=(e)=>EI.get(e);var pc=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},o,{strict:i=!1}={})=>(uc({methodName:"sendMessage",isSubprocess:r,ipc:n,isConnected:e.connected}),iK({anyProcess:e,channel:t,methodName:"sendMessage",isSubprocess:r,message:o,strict:i})),iK=async({anyProcess:e,channel:t,methodName:r,isSubprocess:n,message:o,strict:i})=>{let s=hI({anyProcess:e,channel:t,isSubprocess:n,message:o,strict:i}),a=wI(e,s,i);try{await Ww({anyProcess:e,methodName:r,isSubprocess:n,wrappedMessage:s,message:o})}catch(c){throw lc(e),c}finally{TI(a)}},Ww=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:n,message:o})=>{let i=sK(e);try{await Promise.all([gI(n,e,r),i(n)])}catch(s){throw iI({error:s,methodName:t,isSubprocess:r}),sI({error:s,methodName:t,isSubprocess:r,message:o}),s}},sK=(e)=>{if(Vw.has(e))return Vw.get(e);let t=oK(e.send.bind(e));return Vw.set(e,t),t},Vw=new WeakMap;var AI=(e,t)=>(jw("cancelSignal",!1,e.connected),Ww({anyProcess:e,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:DI,message:t},message:t})),CI=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>(await cK({anyProcess:e,channel:t,isSubprocess:r,ipc:n}),Kw.signal),cK=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>{if(SI)return;if(SI=!0,!n){oI();return}if(t===null){Gw();return}Gi(e,t,r),await aK.yield()},SI=!1,mI=(e)=>{if(e?.type!==DI)return!1;return Kw.abort(e.message),!0},DI="execa:ipc:cancel",Gw=()=>{Kw.abort(nI())},Kw=new AbortController;var II=({gracefulCancel:e,cancelSignal:t,ipc:r,serialization:n})=>{if(!e)return;if(t===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(n==="json")throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")},OI=({subprocess:e,kill:t,cancelSignal:r,gracefulCancel:n,forceKillAfterDelay:o,context:i,controller:s})=>n?[uK({subprocess:e,kill:t,cancelSignal:r,forceKillAfterDelay:o,context:i,controller:s})]:[],uK=async({subprocess:e,kill:t,cancelSignal:r,forceKillAfterDelay:n,context:o,controller:{signal:i}})=>{await Ym(r,i);let s=lK(r);throw await AI(e,s),Hw({kill:t,forceKillAfterDelay:n,context:o,controllerSignal:i}),o.terminationReason??="gracefulCancel",r.reason},lK=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t};import{setTimeout as pK}from"node:timers/promises";var kI=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},RI=(e,t,r,n)=>t===0||t===void 0?[]:[fK(e,t,r,n)],fK=async(e,t,r,{signal:n})=>{throw await pK(t,void 0,{signal:n}),r.terminationReason??="timeout",e(),new no};import{execPath as dK,execArgv as mK}from"node:process";import PI from"node:path";var _I=({options:e})=>{if(e.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},BI=(e,t,{node:r=!1,nodePath:n=dK,nodeOptions:o=mK.filter((c)=>!c.startsWith("--inspect")),cwd:i,execPath:s,...a})=>{if(s!==void 0)throw TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=sc(n,'The "nodePath" option'),u=PI.resolve(i,c),l={__proto__:null,shell:!1,...a,nodePath:u,node:r,cwd:i};if(!r)return[e,t,l];if(PI.basename(e,".exe")==="node")throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[u,[...o,e,...t],{__proto__:null,ipc:!0,...l,shell:!1}]};import{serialize as hK}from"node:v8";var NI=({ipcInput:e,ipc:t,serialization:r})=>{if(e===void 0)return;if(!t)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");bK[r](e)},yK=(e)=>{try{hK(e)}catch(t){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:t})}},gK=(e)=>{try{JSON.stringify(e)}catch(t){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:t})}},bK={advanced:yK,json:gK},FI=async(e,t,r)=>{if(t===void 0)return;await pc({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r},t)};var LI=({encoding:e})=>{if(Yw.has(e))return;let t=wK(e);if(t!==void 0)throw TypeError(`Invalid option \`encoding: ${ih(e)}\`.
260
+ Please rename it to ${ih(t)}.`);let r=[...Yw].map((n)=>ih(n)).join(", ");throw TypeError(`Invalid option \`encoding: ${ih(e)}\`.
261
+ Please rename it to one of: ${r}.`)},xK=new Set(["utf8","utf16le"]),Br=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Yw=xK.union(Br),wK=(e)=>{if(e===null)return"buffer";if(typeof e!=="string")return;let t=e.toLowerCase();if(t in MI)return MI[t];if(Yw.has(t))return t},MI={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},ih=(e)=>typeof e==="string"?`"${e}"`:String(e);import{openSync as DK,readSync as IK,closeSync as OK}from"node:fs";import{Buffer as kK}from"node:buffer";import fc from"node:path";import dc from"node:process";import Zw from"node:fs";import wp from"node:path";import xp from"node:process";var Vs=xp.platform==="win32",TK=Vs?/[\/\\]/v:/\//v,EK=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC";function vK(e,t){if(typeof e!=="string"||e.length===0)throw TypeError("Expected a non-empty string.");let{cwd:r=xp.cwd(),path:n=xp.env.PATH??(Vs?xp.env.Path:void 0)??"",pathExt:o=xp.env.PATHEXT||EK}=t;return{cwd:r,searchPath:n,pathExt:o}}function SK(e,t){let r=t.split(wp.delimiter).filter(Boolean),n=wp.extname(e).toLowerCase();if(n!==""&&r.some((o)=>o.toLowerCase()===n))return["",...r];return r}function*AK(e,{cwd:t,searchPath:r,pathExt:n}){let o=Vs?SK(e,n):[""];if(TK.test(e)){let s=wp.resolve(t,e);for(let a of o)yield s+a;return}let i=[...Vs?[t]:[],...r.split(wp.delimiter)];for(let s of i){let a=Vs&&s.length>1&&s.startsWith('"')&&s.endsWith('"')?s.slice(1,-1):s;if(a==="")continue;let c=wp.resolve(t,a,e);for(let u of o)yield c+u}}function CK(e){let t;try{t=Zw.statSync(e)}catch(r){return Vs&&r.code==="EACCES"}if(!t.isFile())return!1;if(Vs)return!0;try{return Zw.accessSync(e,Zw.constants.X_OK),!0}catch{return!1}}function sh(e,t={}){let r=vK(e,t);for(let n of AK(e,r))if(CK(n))return n;return}var HI=(e,t,r)=>{let n={file:e,commandArguments:[...t],options:r};if(r.shell||dc.platform!=="win32")return n;return _K(n)},RK=/\.(?:com|exe)$/i,PK=/\.(?:bat|cmd)$/i,_K=(e)=>{let t=BK(e);if(t!==void 0&&RK.test(t)){if(e.options.argv0===void 0)e.options.argv0=e.file;return e.file=t,e}for(let s of[e.file,...e.commandArguments])jK(s);let r=t!==void 0&&PK.test(t),n=Jw(fc.normalize(t??e.file)),o=e.commandArguments.map((s)=>GK(s,r)),i=`"${[n,...o].join(" ")}"`;return e.options.windowsVerbatimArguments=!0,{file:dc.env.comspec||"cmd.exe",commandArguments:["/d","/s","/c",i],options:e.options}},BK=(e)=>{let t=$I(e),r=t!==void 0&&LK(t);if(!r)return t;return e.commandArguments.unshift(t),e.file=r,$I(e)},$I=(e)=>{let t=e.options.env||dc.env,r=e.options.cwd??dc.cwd(),n=Tp(t,"PATHEXT"),o=fc.extname(e.file),i=o===""?n:`${o}${fc.delimiter}${n??""}`;if(NK(e.file))return sh(fc.resolve(r,e.file),{cwd:r,pathExt:i});let s=Tp(t,"PATH")??Tp(dc.env,"PATH")??"",a={cwd:r,path:s,pathExt:i};return FK(t)?sh(e.file,a):MK(e.file,a)},NK=(e)=>e.includes("/")||e.includes("\\")||e.includes(":"),FK=(e)=>Tp(dc.env,"NODEFAULTCURRENTDIRECTORYINEXEPATH")===void 0&&Tp(e,"NODEFAULTCURRENTDIRECTORYINEXEPATH")===void 0,MK=(e,{cwd:t,path:r,pathExt:n})=>{for(let o of r.split(fc.delimiter)){let i=o.length>1&&o.startsWith('"')&&o.endsWith('"')?o.slice(1,-1):o;if(i==="")continue;let s=sh(fc.resolve(t,i,e),{cwd:t,pathExt:n});if(s!==void 0)return s}},Tp=(e,t)=>{let r=Object.keys(e).sort().find((n)=>n.toUpperCase()===t);return r===void 0?void 0:e[r]},UI=150,LK=(e)=>{let t=kK.alloc(UI);try{let r=DK(e,"r");try{IK(r,t,0,UI,0)}finally{OK(r)}}catch{return}return UK(t.toString())},$K=/^#!(?<line>.*)/,UK=(e)=>{let t=e.match($K)?.groups.line.trim();if(!t)return;let[r,n]=t.split(" "),o=r.split("/").at(-1);if(o==="env")return n;return n?`${o} ${n}`:o},HK=/[\n\r]/,jK=(e)=>{if(HK.test(e))throw TypeError(`The command and its arguments cannot contain a line break on Windows without a shell.
262
+ This would allow a command injection with \`cmd.exe\`.
263
+ Invalid value: ${JSON.stringify(`${e}`)}`)},qK=/[()\][%!^"`<>&|;, *?]/g,Jw=(e)=>e.replaceAll(qK,"^$&"),zK=/\\+/g,GK=(e,t)=>{let r=`${e}`.replaceAll(zK,(o,i,s)=>{let a=s[i+o.length];return a==='"'||a===void 0?o.repeat(2):o}).replaceAll('"',"\\\""),n=Jw(`"${r}"`);return t?Jw(n):n};import{statSync as VK}from"node:fs";import WK from"node:path";import KK from"node:process";var jI=(e=qI())=>{let t=sc(e,'The "cwd" option');return WK.resolve(t)},qI=()=>{try{return KK.cwd()}catch(e){throw e.message=`The current directory does not exist.
264
+ ${e.message}`,e}},zI=(e,t)=>{if(t===qI())return e;let r;try{r=VK(t)}catch(n){return`The "cwd" option is invalid: ${t}.
265
+ ${n.message}
266
+ ${e}`}if(!r.isDirectory())return`The "cwd" option is not a directory: ${t}.
267
+ ${e}`;return e};var ZK=/^cmd(?:\.exe)?$/i,ah=(e,t,r)=>{let n={__proto__:null,...r};n.cwd=jI(n.cwd);let[o,i,s]=BI(e,t,n),a=dD(s),c=JK(a);c.env=XK(c);let{file:u,commandArguments:l}=HI(o,i,c);if(kI(c),LI(c),NI(c),JD(c),II(c),c.shell=kw(c.shell),c.killSignal=VD(c.killSignal),c.forceKillAfterDelay=YD(c.forceKillAfterDelay),c.lines=c.lines.map((p,f)=>p&&!Br.has(c.encoding)&&c.buffer[f]),GI.platform==="win32"&&ZK.test(YK.basename(u)))l.unshift("/q");return{file:u,commandArguments:l,options:c}},JK=({extendEnv:e=!0,preferLocal:t=!1,cwd:r,localDir:n=r,encoding:o="utf8",reject:i=!0,cleanup:s=!0,killDescendants:a=!1,all:c=!1,windowsHide:u=!0,killSignal:l="SIGTERM",forceKillAfterDelay:p=!0,gracefulCancel:f=!1,ipcInput:d,ipc:h=d!==void 0||f,serialization:m="advanced",...y})=>({__proto__:null,...y,extendEnv:e,preferLocal:t,cwd:r,localDirectory:n,encoding:o,reject:i,cleanup:s,killDescendants:a,all:c,windowsHide:u,killSignal:l,forceKillAfterDelay:p,gracefulCancel:f,ipcInput:d,ipc:h,serialization:m}),XK=({env:e,extendEnv:t,preferLocal:r,node:n,localDirectory:o,nodePath:i})=>{let s=t?{...GI.env,...e}:e;if(r||n)return FD({env:s,cwd:o,execPath:i,preferLocal:r,addExecPath:n});return s};var ch=(e,t,r)=>r.shell&&t.length>0?[[e,...t].join(" "),[],r]:[e,t,r];import{inspect as PY}from"node:util";function mc(e){if(typeof e==="string")return QK(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return eY(e)}var QK=(e)=>e.at(-1)===VI?e.slice(0,e.at(-2)===WI?-2:-1):e,eY=(e)=>e.at(-1)===tY?e.subarray(0,e.at(-2)===rY?-2:-1):e,VI=`
268
+ `,tY=VI.codePointAt(0),WI="\r",rY=WI.codePointAt(0);import{on as IY}from"node:events";import{finished as OY}from"node:stream/promises";function An(e,{checkOpen:t=!0}={}){return e!==null&&typeof e==="object"&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe==="function"}function Xw(e,{checkOpen:t=!0}={}){return An(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write==="function"&&typeof e.end==="function"&&typeof e.writable==="boolean"&&typeof e.writableObjectMode==="boolean"&&typeof e.destroy==="function"&&typeof e.destroyed==="boolean"}function Ws(e,{checkOpen:t=!0}={}){return An(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read==="function"&&typeof e.readable==="boolean"&&typeof e.readableObjectMode==="boolean"&&typeof e.destroy==="function"&&typeof e.destroyed==="boolean"}function Qw(e,t){return Xw(e,t)&&Ws(e,t)}var nY=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class KI{#n;#r;#t=!1;#e=void 0;constructor(e,t){this.#n=e,this.#r=t}next(){let e=()=>this.#i();return this.#e=this.#e?this.#e.then(e,e):e(),this.#e}return(e){let t=()=>this.#o(e);return this.#e?this.#e.then(t,t):t()}async#i(){if(this.#t)return{done:!0,value:void 0};let e;try{e=await this.#n.read()}catch(t){throw this.#e=void 0,this.#t=!0,this.#n.releaseLock(),t}return e.done&&(this.#e=void 0,this.#t=!0,this.#n.releaseLock()),e}async#o(e){if(this.#t)return{done:!0,value:e};if(this.#t=!0,!this.#r){let t=this.#n.cancel(e);return this.#n.releaseLock(),await t,{done:!0,value:e}}return this.#n.releaseLock(),{done:!0,value:e}}}var e1=Symbol();function YI(){return this[e1].next()}Object.defineProperty(YI,"name",{value:"next"});function ZI(e){return this[e1].return(e)}Object.defineProperty(ZI,"name",{value:"return"});var oY=Object.create(nY,{next:{enumerable:!0,configurable:!0,writable:!0,value:YI},return:{enumerable:!0,configurable:!0,writable:!0,value:ZI}});function t1({preventCancel:e=!1}={}){let t=this.getReader(),r=new KI(t,e),n=Object.create(oY);return n[e1]=r,n}var JI=(e)=>{if(Ws(e,{checkOpen:!1})&&Ep.on!==void 0)return sY(e);if(typeof e?.[Symbol.asyncIterator]==="function")return e;if(iY.call(e)==="[object ReadableStream]")return t1.call(e);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:iY}=Object.prototype,sY=async function*(e){let t=new AbortController,r={};aY(e,t,r);try{for await(let[n]of Ep.on(e,"data",{signal:t.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;else if(!t.signal.aborted)throw n}finally{e.destroy()}},aY=async(e,t,r)=>{try{await Ep.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{t.abort()}},Ep={};var hc=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let u=JI(e),l=t();l.length=0;try{for await(let p of u){let f=uY(p),d=r[f](p,l);e8({convertedChunk:d,state:l,getSize:n,truncateChunk:o,addChunk:i,maxBuffer:c})}return cY({state:l,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,maxBuffer:c}),a(l)}catch(p){let f=typeof p==="object"&&p!==null?p:Error(p);throw f.bufferedData=a(l),f}},cY=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:o,maxBuffer:i})=>{let s=o(e);if(s!==void 0)e8({convertedChunk:s,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:i})},e8=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:o,maxBuffer:i})=>{let s=r(e),a=t.length+s;if(a<=i){XI(e,t,o,a);return}let c=n(e,i-t.length);if(c!==void 0)XI(c,t,o,i);throw new Yo},XI=(e,t,r,n)=>{t.contents=r(e,t,n),t.length=n},uY=(e)=>{let t=typeof e;if(t==="string")return"string";if(t!=="object"||e===null)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let r=QI.call(e);if(r==="[object ArrayBuffer]")return"arrayBuffer";if(r==="[object DataView]")return"dataView";if(Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&QI.call(e.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},{toString:QI}=Object.prototype;class Yo extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}var Zo=(e)=>e,vp=()=>{return},uh=({contents:e})=>e,lh=(e)=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},ph=(e)=>e.length;async function fh(e,t){return hc(e,dY,t)}var lY=()=>({contents:[]}),pY=()=>1,fY=(e,{contents:t})=>(t.push(e),t),dY={init:lY,convertChunk:{string:Zo,buffer:Zo,arrayBuffer:Zo,dataView:Zo,typedArray:Zo,others:Zo},getSize:pY,truncateChunk:vp,addChunk:fY,getFinalChunk:vp,finalize:uh};async function dh(e,t){return hc(e,EY,t)}var mY=()=>({contents:new ArrayBuffer(0)}),hY=(e)=>yY.encode(e),yY=new TextEncoder,t8=(e)=>new Uint8Array(e),r8=(e)=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),gY=(e,t)=>e.slice(0,t),bY=(e,{contents:t,length:r},n)=>{let o=i8()?wY(t,n):xY(t,n);return new Uint8Array(o).set(e,r),o},xY=(e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(o8(t));return new Uint8Array(r).set(new Uint8Array(e),0),r},wY=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:o8(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r},o8=(e)=>n8**Math.ceil(Math.log(e)/Math.log(n8)),n8=2,TY=({contents:e,length:t})=>i8()?e:e.slice(0,t),i8=()=>("resize"in ArrayBuffer.prototype),EY={init:mY,convertChunk:{string:hY,buffer:t8,arrayBuffer:t8,dataView:r8,typedArray:r8,others:lh},getSize:ph,truncateChunk:gY,addChunk:bY,getFinalChunk:vp,finalize:TY};async function hh(e,t){return hc(e,DY,t)}var vY=()=>({contents:"",textDecoder:new TextDecoder}),mh=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),SY=(e,{contents:t})=>t+e,AY=(e,t)=>e.slice(0,t),CY=({textDecoder:e})=>{let t=e.decode();return t===""?void 0:t},DY={init:vY,convertChunk:{string:Zo,buffer:mh,arrayBuffer:mh,dataView:mh,typedArray:mh,others:lh},getSize:ph,truncateChunk:AY,addChunk:SY,getFinalChunk:CY,finalize:uh};Object.assign(Ep,{on:IY,finished:OY});var s8=({error:e,stream:t,readableObjectMode:r,lines:n,encoding:o,fdNumber:i})=>{if(!(e instanceof Yo))throw e;if(i==="all")return e;let s=kY(r,n,o);throw e.maxBufferInfo={fdNumber:i,unit:s},t.destroy(),e},kY=(e,t,r)=>{if(e)return"objects";if(t)return"lines";if(r==="buffer")return"bytes";return"characters"},a8=(e,t,r)=>{if(t.length!==r)return;let n=new Yo;throw n.maxBufferInfo={fdNumber:"ipc"},n},c8=(e,t)=>{let{streamName:r,threshold:n,unit:o}=RY(e,t);return`Command's ${r} was larger than ${n} ${o}`},RY=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:"output",threshold:t[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=e;delete e.maxBufferInfo;let o=Ko(t,r);if(r==="ipc")return{streamName:"IPC output",threshold:o,unit:"messages"};return{streamName:Nm(r),threshold:o,unit:n}},u8=(e,t,r)=>e?.code==="ENOBUFS"&&t!==null&&t.some((n)=>n!==null&&n.length>yh(r)),l8=(e,t,r)=>{if(!t)return e;let n=yh(r);return e.length>n?e.slice(0,n):e},yh=([,e])=>e;var f8=({stdio:e,all:t,ipcOutput:r,originalError:n,signal:o,signalDescription:i,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:u,isGracefullyCanceled:l,isMaxBuffer:p,isForcefullyTerminated:f,forceKillAfterDelay:d,killSignal:h,maxBuffer:m,timeout:y,cwd:g})=>{let x=n?.code,b=_Y({originalError:n,timedOut:c,timeout:y,isMaxBuffer:p,maxBuffer:m,errorCode:x,signal:o,signalDescription:i,exitCode:s,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:f,forceKillAfterDelay:d,killSignal:h}),w=NY(n,g),v=w===void 0?"":`
269
+ ${w}`,D=`${b}: ${a}${v}`,O=t===void 0?[e[2],e[1]]:[t],T=[D,...O,...e.slice(3),r.map((A)=>FY(A)).join(`
270
+ `)].map((A)=>hp(mc(MY(A)))).filter(Boolean).join(`
271
+
272
+ `);return{originalMessage:w,shortMessage:D,message:T}},_Y=({originalError:e,timedOut:t,timeout:r,isMaxBuffer:n,maxBuffer:o,errorCode:i,signal:s,signalDescription:a,exitCode:c,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:p,forceKillAfterDelay:f,killSignal:d})=>{let h=BY(p,f);if(t)return`Command timed out after ${r} milliseconds${h}`;if(l){if(s===void 0)return`Command was gracefully canceled with exit code ${c}`;return p?`Command was gracefully canceled${h}`:`Command was gracefully canceled with ${s} (${a})`}if(u)return`Command was canceled${h}`;if(n)return`${c8(e,o)}${h}`;if(i!==void 0)return`Command failed with ${i}${h}`;if(p)return`Command was killed with ${d} (${Km(d)})${h}`;if(s!==void 0)return`Command was killed with ${s} (${a})`;if(c!==void 0)return`Command failed with exit code ${c}`;return"Command failed"},BY=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",NY=(e,t)=>{if(e instanceof no)return;let r=$D(e)?e.originalMessage:String(e?.message??e),n=hp(zI(r,t));return n===""?void 0:n},FY=(e)=>typeof e==="string"?e:PY(e),MY=(e)=>Array.isArray(e)?e.map((t)=>mc(p8(t))).filter(Boolean).join(`
273
+ `):p8(e),p8=(e)=>{if(typeof e==="string")return e;if(dt(e))return _m(e);return""};var gh=({command:e,escapedCommand:t,stdio:r,all:n,ipcOutput:o,options:{cwd:i},startTime:s})=>d8({command:e,escapedCommand:t,cwd:i,durationMs:Mw(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:o,pipedFrom:[]}),yc=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:s})=>Sp({error:e,command:t,escapedCommand:r,startTime:i,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:o,isSync:s}),Sp=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,stdio:p,all:f,ipcOutput:d,options:{timeoutDuration:h,timeout:m=h,forceKillAfterDelay:y,killSignal:g,cwd:x,maxBuffer:b},isSync:w})=>{let{exitCode:v,signal:D,signalDescription:O}=$Y(u,l),{originalMessage:T,shortMessage:A,message:E}=f8({stdio:p,all:f,ipcOutput:d,originalError:e,signal:D,signalDescription:O,exitCode:v,escapedCommand:r,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:y,killSignal:g,maxBuffer:b,timeout:m,cwd:x}),R=MD(e,E,w);return Object.assign(R,LY({error:R,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:v,signal:D,signalDescription:O,stdio:p,all:f,ipcOutput:d,cwd:x,originalMessage:T,shortMessage:A})),R},LY=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:p,stdio:f,all:d,ipcOutput:h,cwd:m,originalMessage:y,shortMessage:g})=>d8({shortMessage:g,originalMessage:y,command:t,escapedCommand:r,cwd:m,durationMs:Mw(n),failed:!0,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:p,code:e.cause?.code,stdout:f[1],stderr:f[2],all:d,stdio:f,ipcOutput:h,pipedFrom:[]}),d8=(e)=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),$Y=(e,t)=>{let r=e===null?void 0:e,n=t===null?void 0:t,o=n===void 0?void 0:Km(t);return{exitCode:r,signal:n,signalDescription:o}};var m8=(e)=>Number.isFinite(e)?e:0;function UY(e){return{days:Math.trunc(e/86400000),hours:Math.trunc(e/3600000%24),minutes:Math.trunc(e/60000%60),seconds:Math.trunc(e/1000%60),milliseconds:Math.trunc(e%1000),microseconds:Math.trunc(m8(e*1000)%1000),nanoseconds:Math.trunc(m8(e*1e6)%1000)}}function HY(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function r1(e){switch(typeof e){case"number":{if(Number.isFinite(e))return UY(e);break}case"bigint":return HY(e)}throw TypeError("Expected a finite number or bigint")}var jY=(e)=>e===0||e===0n,qY=(e,t)=>t===1||t===1n?e:`${e}s`,zY=0.0000001,GY=24n*60n*60n*1000n;function n1(e,t){let r=typeof e==="bigint";if(!r&&!Number.isFinite(e))throw TypeError("Expected a finite number or bigint");t={...t};let n=e<0?"-":"";if(e=e<0?-e:e,t.colonNotation)t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1;if(t.compact)t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0;let o=[],i=(l,p)=>{let f=Math.floor(l*10**p+zY);return(Math.round(f)/10**p).toFixed(p)},s=(l,p,f,d)=>{if((o.length===0||!t.colonNotation)&&jY(l)&&!(t.colonNotation&&f==="m"))return;if(d??=String(l),t.colonNotation){let h=d.includes(".")?d.split(".")[0].length:d.length,m=o.length>0?2:1;d="0".repeat(Math.max(0,m-h))+d}else d+=t.verbose?" "+qY(p,l):f;o.push(d)},a=r1(e),c=BigInt(a.days);if(t.hideYearAndDays)s(BigInt(c)*24n+BigInt(a.hours),"hour","h");else{if(t.hideYear)s(c,"day","d");else s(c/365n,"year","y"),s(c%365n,"day","d");s(Number(a.hours),"hour","h")}if(s(Number(a.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1000&&!t.subSecondsAsDecimals){let l=Number(a.seconds),p=Number(a.milliseconds),f=Number(a.microseconds),d=Number(a.nanoseconds);if(s(l,"second","s"),t.formatSubMilliseconds)s(p,"millisecond","ms"),s(f,"microsecond","µs"),s(d,"nanosecond","ns");else{let h=p+f/1000+d/1e6,m=typeof t.millisecondsDecimalDigits==="number"?t.millisecondsDecimalDigits:0,y=h>=1?Math.round(h):Math.ceil(h),g=1000-10**-m,x=m?Math.min(h,g).toFixed(m):Math.min(y,g);s(Number.parseFloat(x),"millisecond","ms",x)}}else{let l=(r?Number(e%GY):e)/1000%60,p=typeof t.secondsDecimalDigits==="number"?t.secondsDecimalDigits:1,f=i(l,p),d=t.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(d),"second","s",d)}if(o.length===0)return n+"0"+(t.verbose?" milliseconds":"ms");let u=t.colonNotation?":":" ";if(typeof t.unitCount==="number")o=o.slice(0,Math.max(t.unitCount,1));return n+o.join(u)}var h8=(e,t)=>{if(e.failed)ro({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})};var y8=(e,t)=>{if(!ac(t))return;h8(e,t),VY(e,t)},VY=(e,t)=>{let r=`(done in ${n1(e.durationMs)})`;ro({type:"duration",verboseMessage:r,verboseInfo:t,result:e})};var gc=(e,t,{reject:r})=>{if(y8(e,t),e.failed&&r)throw e;return e};import{readFileSync as W8}from"node:fs";var o1=(e,t)=>{if(Ks(e))return"asyncGenerator";if(T8(e))return"generator";if(bh(e))return"fileUrl";if(JY(e))return"filePath";if(tZ(e))return"webStream";if(An(e,{checkOpen:!1}))return"native";if(dt(e))return"uint8Array";if(rZ(e))return"asyncIterable";if(nZ(e))return"iterable";if(s1(e))return x8({transform:e},t);if(ZY(e))return WY(e,t);return"native"},WY=(e,t)=>{if(Qw(e.transform,{checkOpen:!1}))return KY(e,t);if(s1(e.transform))return x8(e,t);return YY(e,t)},KY=(e,t)=>(w8(e,t,"Duplex stream"),"duplex"),x8=(e,t)=>(w8(e,t,"web TransformStream"),"webTransform"),w8=({final:e,binary:t,objectMode:r},n,o)=>{g8(e,`${n}.final`,o),g8(t,`${n}.binary`,o),Ap(r,`${n}.objectMode`)},g8=(e,t,r)=>{if(e!==void 0)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},YY=({transform:e,final:t,binary:r,objectMode:n},o)=>{if(e!==void 0&&!b8(e))throw TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Qw(t,{checkOpen:!1}))throw TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(s1(t))throw TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!b8(t))throw TypeError(`The \`${o}.final\` option must be a generator.`);return Ap(r,`${o}.binary`),Ap(n,`${o}.objectMode`),Ks(e)||Ks(t)?"asyncGenerator":"generator"},Ap=(e,t)=>{if(e!==void 0&&typeof e!=="boolean")throw TypeError(`The \`${t}\` option must use a boolean.`)},b8=(e)=>Ks(e)||T8(e),Ks=(e)=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]",T8=(e)=>Object.prototype.toString.call(e)==="[object GeneratorFunction]",ZY=(e)=>Qe(e)&&(e.transform!==void 0||e.final!==void 0),bh=(e)=>Object.prototype.toString.call(e)==="[object URL]",E8=(e)=>bh(e)&&e.protocol!=="file:",JY=(e)=>Qe(e)&&Object.keys(e).length>0&&Object.keys(e).every((t)=>XY.has(t))&&i1(e.file),XY=new Set(["file","append"]),i1=(e)=>typeof e==="string",Cp=(e)=>Qe(e)&&Object.keys(e).length>0&&Object.keys(e).every((t)=>QY.has(t))&&("value"in e),QY=new Set(["value","input"]),v8=(e,t)=>e==="native"&&typeof t==="string"&&!eZ.has(t),eZ=new Set(["ipc","ignore","inherit","overlapped","pipe"]),S8=(e)=>Object.prototype.toString.call(e)==="[object ReadableStream]",xh=(e)=>Object.prototype.toString.call(e)==="[object WritableStream]",tZ=(e)=>S8(e)||xh(e),s1=(e)=>S8(e?.readable)&&xh(e?.writable),rZ=(e)=>A8(e)&&typeof e[Symbol.asyncIterator]==="function",nZ=(e)=>A8(e)&&typeof e[Symbol.iterator]==="function",A8=(e)=>typeof e==="object"&&e!==null,Zr=new Set(["generator","asyncGenerator","duplex","webTransform"]),wh=new Set(["fileUrl","filePath","fileNumber"]),a1=new Set(["fileUrl","filePath"]),C8=new Set([...a1,"webStream","nodeStream"]),D8=new Set(["webTransform","duplex"]),Vi={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var c1=(e,t,r,n)=>n==="output"?oZ(e,t,r):iZ(e,t,r),oZ=(e,t,r)=>{let n=t!==0&&r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:e??n}},iZ=(e,t,r)=>{let n=t===0?e===!0:r[t-1].value.readableObjectMode,o=t!==r.length-1&&(e??n);return{writableObjectMode:n,readableObjectMode:o}},I8=(e,t)=>{let r=e.findLast(({type:n})=>Zr.has(n));if(r===void 0)return!1;return t==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var O8=(e,t,r,n)=>[...e.filter(({type:o})=>!Zr.has(o)),...sZ(e,t,r,n)],sZ=(e,t,r,{encoding:n})=>{let o=e.filter(({type:s})=>Zr.has(s)),i=Array.from({length:o.length});for(let[s,a]of Object.entries(o))i[s]=aZ({stdioItem:a,index:Number(s),newTransforms:i,optionName:t,direction:r,encoding:n});return pZ(i,r)},aZ=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:n,optionName:o,direction:i,encoding:s})=>{if(t==="duplex")return cZ({stdioItem:e,optionName:o});if(t==="webTransform")return uZ({stdioItem:e,index:r,newTransforms:n,direction:i});return lZ({stdioItem:e,index:r,newTransforms:n,direction:i,encoding:s})},cZ=({stdioItem:e,optionName:t})=>{let{value:r}=e,{transform:n}=r,{writableObjectMode:o,readableObjectMode:i}=n,{objectMode:s=i}=r;if(s&&!i)throw TypeError(`The \`${t}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!s&&i)throw TypeError(`The \`${t}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:n,writableObjectMode:o,readableObjectMode:i}}},uZ=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:o})=>{let{transform:i,objectMode:s}=Qe(t)?t:{transform:t},{writableObjectMode:a,readableObjectMode:c}=c1(s,r,n,o);return{...e,value:{transform:i,writableObjectMode:a,readableObjectMode:c}}},lZ=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:o,encoding:i})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:u=!1,objectMode:l}=Qe(t)?t:{transform:t},p=c||Br.has(i),{writableObjectMode:f,readableObjectMode:d}=c1(l,r,n,o);return{...e,value:{transform:s,final:a,binary:p,preserveNewlines:u,writableObjectMode:f,readableObjectMode:d}}},pZ=(e,t)=>t==="input"?e.reverse():e;import u1 from"node:process";var k8=(e,t,r)=>{let n=e.map((o)=>fZ(o,t));if(n.includes("input")&&n.includes("output"))throw TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??yZ},fZ=(e,t)=>mZ[t]??dZ(e),dZ=({type:e,value:t,direction:r,optionName:n})=>{let o=R8[e](t);if(r==="input"&&o==="output")throw TypeError(`The \`${n}\` option is invalid: \`input: true\` cannot be used with a writable value, which is always an output.`);return r??o},mZ=["input","output","output"],bc=()=>{return},l1=()=>"input",R8={generator:bc,asyncGenerator:bc,fileUrl:bc,filePath:bc,iterable:l1,asyncIterable:l1,uint8Array:l1,webStream:(e)=>xh(e)?"output":"input",nodeStream(e){if(!Ws(e,{checkOpen:!1}))return"output";return Xw(e,{checkOpen:!1})?void 0:"input"},webTransform:bc,duplex:bc,native(e){let t=hZ(e);if(t!==void 0)return t;if(An(e,{checkOpen:!1}))return R8.nodeStream(e)}},hZ=(e)=>{if([0,u1.stdin].includes(e))return"input";if([1,2,u1.stdout,u1.stderr].includes(e))return"output"},yZ="output";var P8=(e,t)=>t?[...e,"ipc"]:e;var N8=({stdio:e,ipc:t,buffer:r,...n},o,i)=>{let s=xZ(e,n).map((a,c)=>F8(a,c));return gZ(s),i?TZ(s,r,o):P8(s,t)},gZ=(e)=>{if(e.some((t)=>bZ(t)))throw Error("The `ipc: true` option must be used instead of `stdio: 'ipc'`.")},bZ=(e)=>{if(Array.isArray(e))return e.some((t)=>_8(t));return _8(e)},_8=(e)=>{if(Cp(e))return e.value==="ipc";return e==="ipc"},xZ=(e,t)=>{if(e===void 0)return Yr.map((n)=>t[n]);if(wZ(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${Yr.map((n)=>`\`${n}\``).join(", ")}`);if(typeof e==="string")return[e,e,e];if(!Array.isArray(e))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let r=Math.max(e.length,Yr.length);return Array.from({length:r},(n,o)=>e[o])},wZ=(e)=>Yr.some((t)=>e[t]!==void 0),F8=(e,t)=>{if(Array.isArray(e))return e.map((r)=>F8(r,t));if(e===null||e===void 0)return t>=Yr.length?"ignore":"pipe";return e},TZ=(e,t,r)=>e.map((n,o)=>!t[o]&&o!==0&&!cc(r,o)&&EZ(n,o)?"ignore":n),EZ=(e,t)=>B8(e,t)||Array.isArray(e)&&e.every((r)=>B8(r,t)),B8=(e,t)=>e==="pipe"||vZ(e,t),vZ=(e,t)=>Cp(e)&&e.value==="pipe"&&(e.input===void 0||e.input===!1||SZ(t,e.input)),SZ=(e,t)=>t===!0&&(e===1||e===2);import{readFileSync as IZ}from"node:fs";import OZ from"node:tty";var Eh=(e,t="stdin")=>{let{options:n,fileDescriptors:o}=io.get(e),i=M8(o,t,!0),s=e.stdio[i];if(s===null)throw TypeError(L8(i,t,n,!0));return s},xc=(e,t="stdout")=>{let{options:n,fileDescriptors:o}=io.get(e),i=M8(o,t,!1),s=i==="all"?e.all:e.stdio[i];if(s===null||s===void 0)throw TypeError(L8(i,t,n,!1));return s},io=new WeakMap,M8=(e,t,r)=>{let n=AZ(t,r);return CZ(n,t,r,e),n},AZ=(e,t)=>{let r=Bw(e);if(r!==void 0)return r;let{validOptions:n,defaultValue:o}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${Dp(t)}" must not be "${e}".
274
+ It must be ${n} or "fd3", "fd4" (and so on).
275
+ It is optional and defaults to "${o}".`)},CZ=(e,t,r,n)=>{let o=n[$8(e)];if(o===void 0)throw TypeError(`"${Dp(r)}" must not be ${t}. That file descriptor does not exist.
276
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(o.direction==="input"&&!r)throw TypeError(`"${Dp(r)}" must not be ${t}. It must be a readable stream, not writable.`);if(o.direction!=="input"&&r)throw TypeError(`"${Dp(r)}" must not be ${t}. It must be a writable stream, not readable.
277
+ If you meant to use it as input, please set its "stdio" option to \`{value: 'pipe', input: true}\`.`)},L8=(e,t,r,n)=>{if(e==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:o,optionValue:i}=DZ(e,r);return`The "${o}: ${Th(i)}" option is incompatible with using "${Dp(n)}: ${Th(t)}".
278
+ Please set this option with "pipe" instead.`},DZ=(e,{stdin:t,stdout:r,stderr:n,stdio:o})=>{let i=$8(e);if(i===0&&t!==void 0)return{optionName:"stdin",optionValue:t};if(i===1&&r!==void 0)return{optionName:"stdout",optionValue:r};if(i===2&&n!==void 0)return{optionName:"stderr",optionValue:n};return{optionName:`stdio[${i}]`,optionValue:o[i]}},$8=(e)=>e==="all"?1:e,Dp=(e)=>e?"to":"from",Th=(e)=>{if(typeof e==="string")return`'${e}'`;return typeof e==="number"?`${e}`:"Stream"};var H8=({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:n,direction:o,isSync:i})=>{if(!r||t!=="native")return e;return i?kZ({stdioItem:e,fdNumber:n,direction:o}):_Z({stdioItem:e,fdNumber:n})},kZ=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n,direction:o})=>{let i=RZ({value:t,optionName:r,fdNumber:n,direction:o});if(i!==void 0)return i;if(An(t,{checkOpen:!1}))throw TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},RZ=({value:e,optionName:t,fdNumber:r,direction:n})=>{let o=PZ(e,r);if(o===void 0)return;if(n==="output")return{type:"fileNumber",value:o,optionName:t};if(OZ.isatty(o))throw TypeError(`The \`${t}: ${Th(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Wo(IZ(o)),optionName:t}},PZ=(e,t)=>{if(e==="inherit")return t;if(typeof e==="number")return e;let r=Bm.indexOf(e);if(r!==-1)return r},_Z=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n})=>{if(t==="inherit")return{type:"nodeStream",value:U8(n,t,r),optionName:r};if(typeof t==="number")return{type:"nodeStream",value:U8(t,t,r),optionName:r};if(An(t,{checkOpen:!1}))return{type:"nodeStream",value:t,optionName:r};return e},U8=(e,t,r)=>{let n=Bm[e];if(n===void 0)throw TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return n};var j8=({input:e,inputFile:t},r)=>r===0?[...BZ(e),...FZ(t)]:[],BZ=(e)=>e===void 0?[]:[{type:NZ(e),value:e,optionName:"input"}],NZ=(e)=>{if(Ws(e,{checkOpen:!1}))return"nodeStream";if(typeof e==="string")return"string";if(dt(e))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},FZ=(e)=>e===void 0?[]:[{...MZ(e),optionName:"inputFile"}],MZ=(e)=>{if(bh(e))return{type:"fileUrl",value:e};if(i1(e))return{type:"filePath",value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var q8=(e)=>e.filter((t,r)=>e.every((n,o)=>!LZ(t,n)||r>=o||t.type==="generator"||t.type==="asyncGenerator")),LZ=(e,t)=>e.value===t.value&&e.direction===t.direction,z8=({stdioItem:{type:e,value:t,optionName:r},direction:n,fileDescriptors:o,isSync:i})=>{let s=$Z(o,e);if(s.length===0)return;if(i){UZ({otherStdioItems:s,type:e,value:t,optionName:r,direction:n});return}if(C8.has(e))return G8({otherStdioItems:s,type:e,value:t,optionName:r,direction:n});if(D8.has(e))jZ({otherStdioItems:s,type:e,value:t,optionName:r})},$Z=(e,t)=>e.flatMap(({direction:r,stdioItems:n})=>n.filter((o)=>o.type===t).map((o)=>({...o,direction:r}))),UZ=({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{if(a1.has(t))G8({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})},G8=({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{let i=e.filter((a)=>HZ(a,r));if(i.length===0)return;let s=i.find((a)=>a.direction!==o);return V8(s,n,t),o==="output"?i[0].stream:void 0},HZ=({type:e,value:t},r)=>{if(e==="filePath")return t.file===r.file;if(e==="fileUrl")return t.href===r.href;return t===r},jZ=({otherStdioItems:e,type:t,value:r,optionName:n})=>{let o=e.find(({value:{transform:i}})=>i===r.transform);V8(o,n,t)},V8=(e,t,r)=>{if(e!==void 0)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${Vi[r]} that is the same.`)};var vh=(e,t,r,n)=>{let i=N8(t,r,n).map((a,c)=>qZ({stdioOption:a,fdNumber:c,options:t,isSync:n})),s=eJ({initialFileDescriptors:i,addProperties:e,options:t,isSync:n});return t.stdio=s.map(({stdioItems:a})=>nJ(a)),s},qZ=({stdioOption:e,fdNumber:t,options:r,isSync:n})=>{let o=Nm(t),{stdioItems:i,isStdioArray:s}=zZ({stdioOption:e,fdNumber:t,options:r,optionName:o}),a=k8(i,t,o),c=i.map((p)=>H8({stdioItem:p,isStdioArray:s,fdNumber:t,direction:a,isSync:n})),u=O8(c,o,a,r),l=I8(u,a);return QZ(u,l),{direction:a,objectMode:l,stdioItems:u}},zZ=({stdioOption:e,fdNumber:t,options:r,optionName:n})=>{let o=Array.isArray(e)?e:[e],i=j8(r,t),s=[...GZ(o.map((u)=>WZ(u,n)),i),...i],a=q8(s),c=a.length>1;return YZ(a,c,n),JZ(a),{stdioItems:a,isStdioArray:c}},GZ=(e,t)=>t.length>0&&VZ(e)?[]:e,VZ=(e)=>e.length===1&&e[0].type==="native"&&e[0].value==="inherit",WZ=(e,t)=>{if(Cp(e))return KZ(e,t);return{type:o1(e,t),value:e,optionName:t}},KZ=({value:e,input:t},r)=>(Ap(t,`${r}.input`),{type:o1(e,r),value:e,direction:t?"input":void 0,optionName:r}),YZ=(e,t,r)=>{if(e.length===0)throw TypeError(`The \`${r}\` option must not be an empty array.`);if(!t)return;for(let{value:n,optionName:o}of e)if(ZZ.has(n))throw Error(`The \`${o}\` option must not include \`${n}\`.`)},ZZ=new Set(["ignore"]),JZ=(e)=>{for(let t of e)XZ(t)},XZ=({type:e,value:t,optionName:r})=>{if(E8(t))throw TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
279
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(v8(e,t))throw TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},QZ=(e,t)=>{if(!t)return;let r=e.find(({type:n})=>wh.has(n));if(r!==void 0)throw TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},eJ=({initialFileDescriptors:e,addProperties:t,options:r,isSync:n})=>{let o=[];try{for(let i of e)o.push(tJ({fileDescriptor:i,fileDescriptors:o,addProperties:t,options:r,isSync:n}));return o}catch(i){throw p1(o),i}},tJ=({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:n,addProperties:o,options:i,isSync:s})=>{let a=r.map((c)=>rJ({stdioItem:c,addProperties:o,direction:e,options:i,fileDescriptors:n,isSync:s}));return{direction:e,objectMode:t,stdioItems:a}},rJ=({stdioItem:e,addProperties:t,direction:r,options:n,fileDescriptors:o,isSync:i})=>{let s=z8({stdioItem:e,direction:r,fileDescriptors:o,isSync:i});if(s!==void 0)return{...e,stream:s};return{...e,...t[r][e.type](e,n)}},p1=(e)=>{for(let{stdioItems:t}of e)for(let{stream:r}of t)if(r!==void 0&&!vn(r))r.destroy()},nJ=(e)=>{if(e.length>1)return e.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:t,value:r}]=e;return t==="native"?r:"pipe"};var Y8=(e,t)=>vh(iJ,e,t,!0),so=({type:e,optionName:t})=>{J8(t,Vi[e])},Z8=({optionName:e,value:t})=>{if(t==="overlapped")J8(e,`"${t}"`);return{}},oJ=(e)=>{let{optionName:t,value:r}=e;if(r==="pipe"&&t!=="stdin")throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be an input pipe with synchronous methods.`);return Z8(e)},J8=(e,t)=>{throw TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},K8={generator(){},asyncGenerator:so,webStream:so,nodeStream:so,webTransform:so,duplex:so,asyncIterable:so,native:Z8},iJ={input:{...K8,native:oJ,fileUrl:({value:e})=>({contents:[Wo(W8(e))]}),filePath:({value:{file:e}})=>({contents:[Wo(W8(e))]}),fileNumber:so,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...K8,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:so,string:so,uint8Array:so}};var Jo=(e,{stripFinalNewline:t},r)=>f1(t,r)&&e!==void 0&&!Array.isArray(e)?mc(e):e,f1=(e,t)=>t==="all"?e[1]||e[2]:e[t];import{Transform as CJ,getDefaultHighWaterMark as c3}from"node:stream";var Sh=(e,t,r,n)=>e||r?void 0:Q8(t,n),m1=(e,t,r)=>r?e.flatMap((n)=>X8(n,t)):X8(e,t),X8=(e,t)=>{let{transform:r,final:n}=Q8(t,{});return[...r(e),...n()]},Q8=(e,t)=>(t.previousChunks="",{transform:sJ.bind(void 0,t,e),final:cJ.bind(void 0,t)}),sJ=function*(e,t,r){if(typeof r!=="string"){yield r;return}let{previousChunks:n}=e,o=-1;for(let i=0;i<r.length;i+=1){if(r[i]!==`
280
+ `)continue;let s=aJ(r,i,t,e),a=r.slice(o+1,i+1-s);if(n.length>0)a=d1(n,a),n="";yield a,o=i}if(o!==r.length-1)n=d1(n,r.slice(o+1));e.previousChunks=n},aJ=(e,t,r,n)=>{if(r)return 0;return n.isWindowsNewline=t!==0&&e[t-1]==="\r",n.isWindowsNewline?2:1},cJ=function*({previousChunks:e}){if(e.length>0)yield e},e3=({binary:e,preserveNewlines:t,readableObjectMode:r,state:n})=>e||t||r?void 0:{transform:uJ.bind(void 0,n)},uJ=function*({isWindowsNewline:e=!1},t){let{unixNewline:r,windowsNewline:n,LF:o,concatBytes:i}=typeof t==="string"?lJ:fJ;if(t.at(-1)===o){yield t;return}yield i(t,e?n:r)},d1=(e,t)=>`${e}${t}`,lJ={windowsNewline:`\r
281
+ `,unixNewline:`
282
+ `,LF:`
283
+ `,concatBytes:d1},pJ=(e,t)=>{let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r},fJ={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:pJ};import{Buffer as dJ}from"node:buffer";var t3=(e,t)=>e?void 0:mJ.bind(void 0,t),mJ=function*(e,t){if(typeof t!=="string"&&!dt(t)&&!dJ.isBuffer(t))throw TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},r3=(e,t)=>e?hJ.bind(void 0,t):yJ.bind(void 0,t),hJ=function*(e,t){n3(e,t),yield t},yJ=function*(e,t){if(n3(e,t),typeof t!=="string"&&!dt(t))throw TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},n3=(e,t)=>{if(t===null||t===void 0)throw TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
284
+ Instead, \`yield\` should either be called with a value, or not be called at all. For example:
285
+ if (condition) { yield value; }`)};import{Buffer as gJ}from"node:buffer";import{StringDecoder as bJ}from"node:string_decoder";var Ah=(e,t,r)=>{if(r)return;if(e)return{transform:xJ.bind(void 0,new TextEncoder)};let n=new bJ(t);return{transform:wJ.bind(void 0,n),final:TJ.bind(void 0,n)}},xJ=function*(e,t){if(gJ.isBuffer(t))yield Wo(t);else if(typeof t==="string")yield e.encode(t);else yield t},wJ=function*(e,t){yield dt(t)?e.write(t):t},TJ=function*(e){let t=e.end();if(t!=="")yield t};import{callbackify as o3}from"node:util";var h1=o3(async(e,t,r,n)=>{t.currentIterable=e(...r);try{for await(let o of t.currentIterable)n.push(o)}finally{delete t.currentIterable}}),Ch=async function*(e,t,r){if(r===t.length){yield e;return}let{transform:n=vJ}=t[r];for await(let o of n(e))yield*Ch(o,t,r+1)},i3=async function*(e){for(let[t,{final:r}]of Object.entries(e))yield*EJ(r,Number(t),e)},EJ=async function*(e,t,r){if(e===void 0)return;for await(let n of e())yield*Ch(n,r,t+1)},s3=o3(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),vJ=function*(e){yield e};var y1=(e,t,r,n)=>{try{for(let o of e(...t))r.push(o);n()}catch(o){n(o)}},a3=(e,t)=>[...t.flatMap((r)=>[...Ys(r,e,0)]),...Ip(e)],Ys=function*(e,t,r){if(r===t.length){yield e;return}let{transform:n=AJ}=t[r];for(let o of n(e))yield*Ys(o,t,r+1)},Ip=function*(e){for(let[t,{final:r}]of Object.entries(e))yield*SJ(r,Number(t),e)},SJ=function*(e,t,r){if(e===void 0)return;for(let n of e())yield*Ys(n,r,t+1)},AJ=function*(e){yield e};var g1=({value:e,value:{transform:t,final:r,writableObjectMode:n,readableObjectMode:o},optionName:i},{encoding:s})=>{let a={},c=u3(e,s,i),u=Ks(t),l=Ks(r),p=u?h1.bind(void 0,Ch,a):y1.bind(void 0,Ys),f=u||l?h1.bind(void 0,i3,a):y1.bind(void 0,Ip),d=u||l?s3.bind(void 0,a):void 0;return{stream:new CJ({writableObjectMode:n,writableHighWaterMark:c3(n),readableObjectMode:o,readableHighWaterMark:c3(o),transform(m,y,g){p([m,c,0],this,g)},flush(m){f([c],this,m)},destroy:d})}},Dh=(e,t,r,n)=>{let o=t.filter(({type:s})=>s==="generator"),i=n?o.reverse():o;for(let{value:s,optionName:a}of i){let c=u3(s,r,a);e=a3(c,e)}return e},u3=({transform:e,final:t,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:i},s,a)=>{let c={};return[{transform:t3(n,a)},Ah(r,s,n),Sh(r,i,n,c),{transform:e,final:t},{transform:r3(o,a)},e3({binary:r,preserveNewlines:i,readableObjectMode:o,state:c})].filter(Boolean)};var l3=(e,t)=>{for(let r of DJ(e))IJ(e,r,t)},DJ=(e)=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),IJ=(e,t,r)=>{let{stdioItems:n}=e[t],o=n.filter(({contents:a})=>a!==void 0);if(o.length===0)return;if(t!==0){let[{type:a,optionName:c}]=o;throw TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${Vi[a]} with synchronous methods.`)}let s=o.map(({contents:a})=>a).map((a)=>OJ(a,n));r.input=mp(s)},OJ=(e,t)=>{let r=Dh(e,t,"utf8",!0);return kJ(r),mp(r)},kJ=(e)=>{let t=e.find((r)=>typeof r!=="string"&&!dt(r));if(t!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)};import{writeFileSync as BJ,appendFileSync as NJ}from"node:fs";var Ih=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:n})=>n!=="all"&&cc(r,n)&&!Br.has(t)&&RJ(n)&&(e.some(({type:o,value:i})=>o==="native"&&PJ.has(i))||e.every(({type:o})=>Zr.has(o))),RJ=(e)=>e===1||e===2,PJ=new Set(["pipe","overlapped"]),p3=async(e,t,r,n)=>{for await(let o of e)if(!_J(t))d3(o,r,n)},f3=(e,t,r)=>{for(let n of e)d3(n,t,r)},_J=(e)=>e._readableState.pipes.length>0,d3=(e,t,r)=>{let n=Hm(e);ro({type:"output",verboseMessage:n,fdNumber:t,verboseInfo:r})};var m3=({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:n,verboseInfo:o})=>{if(t===null)return{output:Array.from({length:3})};let i={},s=new Set;return{output:t.map((c,u)=>FJ({result:c,fileDescriptors:e,fdNumber:u,state:i,outputFiles:s,isMaxBuffer:n,verboseInfo:o},r)),...i}},FJ=({result:e,fileDescriptors:t,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:i,verboseInfo:s},{buffer:a,encoding:c,lines:u,stripFinalNewline:l,maxBuffer:p})=>{if(e===null)return;let f=l8(e,i,p),d=Wo(f),{stdioItems:h,objectMode:m}=t[r],y=MJ([d],h,c,n),{serializedResult:g,finalResult:x=g}=LJ({chunks:y,objectMode:m,encoding:c,lines:u,stripFinalNewline:l,fdNumber:r});$J({serializedResult:g,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:h,objectMode:m});let b=a[r]?x:void 0;try{if(n.error===void 0)UJ(g,h,o);return b}catch(w){return n.error=w,b}},MJ=(e,t,r,n)=>{try{return Dh(e,t,r,!1)}catch(o){return n.error=o,e}},LJ=({chunks:e,objectMode:t,encoding:r,lines:n,stripFinalNewline:o,fdNumber:i})=>{if(t)return{serializedResult:e};if(r==="buffer")return{serializedResult:mp(e)};let s=sD(e,r);if(n[i])return{serializedResult:s,finalResult:m1(s,!o[i],t)};return{serializedResult:s}},$J=({serializedResult:e,fdNumber:t,state:r,verboseInfo:n,encoding:o,stdioItems:i,objectMode:s})=>{if(!Ih({stdioItems:i,encoding:o,verboseInfo:n,fdNumber:t}))return;let a=m1(e,!1,s);try{f3(a,t,n)}catch(c){r.error??=c}},UJ=(e,t,r)=>{let n=t.filter(({type:o})=>wh.has(o));for(let{path:o,append:i}of n){let s=typeof o==="string"?o:o.toString();if(i||r.has(s))NJ(o,e);else r.add(s),BJ(o,e)}};var h3=([,e,t],r)=>{if(!r.all)return;if(e===void 0)return t;if(t===void 0)return e;if(Array.isArray(e))return Array.isArray(t)?[...e,...t]:[...e,Jo(t,r,"all")];if(Array.isArray(t))return[Jo(e,r,"all"),...t];if(dt(e)&&dt(t))return Rw([e,t]);return`${e}${t}`};import{once as b1}from"node:events";var y3=async(e,t)=>{let[r,n]=await HJ(e);return t.isForcefullyTerminated??=!1,[r,n]},HJ=async(e)=>{let[t,r]=await Promise.allSettled([b1(e,"spawn"),b1(e,"exit")]);if(t.status==="rejected")return[];return r.status==="rejected"?g3(e):r.value},g3=async(e)=>{try{return await b1(e,"exit")}catch{return g3(e)}},b3=async(e)=>{let[t,r]=await e;if(!jJ(t,r)&&x1(t,r))throw new no;return[t,r]},jJ=(e,t)=>e===void 0&&t===void 0,x1=(e,t)=>e!==0||t!==null;var x3=({error:e,status:t,signal:r,output:n},{maxBuffer:o})=>{let i=qJ(e,t,r),s=i?.code==="ETIMEDOUT",a=u8(i,n,o);return{resultError:i,exitCode:t,signal:r,timedOut:s,isMaxBuffer:a}},qJ=(e,t,r)=>{if(e!==void 0)return e;return x1(t,r)?new no:void 0};var w3=(e,t,r)=>{let{file:n,commandArguments:o,command:i,escapedCommand:s,startTime:a,verboseInfo:c,options:u,fileDescriptors:l}=GJ(e,t,r),p=KJ({file:n,commandArguments:o,options:u,command:i,escapedCommand:s,verboseInfo:c,fileDescriptors:l,startTime:a});return gc(p,c,u)},GJ=(e,t,r)=>{let{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=qm(e,t,r),a=VJ(r),{file:c,commandArguments:u,options:l}=ah(e,t,a);WJ(l);let p=Y8(l,s);return{file:c,commandArguments:u,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:l,fileDescriptors:p}},VJ=(e)=>e.node&&!e.ipc?{...e,ipc:!1}:e,WJ=({ipc:e,ipcInput:t,detached:r,cancelSignal:n,killDescendants:o})=>{if(t)Op("ipcInput");if(e)Op("ipc: true");if(r)Op("detached: true");if(o)Op("killDescendants: true");if(n)Op("cancelSignal")},Op=(e)=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},KJ=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,verboseInfo:i,fileDescriptors:s,startTime:a})=>{let c=YJ({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:u,exitCode:l,signal:p,timedOut:f,isMaxBuffer:d}=x3(c,r),{output:h,error:m=u}=m3({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:d,verboseInfo:i}),y=h.map((x,b)=>Jo(x,r,b)),g=Jo(h3(h,r),r,"all");return JJ({error:m,exitCode:l,signal:p,timedOut:f,isMaxBuffer:d,stdio:y,all:g,options:r,command:n,escapedCommand:o,startTime:a})},YJ=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:i,startTime:s})=>{try{l3(i,r);let a=ZJ(r);return zJ(...ch(e,t,a))}catch(a){return yc({error:a,command:n,escapedCommand:o,fileDescriptors:i,options:r,startTime:s,isSync:!0})}},ZJ=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:yh(t)}),JJ=({error:e,exitCode:t,signal:r,timedOut:n,isMaxBuffer:o,stdio:i,all:s,options:a,command:c,escapedCommand:u,startTime:l})=>e===void 0?gh({command:c,escapedCommand:u,stdio:i,all:s,ipcOutput:[],options:a,startTime:l}):Sp({error:e,command:c,escapedCommand:u,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:i,all:s,ipcOutput:[],options:a,startTime:l,isSync:!0});import{setMaxListeners as oee}from"node:events";import{spawn as iee}from"node:child_process";import A3 from"node:process";import{once as w1,on as XJ}from"node:events";var T1=Symbol("internalGetOneMessageOptions"),T3=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},o={})=>{let{reference:i=!0,filter:s}=o,{signal:a}=o[T1]??{};return uc({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:th(e)}),QJ({anyProcess:e,channel:t,isSubprocess:r,filter:s,reference:i,signal:a})},QJ=async({anyProcess:e,channel:t,isSubprocess:r,filter:n,reference:o,signal:i})=>{Jm(t,o);let s=Gi(e,t,r),a=new AbortController;eX(i,a);try{return await Promise.race([tX(s,n,a),rX(s,r,a),nX(s,r,a)])}catch(c){throw lc(e),c}finally{a.abort(),Xm(t,o)}},eX=(e,t)=>{if(e===void 0)return;if(e.aborted){t.abort();return}e.addEventListener("abort",()=>{t.abort()},{once:!0,signal:t.signal})},tX=async(e,t,{signal:r})=>{if(t===void 0){let[n]=await w1(e,"message",{signal:r});return n}for await(let[n]of XJ(e,"message",{signal:r}))if(t(n))return n},rX=async(e,t,{signal:r})=>{await w1(e,"disconnect",{signal:r}),QD(t)},nX=async(e,t,{signal:r})=>{let[n]=await w1(e,"strict:error",{signal:r});throw Zm(n,t)};import{once as v3,on as oX}from"node:events";var E1=Symbol("internalGetEachMessageOptions"),S3=(e,t={})=>{let{reference:r=!0}=t,{signal:n,shouldAwait:o=!e.isSubprocess}=t[E1]??{};return v1({...e,shouldAwait:o,reference:r,signal:n})},v1=({anyProcess:e,waitProcess:t=e,channel:r,isSubprocess:n,ipc:o,shouldAwait:i,reference:s,signal:a})=>{uc({methodName:"getEachMessage",isSubprocess:n,ipc:o,isConnected:th(e)}),Jm(r,s);let c=Gi(e,r,n),u=new AbortController,l={};return iX(a,u),sX(e,c,u),aX({ipcEmitter:c,isSubprocess:n,controller:u,state:l}),cX({anyProcess:e,waitProcess:t,channel:r,ipcEmitter:c,isSubprocess:n,shouldAwait:i,controller:u,state:l,reference:s})},iX=(e,t)=>{if(e===void 0)return;if(e.aborted){t.abort();return}e.addEventListener("abort",()=>{t.abort()},{once:!0,signal:t.signal})},sX=async(e,t,r)=>{try{await v3(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},aX=async({ipcEmitter:e,isSubprocess:t,controller:r,state:n})=>{try{let[o]=await v3(e,"strict:error",{signal:r.signal});n.error=Zm(o,t),r.abort()}catch{}},cX=async function*({anyProcess:e,waitProcess:t,channel:r,ipcEmitter:n,isSubprocess:o,shouldAwait:i,controller:s,state:a,reference:c}){try{for await(let[u]of oX(n,"message",{signal:s.signal}))E3(a),yield u}catch{E3(a)}finally{if(s.abort(),Xm(r,c),!o)lc(e);if(i)await t}},E3=({error:e})=>{if(e)throw e};var C3=(e,t,{ipc:r})=>{Object.assign(e,I3(t,!1,r,e))},D3=()=>{let e=A3,t=!0,r=A3.channel!==void 0;return{...I3(e,!0,r),getCancelSignal:CI.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:!0,ipc:r})}},I3=(e,t,r,n=e)=>({sendMessage:pc.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:T3.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:S3.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r,waitProcess:n})});import{ChildProcess as uX}from"node:child_process";import{PassThrough as lX,Readable as k3,Writable as R3,Duplex as P3}from"node:stream";var _3=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,verboseInfo:s})=>{p1(n);let a=new uX,c=pX(a,n),u=yc({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:!1}),l=hX(u,s,o);return{subprocess:a,promise:l,all:o.all?c:void 0,convertedStreams:{readable:B3,writable:N3,duplex:F3,readableStream:fX,writableStream:dX,transformStream:mX,iterable:O3,[Symbol.asyncIterator]:O3}}},pX=(e,t)=>{let r=kp(),n=kp(),o=kp(),i=Array.from({length:t.length-3},kp),s=kp(),a=[r,n,o,...i];return Object.assign(e,{stdin:r,stdout:n,stderr:o,stdio:a}),s},kp=()=>{let e=new lX;return e.end(),e},B3=()=>new k3({read(){}}),N3=()=>new R3({write(){}}),F3=()=>new P3({read(){},write(){}}),fX=()=>k3.toWeb(B3()),dX=()=>R3.toWeb(N3()),mX=()=>P3.toWeb(F3()),O3=async function*(){},hX=async(e,t,r)=>gc(e,t,r);import{createReadStream as M3,createWriteStream as L3}from"node:fs";import{Buffer as yX}from"node:buffer";import{Readable as Rp,Writable as gX,Duplex as bX}from"node:stream";var U3=(e,t)=>vh(xX,e,t,!1),Pp=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${Vi[e]}.`)},$3={fileNumber:Pp,generator:g1,asyncGenerator:g1,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){let n=t||r;return{stream:bX.fromWeb(e,{objectMode:n})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},xX={input:{...$3,fileUrl:({value:e})=>({stream:M3(e)}),filePath:({value:{file:e}})=>({stream:M3(e)}),webStream:({value:e})=>({stream:Rp.fromWeb(e)}),iterable:({value:e})=>({stream:Rp.from(e)}),asyncIterable:({value:e})=>({stream:Rp.from(e)}),string:({value:e})=>({stream:Rp.from(e)}),uint8Array:({value:e})=>({stream:Rp.from(yX.from(e))})},output:{...$3,fileUrl:({value:e})=>({stream:L3(e)}),filePath:({value:{file:e,append:t}})=>({stream:L3(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:gX.fromWeb(e)}),iterable:Pp,asyncIterable:Pp,string:Pp,uint8Array:Pp}};import{on as wX,once as H3}from"node:events";import{PassThrough as TX,getDefaultHighWaterMark as EX}from"node:stream";import{finished as z3}from"node:stream/promises";function Zs(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let o of e)S1(o);let t=e.some(({readableObjectMode:o})=>o),r=vX(e,t),n=new G3({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of e)n.add(o);return n}var vX=(e,t)=>{if(e.length===0)return EX(t);let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)};class G3 extends TX{#n=new Set([]);#r=new Set([]);#t=new Set([]);#e;#i=Symbol("unpipe");#o=new WeakMap;add(e){if(S1(e),this.#n.has(e))return;this.#n.add(e),this.#e??=SX(this,this.#n,this.#i);let t=DX({passThroughStream:this,stream:e,streams:this.#n,ended:this.#r,aborted:this.#t,onFinished:this.#e,unpipeEvent:this.#i});this.#o.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(S1(e),!this.#n.has(e))return!1;let t=this.#o.get(e);if(t===void 0)return!1;return this.#o.delete(e),e.unpipe(this),await t,!0}}var SX=async(e,t,r)=>{Oh(e,j3);let n=new AbortController;try{await Promise.race([AX(e,n),CX(e,t,r,n)])}finally{n.abort(),Oh(e,-j3)}},AX=async(e,{signal:t})=>{try{await z3(e,{signal:t,cleanup:!0})}catch(r){throw V3(e,r),r}},CX=async(e,t,r,{signal:n})=>{for await(let[o]of wX(e,"unpipe",{signal:n}))if(t.has(o))o.emit(r)},S1=(e)=>{if(typeof e?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},DX=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i,unpipeEvent:s})=>{Oh(e,q3);let a=new AbortController;try{await Promise.race([IX(i,t,a),OX({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:a}),kX({stream:t,streams:r,ended:n,aborted:o,unpipeEvent:s,controller:a})])}finally{a.abort(),Oh(e,-q3)}if(r.size>0&&r.size===n.size+o.size)if(n.size===0&&o.size>0)A1(e);else RX(e)},IX=async(e,t,{signal:r})=>{try{if(await e,!r.aborted)A1(t)}catch(n){if(!r.aborted)V3(t,n)}},OX=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{if(await z3(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t))n.add(t)}catch(s){if(i.aborted||!r.has(t))return;if(W3(s))o.add(t);else K3(e,s)}},kX=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:o,controller:{signal:i}})=>{if(await H3(e,o,{signal:i}),!e.readable)return H3(i,"abort",{signal:i});t.delete(e),r.delete(e),n.delete(e)},RX=(e)=>{if(e.writable)e.end()},V3=(e,t)=>{if(W3(t))A1(e);else K3(e,t)},W3=(e)=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",A1=(e)=>{if(e.readable||e.writable)e.destroy()},K3=(e,t)=>{if(!e.destroyed)e.once("error",PX),e.destroy(t)},PX=()=>{},Oh=(e,t)=>{let r=e.getMaxListeners();if(r!==0&&r!==Number.POSITIVE_INFINITY)e.setMaxListeners(r+t)},j3=2,q3=1;import{finished as Y3}from"node:stream/promises";var wc=(e,t)=>{e.pipe(t),_X(e,t),BX(e,t)},_X=async(e,t)=>{if(vn(e)||vn(t))return;try{await Y3(e,{cleanup:!0,readable:!0,writable:!1})}catch{}C1(t)},C1=(e)=>{if(e.writable)e.end()},BX=async(e,t)=>{if(vn(e)||vn(t))return;try{await Y3(t,{cleanup:!0,readable:!1,writable:!0})}catch{}D1(e)},D1=(e)=>{if(e.readable)e.destroy()};var Z3=(e,t,r)=>{let n=new Map;for(let[o,{stdioItems:i,direction:s}]of Object.entries(t)){let a=i.filter(({type:u})=>Zr.has(u));for(let{stream:u}of a)NX(e,u,s,o);let c=i.filter(({type:u})=>!Zr.has(u));for(let{stream:u}of c)MX({subprocess:e,stream:u,direction:s,fdNumber:o,pipeGroups:n,controller:r})}for(let[o,i]of n){let s=i.length===1?i[0]:Zs(i);wc(s,o)}},NX=(e,t,r,n)=>{if(r==="output")wc(e.stdio[n],t);else wc(t,e.stdio[n]);let o=FX[n];if(o!==void 0)e[o]=t;e.stdio[n]=t},FX=["stdin","stdout","stderr"],MX=({subprocess:e,stream:t,direction:r,fdNumber:n,pipeGroups:o,controller:i})=>{if(t===void 0)return;LX(t,i);let[s,a]=r==="output"?[t,e.stdio[n]]:[e.stdio[n],t],c=o.get(s)??[];o.set(s,[...c,a])},LX=(e,{signal:t})=>{if(vn(e))Gs(e,$X,t)},$X=2;import kh from"node:process";import{execFile as UX}from"node:child_process";import J3 from"node:path/win32";var X3=kh.platform==="win32",Q3=(e)=>e.killDescendants&&!X3?{...e,detached:!0}:e,eO=(e,{killDescendants:t})=>{if(!t)return e.kill.bind(e);return(X3?jX:HX).bind(void 0,e)},HX=(e,t)=>{if(e.pid===void 0)return!1;try{return kh.kill(-e.pid,t)}catch{return e.kill(t)}},jX=(e,t)=>{if(e.pid===void 0)return!1;let r=qX();if(r===void 0)return e.kill(t);return UX(r,["/pid",`${e.pid}`,"/T","/F"],(n)=>{if(n)e.kill(t)}),!0},qX=()=>{let e=[kh.env.SystemRoot,kh.env.windir].find((t)=>t&&zX(t));return e===void 0?void 0:J3.join(e,"System32","taskkill.exe")},zX=(e)=>{let{root:t}=J3.parse(e);return/^[a-z]:[/\\]/i.test(t)};Ph();import{addAbortListener as WX}from"node:events";var iO=(e,{cleanup:t,detached:r},{signal:n})=>{if(!t||r)return;let o=Tc(()=>{e()});WX(n,()=>{o()})};var _h=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),_p=(e,t,r)=>{let n=e[r];if(!n.has(t))n.set(t,[]);let o=n.get(t),i=oo();return o.push(i),{resolve:i.resolve.bind(i),promises:o}},Ec=async({resolve:e,promises:t},r)=>{e();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!n};import{on as KX}from"node:events";import{getDefaultHighWaterMark as YX}from"node:stream";var Bh=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:n,encoding:o,preserveNewlines:i})=>{let s=new AbortController;return ZX(t,s),aO({stream:e,controller:s,binary:r,shouldEncode:!e.readableObjectMode&&n,encoding:o,shouldSplit:!e.readableObjectMode,preserveNewlines:i})},ZX=async(e,t)=>{try{await e}catch{}finally{t.abort()}},P1=({stream:e,onStreamEnd:t,lines:r,encoding:n,stripFinalNewline:o,allMixed:i})=>{let s=new AbortController;JX(t,s,e);let a=e.readableObjectMode&&!i;return aO({stream:e,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!o})},JX=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},aO=({stream:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})=>{let a=KX(e,"data",{signal:t.signal,highWaterMark:sO,highWatermark:sO});return XX({onStdoutChunk:a,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})},_1=YX(!0),sO=_1,XX=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s}){let a=QX({binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s});try{for await(let[c]of e)yield*Ys(c,a,0)}catch(c){if(!t.signal.aborted)throw c}finally{yield*Ip(a)}},QX=({binary:e,shouldEncode:t,encoding:r,shouldSplit:n,preserveNewlines:o})=>[Ah(e,r,!t),Sh(e,o,!n,{})].filter(Boolean);var vc=(e,t,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{let i=n||Br.has(t),s=xc(e,r),a=Bh({subprocessStdout:s,subprocess:e,binary:i,shouldEncode:!0,encoding:t,preserveNewlines:o});return eQ(a,s,e)},eQ=async function*(e,t,r){try{yield*e}finally{if(t.readable)t.destroy();await r}};import{Readable as aQ}from"node:stream";import{callbackify as cQ}from"node:util";import{finished as uO}from"node:stream/promises";import{finished as tQ}from"node:stream/promises";var Bp=async(e,t,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{let i=rQ(e,r),s=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],tQ(e,{cleanup:!0,signal:s.signal})])}catch(a){if(!i.stdinCleanedUp)iQ(a,t,r,n)}finally{s.abort()}},rQ=(e,{originalStreams:t,subprocess:r})=>{let[n]=t,o={stdinCleanedUp:!1};if(e===n)nQ(e,r,o);return o},nQ=(e,t,r)=>{let{_destroy:n}=e;e._destroy=(...o)=>{oQ(t,r),n.call(e,...o)}},oQ=({exitCode:e,signalCode:t},r)=>{if(e!==null||t!==null)r.stdinCleanedUp=!0},iQ=(e,t,r,n)=>{if(!sQ(e,t,r,n))throw e},sQ=(e,t,r,n=!0)=>{if(r.propagating)return cO(e)||Sc(e);return r.propagating=!0,B1(r,t)===n?cO(e):Sc(e)},B1=({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input",Sc=(e)=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",cO=(e)=>e?.code==="EPIPE";var N1=async(e)=>{if(e===void 0)return;try{await F1(e)}catch{}},lO=async(e)=>{if(e===void 0)return;try{await M1(e)}catch{}},F1=async(e)=>{await uO(e,{cleanup:!0,readable:!1,writable:!0})},M1=async(e)=>{await uO(e,{cleanup:!0,readable:!0,writable:!1})},Nh=async(e,t)=>{if(await e,t)throw t},Fh=(e,t,r)=>{if(r&&!Sc(r))e.destroy(r);else if(t)e.destroy()};var Mh=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,binary:o=!0,preserveNewlines:i=!0}={})=>{let s=o||Br.has(r),{subprocessStdout:a,waitReadableDestroy:c}=L1(e,n,t),{readableEncoding:u,readableObjectMode:l,readableHighWaterMark:p}=$1(a,s),{read:f,onStdoutDataDone:d}=U1({subprocessStdout:a,subprocess:e,binary:s,encoding:r,preserveNewlines:i}),h=new aQ({read:f,destroy:cQ(j1.bind(void 0,{subprocessStdout:a,subprocess:e,waitReadableDestroy:c})),highWaterMark:p,objectMode:l,encoding:u});return H1({subprocessStdout:a,onStdoutDataDone:d,readable:h,subprocess:e}),h},L1=(e,t,r)=>{let n=xc(e,t),o=_p(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:o}},$1=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},n)=>n?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:_1},U1=({subprocessStdout:e,subprocess:t,binary:r,encoding:n,preserveNewlines:o})=>{let i=oo(),s=Bh({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){uQ(this,s,i)},onStdoutDataDone:i}},uQ=async(e,t,r)=>{try{let{value:n,done:o}=await t.next();if(o)r.resolve();else e.push(n)}catch{}},H1=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:n,subprocessStdin:o})=>{try{if(await M1(e),await n,await N1(o),await t,r.readable)r.push(null)}catch(i){await N1(o),pO(r,await lQ(n,i))}},lQ=async(e,t)=>{if(t.code!=="ERR_STREAM_PREMATURE_CLOSE")return t;try{await e}catch(r){return r}return t},j1=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},n)=>{if(!await Ec(r,t))return;pO(e,n),await Nh(t,n)},pO=(e,t)=>{Fh(e,e.readable,t)};import{Readable as pQ,Writable as fQ,Duplex as dQ}from"node:stream";var Lh=(e,t)=>pQ.toWeb(e.readable(t)),fO=(e,t)=>fQ.toWeb(e.writable(t)),dO=(e,t)=>dQ.toWeb(e.duplex(t));var hO=({source:e,sourcePromise:t,boundOptions:r,createNested:n},...o)=>{let i=jm(),{destination:s,destinationStream:a,destinationError:c,from:u,unpipeSignal:l}=mQ(r,n,o),{sourceStream:p,sourceError:f}=yQ(e,u),{options:d,fileDescriptors:h}=io.get(e);return{sourcePromise:t,sourceStream:p,sourceOptions:d,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:l,fileDescriptors:h,startTime:i}},mQ=(e,t,r)=>{try{let{destination:n,pipeOptions:{from:o,to:i,unpipeSignal:s}={}}=hQ(e,t,...r),a=Eh(n,i);return{destination:n,destinationStream:a,from:o,unpipeSignal:s}}catch(n){return{destinationError:n}}},hQ=(e,t,r,...n)=>{if(Array.isArray(r))return{destination:t(mO,e)(r,...n),pipeOptions:e};if(typeof r==="string"||r instanceof URL||Ow(r)){if(Object.keys(e).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[o,i,s]=Pm(r,...n);return{destination:t(mO)(o,i,s),pipeOptions:s}}if(io.has(r)){if(Object.keys(e).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},mO=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),yQ=(e,t)=>{try{return{sourceStream:xc(e,t)}}catch(r){return{sourceError:r}}};var gO=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:i,startTime:s})=>{let a=gQ({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n});if(a!==void 0)throw q1({error:a,fileDescriptors:o,sourceOptions:i,startTime:s})},gQ=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n})=>{if(t!==void 0&&n!==void 0)return n;if(n!==void 0)return D1(e),n;if(t!==void 0)return C1(r),t},q1=({error:e,fileDescriptors:t,sourceOptions:r,startTime:n})=>yc({error:e,command:yO,escapedCommand:yO,fileDescriptors:t,options:r,startTime:n,isSync:!1}),yO="source.pipe(destination)";var bO=async(e)=>{let[{status:t,reason:r,value:n=r},{status:o,reason:i,value:s=i}]=await e;if(!s.pipedFrom.includes(n))s.pipedFrom.push(n);if(o==="rejected")throw s;if(t==="rejected")throw n;return s};import{finished as bQ}from"node:stream/promises";var xO=(e,t,r)=>{let n=$h.has(t)?wQ(e,t):xQ(e,t);return Gs(e,EQ,r.signal),Gs(t,vQ,r.signal),TQ(t),n},xQ=(e,t)=>{let r=Zs([e]);return wc(r,t),$h.set(t,r),r},wQ=(e,t)=>{let r=$h.get(t);return r.add(e),r},TQ=async(e)=>{try{await bQ(e,{cleanup:!0,readable:!1,writable:!0})}catch{}$h.delete(e)},$h=new WeakMap,EQ=2,vQ=1;import{aborted as SQ}from"node:util";var wO=(e,t)=>e===void 0?[]:[AQ(e,t)],AQ=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:i})=>{await SQ(e,t),await r.remove(t);let s=Error("Pipe canceled by `unpipeSignal` option.");throw q1({error:s,fileDescriptors:n,sourceOptions:o,startTime:i})};var Uh=(e,...t)=>{if(Qe(t[0]))return Uh.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:r,...n}=hO(e,...t),o=new AbortController,i=LQ({...n,destination:r,pipeFailureController:o});return i.pipe=Uh.bind(void 0,{...e,source:r,sourcePromise:i,boundOptions:{}}),CQ(i,r,o.signal),i},CQ=(e,t,r)=>{if(t===void 0)return;DQ(e,t),RQ(e,t,r)},DQ=(e,t)=>{let r=io.get(t);io.set(e,r),e.stdio=t.stdio,e.all=t.all;let{options:{encoding:n}}=r,o=_h();e[Symbol.asyncIterator]=vc.bind(void 0,e,n,{}),e.iterable=vc.bind(void 0,e,n),e.readable=OQ.bind(void 0,e,{subprocess:e,concurrentStreams:o,encoding:n}),e.readableStream=Lh.bind(void 0,e),IQ(e,t)},IQ=(e,t)=>{if(t.all===void 0){e.all=void 0;return}Object.defineProperty(e,"all",{get(){TO(e,t.all);let r=e.readable({from:"all"});return TO(e,r),r},enumerable:!0,configurable:!0})},TO=(e,t)=>{Object.defineProperty(e,"all",{value:t,writable:!0,enumerable:!0,configurable:!0})},OQ=(e,t,...r)=>{let n=Mh(t,...r);return kQ(e,n),n},kQ=async(e,t)=>{try{await e}catch(r){t.destroy(r)}},RQ=(e,t,r)=>{e.sendMessage=t.sendMessage,e.getOneMessage=PQ.bind(void 0,t,r),e.getEachMessage=NQ.bind(void 0,e,t,r)},PQ=(e,t,...r)=>{let n=new AbortController,o=e.getOneMessage(...EO(r,n.signal,T1));return _Q(t,o,n)},_Q=async(e,t,r)=>{try{return await Promise.race([t,BQ(e,r.signal)])}finally{r.abort()}},BQ=(e,t)=>new Promise((r,n)=>{if(e.aborted){n(e.reason);return}e.addEventListener("abort",()=>{n(e.reason)},{once:!0,signal:t})}),NQ=(e,t,r,...n)=>{let o=new AbortController,i=t.getEachMessage(...EO(n,o.signal,E1));return MQ(r,o),FQ(e,i,o)},FQ=async function*(e,t,r){try{yield*t}finally{r.abort(),await e}},EO=(e,t,r)=>{if(e[0]===null)return e;let[n]=e;return[{...n,[r]:{signal:t,shouldAwait:!1}}]},MQ=(e,t)=>{if(e.aborted){t.abort();return}e.addEventListener("abort",()=>{t.abort()},{once:!0,signal:t.signal})},LQ=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:n,destination:o,destinationStream:i,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:u,pipeFailureController:l})=>{let p=new AbortController;try{let f=$Q(e,o);gO({sourceStream:t,sourceError:n,destinationStream:i,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:u});let d=xO(t,i,p);return await Promise.race([bO(f),...wO(a,{sourceStream:t,mergedStream:d,sourceOptions:r,fileDescriptors:c,startTime:u})])}catch(f){throw l.abort(f),f}finally{p.abort()}},$Q=(e,t)=>Promise.allSettled([e,t]);import{setImmediate as UQ}from"node:timers/promises";var vO=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,buffer:o,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:u,streamInfo:l})=>{let p=HQ({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:a,verboseInfo:u,streamInfo:l});if(!o){await Promise.all([jQ(e),p]);return}let f=f1(c,r),d=P1({stream:e,onStreamEnd:t,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[h]=await Promise.all([qQ({stream:e,iterable:d,fdNumber:r,encoding:n,maxBuffer:i,lines:s}),p]);return h},HQ=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:o,verboseInfo:i,streamInfo:{fileDescriptors:s}})=>{if(!Ih({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:i,fdNumber:r}))return;let a=P1({stream:e,onStreamEnd:t,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await p3(a,e,r,i)},jQ=async(e)=>{if(await UQ(),e.readableFlowing===null)e.resume()},qQ=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:n,encoding:o,maxBuffer:i,lines:s})=>{try{if(t||s)return await fh(r,{maxBuffer:i});if(o==="buffer")return new Uint8Array(await dh(r,{maxBuffer:i}));return await hh(r,{maxBuffer:i})}catch(a){return SO(s8({error:a,stream:e,readableObjectMode:t,lines:s,encoding:o,fdNumber:n}))}},z1=async(e)=>{try{return await e}catch(t){return SO(t)}},SO=({bufferedData:e})=>oD(e)?new Uint8Array(e):e;var AO=({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:a})=>e.stdio.map((c,u)=>G1({stream:c,fdNumber:u,encoding:t,buffer:r[u],maxBuffer:n[u],lines:o[u],allMixed:!1,stripFinalNewline:i,verboseInfo:s,streamInfo:a})),G1=async({stream:e,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:u})=>{if(!e)return;let l=Bp(e,t,u);if(B1(u,t)){await l;return}let[p]=await Promise.all([vO({stream:e,onStreamEnd:l,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:u}),l]);return p};var CO=({stdout:e,stderr:t},{all:r})=>r&&(e||t)?Zs([e,t].filter(Boolean)):void 0,DO=({subprocess:e,all:t,encoding:r,buffer:n,maxBuffer:o,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:c})=>G1({...zQ(e,t,n),fdNumber:"all",encoding:r,maxBuffer:o[1]+o[2],lines:i[1]||i[2],allMixed:GQ(e,t),stripFinalNewline:s,verboseInfo:a,streamInfo:c}),zQ=({stdout:e,stderr:t},r,[,n,o])=>{let i=n||o;if(!i)return{stream:r,buffer:i};if(!n)return{stream:t,buffer:i};if(!o)return{stream:e,buffer:i};return{stream:r,buffer:i}},GQ=({stdout:e,stderr:t},r)=>r&&e&&t&&e.readableObjectMode!==t.readableObjectMode;import{once as VQ}from"node:events";var IO=(e)=>cc(e,"ipc"),OO=(e,t)=>{let r=Hm(e);ro({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})};var kO=async({subprocess:e,buffer:t,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:i})=>{if(!n)return o;let s=IO(i),a=Ko(t,"ipc"),c=Ko(r,"ipc");for await(let u of v1({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0})){if(a)a8(e,o,c),o.push(u);if(s)OO(u,i)}return o},RO=async(e,t)=>(await Promise.allSettled([e]),t);var PO=async({subprocess:e,kill:t,all:r,options:{encoding:n,buffer:o,maxBuffer:i,lines:s,timeoutDuration:a,cancelSignal:c,gracefulCancel:u,forceKillAfterDelay:l,stripFinalNewline:p,ipc:f,ipcInput:d},context:h,verboseInfo:m,fileDescriptors:y,originalStreams:g,onInternalError:x,controller:b})=>{let w=y3(e,h),v={originalStreams:g,fileDescriptors:y,subprocess:e,exitPromise:w,propagating:!1},D=AO({subprocess:e,encoding:n,buffer:o,maxBuffer:i,lines:s,stripFinalNewline:p,verboseInfo:m,streamInfo:v}),O=DO({subprocess:e,all:r,encoding:n,buffer:o,maxBuffer:i,lines:s,stripFinalNewline:p,verboseInfo:m,streamInfo:v}),T=[],A=kO({subprocess:e,buffer:o,maxBuffer:i,ipc:f,ipcOutput:T,verboseInfo:m}),E=WQ(g,e,v),R=KQ(y,v);try{return await Promise.race([Promise.all([{},b3(w),Promise.all(D),O,A,FI(e,d,f),...E,...R]),x,YQ(e,b),...RI(t,a,h,b),...XD({kill:t,cancelSignal:c,gracefulCancel:u,context:h,controller:b}),...OI({subprocess:e,kill:t,cancelSignal:c,gracefulCancel:u,forceKillAfterDelay:l,context:h,controller:b})])}catch(S){return h.terminationReason??="other",Promise.all([{error:S},w,Promise.all(D.map((k)=>z1(k))),z1(O),RO(A,T),Promise.allSettled(E),Promise.allSettled(R)])}},WQ=(e,t,r)=>e.map((n,o)=>n===t.stdio[o]?void 0:Bp(n,o,r)),KQ=(e,t)=>e.flatMap(({stdioItems:r},n)=>r.filter(({value:o,stream:i=o})=>An(i,{checkOpen:!1})&&!vn(i)).map(({type:o,value:i,stream:s=i})=>Bp(s,n,t,{isSameDirection:Zr.has(o),stopOnExit:o==="native"}))),YQ=async(e,{signal:t})=>{let[r]=await VQ(e,"error",{signal:t});throw r};import{Writable as ZQ}from"node:stream";import{callbackify as _O}from"node:util";var BO=({subprocess:e,concurrentStreams:t},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:i}=V1(e,r,t),s=new ZQ({...W1(n,e,o),destroy:_O(Y1.bind(void 0,{subprocessStdin:n,subprocess:e,waitWritableFinal:o,waitWritableDestroy:i})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return K1(n,s,void 0,e),s},V1=(e,t,r)=>{let n=Eh(e,t),o=_p(r,n,"writableFinal"),i=_p(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:i}},W1=(e,t,r)=>({write:JQ.bind(void 0,e),final:_O(XQ.bind(void 0,e,t,r))}),JQ=(e,t,r,n)=>{if(e.write(t,r))n();else e.once("drain",n)},XQ=async(e,t,r)=>{if(!await Ec(r,t))return;if(e.writable)e.end();await t},K1=async(e,t,r,n)=>{try{if(await F1(e),await n,t.writable)t.end()}catch(o){await lO(r),NO(t,await QQ(n,o))}},QQ=async(e,t)=>{if(!eee(t))return t;try{await e}catch(r){return r}return t},eee=(e)=>e===void 0||Sc(e),Y1=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:n},o)=>{if(await Ec(r,t),await Ec(n,t))NO(e,o),await Nh(t,o)},NO=(e,t)=>{Fh(e,e.writable,t)};import{Duplex as tee}from"node:stream";import{callbackify as ree}from"node:util";var FO=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,to:o,binary:i=!0,preserveNewlines:s=!0}={})=>{let a=i||Br.has(r),{subprocessStdout:c,waitReadableDestroy:u}=L1(e,n,t),{subprocessStdin:l,waitWritableFinal:p,waitWritableDestroy:f}=V1(e,o,t),{readableEncoding:d,readableObjectMode:h,readableHighWaterMark:m}=$1(c,a),{read:y,onStdoutDataDone:g}=U1({subprocessStdout:c,subprocess:e,binary:a,encoding:r,preserveNewlines:s}),x=new tee({read:y,...W1(l,e,p),destroy:ree(nee.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:e,waitReadableDestroy:u,waitWritableFinal:p,waitWritableDestroy:f})),readableHighWaterMark:m,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:h,writableObjectMode:l.writableObjectMode,encoding:d});return H1({subprocessStdout:c,onStdoutDataDone:g,readable:x,subprocess:e,subprocessStdin:l}),K1(l,x,c,e),x},nee=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:i},s)=>{await Promise.all([j1({subprocessStdout:e,subprocess:r,waitReadableDestroy:n},s),Y1({subprocessStdin:t,subprocess:r,waitWritableFinal:o,waitWritableDestroy:i},s)])};var MO=(e,{encoding:t})=>{let r=_h();e.readable=Mh.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=BO.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=FO.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.readableStream=Lh.bind(void 0,e),e.writableStream=fO.bind(void 0,e),e.transformStream=dO.bind(void 0,e),e.iterable=vc.bind(void 0,e,t),e[Symbol.asyncIterator]=vc.bind(void 0,e,t,{})};var LO=(e,t)=>Object.assign(e,t);var $O=(e,t,r,n)=>{let{file:o,commandArguments:i,command:s,escapedCommand:a,startTime:c,verboseInfo:u,options:l,fileDescriptors:p}=see(e,t,r),{subprocess:f,promise:d,kill:h,all:m,convertedStreams:y}=cee({file:o,commandArguments:i,options:l,startTime:c,verboseInfo:u,command:s,escapedCommand:a,fileDescriptors:p}),g=uee({promise:d,nodeChildProcess:f,kill:h,all:m,convertedStreams:y,options:l});return g.pipe=Uh.bind(void 0,{source:g,sourcePromise:d,boundOptions:{},createNested:n}),io.set(g,{options:l,fileDescriptors:p}),g},see=(e,t,r)=>{let{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=qm(e,t,r),{file:a,commandArguments:c,options:u}=ah(e,t,r),l=aee(u),p=U3(l,s);return{file:a,commandArguments:c,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:l,fileDescriptors:p}},aee=({timeout:e,signal:t,...r})=>{if(t!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:e}},cee=({file:e,commandArguments:t,options:r,startTime:n,verboseInfo:o,command:i,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=iee(...ch(e,t,Q3(r)))}catch(y){return _3({error:y,command:i,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:o})}let u=new AbortController;oee(1/0,u.signal);let l=[...c.stdio];Z3(c,a,u),vI(c,r);let p={},f=oo(),d=ZD.bind(void 0,{kill:eO(c,r),options:r,onInternalError:f,context:p,controller:u});iO(d,r,u);let h=CO(c,r),m=pee({subprocess:c,kill:d,all:h,options:r,startTime:n,verboseInfo:o,fileDescriptors:a,originalStreams:l,command:i,escapedCommand:s,context:p,onInternalError:f,controller:u});return{subprocess:c,promise:m,kill:d,all:h}},uee=({promise:e,nodeChildProcess:t,kill:r,all:n,convertedStreams:o,options:i})=>{let s=LO(e,lee(t,n));if(s.kill=r??s.kill,o===void 0)MO(s,i);else Object.assign(s,o);return C3(s,t,i),s},lee=(e,t)=>({nodeChildProcess:e,pid:e.pid,stdin:e.stdin,stdout:e.stdout,stderr:e.stderr,stdio:e.stdio,all:t,kill:e.kill.bind(e)}),pee=async({subprocess:e,kill:t,all:r,options:n,startTime:o,verboseInfo:i,fileDescriptors:s,originalStreams:a,command:c,escapedCommand:u,context:l,onInternalError:p,controller:f})=>{let[d,[h,m],y,g,x]=await PO({subprocess:e,kill:t,all:r,options:n,context:l,verboseInfo:i,fileDescriptors:s,originalStreams:a,onInternalError:p,controller:f});f.abort(),p.resolve();let b=y.map((D,O)=>Jo(D,n,O)),w=Jo(g,n,"all"),v=fee({errorInfo:d,exitCode:h,signal:m,stdio:b,all:w,ipcOutput:x,context:l,options:n,command:c,escapedCommand:u,startTime:o});return gc(v,i,n)},fee=({errorInfo:e,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,context:s,options:a,command:c,escapedCommand:u,startTime:l})=>("error"in e)?Sp({error:e.error,command:c,escapedCommand:u,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof Yo,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,options:a,startTime:l,isSync:!1}):gh({command:c,escapedCommand:u,stdio:n,all:o,ipcOutput:i,options:a,startTime:l});var Hh=(e,t)=>{let r={__proto__:null,...e},n=Object.fromEntries(Object.entries(t).map(([o,i])=>[o,dee(o,r[o],i)]));return{...r,...n}},dee=(e,t,r)=>{if(mee.has(e)&&Qe(t)&&Qe(r))return{...t,...r};return r},mee=new Set(["env",...Nw]);var Ac=(e,t,r,n)=>{let o=(s,a,c)=>Ac(s,a,r,c),i=(...s)=>hee({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:n,createNested:o},...s);if(n!==void 0)n(i,o,t);return i},hee=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:n,createNested:o},i,...s)=>{if(Qe(i))return o(e,Hh(r,i),n);let{file:a,commandArguments:c,options:u,isSync:l}=yee({mapArguments:e,firstArgument:i,nextArguments:s,deepOptions:t,boundOptions:r});return l?w3(a,c,u):$O(a,c,u,o)},yee=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:n,boundOptions:o})=>{let i=lD(t)?pD(t,r):[t,...r],[s,a,c]=Pm(...i),u=Hh(Hh(n,o),c),{options:l=u,isSync:p=!1}=e({options:u});return{file:s,commandArguments:a,options:l,isSync:p}};var UO=(e,t,r)=>{e.sync=t(gee,r),e.s=e.sync},HO=({options:e})=>jO(e),gee=({options:e})=>({...jO(e),isSync:!0}),jO=(e)=>({options:{...bee(e),...e}}),bee=({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},qO={preferLocal:!0};var We=Ac(()=>({})),cPe=Ac(()=>({isSync:!0})),uPe=Ac(_I),lPe=Ac(HO,{},qO,UO),{sendMessage:pPe,getOneMessage:fPe,getEachMessage:dPe,getCancelSignal:mPe}=D3();import jS from"node:fs";import uH from"node:path";iy();var sy=256,ay;function cy(e=11){if(!ay||sy+e>512){ay="",sy=0;for(let t=0;t<256;t++)ay+=(256+Math.random()*256|0).toString(16).substring(1)}return ay.substring(sy,sy+++e)}function uy(e){let{batch:t,chain:r,ccipRead:n,dataSuffix:o,key:i="base",name:s="Base Client",tokens:a,type:c="base"}=e,u=e.experimental_blockTag??(typeof r?.experimental_preconfirmationTime==="number"?"pending":void 0),l=r?.blockTime??12000,p=Math.min(Math.max(Math.floor(l/2),500),4000),f=e.pollingInterval??p,d=e.cacheTime??f,h=e.account?ee(e.account):void 0,{config:m,request:y,value:g}=e.transport({account:h,chain:r,pollingInterval:f}),x={...m,...g},b={account:h,batch:t,cacheTime:d,ccipRead:n,chain:r,dataSuffix:o,key:i,name:s,pollingInterval:f,request:y,tokens:a,transport:x,type:c,uid:cy(),...u?{experimental_blockTag:u}:{}};function w(v){return(D)=>{let O=D(v);for(let A in b)delete O[A];let T={...v,...O};for(let A in O){let E=v[A],R=O[A];if(Ek(E)&&Ek(R))T[A]={...E,...R}}return Object.assign(T,{extend:w(T)})}}return Object.assign(b,{extend:w(b)})}function Ek(e){if(typeof e!=="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function co(e,t){let r=(n={})=>t(e,n);for(let n of["call","calls","callWithPeriod","estimateGas","prepare","prepareRecipient","predict","simulate"])if(Object.hasOwn(t,n)){let o=t[n];r[n]=(i={})=>{if(o.length===1)return o(i);return o(e,i)}}for(let n of["extractEvent","extractEvents"])if(Object.hasOwn(t,n))r[n]=t[n];return r}_t();ai();Er();Pn();ca();yr();X();se();xo();function qc(e){if(!(e instanceof B))return!1;let t=e.walk((r)=>r instanceof go);if(!(t instanceof go))return!1;if(t.data?.errorName==="HttpError")return!0;if(t.data?.errorName==="ResolverError")return!0;if(t.data?.errorName==="ResolverNotContract")return!0;if(t.data?.errorName==="ResolverNotFound")return!0;if(t.data?.errorName==="ReverseAddressMismatch")return!0;if(t.data?.errorName==="UnsupportedResolverProfile")return!0;return!1}uf();vt();X();Qr();function Hy(e){if(e.length!==66)return null;if(e.indexOf("[")!==0)return null;if(e.indexOf("]")!==65)return null;let t=`0x${e.slice(1,65)}`;if(!oe(t))return null;return t}function lf(e){let t=new Uint8Array(32).fill(0);if(!e)return be(t);let r=e.split(".");for(let n=r.length-1;n>=0;n-=1){let o=Hy(r[n]),i=o?Xr(o):ke(On(r[n]),"bytes");t=ke(yt([t,i]),"bytes")}return be(t)}vt();function IR(e){return`[${e.slice(2)}]`}vt();X();Qr();function OR(e){let t=new Uint8Array(32).fill(0);if(!e)return be(t);return Hy(e)||ke(On(e))}function zc(e){let t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);let r=new Uint8Array(On(t).byteLength+2),n=0,o=t.split(".");for(let i=0;i<o.length;i++){let s=On(o[i]);if(s.byteLength>255)s=On(IR(OR(o[i])));r[n]=s.length,r.set(s,n+1),n+=s.length+1}if(r.byteLength!==n+1)return r.slice(0,n+1);return r}function q(e,t,r){let n=e[t.name];if(typeof n==="function")return n;let o=e[r];if(typeof o==="function")return o;return(i)=>t(e,i)}ai();Er();et();se();xo();da();pu();var Ete=3;function Lr(e,{abi:t,address:r,args:n,docsPath:o,functionName:i,sender:s}){let a=e instanceof bo?e:e instanceof B?e.walk((h)=>typeof h==="object"&&h!==null&&("data"in h))||e.walk():{},{code:c,data:u,details:l,message:p,shortMessage:f}=a,d=(()=>{if(e instanceof Dn)return new $y({functionName:i,cause:e});if([Ete,ui.code].includes(c)&&(u||l||p||f)||c===tn.code&&l==="execution reverted"&&u)return new go({abi:t,data:typeof u==="object"?u.data:u,functionName:i,message:a instanceof fa?l:f??p,cause:e});return e})();return new jc(d,{abi:t,args:n,contractAddress:r,docsPath:o,functionName:i,sender:s})}ns();async function we(e,t){let{abi:r,address:n,args:o,functionName:i,...s}=t,a=Be({abi:r,args:o,functionName:i});try{let{data:c}=await q(e,Dr,"call")({...s,data:a,to:n});return Gt({abi:r,args:o,functionName:i,data:c||"0x"})}catch(c){throw Lr(c,{abi:r,address:n,args:o,docsPath:"/docs/contract/readContract",functionName:i})}}async function yP(e,t){let{blockNumber:r,blockTag:n,coinType:o,name:i,gatewayUrls:s,strict:a}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw Error("client chain not configured. universalResolverAddress is required.");return en({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})(),l=c?.ensTlds;if(l&&!l.some((f)=>i.endsWith(f)))return null;let p=(()=>{if(o!=null)return[lf(i),BigInt(o)];return[lf(i)]})();try{let f=Be({abi:s2,functionName:"addr",args:p}),d={address:u,abi:py,functionName:"resolveWithGateways",args:[Ce(zc(i)),f,s??[ci]],blockNumber:r,blockTag:n},m=await q(e,we,"readContract")(d);if(m[0]==="0x")return null;let y=Wte({coinType:o,data:m[0],args:p});if(y==="0x")return null;if(Bt(y)==="0x00")return null;return y}catch(f){if(a)throw f;if(qc(f))return null;throw f}}function Wte({coinType:e,data:t,args:r}){try{return Gt({abi:s2,args:r,functionName:"addr",data:t})}catch(n){if(e==null)throw n;let o=Bt(t);if(fe(o)===20)return de(o);throw n}}se();class LT extends B{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`],name:"EnsAvatarInvalidMetadataError"})}}class Ea extends B{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class Sf extends B{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class $T extends B{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}var Kte=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Yte=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,Zte=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Jte=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Xte(e){try{let t=await fetch(e,{method:"HEAD"});if(t.status===200)return t.headers.get("content-type")?.startsWith("image/");return!1}catch(t){if(typeof t==="object"&&typeof t.response<"u")return!1;if(!Object.hasOwn(globalThis,"Image"))return!1;return new Promise((r)=>{let n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=e})}}function gP(e,t){if(!e)return t;if(e.endsWith("/"))return e.slice(0,-1);return e}function UT({uri:e,gatewayUrls:t}){let r=Zte.test(e);if(r)return{uri:e,isOnChain:!0,isEncoded:r};let n=gP(t?.ipfs,"https://ipfs.io"),o=gP(t?.arweave,"https://arweave.net"),i=e.match(Kte),{protocol:s,subpath:a,target:c,subtarget:u=""}=i?.groups||{},l=s==="ipns:/"||a==="ipns/",p=s==="ipfs:/"||a==="ipfs/"||Yte.test(e);if(e.startsWith("http")&&!l&&!p){let d=e;if(t?.arweave)d=e.replace(/https:\/\/arweave.net/g,t?.arweave);return{uri:d,isOnChain:!1,isEncoded:!1}}if((l||p)&&c)return{uri:`${n}/${l?"ipns":"ipfs"}/${c}${u}`,isOnChain:!1,isEncoded:!1};if(s==="ar:/"&&c)return{uri:`${o}/${c}${u||""}`,isOnChain:!1,isEncoded:!1};let f=e.replace(Jte,"");if(f.startsWith("<svg"))f=`data:image/svg+xml;base64,${btoa(f)}`;if(f.startsWith("data:")||f.startsWith("{"))return{uri:f,isOnChain:!0,isEncoded:!1};throw new Sf({uri:e})}function HT(e){if(typeof e!=="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new LT({data:e});return e.image||e.image_url||e.image_data}async function bP({gatewayUrls:e,uri:t}){try{let r=await fetch(t).then((o)=>o.json());return await n0({gatewayUrls:e,uri:HT(r)})}catch{throw new Sf({uri:t})}}async function n0({gatewayUrls:e,uri:t}){let{uri:r,isOnChain:n}=UT({uri:t,gatewayUrls:e});if(n)return r;if(await Xte(r))return r;throw new Sf({uri:t})}function xP(e){let t=e;if(t.startsWith("did:nft:"))t=t.replace("did:nft:","").replace(/_/g,"/");let[r,n,o]=t.split("/"),[i,s]=r.split(":"),[a,c]=n.split(":");if(!i||i.toLowerCase()!=="eip155")throw new Ea({reason:"Only EIP-155 supported"});if(!s)throw new Ea({reason:"Chain ID not found"});if(!c)throw new Ea({reason:"Contract address not found"});if(!o)throw new Ea({reason:"Token ID not found"});if(!a)throw new Ea({reason:"ERC namespace not found"});return{chainID:Number.parseInt(s,10),namespace:a.toLowerCase(),contractAddress:c,tokenID:o}}async function wP(e,{nft:t}){if(t.namespace==="erc721")return we(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return we(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new $T({namespace:t.namespace})}async function TP(e,{gatewayUrls:t,record:r}){if(/eip155:/i.test(r))return Qte(e,{gatewayUrls:t,record:r});return n0({uri:r,gatewayUrls:t})}async function Qte(e,{gatewayUrls:t,record:r}){let n=xP(r),o=await wP(e,{nft:n}),{uri:i,isOnChain:s,isEncoded:a}=UT({uri:o,gatewayUrls:t});if(s&&(i.includes("data:application/json;base64,")||i.startsWith("{"))){let u=a?atob(i.replace("data:application/json;base64,","")):i,l=JSON.parse(u);return n0({uri:HT(l),gatewayUrls:t})}let c=n.tokenID;if(n.namespace==="erc1155")c=c.replace("0x","").padStart(64,"0");return bP({gatewayUrls:t,uri:i.replace(/(?:0x)?{id}/,c)})}_t();ai();Er();ca();X();uf();async function o0(e,t){let{blockNumber:r,blockTag:n,key:o,name:i,gatewayUrls:s,strict:a}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw Error("client chain not configured. universalResolverAddress is required.");return en({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})(),l=c?.ensTlds;if(l&&!l.some((p)=>i.endsWith(p)))return null;try{let p={address:u,abi:py,args:[Ce(zc(i)),Be({abi:i2,functionName:"text",args:[lf(i),o]}),s??[ci]],functionName:"resolveWithGateways",blockNumber:r,blockTag:n},d=await q(e,we,"readContract")(p);if(d[0]==="0x")return null;let h=Gt({abi:i2,functionName:"text",data:d[0]});return h===""?null:h}catch(p){if(a)throw p;if(qc(p))return null;throw p}}async function EP(e,{blockNumber:t,blockTag:r,assetGatewayUrls:n,name:o,gatewayUrls:i,strict:s,universalResolverAddress:a}){let c=await q(e,o0,"getEnsText")({blockNumber:t,blockTag:r,key:"avatar",name:o,universalResolverAddress:a,gatewayUrls:i,strict:s});if(!c)return null;try{return await TP(e,{record:c,gatewayUrls:n})}catch{return null}}_t();ca();uf();async function vP(e,t){let{address:r,blockNumber:n,blockTag:o,coinType:i=60n,gatewayUrls:s,strict:a}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw Error("client chain not configured. universalResolverAddress is required.");return en({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})();try{let l={address:u,abi:Sk,args:[r,i,s??[ci]],functionName:"reverseWithGateways",blockNumber:n,blockTag:o},p=q(e,we,"readContract"),[f]=await p(l);return f||null}catch(l){if(a)throw l;if(qc(l))return null;throw l}}ca();X();async function SP(e,t){let{blockNumber:r,blockTag:n,name:o}=t,{chain:i}=e,s=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!i)throw Error("client chain not configured. universalResolverAddress is required.");return en({blockNumber:r,chain:i,contract:"ensUniversalResolver"})})(),a=i?.ensTlds;if(a&&!a.some((u)=>o.endsWith(u)))throw Error(`${o} is not a valid ENS TLD (${a?.join(", ")}) for chain "${i.name}" (id: ${i.id}).`);let[c]=await q(e,we,"readContract")({address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Ce(zc(o))],blockNumber:r,blockTag:n});return c}ns();se();X();PT();So();Ao();async function AP(e,t){let{account:r=e.account,blockNumber:n,blockTag:o="latest",blobs:i,data:s,gas:a,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:l,maxPriorityFeePerGas:p,to:f,value:d,...h}=t,m=r?ee(r):void 0;try{Dt(t);let g=(typeof n==="bigint"?M(n):void 0)||o,x=e.chain?.formatters?.transactionRequest?.format,w=(x||Ct)({...Cr(h,{format:x}),account:m,blobs:i,data:s,gas:a,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:l,maxPriorityFeePerGas:p,to:f,value:d},"createAccessList"),v=await e.request({method:"eth_createAccessList",params:[w,g]});if(v.error)throw new B(v.error,{details:v.error});return{accessList:v.accessList,gasUsed:BigInt(v.gasUsed)}}catch(y){throw e0(y,{...t,account:m,chain:e.chain})}}function os(e,{method:t}){let r={};if(e.transport.type==="fallback")e.transport.onResponse?.(({method:n,response:o,status:i,transport:s})=>{if(i==="success"&&t===n)r[o]=s.request});return(n)=>r[n]||e.request}async function CP(e){let t=os(e,{method:"eth_newBlockFilter"}),r=await e.request({method:"eth_newBlockFilter"});return{id:r,request:t(r),type:"block"}}et();se();class jT extends B{constructor(e){super(`Filter type "${e}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}vt();Qr();nf();ho();Xo();Zi();var DP="/docs/contract/encodeEventTopics";function Co(e){let{abi:t,eventName:r,args:n}=e,o=t[0];if(r){let c=Tr({abi:t,name:r});if(!c)throw new hy(r,{docsPath:DP});o=c}if(o.type!=="event")throw new hy(void 0,{docsPath:DP});let i=[];if(n&&"inputs"in o){let c=o.inputs?.filter((l)=>("indexed"in l)&&l.indexed),u=Array.isArray(n)?n:Object.values(n).length>0?c?.map((l)=>n[l.name])??[]:[];if(u.length>0)i=c?.map((l,p)=>{if(Array.isArray(u[p]))return u[p].map((f,d)=>IP({param:l,value:u[p][d]}));return typeof u[p]<"u"&&u[p]!==null?IP({param:l,value:u[p]}):null})??[]}if(o.anonymous)return i;let s=mt(o);return[Yi(s),...i]}function IP({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return ke(Xr(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new jT(e.type);return ct([e],[t])}X();async function i0(e,t){let{address:r,abi:n,args:o,eventName:i,fromBlock:s,strict:a,toBlock:c}=t,u=os(e,{method:"eth_newFilter"}),l=i?Co({abi:n,args:o,eventName:i}):void 0,p=await e.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof s==="bigint"?M(s):s,toBlock:typeof c==="bigint"?M(c):c,topics:l}]});return{abi:n,args:o,eventName:i,id:p,request:u(p),strict:Boolean(a),type:"event"}}X();async function s0(e,{address:t,args:r,event:n,events:o,fromBlock:i,strict:s,toBlock:a}={}){let c=o??(n?[n]:void 0),u=os(e,{method:"eth_newFilter"}),l=[];if(c){if(l=[c.flatMap((d)=>Co({abi:[d],eventName:d.name,args:r}))],n)l=l[0]}let p=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof i==="bigint"?M(i):i,toBlock:typeof a==="bigint"?M(a):a,...l.length?{topics:l}:{}}]});return{abi:c,args:r,eventName:n?n.name:void 0,fromBlock:i,id:p,request:u(p),strict:Boolean(s),toBlock:a,type:"event"}}async function a0(e){let t=os(e,{method:"eth_newPendingTransactionFilter"}),r=await e.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:t(r),type:"transaction"}}Er();se();Pn();Qr();function c0(e){let t=ke(`0x${e.substring(4)}`).substring(26);return fo(`0x${t}`)}yr();st();X();async function t_({hash:e,signature:t}){let r=oe(e)?e:Ce(e);await Promise.resolve().then(() => If());return`0x${(()=>{if(typeof t==="object"&&"r"in t&&"s"in t){let{r:u,s:l,v:p,yParity:f}=t,d=Number(f??p),h=e_(d);return new xi.Signature(_e(u),_e(l)).addRecoveryBit(h)}let s=oe(t)?t:Ce(t);if(fe(s)!==65)throw Error("invalid signature length");let a=Oe(`0x${s.slice(130)}`),c=e_(a);return xi.Signature.fromCompact(s.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function e_(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw Error("Invalid yParityOrV value")}async function Of({hash:e,signature:t}){return c0(await t_({hash:e,signature:t}))}vt();X();se();Cy();vt();X();function wi(e,t="hex"){let r=r_(e),n=_c(new Uint8Array(r.length));if(r.encode(n),t==="hex")return be(n.bytes);return n.bytes}function r_(e){if(Array.isArray(e))return wre(e.map((t)=>r_(t)));return Tre(e)}function wre(e){let t=e.reduce((o,i)=>o+i.length,0),r=n_(t);return{length:(()=>{if(t<=55)return 1+t;return 1+r+t})(),encode(o){if(t<=55)o.pushByte(192+t);else if(o.pushByte(247+r),r===1)o.pushUint8(t);else if(r===2)o.pushUint16(t);else if(r===3)o.pushUint24(t);else o.pushUint32(t);for(let{encode:i}of e)i(o)}}}function Tre(e){let t=typeof e==="string"?ht(e):e,r=n_(t.length);return{length:(()=>{if(t.length===1&&t[0]<128)return 1;if(t.length<=55)return 1+t.length;return 1+r+t.length})(),encode(o){if(t.length===1&&t[0]<128)o.pushBytes(t);else if(t.length<=55)o.pushByte(128+t.length),o.pushBytes(t);else{if(o.pushByte(183+r),r===1)o.pushUint8(t.length);else if(r===2)o.pushUint16(t.length);else if(r===3)o.pushUint24(t.length);else o.pushUint32(t.length);o.pushBytes(t)}}}}function n_(e){if(e<256)return 1;if(e<65536)return 2;if(e<16777216)return 3;if(e<4294967296)return 4;throw new B("Length is too large.")}Qr();function p0(e){let{chainId:t,nonce:r,to:n}=e,o=e.contractAddress??e.address,i=ke(He(["0x05",wi([t?M(t):"0x",o,r?M(r):"0x"])]));if(n==="bytes")return ht(i);return i}async function cs(e){let{authorization:t,signature:r}=e;return Of({hash:p0(t),signature:r??t})}X();Ly();Uc();se();ir();class cE extends B{constructor(e,{account:t,docsPath:r,chain:n,data:o,gas:i,gasPrice:s,maxFeePerGas:a,maxPriorityFeePerGas:c,nonce:u,to:l,value:p}){let f=ua({from:t?.address,to:l,value:typeof p<"u"&&`${$c(p)} ${n?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:i,gasPrice:typeof s<"u"&&`${gt(s)} gwei`,maxFeePerGas:typeof a<"u"&&`${gt(a)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${gt(c)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",f].filter(Boolean),name:"EstimateGasExecutionError"});Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}hi();vf();function o_(e,{docsPath:t,...r}){let n=(()=>{let o=rs(e,r);if(o instanceof Fn)return e;return o})();return new cE(n,{docsPath:t,...r})}So();r0();Ao();Uc();se();class kf extends B{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Sa extends B{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class uE extends B{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${gt(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}st();se();class Aa extends B{constructor({blockHash:e,blockNumber:t}){let r="Block";if(e)r=`Block at hash "${e}"`;if(t)r=`Block at number "${t}"`;super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}X();st();var lE={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Au(e,t){let r={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,...e.blockTimestamp!=null&&{blockTimestamp:BigInt(e.blockTimestamp)},chainId:e.chainId?Oe(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?Oe(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?lE[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};if(e.authorizationList)r.authorizationList=Ere(e.authorizationList);if(r.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof r.v==="bigint"){if(r.v===0n||r.v===27n)return 0;if(r.v===1n||r.v===28n)return 1;if(r.v>=35n)return r.v%2n===0n?1:0}return})(),r.type==="legacy")delete r.accessList,delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.yParity;if(r.type==="eip2930")delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas;if(r.type==="eip1559")delete r.maxFeePerBlobGas;return r}function Ere(e){return e.map((t)=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function Cu(e,t){let r=(e.transactions??[]).map((n)=>{if(typeof n==="string")return n;return Au(n)});return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:r,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}async function lt(e,{blockHash:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest",includeTransactions:o}={}){let i=o??!1,s=r!==void 0?M(r):void 0,a=null;if(t)a=await e.request({method:"eth_getBlockByHash",params:[t,i]},{dedupe:!0});else a=await e.request({method:"eth_getBlockByNumber",params:[s||n,i]},{dedupe:Boolean(s)});if(!a)throw new Aa({blockHash:t,blockNumber:r});return(e.chain?.formatters?.block?.format||Cu)(a,"getBlock")}async function Du(e){let t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function i_(e,t){return pE(e,t)}async function pE(e,t){let{block:r,chain:n=e.chain,request:o}=t||{};try{let i=n?.fees?.maxPriorityFeePerGas??n?.fees?.defaultPriorityFee;if(typeof i==="function"){let a=r||await q(e,lt,"getBlock")({}),c=await i({block:a,client:e,request:o});if(c===null)throw Error();return c}if(typeof i<"u")return i;let s=await e.request({method:"eth_maxPriorityFeePerGas"});return _e(s)}catch{let[i,s]=await Promise.all([r?Promise.resolve(r):q(e,lt,"getBlock")({}),q(e,Du,"getGasPrice")({})]);if(typeof i.baseFeePerGas!=="bigint")throw new Sa;let a=s-i.baseFeePerGas;if(a<0n)return 0n;return a}}async function s_(e,t){return f0(e,t)}async function f0(e,t){let{block:r,chain:n=e.chain,request:o,type:i="eip1559"}=t||{},s=await(async()=>{if(typeof n?.fees?.baseFeeMultiplier==="function")return n.fees.baseFeeMultiplier({block:r,client:e,request:o});return n?.fees?.baseFeeMultiplier??1.2})();if(s<1)throw new kf;let c=10**(s.toString().split(".")[1]?.length??0),u=(f)=>f*BigInt(Math.round(s*c))/BigInt(c),l=r?r:await q(e,lt,"getBlock")({});if(typeof n?.fees?.estimateFeesPerGas==="function"){let f=await n.fees.estimateFeesPerGas({block:r,client:e,multiply:u,request:o,type:i});if(f!==null)return f}if(i==="eip1559"){if(typeof l.baseFeePerGas!=="bigint")throw new Sa;let f=typeof o?.maxPriorityFeePerGas==="bigint"?o.maxPriorityFeePerGas:await pE(e,{block:l,chain:n,request:o}),d=u(l.baseFeePerGas);return{maxFeePerGas:o?.maxFeePerGas??d+f,maxPriorityFeePerGas:f}}return{gasPrice:o?.gasPrice??u(await q(e,Du,"getGasPrice")({}))}}ts();st();async function Iu(e,{address:t,blockHash:r,blockNumber:n,blockTag:o="latest",requireCanonical:i}){let s=cr({blockHash:r,blockNumber:n,blockTag:o,requireCanonical:i}),a=await e.request({method:"eth_getTransactionCount",params:[t,s]},{dedupe:typeof n==="bigint"||r!==void 0});return Oe(a)}ir();vt();X();function Ou(e){let{kzg:t}=e,r=e.to??(typeof e.blobs[0]==="string"?"hex":"bytes"),n=typeof e.blobs[0]==="string"?e.blobs.map((i)=>ht(i)):e.blobs,o=[];for(let i of n)o.push(Uint8Array.from(t.blobToKzgCommitment(i)));return r==="bytes"?o:o.map((i)=>be(i))}vt();X();function ku(e){let{kzg:t}=e,r=e.to??(typeof e.blobs[0]==="string"?"hex":"bytes"),n=typeof e.blobs[0]==="string"?e.blobs.map((s)=>ht(s)):e.blobs,o=typeof e.commitments[0]==="string"?e.commitments.map((s)=>ht(s)):e.commitments,i=[];for(let s=0;s<n.length;s++){let a=n[s],c=o[s];i.push(Uint8Array.from(t.computeBlobKzgProof(a,c)))}return r==="bytes"?i:i.map((s)=>be(s))}X();Su();var a_=Do;vt();X();function c_(e,t){let r=t||"hex",n=a_(oe(e,{strict:!1})?Xr(e):e);if(r==="bytes")return n;return Ce(n)}function u_(e){let{commitment:t,version:r=1}=e,n=e.to??(typeof t==="string"?"hex":"bytes"),o=c_(t,"bytes");return o.set([r],0),n==="bytes"?o:be(o)}function d0(e){let{commitments:t,version:r}=e,n=e.to??(typeof t[0]==="string"?"hex":"bytes"),o=[];for(let i of t)o.push(u_({commitment:i,to:n,version:r}));return o}var l_=32,p_=4096,f_=131072,fE=761855;var m0=1;se();class dE extends B{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`],name:"BlobSizeTooLargeError"})}}class Rf extends B{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class mE extends B{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`],name:"InvalidVersionedHashSizeError"})}}class hE extends B{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${m0}`,`Received: ${t}`],name:"InvalidVersionedHashVersionError"})}}Cy();yr();vt();X();function d_(e){let t=e.to??(typeof e.data==="string"?"hex":"bytes"),r=typeof e.data==="string"?ht(e.data):e.data,n=fe(r);if(!n)throw new Rf;if(n>fE)throw new dE({maxSize:fE,size:n});let o=[],i=!0,s=0;while(i){let a=_c(new Uint8Array(f_)),c=0;while(c<p_){let u=r.slice(s,s+(l_-1));if(a.pushByte(0),a.pushBytes(u),u.length<31){a.pushByte(128),i=!1;break}c++,s+=31}o.push(a)}return t==="bytes"?o.map((a)=>a.bytes):o.map((a)=>be(a.bytes))}function h0(e){let{data:t,kzg:r,to:n}=e,o=e.blobs??d_({data:t,to:n}),i=e.commitments??Ou({blobs:o,kzg:r,to:n}),s=e.proofs??ku({blobs:o,commitments:i,kzg:r,to:n}),a=[];for(let c=0;c<o.length;c++)a.push({blob:o[c],commitment:i[c],proof:s[c]});return a}aa();Ao();ir();function y0(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u"){if(typeof e.accessList<"u")return"eip2930";return"legacy"}throw new Q2({transaction:e})}ir();hi();ir();vf();function us(e,{docsPath:t,...r}){let n=(()=>{let o=rs(e,r);if(o instanceof Fn)return e;return o})();return new tT(n,{docsPath:t,...r})}So();Ao();st();async function Zt(e){let t=await e.request({method:"eth_chainId"},{dedupe:!0});return Oe(t)}async function Ru(e,t){let{account:r=e.account,accessList:n,authorizationList:o,chain:i=e.chain,blobVersionedHashes:s,blobs:a,data:c,gas:u,gasPrice:l,maxFeePerBlobGas:p,maxFeePerGas:f,maxPriorityFeePerGas:d,nonce:h,nonceManager:m,to:y,type:g,value:x,...b}=t,w=await(async()=>{if(!r)return h;if(!m)return h;if(typeof h<"u")return h;let T=ee(r),A=i?i.id:await q(e,Zt,"getChainId")({});return await m.consume({address:T.address,chainId:A,client:e})})();Dt(t);let v=i?.formatters?.transactionRequest?.format,O=(v||Ct)({...Cr(b,{format:v}),account:r?ee(r):void 0,accessList:n,authorizationList:o,blobs:a,blobVersionedHashes:s,data:c,gas:u,gasPrice:l,maxFeePerBlobGas:p,maxFeePerGas:f,maxPriorityFeePerGas:d,nonce:w,to:y,type:g,value:x},"fillTransaction");try{let T=await e.request({method:"eth_fillTransaction",params:[O]}),E=(i?.formatters?.transaction?.format||Au)(T.tx);delete E.blockHash,delete E.blockNumber,delete E.r,delete E.s,delete E.transactionIndex,delete E.v,delete E.yParity,E.data=E.input;let R=typeof E.feePayerSignature<"u"&&E.feePayerSignature!==null;if(R&&typeof w<"u"&&E.nonce!==w)throw new af({filledNonce:E.nonce,requestedNonce:w});if(!R){if(E.gas)E.gas=t.gas??E.gas;if(E.gasPrice)E.gasPrice=t.gasPrice??E.gasPrice;if(E.maxFeePerBlobGas)E.maxFeePerBlobGas=t.maxFeePerBlobGas??E.maxFeePerBlobGas;if(E.maxFeePerGas)E.maxFeePerGas=t.maxFeePerGas??E.maxFeePerGas;if(E.maxPriorityFeePerGas)E.maxPriorityFeePerGas=t.maxPriorityFeePerGas??E.maxPriorityFeePerGas;if(typeof E.nonce<"u")E.nonce=t.nonce??E.nonce;let S=await(async()=>{if(typeof i?.fees?.baseFeeMultiplier==="function"){let P=await q(e,lt,"getBlock")({});return i.fees.baseFeeMultiplier({block:P,client:e,request:t})}return i?.fees?.baseFeeMultiplier??1.2})();if(S<1)throw new kf;let I=10**(S.toString().split(".")[1]?.length??0),C=(P)=>P*BigInt(Math.round(S*I))/BigInt(I);if(E.maxFeePerGas&&!t.maxFeePerGas)E.maxFeePerGas=C(E.maxFeePerGas);if(E.gasPrice&&!t.gasPrice)E.gasPrice=C(E.gasPrice)}return{raw:T.raw,transaction:{from:O.from,...E},...T.capabilities?{capabilities:T.capabilities}:{}}}catch(T){throw us(T,{...t,chain:e.chain})}}var Pf=["blobVersionedHashes","chainId","fees","gas","nonce","type"],m_=new Map,yE=new Mr(128);async function Oo(e,t){let r=t;r.account??=e.account,r.parameters??=Pf;let{account:n,chain:o=e.chain,nonceManager:i,parameters:s}=r,a=(()=>{if(typeof o?.prepareTransactionRequest==="function")return{fn:o.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(o?.prepareTransactionRequest))return{fn:o.prepareTransactionRequest[0],runAt:o.prepareTransactionRequest[1].runAt};return})(),c;async function u(){if(c)return c;if(typeof r.chainId<"u")return r.chainId;if(o)return o.id;return c=await q(e,Zt,"getChainId")({}),c}let l=n?ee(n):n,p=r.nonce;if(a?.fn&&a.runAt?.includes("beforeFillTransaction")){r=await a.fn({...r,chain:o},{client:e,phase:"beforeFillTransaction"}),p??=r.nonce;let w=r.account??r.from;l=w?ee(w):void 0}if(s.includes("nonce")&&typeof p>"u"&&l&&i){let w=await u();p=await i.consume({address:l.address,chainId:w,client:e})}let d=(()=>{if((s.includes("blobVersionedHashes")||s.includes("sidecars"))&&r.kzg&&r.blobs)return!1;if(s.length>0&&"feePayer"in r&&r.feePayer&&!(("feePayerSignature"in r)&&r.feePayerSignature))return!0;if(yE.get(e.uid)===!1)return!1;if(!["fees","gas"].some((v)=>s.includes(v)))return!1;if(s.includes("chainId")&&typeof r.chainId!=="number")return!0;if(s.includes("nonce")&&typeof p!=="number")return!0;if(s.includes("fees")&&typeof r.gasPrice!=="bigint"&&(typeof r.maxFeePerGas!=="bigint"||typeof r.maxPriorityFeePerGas!=="bigint"))return!0;if(s.includes("gas")&&typeof r.gas!=="bigint")return!0;return!1})()?await q(e,Ru,"fillTransaction")({...r,nonce:p}).then((w)=>{let{chainId:v,from:D,gas:O,gasPrice:T,nonce:A,maxFeePerBlobGas:E,maxFeePerGas:R,maxPriorityFeePerGas:S,type:k,...I}=w.transaction,C="feeToken"in I?I.feeToken:void 0,P="feePayerSignature"in I&&I.feePayerSignature!==null&&typeof I.feePayerSignature<"u",N=typeof C<"u"&&C!==null&&(!("feeToken"in r)||P);return yE.set(e.uid,!0),{...r,...D?{from:D}:{},...k&&!r.type?{type:k}:{},...typeof v<"u"?{chainId:v}:{},...typeof O<"u"?{gas:O}:{},...typeof T<"u"?{gasPrice:T}:{},...typeof A<"u"?{nonce:A}:{},...typeof E<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxFeePerBlobGas:E}:{},...typeof R<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxFeePerGas:R}:{},...typeof S<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxPriorityFeePerGas:S}:{},..."nonceKey"in I&&typeof I.nonceKey<"u"?{nonceKey:I.nonceKey}:{},..."keyAuthorization"in I&&typeof I.keyAuthorization<"u"&&I.keyAuthorization!==null&&!("keyAuthorization"in r)?{keyAuthorization:I.keyAuthorization}:{},..."feePayerSignature"in I&&typeof I.feePayerSignature<"u"&&I.feePayerSignature!==null?{feePayerSignature:I.feePayerSignature}:{},...N?{feeToken:C}:{},...w.capabilities?{_capabilities:w.capabilities}:{}}}).catch((w)=>{let v=w;if(v.name!=="TransactionExecutionError")return r;if(v.walk?.((A)=>A instanceof af))throw w;if(v.walk?.((A)=>A.name==="ExecutionRevertedError"))throw w;if(v.walk?.((A)=>{let E=A;return E.name==="MethodNotFoundRpcError"||E.name==="MethodNotSupportedRpcError"||E.message?.includes("eth_fillTransaction is not available")}))yE.set(e.uid,!1);return r}):r;p??=d.nonce,r={...d,...l?{from:l?.address}:{},...typeof p<"u"?{nonce:p}:{}};let{blobs:h,gas:m,kzg:y,type:g}=r;if(a?.fn&&a.runAt?.includes("beforeFillParameters"))r=await a.fn({...r,chain:o},{client:e,phase:"beforeFillParameters"});let x;async function b(){if(x)return x;return x=await q(e,lt,"getBlock")({blockTag:"latest"}),x}if(s.includes("nonce")&&typeof p>"u"&&l&&!i)r.nonce=await q(e,Iu,"getTransactionCount")({address:l.address,blockTag:"pending"});if((s.includes("blobVersionedHashes")||s.includes("sidecars"))&&h&&y){let w=Ou({blobs:h,kzg:y});if(s.includes("blobVersionedHashes")){let v=d0({commitments:w,to:"hex"});r.blobVersionedHashes=v}if(s.includes("sidecars")){let v=ku({blobs:h,commitments:w,kzg:y}),D=h0({blobs:h,commitments:w,proofs:v,to:"hex"});r.sidecars=D}}if(s.includes("chainId"))r.chainId=await u();if((s.includes("fees")||s.includes("type"))&&typeof g>"u")try{r.type=y0(r)}catch{let w=m_.get(e.uid);if(typeof w>"u")w=typeof(await b())?.baseFeePerGas==="bigint",m_.set(e.uid,w);r.type=w?"eip1559":"legacy"}if(s.includes("fees"))if(r.type!=="legacy"&&r.type!=="eip2930"){if(typeof r.maxFeePerGas>"u"||typeof r.maxPriorityFeePerGas>"u"){let w=await b(),{maxFeePerGas:v,maxPriorityFeePerGas:D}=await f0(e,{block:w,chain:o,request:r});if(typeof r.maxPriorityFeePerGas>"u"&&r.maxFeePerGas&&r.maxFeePerGas<D)throw new uE({maxPriorityFeePerGas:D});r.maxPriorityFeePerGas=D,r.maxFeePerGas=v}}else{if(typeof r.maxFeePerGas<"u"||typeof r.maxPriorityFeePerGas<"u")throw new Sa;if(typeof r.gasPrice>"u"){let w=await b(),{gasPrice:v}=await f0(e,{block:w,chain:o,request:r,type:"legacy"});r.gasPrice=v}}if(s.includes("gas")&&typeof m>"u")r.gas=await q(e,Pu,"estimateGas")({...r,account:l,prepare:l?.type==="local"?[]:["blobVersionedHashes"]});if(a?.fn&&a.runAt?.includes("afterFillParameters"))r=await a.fn({...r,chain:o},{client:e,phase:"afterFillParameters"});return Dt(r),delete r.parameters,r}async function Pu(e,t){let{account:r=e.account,prepare:n=!0}=t,o=r?ee(r):void 0,i=(()=>{if(Array.isArray(n))return n;if(o?.type!=="local")return["blobVersionedHashes"];return})();try{let s=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await cs({authorization:t.authorizationList[0]}).catch(()=>{throw new B("`to` is required. Could not infer from `authorizationList`")});return})(),{accessList:a,authorizationList:c,blobs:u,blobVersionedHashes:l,blockNumber:p,blockTag:f,data:d,gas:h,gasPrice:m,maxFeePerBlobGas:y,maxFeePerGas:g,maxPriorityFeePerGas:x,nonce:b,value:w,stateOverride:v,...D}=n?await Oo(e,{...t,parameters:i,to:s}):t;if(h&&t.gas!==h)return h;let T=(typeof p==="bigint"?M(p):void 0)||f,A=Tu(v);Dt(t);let E=e.chain?.formatters?.transactionRequest?.format,S=(E||Ct)({...Cr(D,{format:E}),account:o,accessList:a,authorizationList:c,blobs:u,blobVersionedHashes:l,data:d,gasPrice:m,maxFeePerBlobGas:y,maxFeePerGas:g,maxPriorityFeePerGas:x,nonce:b,to:s,value:w},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:A?[S,T??e.experimental_blockTag??"latest",A]:T?[S,T]:[S]}))}catch(s){throw o_(s,{...t,account:o,chain:e.chain})}}async function _u(e,t){let{abi:r,address:n,args:o,functionName:i,dataSuffix:s=typeof e.dataSuffix==="string"?e.dataSuffix:e.dataSuffix?.value,...a}=t,c=Be({abi:r,args:o,functionName:i});try{return await q(e,Pu,"estimateGas")({data:`${c}${s?s.replace("0x",""):""}`,to:n,...a})}catch(u){let l=a.account?ee(a.account):void 0;throw Lr(u,{abi:r,address:n,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:i,sender:l?.address})}}_t();ai();Er();ts();ns();async function h_(e,{address:t,blockHash:r,blockNumber:n,blockTag:o=e.experimental_blockTag??"latest",requireCanonical:i}){let s=cr({blockHash:r,blockNumber:n,blockTag:o,requireCanonical:i});if(e.batch?.multicall&&e.chain?.contracts?.multicall3){let c=e.chain.contracts.multicall3.address,u=Be({abi:Jr,functionName:"getEthBalance",args:[t]}),{data:l}=await q(e,Dr,"call")({to:c,data:u,blockHash:r,blockNumber:n,blockTag:o,requireCanonical:i});return Gt({abi:Jr,functionName:"getEthBalance",args:[t],data:l||"0x"})}let a=await e.request({method:"eth_getBalance",params:[t,s]});return BigInt(a)}async function y_(e){let t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}var vre=new Map,Sre=new Map;function g_(e){let t=(o,i)=>({clear:()=>i.delete(o),get:()=>i.get(o),set:(s)=>i.set(o,s)}),r=t(e,vre),n=t(e,Sre);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function b_(e,{cacheKey:t,cacheTime:r=Number.POSITIVE_INFINITY}){let n=g_(t),o=n.response.get();if(o&&r>0){if(Date.now()-o.created.getTime()<r)return o.data}let i=n.promise.get();if(!i)i=e(),n.promise.set(i);try{let s=await i;return n.response.set({created:new Date,data:s}),s}finally{n.promise.clear()}}var Are=(e)=>`blockNumber.${e}`;async function on(e,{cacheTime:t=e.cacheTime}={}){let r=await b_(()=>e.request({method:"eth_blockNumber"}),{cacheKey:Are(e.uid),cacheTime:t});return BigInt(r)}X();st();function Ot(e,{args:t,eventName:r}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...r?{args:t,eventName:r}:{}}}var gE={"0x0":"reverted","0x1":"success"};function Bu(e,t){let r={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map((n)=>Ot(n)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Oe(e.transactionIndex):null,status:e.status?gE[e.status]:null,type:e.type?lE[e.type]||e.type:null};if(e.blobGasPrice)r.blobGasPrice=BigInt(e.blobGasPrice);if(e.blobGasUsed)r.blobGasUsed=BigInt(e.blobGasUsed);return r}async function x_(e,{blockHash:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest"}={}){let o=r!==void 0?M(r):void 0,i=await e.request({method:"eth_getBlockReceipts",params:[t||o||n]},{dedupe:Boolean(t||o)});if(!i)throw new Aa({blockHash:t,blockNumber:r});let s=e.chain?.formatters?.transactionReceipt?.format||Bu;return i.map((a)=>s(a,"getBlockReceipts"))}st();X();async function w_(e,{blockHash:t,blockNumber:r,blockTag:n="latest"}={}){let o=r!==void 0?M(r):void 0,i;if(t)i=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0});else i=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[o||n]},{dedupe:Boolean(o)});return Oe(i)}ts();async function Ca(e,{address:t,blockHash:r,blockNumber:n,blockTag:o="latest",requireCanonical:i}){let s=cr({blockHash:r,blockNumber:n,blockTag:o,requireCanonical:i}),a=await e.request({method:"eth_getCode",params:[t,s]},{dedupe:typeof n==="bigint"||r!==void 0});if(a==="0x")return;return a}Zi();Eo();vt();Qr();nf();et();N2();yr();nf();rf();Xo();var T_="/docs/contract/decodeEventLog";function Da(e){let{abi:t,data:r,strict:n,topics:o}=e,i=n??!0,[s,...a]=o;if(!s)throw new h2({docsPath:T_});let c=t.find((g)=>g.type==="event"&&s===Yi(mt(g)));if(!(c&&("name"in c))||c.type!=="event")throw new y2(s,{docsPath:T_});let{name:u,inputs:l}=c,p=l?.some((g)=>!(("name"in g)&&g.name)),f=p?[]:{},d=l.map((g,x)=>[g,x]).filter(([g])=>("indexed"in g)&&g.indexed),h=[];for(let g=0;g<d.length;g++){let[x,b]=d[g],w=a[g];if(!w){if(i)throw new Qs({abiItem:c,param:x});h.push([x,b]);continue}f[p?b:x.name||b]=Cre({param:x,value:w})}let m=l.filter((g)=>!(("indexed"in g)&&g.indexed)),y=i?m:[...h.map(([g])=>g),...m];if(y.length>0){if(r&&r!=="0x")try{let g=si(y,r);if(g){let x=0;if(!i)for(let[b,w]of h)f[p?w:b.name||w]=g[x++];if(p){for(let b=0;b<l.length;b++)if(f[b]===void 0&&x<g.length)f[b]=g[x++]}else for(let b=0;b<m.length;b++)f[m[b].name]=g[x++]}}catch(g){if(i){if(g instanceof Hp||g instanceof Qp)throw new Wi({abiItem:c,data:r,params:y,size:fe(r)});throw g}}else if(i)throw new Wi({abiItem:c,data:"0x",params:y,size:0})}return{eventName:u,args:Object.values(f).length>0?f:void 0}}function Cre({param:e,value:t}){if(e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))return t;return(si([e],t)||[])[0]}function ko(e){let{abi:t,args:r,logs:n,strict:o=!0}=e,i=(()=>{if(!e.eventName)return;if(Array.isArray(e.eventName))return e.eventName;return[e.eventName]})(),s=t.filter((a)=>a.type==="event").map((a)=>({abi:a,selector:Yi(a)}));return n.map((a)=>{let c=typeof a.blockNumber==="string"?Ot(a):a,u=s.filter((f)=>c.topics[0]===f.selector);if(u.length===0)return null;let l,p;for(let f of u)try{l=Da({...c,abi:[f.abi],strict:!0}),p=f;break}catch{}if(!l&&!o){p=u[0];try{l=Da({data:c.data,topics:c.topics,abi:[p.abi],strict:!1})}catch{let f=p.abi.inputs?.some((d)=>!(("name"in d)&&d.name));return{...c,args:f?[]:{},eventName:p.abi.name}}}if(!l||!p)return null;if(i&&!i.includes(l.eventName))return null;if(!Dre({args:l.args,inputs:p.abi.inputs,matchArgs:r}))return null;return{...l,...c}}).filter(Boolean)}function Dre(e){let{args:t,inputs:r,matchArgs:n}=e;if(!n)return!0;if(!t)return!1;function o(i,s,a){try{if(i.type==="address")return Ne(s,a);if(i.type==="string"||i.type==="bytes")return ke(Xr(s))===a;return s===a}catch{return!1}}if(Array.isArray(t)&&Array.isArray(n))return n.every((i,s)=>{if(i===null||i===void 0)return!0;let a=r[s];if(!a)return!1;return(Array.isArray(i)?i:[i]).some((u)=>o(a,u,t[s]))});if(typeof t==="object"&&!Array.isArray(t)&&typeof n==="object"&&!Array.isArray(n))return Object.entries(n).every(([i,s])=>{if(s===null||s===void 0)return!0;let a=r.find((u)=>u.name===i);if(!a)return!1;return(Array.isArray(s)?s:[s]).some((u)=>o(a,u,t[i]))});return!1}X();async function Nu(e,{address:t,blockHash:r,fromBlock:n,toBlock:o,event:i,events:s,args:a,strict:c}={}){let u=c??!1,l=s??(i?[i]:void 0),p=[];if(l){if(p=[l.flatMap((m)=>Co({abi:[m],eventName:m.name,args:s?void 0:a}))],i)p=p[0]}let f;if(r)f=await e.request({method:"eth_getLogs",params:[{address:t,topics:p,blockHash:r}]});else f=await e.request({method:"eth_getLogs",params:[{address:t,topics:p,fromBlock:typeof n==="bigint"?M(n):n,toBlock:typeof o==="bigint"?M(o):o}]});let d=f.map((h)=>Ot(h));if(!l)return d;return ko({abi:l,args:a,logs:d,strict:u})}async function g0(e,t){let{abi:r,address:n,args:o,blockHash:i,eventName:s,fromBlock:a,toBlock:c,strict:u}=t,l=s?Tr({abi:r,name:s}):void 0,p=!l?r.filter((f)=>f.type==="event"):void 0;return q(e,Nu,"getLogs")({address:n,args:o,blockHash:i,event:l,events:p,fromBlock:a,toBlock:c,strict:u})}Pn();yr();ii();async function E_(e,{address:t,blockNumber:r,blockTag:n="latest"}){let o=await Ca(e,{address:t,...r!==void 0?{blockNumber:r}:{blockTag:n}});if(!o)return;if(fe(o)!==23)return;if(!o.startsWith("0xef0100"))return;return de(wr(o,3,23))}se();class bE extends B{constructor({address:e}){super(`No EIP-712 domain found on contract "${e}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${e}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function v_(e,t){let{address:r,factory:n,factoryData:o}=t;try{let[i,s,a,c,u,l,p]=await q(e,we,"readContract")({abi:Ire,address:r,functionName:"eip712Domain",factory:n,factoryData:o});return{domain:{name:s,version:a,chainId:Number(c),verifyingContract:u,salt:l},extensions:p,fields:i}}catch(i){let s=i;if(s.name==="ContractFunctionExecutionError"&&s.cause.name==="ContractFunctionZeroDataError")throw new bE({address:r});throw s}}var Ire=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];X();function S_(e){return{baseFeePerGas:e.baseFeePerGas.map((t)=>BigInt(t)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:e.reward?.map((t)=>t.map((r)=>BigInt(r)))}}async function A_(e,{blockCount:t,blockNumber:r,blockTag:n="latest",rewardPercentiles:o}){let i=typeof r==="bigint"?M(r):void 0,s=await e.request({method:"eth_feeHistory",params:[M(t),i||n,o]},{dedupe:Boolean(i)});return S_(s)}async function ls(e,{filter:t}){let r="strict"in t&&t.strict,n=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof n[0]==="string")return n;let o=n.map((i)=>Ot(i));if(!("abi"in t)||!t.abi)return o;return ko({abi:t.abi,logs:o,strict:r})}async function C_(e,{filter:t}){let r=t.strict??!1,o=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map((i)=>Ot(i));if(!t.abi)return o;return ko({abi:t.abi,logs:o,strict:r})}ts();Er();st();function Rre(e){return e.map((t)=>({...t,value:BigInt(t.value)}))}function D_(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?Oe(e.nonce):void 0,storageProof:e.storageProof?Rre(e.storageProof):void 0}}async function I_(e,{address:t,blockHash:r,blockNumber:n,blockTag:o="latest",requireCanonical:i,storageKeys:s}){let a=cr({blockHash:r,blockNumber:n,blockTag:o,requireCanonical:i}),c=await e.request({method:"eth_getProof",params:[t,s,a]});return D_(c)}ir();async function O_(e,{hash:t}){let r=await e.request({method:"eth_getRawTransactionByHash",params:[t]},{dedupe:!0});if(!r)throw new la({hash:t});return r}ts();async function k_(e,{address:t,blockHash:r,blockNumber:n,blockTag:o="latest",requireCanonical:i,slot:s}){let a=cr({blockHash:r,blockNumber:n,blockTag:o,requireCanonical:i});return await e.request({method:"eth_getStorageAt",params:[t,s,a]})}ts();async function R_(e,{blockHash:t,blockNumber:r,blockTag:n="latest",requireCanonical:o,requests:i}){let s=cr({blockHash:t,blockNumber:r,blockTag:n,requireCanonical:o});return e.request({method:"eth_getStorageValues",params:[i,s]})}ir();X();async function Fu(e,{blockHash:t,blockNumber:r,blockTag:n,hash:o,index:i,sender:s,nonce:a}){let c=n||"latest",u=r!==void 0?M(r):void 0,l=null;if(o)l=await e.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0});else if(t)l=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,M(i)]},{dedupe:!0});else if((u||c)&&typeof i==="number")l=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[u||c,M(i)]},{dedupe:Boolean(u)});else if(s&&typeof a==="number")l=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[s,M(a)]},{dedupe:!0});if(!l)throw new la({blockHash:t,blockNumber:r,blockTag:c,hash:o,index:i});return(e.chain?.formatters?.transaction?.format||Au)(l,"getTransaction")}async function P_(e,{hash:t,transactionReceipt:r}){let[n,o]=await Promise.all([q(e,on,"getBlockNumber")({}),t?q(e,Fu,"getTransaction")({hash:t}):void 0]),i=r?.blockNumber||o?.blockNumber;if(!i)return 0n;return n-i+1n}ir();async function Mu(e,{hash:t}){let r=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!r)throw new cf({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||Bu)(r,"getTransactionReceipt")}_t();et();se();xo();ai();Er();ca();t0();async function __(e,t){let{account:r,authorizationList:n,allowFailure:o=!0,blockHash:i,blockNumber:s,blockOverrides:a,blockTag:c,requireCanonical:u,stateOverride:l}=t,p=t.contracts,f=typeof e.batch?.multicall==="object"?e.batch.multicall:{},d=t.batchSize??f.batchSize??1024,h=t.deployless??f.deployless??!1,m=(()=>{if(t.multicallAddress)return t.multicallAddress;if(h)return null;if(e.chain)return en({blockNumber:s,chain:e.chain,contract:"multicall3"});throw Error("client chain not configured. multicallAddress is required.")})(),y=[[]],g=0,x=0;for(let O=0;O<p.length;O++){let{abi:T,address:A,args:E,functionName:R}=p[O];try{let S=Be({abi:T,args:E,functionName:R});if(x+=(S.length-2)/2,d>0&&x>d&&y[g].length>0)g++,x=(S.length-2)/2,y[g]=[];y[g]=[...y[g],{allowFailure:!0,callData:S,target:A}]}catch(S){let k=Lr(S,{abi:T,address:A,args:E,docsPath:"/docs/contract/multicall",functionName:R,sender:r});if(!o)throw k;y[g]=[...y[g],{allowFailure:!0,callData:"0x",target:A}]}}let b=Boolean(e.batch?.multicall),w=b?y.flatMap((O)=>O.map((T)=>[T])):y,v=await Promise.allSettled(w.map((O)=>{if(b)return Pre(e,{account:r,authorizationList:n,batchSize:d,blockHash:i,blockNumber:s,blockOverrides:a,blockTag:c,call:O[0],multicallAddress:m,requireCanonical:u,stateOverride:l}).then((T)=>[T]);return q(e,we,"readContract")({...m===null?{code:wa}:{address:m},abi:Jr,account:r,args:[O],authorizationList:n,blockHash:i,blockNumber:s,blockOverrides:a,blockTag:c,functionName:"aggregate3",requireCanonical:u,stateOverride:l})})),D=[];for(let O=0;O<v.length;O++){let T=v[O];if(T.status==="rejected"){if(!o)throw T.reason;for(let E=0;E<w[O].length;E++)D.push({status:"failure",error:T.reason,result:void 0});continue}let A=T.value;for(let E=0;E<A.length;E++){let{returnData:R,success:S}=A[E],{callData:k}=w[O][E],{abi:I,address:C,functionName:P,args:N}=p[D.length];try{if(k==="0x")throw new Dn;if(!S)throw new bo({data:R});let L=Gt({abi:I,args:N,data:R,functionName:P});D.push(o?{result:L,status:"success"}:L)}catch(L){let F=Lr(L,{abi:I,address:C,args:N,docsPath:"/docs/contract/multicall",functionName:P});if(!o)throw F;D.push({error:F,result:void 0,status:"failure"})}}}if(D.length!==p.length)throw new B("multicall results mismatch");return D}async function Pre(e,t){let{batchSize:r,call:n,multicallAddress:o,...i}=t,{wait:s=0}=typeof e.batch?.multicall==="object"?e.batch.multicall:{},{schedule:a}=wu({id:ue(["multicall",e.uid,r,o,i]),wait:s,shouldSplitBatch(u){if(r===0)return!1;return u.reduce((p,{callData:f})=>p+(f.length-2)/2,0)>r},fn:(u)=>q(e,we,"readContract")({...o===null?{code:wa}:{address:o},...i,abi:Jr,args:[u],functionName:"aggregate3"})}),[c]=await a(n);return c}kT();et();xo();hi();ai();Er();X();vf();So();r0();Ao();async function Lu(e,t){let{blockNumber:r,blockTag:n=e.experimental_blockTag??"latest",blocks:o,returnFullTransactions:i,traceTransfers:s,validation:a}=t;try{let c=[];for(let f of o){let d=f.blockOverrides?Jy(f.blockOverrides):void 0,h=f.calls.map((y)=>{let g=y,x=g.account?ee(g.account):void 0,b=g.abi?Be(g):g.data,w={...g,account:x,data:g.dataSuffix?yt([b||"0x",g.dataSuffix]):b,from:g.from??x?.address};return Dt(w),Ct(w)}),m=f.stateOverrides?Tu(f.stateOverrides):void 0;c.push({blockOverrides:d,calls:h,stateOverrides:m})}let l=(typeof r==="bigint"?M(r):void 0)||n;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:i,traceTransfers:s,validation:a},l]})).map((f,d)=>({...Cu(f),calls:f.calls.map((h,m)=>{let{abi:y,args:g,functionName:x,to:b}=o[d].calls[m],w=h.error?.data??h.returnData,v=BigInt(h.gasUsed),D=h.maxUsedGas===void 0?void 0:BigInt(h.maxUsedGas),O=h.logs?.map((R)=>Ot(R)),T=h.status==="0x1"?"success":"failure",A=y&&T==="success"&&w!=="0x"?Gt({abi:y,data:w,functionName:x}):null,E=(()=>{if(T==="success")return;let R;if(w==="0x")R=new Dn;else if(w)R=new bo({data:w});if(!R)return;return Lr(R,{abi:y??[],address:b??"0x",args:g,functionName:x??"<unknown>"})})();return{data:w,gasUsed:v,logs:O,...D===void 0?{}:{maxUsedGas:D},status:T,...T==="success"?{result:A}:{error:E}}})}))}catch(c){let u=c,l=rs(u,{});if(l instanceof Fn)throw u;throw l}}var B_="1.3.0";class nt extends Error{constructor(e,t={}){let r=t.cause instanceof nt?t.cause.details:t.cause?.message?t.cause.message:t.details,n=t.cause instanceof nt?t.cause.docsPath||t.docsPath:t.docsPath,o=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...n?[`Docs: https://abitype.dev${n}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${B_}`].join(`
286
+ `);super(o);if(Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),t.cause)this.cause=t.cause;this.details=r,this.docsPath=n,this.metaMessages=t.metaMessages,this.shortMessage=e}}function Hr(e,t){return e.exec(t)?.groups}var xE=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,wE=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,b0=/^\(.+?\).*?$/;var N_=/^tuple(?<array>(\[(\d*)\])*)$/;function x0(e){let t=e.type;if(N_.test(e.type)&&"components"in e){t="(";let r=e.components.length;for(let o=0;o<r;o++){let i=e.components[o];if(t+=x0(i),o<r-1)t+=", "}let n=Hr(N_,e.type);return t+=`)${n?.array||""}`,x0({...e,type:t})}if("indexed"in e&&e.indexed)t=`${t} indexed`;if(e.name)return`${t} ${e.name}`;return t}function Ti(e){let t="",r=e.length;for(let n=0;n<r;n++){let o=e[n];if(t+=x0(o),n!==r-1)t+=", "}return t}function _f(e){if(e.type==="function")return`function ${e.name}(${Ti(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${Ti(e.outputs)})`:""}`;if(e.type==="event")return`event ${e.name}(${Ti(e.inputs)})`;if(e.type==="error")return`error ${e.name}(${Ti(e.inputs)})`;if(e.type==="constructor")return`constructor(${Ti(e.inputs)})${e.stateMutability==="payable"?" payable":""}`;if(e.type==="fallback")return`fallback() external${e.stateMutability==="payable"?" payable":""}`;return"receive() external payable"}var F_=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function M_(e){return F_.test(e)}function L_(e){return Hr(F_,e)}var $_=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function U_(e){return $_.test(e)}function H_(e){return Hr($_,e)}var j_=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function q_(e){return j_.test(e)}function z_(e){return Hr(j_,e)}var G_=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function $u(e){return G_.test(e)}function V_(e){return Hr(G_,e)}var W_=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function K_(e){return W_.test(e)}function Y_(e){return Hr(W_,e)}var Z_=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function J_(e){return Z_.test(e)}function X_(e){return Hr(Z_,e)}var _re=/^receive\(\) external payable$/;function Q_(e){return _re.test(e)}var TE=new Set(["memory","indexed","storage","calldata"]),eB=new Set(["indexed"]),w0=new Set(["calldata","memory","storage"]);class EE extends nt{constructor({signature:e}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiitem-1"});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class vE extends nt{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class SE extends nt{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class AE extends nt{constructor({params:e}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiparameters-1"});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class CE extends nt{constructor({param:e}){super("Invalid ABI parameter.",{details:e});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class DE extends nt{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class IE extends nt{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class OE extends nt{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class kE extends nt{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class Ei extends nt{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class RE extends nt{constructor({signature:e}){super("Unknown signature.",{details:e});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class PE extends nt{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class _E extends nt{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class BE extends nt{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function tB(e,t,r){let n="";if(r)for(let o of Object.entries(r)){if(!o)continue;let i="";for(let s of o[1])i+=`[${s.type}${s.name?`:${s.name}`:""}]`;n+=`(${o[0]}{${i}})`}if(t)return`${t}:${e}${n}`;return`${e}${n}`}var T0=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function NE(e,t={}){if(q_(e))return Bre(e,t);if(U_(e))return Nre(e,t);if(M_(e))return Fre(e,t);if(K_(e))return Mre(e,t);if(J_(e))return Lre(e);if(Q_(e))return{type:"receive",stateMutability:"payable"};throw new RE({signature:e})}function Bre(e,t={}){let r=z_(e);if(!r)throw new Ei({signature:e,type:"function"});let n=Ir(r.parameters),o=[],i=n.length;for(let a=0;a<i;a++)o.push(Mn(n[a],{modifiers:w0,structs:t,type:"function"}));let s=[];if(r.returns){let a=Ir(r.returns),c=a.length;for(let u=0;u<c;u++)s.push(Mn(a[u],{modifiers:w0,structs:t,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:o,outputs:s}}function Nre(e,t={}){let r=H_(e);if(!r)throw new Ei({signature:e,type:"event"});let n=Ir(r.parameters),o=[],i=n.length;for(let s=0;s<i;s++)o.push(Mn(n[s],{modifiers:eB,structs:t,type:"event"}));return{name:r.name,type:"event",inputs:o}}function Fre(e,t={}){let r=L_(e);if(!r)throw new Ei({signature:e,type:"error"});let n=Ir(r.parameters),o=[],i=n.length;for(let s=0;s<i;s++)o.push(Mn(n[s],{structs:t,type:"error"}));return{name:r.name,type:"error",inputs:o}}function Mre(e,t={}){let r=Y_(e);if(!r)throw new Ei({signature:e,type:"constructor"});let n=Ir(r.parameters),o=[],i=n.length;for(let s=0;s<i;s++)o.push(Mn(n[s],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:o}}function Lre(e){let t=X_(e);if(!t)throw new Ei({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}var $re=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Ure=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Hre=/^u?int$/;function Mn(e,t){let r=tB(e,t?.type,t?.structs);if(T0.has(r))return T0.get(r);let n=b0.test(e),o=Hr(n?Ure:$re,e);if(!o)throw new CE({param:e});if(o.name&&qre(o.name))throw new DE({param:e,name:o.name});let i=o.name?{name:o.name}:{},s=o.modifier==="indexed"?{indexed:!0}:{},a=t?.structs??{},c,u={};if(n){c="tuple";let p=Ir(o.type),f=[],d=p.length;for(let h=0;h<d;h++)f.push(Mn(p[h],{structs:a}));u={components:f}}else if(o.type in a)c="tuple",u={components:a[o.type]};else if(Hre.test(o.type))c=`${o.type}256`;else if(o.type==="address payable")c="address";else if(c=o.type,t?.type!=="struct"&&!FE(c))throw new SE({type:c});if(o.modifier){if(!t?.modifiers?.has?.(o.modifier))throw new IE({param:e,type:t?.type,modifier:o.modifier});if(w0.has(o.modifier)&&!zre(c,!!o.array))throw new OE({param:e,type:t?.type,modifier:o.modifier})}let l={type:`${c}${o.array??""}`,...i,...s,...u};return T0.set(r,l),l}function Ir(e,t=[],r="",n=0){let o=e.trim().length;for(let i=0;i<o;i++){let s=e[i],a=e.slice(i+1);switch(s){case",":return n===0?Ir(a,[...t,r.trim()]):Ir(a,t,`${r}${s}`,n);case"(":return Ir(a,t,`${r}${s}`,n+1);case")":return Ir(a,t,`${r}${s}`,n-1);default:return Ir(a,t,`${r}${s}`,n)}}if(r==="")return t;if(n!==0)throw new BE({current:r,depth:n});return t.push(r.trim()),t}function FE(e){return e==="address"||e==="bool"||e==="function"||e==="string"||xE.test(e)||wE.test(e)}var jre=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function qre(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||xE.test(e)||wE.test(e)||jre.test(e)}function zre(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function E0(e){let t={},r=e.length;for(let s=0;s<r;s++){let a=e[s];if(!$u(a))continue;let c=V_(a);if(!c)throw new Ei({signature:a,type:"struct"});let u=c.properties.split(";"),l=[],p=u.length;for(let f=0;f<p;f++){let h=u[f].trim();if(!h)continue;let m=Mn(h,{type:"struct"});l.push(m)}if(!l.length)throw new PE({signature:a});t[c.name]=l}let n={},o=Object.entries(t),i=o.length;for(let s=0;s<i;s++){let[a,c]=o[s];n[a]=rB(c,t)}return n}var Gre=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function rB(e=[],t={},r=new Set){let n=[],o=e.length;for(let i=0;i<o;i++){let s=e[i];if(b0.test(s.type))n.push(s);else{let c=Hr(Gre,s.type);if(!c?.type)throw new kE({abiParameter:s});let{array:u,type:l}=c;if(l in t){if(r.has(l))throw new _E({type:l});n.push({...s,type:`tuple${u??""}`,components:rB(t[l],t,new Set([...r,l]))})}else if(FE(l))n.push(s);else throw new vE({type:l})}}return n}function v0(e){let t;if(typeof e==="string")t=NE(e);else{let r=E0(e),n=e.length;for(let o=0;o<n;o++){let i=e[o];if($u(i))continue;t=NE(i,r);break}}if(!t)throw new EE({signature:e});return t}function S0(e){let t=[];if(typeof e==="string"){let r=Ir(e),n=r.length;for(let o=0;o<n;o++)t.push(Mn(r[o],{modifiers:TE}))}else{let r=E0(e),n=e.length;for(let o=0;o<n;o++){let i=e[o];if($u(i))continue;let s=Ir(i),a=s.length;for(let c=0;c<a;c++)t.push(Mn(s[c],{modifiers:TE,structs:r}))}}if(t.length===0)throw new AE({params:e});return t}rn();GT();Fr();var Vre=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),iB=(()=>Uint8Array.from(Array(16).fill(0).map((e,t)=>t)))(),Wre=(()=>iB.map((e)=>(9*e+5)%16))(),sB=(()=>{let r=[[iB],[Wre]];for(let n=0;n<4;n++)for(let o of r)o.push(o[n].map((i)=>Vre[i]));return r})(),aB=(()=>sB[0])(),cB=(()=>sB[1])(),uB=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((e)=>Uint8Array.from(e)),Kre=aB.map((e,t)=>e.map((r)=>uB[t][r])),Yre=cB.map((e,t)=>e.map((r)=>uB[t][r])),Zre=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),Jre=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function oB(e,t,r,n){if(e===0)return t^r^n;if(e===1)return t&r|~t&n;if(e===2)return(t|~r)^n;if(e===3)return t&n|r&~n;return t^(r|~n)}var A0=new Uint32Array(16);class lB extends vu{constructor(){super(64,20,8,!0);this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:e,h1:t,h2:r,h3:n,h4:o}=this;return[e,t,r,n,o]}set(e,t,r,n,o){this.h0=e|0,this.h1=t|0,this.h2=r|0,this.h3=n|0,this.h4=o|0}process(e,t){for(let f=0;f<16;f++,t+=4)A0[f]=e.getUint32(t,!0);let r=this.h0|0,n=r,o=this.h1|0,i=o,s=this.h2|0,a=s,c=this.h3|0,u=c,l=this.h4|0,p=l;for(let f=0;f<5;f++){let d=4-f,h=Zre[f],m=Jre[f],y=aB[f],g=cB[f],x=Kre[f],b=Yre[f];for(let w=0;w<16;w++){let v=Zp(r+oB(f,o,s,c)+A0[y[w]]+h,x[w])+l|0;r=l,l=c,c=Zp(s,10)|0,s=o,o=v}for(let w=0;w<16;w++){let v=Zp(n+oB(d,i,a,u)+A0[g[w]]+m,b[w])+p|0;n=p,p=u,u=Zp(a,10)|0,a=i,i=v}}this.set(this.h1+s+u|0,this.h2+c+p|0,this.h3+l+n|0,this.h4+r+i|0,this.h0+o+a|0)}roundClean(){Nt(A0)}destroy(){this.destroyed=!0,Nt(this.buffer),this.set(0,0,0,0,0)}}var pB=sa(()=>new lB);R2();yu();Ar();function C0(e,t={}){let{as:r=typeof e==="string"?"Hex":"Bytes"}=t,n=Sy(KR(e));if(r==="Bytes")return n;return Vt(n)}Ar();yu();class ME extends Map{constructor(e){super();Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);if(super.has(e)&&t!==void 0)this.delete(e),super.set(e,t);return t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let r=this.keys().next().value;if(r)this.delete(r)}return this}}var Xre={checksum:new ME(8192)},D0=Xre.checksum;rn();var ene=/^0x[a-fA-F0-9]{40}$/;function Uu(e,t={}){let{strict:r=!0}=t;if(!ene.test(e))throw new LE({address:e,cause:new dB});if(r){if(e.toLowerCase()===e)return;if($E(e)!==e)throw new LE({address:e,cause:new mB})}}function $E(e){if(D0.has(e))return D0.get(e);Uu(e,{strict:!1});let t=e.substring(2).toLowerCase(),r=C0(YR(t),{as:"Bytes"}),n=t.split("");for(let i=0;i<40;i+=2){if(r[i>>1]>>4>=8&&n[i])n[i]=n[i].toUpperCase();if((r[i>>1]&15)>=8&&n[i+1])n[i+1]=n[i+1].toUpperCase()}let o=`0x${n.join("")}`;return D0.set(e,o),o}function I0(e,t={}){let{strict:r=!0}=t??{};try{return Uu(e,{strict:r}),!0}catch{return!1}}class LE extends Q{constructor({address:e,cause:t}){super(`Address "${e}" is invalid.`,{cause:t});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class dB extends Q{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class mB extends Q{constructor(){super("Address does not match its checksum counterpart.");Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}rn();function k0(e){let t=!0,r="",n=0,o="",i=!1;for(let s=0;s<e.length;s++){let a=e[s];if(["(",")",","].includes(a))t=!0;if(a==="(")n++;if(a===")")n--;if(!t)continue;if(n===0){if(a===" "&&["event","function","error",""].includes(o))o="";else if(o+=a,a===")"){i=!0;break}continue}if(a===" "){if(e[s-1]!==","&&r!==","&&r!==",(")r="",t=!1;continue}o+=a,r+=a}if(!i)throw new Q("Unable to normalize signature.");return o}function O0(e,t){let r=typeof e,n=t.type;switch(n){case"address":return I0(e,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:{if(n==="tuple"&&"components"in t)return Object.values(t.components).every((o,i)=>O0(Object.values(e)[i],o));if(/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n))return r==="number"||r==="bigint";if(/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n))return r==="string"||e instanceof Uint8Array;if(/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n))return Array.isArray(e)&&e.every((o)=>O0(o,{...t,type:n.replace(/(\[[0-9]{0,}\])$/,"")}));return!1}}}function HE(e,t,r){for(let n in e){let o=e[n],i=t[n];if(o.type==="tuple"&&i.type==="tuple"&&"components"in o&&"components"in i)return HE(o.components,i.components,r[n]);let s=[o.type,i.type];if((()=>{if(s.includes("address")&&s.includes("bytes20"))return!0;if(s.includes("address")&&s.includes("string"))return I0(r[n],{strict:!1});if(s.includes("address")&&s.includes("bytes"))return I0(r[n],{strict:!1});return!1})())return s}return}function Hu(e,t={}){let{prepare:r=!0}=t,n=(()=>{if(Array.isArray(e))return v0(e);if(typeof e==="string")return v0(e);return e})();return{...n,...r?{hash:ps(n)}:{}}}function ju(e,t,r){let{args:n=[],prepare:o=!0}=r??{},i=OT(t,{strict:!1}),s=e.filter((u)=>{if(i){if(u.type==="function"||u.type==="error")return jE(u)===Wt(t,0,4);if(u.type==="event")return ps(u)===t;return!1}return"name"in u&&u.name===t});if(s.length===0)throw new fs({name:t});if(s.length===1)return{...s[0],...o?{hash:ps(s[0])}:{}};let a;for(let u of s){if(!("inputs"in u))continue;if(!n||n.length===0){if(!u.inputs||u.inputs.length===0)return{...u,...o?{hash:ps(u)}:{}};continue}if(!u.inputs)continue;if(u.inputs.length===0)continue;if(u.inputs.length!==n.length)continue;if(n.every((p,f)=>{let d="inputs"in u&&u.inputs[f];if(!d)return!1;return O0(p,d)})){if(a&&"inputs"in a&&a.inputs){let p=HE(u.inputs,a.inputs,n);if(p)throw new hB({abiItem:u,type:p[0]},{abiItem:a,type:p[1]})}a=u}}let c=(()=>{if(a)return a;let[u,...l]=s;return{...u,overloads:l}})();if(!c)throw new fs({name:t});return{...c,...o?{hash:ps(c)}:{}}}function jE(...e){let t=(()=>{if(Array.isArray(e[0])){let[r,n]=e;return ju(r,n)}return e[0]})();return Wt(ps(t),0,4)}function rne(...e){let t=(()=>{if(Array.isArray(e[0])){let[n,o]=e;return ju(n,o)}return e[0]})(),r=(()=>{if(typeof t==="string")return t;return _f(t)})();return k0(r)}function ps(...e){let t=(()=>{if(Array.isArray(e[0])){let[r,n]=e;return ju(r,n)}return e[0]})();if(typeof t!=="string"&&"hash"in t&&t.hash)return t.hash;return C0(bu(rne(t)))}class hB extends Q{constructor(e,t){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}\` in \`${k0(_f(e.abiItem))}\`, and`,`\`${t.type}\` in \`${k0(_f(t.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class fs extends Q{constructor({name:e,data:t,type:r="item"}){let n=(()=>{if(e)return` with name "${e}"`;if(t)return` with data "${t}"`;return""})();super(`ABI ${r}${n} not found.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}yu();rn();Ar();yu();rn();Ar();var yB=/^(.*)\[([0-9]*)\]$/,gB=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,R0=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,yJe=2n**(8n-1n)-1n,gJe=2n**(16n-1n)-1n,bJe=2n**(24n-1n)-1n,xJe=2n**(32n-1n)-1n,wJe=2n**(40n-1n)-1n,TJe=2n**(48n-1n)-1n,EJe=2n**(56n-1n)-1n,vJe=2n**(64n-1n)-1n,SJe=2n**(72n-1n)-1n,AJe=2n**(80n-1n)-1n,CJe=2n**(88n-1n)-1n,DJe=2n**(96n-1n)-1n,IJe=2n**(104n-1n)-1n,OJe=2n**(112n-1n)-1n,kJe=2n**(120n-1n)-1n,RJe=2n**(128n-1n)-1n,PJe=2n**(136n-1n)-1n,_Je=2n**(144n-1n)-1n,BJe=2n**(152n-1n)-1n,NJe=2n**(160n-1n)-1n,FJe=2n**(168n-1n)-1n,MJe=2n**(176n-1n)-1n,LJe=2n**(184n-1n)-1n,$Je=2n**(192n-1n)-1n,UJe=2n**(200n-1n)-1n,HJe=2n**(208n-1n)-1n,jJe=2n**(216n-1n)-1n,qJe=2n**(224n-1n)-1n,zJe=2n**(232n-1n)-1n,GJe=2n**(240n-1n)-1n,VJe=2n**(248n-1n)-1n,WJe=2n**(256n-1n)-1n,KJe=-(2n**(8n-1n)),YJe=-(2n**(16n-1n)),ZJe=-(2n**(24n-1n)),JJe=-(2n**(32n-1n)),XJe=-(2n**(40n-1n)),QJe=-(2n**(48n-1n)),eXe=-(2n**(56n-1n)),tXe=-(2n**(64n-1n)),rXe=-(2n**(72n-1n)),nXe=-(2n**(80n-1n)),oXe=-(2n**(88n-1n)),iXe=-(2n**(96n-1n)),sXe=-(2n**(104n-1n)),aXe=-(2n**(112n-1n)),cXe=-(2n**(120n-1n)),uXe=-(2n**(128n-1n)),lXe=-(2n**(136n-1n)),pXe=-(2n**(144n-1n)),fXe=-(2n**(152n-1n)),dXe=-(2n**(160n-1n)),mXe=-(2n**(168n-1n)),hXe=-(2n**(176n-1n)),yXe=-(2n**(184n-1n)),gXe=-(2n**(192n-1n)),bXe=-(2n**(200n-1n)),xXe=-(2n**(208n-1n)),wXe=-(2n**(216n-1n)),TXe=-(2n**(224n-1n)),EXe=-(2n**(232n-1n)),vXe=-(2n**(240n-1n)),SXe=-(2n**(248n-1n)),AXe=-(2n**(256n-1n)),CXe=2n**8n-1n,DXe=2n**16n-1n,IXe=2n**24n-1n,OXe=2n**32n-1n,kXe=2n**40n-1n,RXe=2n**48n-1n,PXe=2n**56n-1n,_Xe=2n**64n-1n,BXe=2n**72n-1n,NXe=2n**80n-1n,FXe=2n**88n-1n,MXe=2n**96n-1n,LXe=2n**104n-1n,$Xe=2n**112n-1n,UXe=2n**120n-1n,HXe=2n**128n-1n,jXe=2n**136n-1n,qXe=2n**144n-1n,zXe=2n**152n-1n,GXe=2n**160n-1n,VXe=2n**168n-1n,WXe=2n**176n-1n,KXe=2n**184n-1n,YXe=2n**192n-1n,ZXe=2n**200n-1n,JXe=2n**208n-1n,XXe=2n**216n-1n,QXe=2n**224n-1n,eQe=2n**232n-1n,tQe=2n**240n-1n,rQe=2n**248n-1n,zE=2n**256n-1n;function Ia(e,t,r){let{checksumAddress:n,staticPosition:o}=r,i=WE(t.type);if(i){let[s,a]=i;return one(e,{...t,type:a},{checksumAddress:n,length:s,staticPosition:o})}if(t.type==="tuple")return cne(e,t,{checksumAddress:n,staticPosition:o});if(t.type==="address")return nne(e,{checksum:n});if(t.type==="bool")return ine(e);if(t.type.startsWith("bytes"))return sne(e,t,{staticPosition:o});if(t.type.startsWith("uint")||t.type.startsWith("int"))return ane(e,t);if(t.type==="string")return une(e,{staticPosition:o});throw new Bf(t.type)}var xB=32,GE=32;function nne(e,t={}){let{checksum:r=!1}=t,n=e.readBytes(32);return[((i)=>r?$E(i):i)(Vt(ZR(n,-20))),32]}function one(e,t,r){let{checksumAddress:n,length:o,staticPosition:i}=r;if(o===null){let c=wo(e.readBytes(GE)),u=i+c,l=u+xB;e.setPosition(u);let p=wo(e.readBytes(xB)),f=qu(t),d=0,h=[];for(let m=0;m<p;++m){e.setPosition(l+(f?m*32:d));let[y,g]=Ia(e,t,{checksumAddress:n,staticPosition:l});if(d+=g,h.push(y),g===0)e.assertReadLimit(),e._touch()}return e.setPosition(i+32),[h,32]}if(qu(t)){let c=wo(e.readBytes(GE)),u=i+c,l=[];for(let p=0;p<o;++p){e.setPosition(u+p*32);let[f]=Ia(e,t,{checksumAddress:n,staticPosition:u});l.push(f)}return e.setPosition(i+32),[l,32]}let s=0,a=[];for(let c=0;c<o;++c){let[u,l]=Ia(e,t,{checksumAddress:n,staticPosition:i+s});if(s+=l,a.push(u),l===0)e.assertReadLimit(),e._touch()}return[a,s]}function ine(e){return[XR(e.readBytes(32),{size:32}),32]}function sne(e,t,{staticPosition:r}){let[n,o]=t.type.split("bytes");if(!o){let s=wo(e.readBytes(32));e.setPosition(r+s);let a=wo(e.readBytes(32));if(a===0)return e.setPosition(r+32),["0x",32];let c=e.readBytes(a);return e.setPosition(r+32),[Vt(c),32]}return[Vt(e.readBytes(Number.parseInt(o,10),32)),32]}function ane(e,t){let r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[n>48?JR(o,{signed:r}):wo(o,{signed:r}),32]}function cne(e,t,r){let{checksumAddress:n,staticPosition:o}=r,i=t.components.length===0||t.components.some(({name:c})=>!c),s=i?[]:{},a=0;if(qu(t)){let c=wo(e.readBytes(GE)),u=o+c;for(let l=0;l<t.components.length;++l){let p=t.components[l];e.setPosition(u+a);let[f,d]=Ia(e,p,{checksumAddress:n,staticPosition:u});a+=d,s[i?l:p?.name]=f}return e.setPosition(o+32),[s,32]}for(let c=0;c<t.components.length;++c){let u=t.components[c],[l,p]=Ia(e,u,{checksumAddress:n,staticPosition:o});s[i?c:u?.name]=l,a+=p}return[s,a]}function une(e,{staticPosition:t}){let r=wo(e.readBytes(32)),n=t+r;e.setPosition(n);let o=wo(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];let i=e.readBytes(o,32),s=QR(AT(i));return e.setPosition(t+32),[s,32]}function wB({checksumAddress:e,parameters:t,values:r}){let n=[];for(let o=0;o<t.length;o++)n.push(VE({checksumAddress:e,parameter:t[o],value:r[o]}));return n}function VE({checksumAddress:e=!1,parameter:t,value:r}){let n=t,o=WE(n.type);if(o){let[i,s]=o;return pne(r,{checksumAddress:e,length:i,parameter:{...n,type:s}})}if(n.type==="tuple")return yne(r,{checksumAddress:e,parameter:n});if(n.type==="address")return lne(r,{checksum:e});if(n.type==="bool")return dne(r);if(n.type.startsWith("uint")||n.type.startsWith("int")){let i=n.type.startsWith("int"),[,,s="256"]=R0.exec(n.type)??[];return mne(r,{signed:i,size:Number(s)})}if(n.type.startsWith("bytes"))return fne(r,{type:n.type});if(n.type==="string")return hne(r);throw new Bf(n.type)}function P0(e){let t=0;for(let i=0;i<e.length;i++){let{dynamic:s,encoded:a}=e[i];if(s)t+=32;else t+=ut(a)}let r=[],n=[],o=0;for(let i=0;i<e.length;i++){let{dynamic:s,encoded:a}=e[i];if(s)r.push(rt(t+o,{size:32})),n.push(a),o+=ut(a);else r.push(a)}return At(...r,...n)}function lne(e,t){let{checksum:r=!1}=t;return Uu(e,{strict:r}),{dynamic:!1,encoded:di(e.toLowerCase())}}function pne(e,t){let{checksumAddress:r,length:n,parameter:o}=t,i=n===null;if(!Array.isArray(e))throw new YE(e);if(!i&&e.length!==n)throw new KE({expectedLength:n,givenLength:e.length,type:`${o.type}[${n}]`});let s=e.length===0&&qu(o),a=[];for(let c=0;c<e.length;c++){let u=VE({checksumAddress:r,parameter:o,value:e[c]});if(u.dynamic)s=!0;a.push(u)}if(i||s){let c=P0(a);if(i){let u=rt(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?At(u,c):u}}if(s)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:At(...a.map(({encoded:c})=>c))}}function fne(e,{type:t}){let[,r]=t.split("bytes"),n=ut(e);if(!r){let o=e;if(n%32!==0)o=To(o,Math.ceil((e.length-2)/2/32)*32);return{dynamic:!0,encoded:At(di(rt(n,{size:32})),o)}}if(n!==Number.parseInt(r,10))throw new _0({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:To(e)}}function dne(e){if(typeof e!=="boolean")throw new Q(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:di(Yy(e))}}function mne(e,{signed:t,size:r}){if(typeof r==="number"){let n=2n**(BigInt(r)-(t?1n:0n))-1n,o=t?-n-1n:0n;if(e>n||e<o)throw new Zy({max:n.toString(),min:o.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:rt(e,{size:32,signed:t})}}function hne(e){let t=bu(e),r=Math.ceil(ut(t)/32),n=[];for(let o=0;o<r;o++)n.push(To(Wt(t,o*32,(o+1)*32)));return{dynamic:!0,encoded:At(To(rt(ut(t),{size:32})),...n)}}function yne(e,t){let{checksumAddress:r,parameter:n}=t,o=!1,i=[];for(let s=0;s<n.components.length;s++){let a=n.components[s],c=Array.isArray(e)?s:a.name,u=VE({checksumAddress:r,parameter:a,value:e[c]});if(i.push(u),u.dynamic)o=!0}return{dynamic:o,encoded:o?P0(i):At(...i.map(({encoded:s})=>s))}}function WE(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function qu(e){let{type:t}=e;if(t==="string")return!0;if(t==="bytes")return!0;if(t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(qu);let r=WE(e.type);if(r&&qu({...e,type:r[1]}))return!0;return!1}rn();var bne={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new vB({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new EB({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new ZE({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new ZE({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();if(this.positionReadCount.set(this.position,e+1),e>0)this.recursiveReadCount++}};function TB(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(bne);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}class ZE extends Q{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class EB extends Q{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class vB extends Q{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function zu(e,t,r={}){let{as:n="Array",checksumAddress:o=!1}=r,i=typeof t==="string"?ST(t):t,s=TB(i);if(nn(i)===0&&e.length>0)throw new AB;if(nn(i)&&nn(i)<32)throw new SB({data:typeof t==="string"?t:Vt(t),parameters:e,size:nn(i)});let a=0,c=n==="Array"?[]:{};for(let u=0;u<e.length;++u){let l=e[u];if(a<i.length)s.setPosition(a);let[p,f]=Ia(s,l,{checksumAddress:o,staticPosition:0});if(a+=f,n==="Array")c.push(p);else c[l.name??u]=p}return c}function Oa(e,t,r){let{checksumAddress:n=!1}=r??{};if(e.length!==t.length)throw new XE({expectedLength:e.length,givenLength:t.length});let o=wB({checksumAddress:n,parameters:e,values:t}),i=P0(o);if(i.length===0)return"0x";return i}function JE(e,t){if(e.length!==t.length)throw new XE({expectedLength:e.length,givenLength:t.length});let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n];r.push(JE.encode(o,i))}return At(...r)}(function(e){function t(r,n,o=!1){if(r==="address"){let c=n;return Uu(c),di(c.toLowerCase(),o?32:0)}if(r==="string")return bu(n);if(r==="bytes")return n;if(r==="bool")return di(Yy(n),o?32:1);let i=r.match(R0);if(i){let[c,u,l="256"]=i,p=Number.parseInt(l,10)/8;return rt(n,{size:o?32:p,signed:u==="int"})}let s=r.match(gB);if(s){let[c,u]=s;if(Number.parseInt(u,10)!==(n.length-2)/2)throw new _0({expectedSize:Number.parseInt(u,10),value:n});return To(n,o?32:0)}let a=r.match(yB);if(a&&Array.isArray(n)){let[c,u]=a,l=[];for(let p=0;p<n.length;p++)l.push(t(u,n[p],!0));if(l.length===0)return"0x";return At(...l)}throw new Bf(r)}e.encode=t})(JE||(JE={}));function B0(e){if(Array.isArray(e)&&typeof e[0]==="string")return S0(e);if(typeof e==="string")return S0(e);return e}class SB extends Q{constructor({data:e,parameters:t,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${Ti(t)})`,`Data: ${e} (${r} bytes)`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class AB extends Q{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.');Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class KE extends Q{constructor({expectedLength:e,givenLength:t,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${e}\`. Given: \`${t}\`.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class _0 extends Q{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${ut(t)}) does not match expected size (bytes${e}).`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class XE extends Q{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${e}`,`Given length (values): ${t}`].join(`
287
+ `));Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class YE extends Q{constructor(e){super(`Value \`${e}\` is not a valid array.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class Bf extends Q{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}Ar();function CB(...e){let[t,r]=(()=>{if(Array.isArray(e[0])){let[i,s]=e;return[wne(i),s]}return e})(),{bytecode:n,args:o}=r;return At(n,t.inputs?.length&&o?.length?Oa(t.inputs,o):"0x")}function DB(e){return Hu(e)}function wne(e){let t=e.find((r)=>r.type==="constructor");if(!t)throw new fs({name:"constructor"});return t}function IB(e,t={}){return Hu(e,t)}function OB(e){return ps(e)}Ar();function kB(...e){let[t,r,n={}]=(()=>{if(Array.isArray(e[0])){let[i,s,a,c]=e;return[QE(i,s),a,c]}return e})(),o=zu(t.outputs,r,n);if(o&&Object.keys(o).length===0)return;if(o&&Object.keys(o).length===1){if(Array.isArray(o))return o[0];return Object.values(o)[0]}return o}function ds(...e){let[t,r=[]]=(()=>{if(Array.isArray(e[0])){let[u,l,p]=e;return[QE(u,l,{args:p}),p]}let[a,c]=e;return[a,c]})(),{overloads:n}=t,o=n?QE([t,...n],t.name,{args:r}):t,i=vne(o),s=r.length>0?Oa(o.inputs,r):void 0;return s?At(i,s):i}function ka(e,t={}){return Hu(e,t)}function QE(e,t,r){let n=ju(e,t,r);if(n.type!=="function")throw new fs({name:t,type:"function"});return n}function vne(e){return jE(e)}var Ff="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Ln="0x0000000000000000000000000000000000000000";se();xo();hi();Oc();st();ns();var Ane="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033",MB="0x608060405234801561000f575f5ffd5b5060043610610029575f3560e01c8063fd00430c1461002d575b5f5ffd5b6100476004803603810190610042919061012b565b610049565b005b80825f375f5f825f865afa610060573d5f5f3e3d5ffd5b3d5f5f3e3d5ff35b5f5ffd5b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61009982610070565b9050919050565b6100a98161008f565b81146100b3575f5ffd5b50565b5f813590506100c4816100a0565b92915050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f8401126100eb576100ea6100ca565b5b8235905067ffffffffffffffff811115610108576101076100ce565b5b602083019150836001820283011115610124576101236100d2565b5b9250929050565b5f5f5f6040848603121561014257610141610068565b5b5f61014f868287016100b6565b935050602084013567ffffffffffffffff8111156101705761016f61006c565b5b61017c868287016100d6565b9250925050925092509256fea2646970667358221220635ed99185cacf3f2acba6921f23687c969cec2bbaf5f9ad599f507e6e105e6964736f6c63430008230033",Mf=1000000n,Cne=0x00000000000000000000000000000000deadbeefn,Dne=OB(IB("event Transfer(address indexed from, address indexed to, uint256 value)")),RB=ka("function balanceOf(address) returns (uint256)"),PB=ka("function decimals() returns (uint256)"),_B=ka("function tokenURI(uint256) returns (string)"),BB=ka("function symbol() returns (string)"),Ine=ka("function query(address target, bytes data)");async function LB(e,t){let{blockNumber:r,blockTag:n,calls:o,stateOverrides:i,traceAssetChanges:s,traceTransfers:a,validation:c}=t,u=t.account?ee(t.account):void 0;if(s&&!u)throw new B("`account` is required when `traceAssetChanges` is true");let l=u?CB(DB("constructor(bytes, bytes)"),{bytecode:Xy,args:[Ane,ds(ka("function getBalance(address)"),[u.address])]}):void 0,p=n??e.experimental_blockTag??"latest",f=r;if(s&&typeof f!=="bigint"&&p!=="earliest"&&p!=="pending")if(p==="latest")f=await on(e,{cacheTime:0});else{let z=await lt(e,{blockTag:p});if(typeof z.number!=="bigint")throw new B(`Block tag \`${p}\` did not resolve to a number.`);f=z.number}let d=typeof f==="bigint"?{blockNumber:f}:{blockTag:p},h=s?await Lu(e,{...d,blocks:[{calls:o.map((z)=>({...z,from:u.address})),stateOverrides:i}],traceTransfers:a,validation:c}):void 0,m=h?[...new Set([...One(h[0].calls.flatMap((z)=>z.logs??[]),u.address),...t.calls.map((z)=>z.to?.toLowerCase())])].filter((z)=>Boolean(z)&&z!==Ff&&z!==Ln):[],y=kne([...u?[u.address]:[],...m,...i?.map(({address:z})=>z)??[]]),g=[{address:y,code:MB}],[x,b]=await Promise.all([s?Promise.all([FB(e,{account:u.address,...d,data:l,stateOverride:i}),...m.map((z)=>FB(e,{account:u.address,address:z,...d,data:ds(RB,[u.address]),staticCallAddress:y,stateOverride:i}))]):[],Lu(e,{...d,blocks:[{calls:[...o,{to:Ln}].map((z)=>({...z,from:u?.address})),stateOverrides:i},...s?[{calls:[{data:l}]},{calls:m.map((z)=>({to:y,gas:Mf,data:Lf(z,ds(RB,[u.address]))})),stateOverrides:g},{calls:m.map((z)=>({to:y,gas:Mf,data:Lf(z,ds(PB))})),stateOverrides:g},{calls:m.map((z)=>({to:y,gas:Mf,data:Lf(z,ds(_B,[0n]))})),stateOverrides:g},{calls:m.map((z)=>({to:y,gas:Mf,data:Lf(z,ds(BB))})),stateOverrides:g}]:[]],traceTransfers:a,validation:c})]),w=b[0],[v,D,O,T,A]=s?b.slice(1):[],{calls:E,...R}=w,S=E.slice(0,-1),k=x.map((z)=>NB(z)?_e(z.data):null),I=v?.calls??[],C=D?.calls??[],N=[...I,...C].map((z)=>NB(z)?_e(z.data):null),L=(O?.calls??[]).map((z)=>e6(z,PB)),F=(A?.calls??[]).map((z)=>e6(z,BB)),j=(T?.calls??[]).map((z)=>e6(z,_B)),V=[];for(let[z,te]of N.entries()){let G=k[z],Y=x[z],ne=typeof G==="bigint"?G:z>0&&Y?.status==="success"&&Y.data==="0x"?0n:null;if(typeof te!=="bigint")continue;if(typeof ne!=="bigint")continue;let he=L[z-1],Te=F[z-1],ye=j[z-1],mr=(()=>{if(z===0)return{address:Ff,decimals:18,symbol:"ETH"};return{address:m[z-1],decimals:ye||he?Number(he??1):void 0,symbol:Te??void 0}})();V.push({token:mr,value:{pre:ne,post:te,diff:te-ne}})}return{assetChanges:V,block:R,results:S}}function Lf(e,t){return ds(Ine,[e,t])}function One(e,t){let r=gr(t.toLowerCase(),{size:32});return e.filter((n)=>{if(n.topics[0]?.toLowerCase()!==Dne)return!1;if(n.address.toLowerCase()===Ff)return!1;return n.topics[1]?.toLowerCase()===r||n.topics[2]?.toLowerCase()===r}).map((n)=>n.address.toLowerCase())}function NB(e){return e.status==="success"&&/^0x[\da-f]{64}$/i.test(e.data)}function e6(e,t){if(e.status==="failure"||e.data==="0x")return null;try{return kB(t,e.data)}catch{return null}}async function FB(e,t){let{account:r,address:n,blockNumber:o,blockTag:i,data:s,staticCallAddress:a,stateOverride:c}=t;try{return{data:(await Dr({...e,ccipRead:!1},{account:n?Ln:r,data:n?Lf(n,s):s,stateOverride:n&&a?[...c??[],{address:a,code:MB}]:c,...n?{gas:Mf,to:a}:{},...typeof o==="bigint"?{blockNumber:o}:{blockTag:i}})).data??"0x",status:"success"}}catch(u){if(!(u instanceof Ji)||!(u.cause instanceof vo))throw u;return{data:"0x",status:"failure"}}}function kne(e){let t=new Set(e.map((n)=>n.toLowerCase())),r=Cne;while(t.has(`0x${r.toString(16).padStart(40,"0")}`))r++;return`0x${r.toString(16).padStart(40,"0")}`}ai();Er();ns();async function Gu(e,t){let{abi:r,address:n,args:o,functionName:i,dataSuffix:s=typeof e.dataSuffix==="string"?e.dataSuffix:e.dataSuffix?.value,...a}=t,c=a.account?ee(a.account):e.account,u=Be({abi:r,args:o,functionName:i});try{let{data:l}=await q(e,Dr,"call")({batch:!1,data:`${u}${s?s.replace("0x",""):""}`,to:n,...a,account:c}),p=Gt({abi:r,args:o,functionName:i,data:l||"0x"}),f=r.filter((d)=>("name"in d)&&d.name===t.functionName);return{result:p,request:{abi:f,address:n,args:o,dataSuffix:s,functionName:i,...a,account:c}}}catch(l){throw Lr(l,{abi:r,address:n,args:o,docsPath:"/docs/contract/simulateContract",functionName:i,sender:c?.address})}}async function ms(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}rn();Ar();var $B="0x6492649264926492649264926492649264926492649264926492649264926492";function Rne(e){if(Wt(e,-32)!==$B)throw new UB(e)}function Pne(e){let{data:t,signature:r,to:n}=e;return At(Oa(B0("address, bytes, bytes"),[n,t,r]),$B)}function _ne(e){try{return Rne(e),!0}catch{return!1}}class UB extends Q{constructor(e){super(`Value \`${e}\` is an invalid ERC-6492 wrapped signature.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}rn();Ar();function t6(e,t={}){let{recovered:r}=t;if(typeof e.r>"u")throw new N0({signature:e});if(typeof e.s>"u")throw new N0({signature:e});if(r&&typeof e.yParity>"u")throw new N0({signature:e});if(e.r<0n||e.r>zE)throw new VB({value:e.r});if(e.s<0n||e.s>zE)throw new WB({value:e.s});if(typeof e.yParity==="number"&&e.yParity!==0&&e.yParity!==1)throw new F0({value:e.yParity})}function Bne(e){return jB(Vt(e))}function jB(e){if(e.length!==130&&e.length!==132)throw new GB({signature:e});let t=BigInt(Wt(e,0,32)),r=BigInt(Wt(e,32,64)),n=(()=>{let o=Number(`0x${e.slice(130)}`);if(Number.isNaN(o))return;try{return r6(o)}catch{throw new F0({value:o})}})();if(typeof n>"u")return{r:t,s:r};return{r:t,s:r,yParity:n}}function qB(e){if(typeof e.r>"u")return;if(typeof e.s>"u")return;return zB(e)}function zB(e){let t=(()=>{if(typeof e==="string")return jB(e);if(e instanceof Uint8Array)return Bne(e);if(typeof e.r==="string")return Fne(e);if(e.v)return Nne(e);return{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}}})();return t6(t),t}function Nne(e){return{r:e.r,s:e.s,yParity:r6(e.v)}}function Fne(e){let t=(()=>{let r=e.v?Number(e.v):void 0,n=e.yParity?Number(e.yParity):void 0;if(typeof r==="number"&&typeof n!=="number")n=r6(r);if(typeof n!=="number")throw new F0({value:e.yParity});return n})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function r6(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new KB({value:e})}class GB extends Q{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${ut(tP(e))} bytes.`]});Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class N0 extends Q{constructor({signature:e}){super(`Signature \`${Wy(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class VB extends Q{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class WB extends Q{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class F0 extends Q{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class KB extends Q{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function ZB(e,t={}){if(typeof e.chainId==="string")return Mne(e);return{...e,...t.signature}}function Mne(e){let{address:t,chainId:r,nonce:n}=e,o=qB(e);return{address:t,chainId:Number(r),nonce:BigInt(n),...o}}rn();Ar();Fr();Fr();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */var i6=BigInt(0),o6=BigInt(1);function $f(e,t=""){if(typeof e!=="boolean"){let r=t&&`"${t}"`;throw Error(r+"expected boolean, got type="+typeof e)}return e}function hs(e,t,r=""){let n=oa(e),o=e?.length,i=t!==void 0;if(!n||i&&o!==t){let s=r&&`"${r}" `,a=i?` of length ${t}`:"",c=n?`length=${o}`:`type=${typeof e}`;throw Error(s+"expected Uint8Array"+a+", got "+c)}return e}function Uf(e){let t=e.toString(16);return t.length&1?"0"+t:t}function JB(e){if(typeof e!=="string")throw Error("hex string expected, got "+typeof e);return e===""?i6:BigInt("0x"+e)}function Vu(e){return JB(Rn(e))}function s6(e){return tt(e),JB(Rn(Uint8Array.from(e).reverse()))}function M0(e,t){return oi(e.toString(16).padStart(t*2,"0"))}function a6(e,t){return M0(e,t).reverse()}function Jt(e,t,r){let n;if(typeof t==="string")try{n=oi(t)}catch(i){throw Error(e+" must be hex string or Uint8Array, cause: "+i)}else if(oa(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let o=n.length;if(typeof r==="number"&&o!==r)throw Error(e+" of length "+r+" expected, got "+o);return n}var n6=(e)=>typeof e==="bigint"&&i6<=e;function XB(e,t,r){return n6(e)&&n6(t)&&n6(r)&&t<=e&&e<r}function QB(e,t,r,n){if(!XB(t,r,n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function L0(e){let t;for(t=0;e>i6;e>>=o6,t+=1);return t}var ys=(e)=>(o6<<BigInt(e))-o6;function e4(e,t,r){if(typeof e!=="number"||e<2)throw Error("hashLen must be a number");if(typeof t!=="number"||t<2)throw Error("qByteLen must be a number");if(typeof r!=="function")throw Error("hmacFn must be a function");let n=(d)=>new Uint8Array(d),o=(d)=>Uint8Array.of(d),i=n(e),s=n(e),a=0,c=()=>{i.fill(1),s.fill(0),a=0},u=(...d)=>r(s,i,...d),l=(d=n(0))=>{if(s=u(o(0),d),i=u(),d.length===0)return;s=u(o(1),d),i=u()},p=()=>{if(a++>=1000)throw Error("drbg: tried 1000 values");let d=0,h=[];while(d<t){i=u();let m=i.slice();h.push(m),d+=i.length}return St(...h)};return(d,h)=>{c(),l(d);let m=void 0;while(!(m=h(p())))l();return c(),m}}function Hf(e,t,r={}){if(!e||typeof e!=="object")throw Error("expected valid options object");function n(o,i,s){let a=e[o];if(s&&a===void 0)return;let c=typeof a;if(c!==i||a===null)throw Error(`param "${o}" is invalid: expected ${i}, got ${c}`)}Object.entries(t).forEach(([o,i])=>n(o,i,!1)),Object.entries(r).forEach(([o,i])=>n(o,i,!0))}function c6(e){let t=new WeakMap;return(r,...n)=>{let o=t.get(r);if(o!==void 0)return o;let i=e(r,...n);return t.set(r,i),i}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */var lr=BigInt(0),Xt=BigInt(1),Ra=BigInt(2),n4=BigInt(3),o4=BigInt(4),i4=BigInt(5),$ne=BigInt(7),s4=BigInt(8),Une=BigInt(9),a4=BigInt(16);function Or(e,t){let r=e%t;return r>=lr?r:t+r}function jr(e,t,r){let n=e;while(t-- >lr)n*=n,n%=r;return n}function t4(e,t){if(e===lr)throw Error("invert: expected non-zero number");if(t<=lr)throw Error("invert: expected positive modulus, got "+t);let r=Or(e,t),n=t,o=lr,i=Xt,s=Xt,a=lr;while(r!==lr){let u=n/r,l=n%r,p=o-s*u,f=i-a*u;n=r,r=l,o=s,i=a,s=p,a=f}if(n!==Xt)throw Error("invert: does not exist");return Or(o,t)}function u6(e,t,r){if(!e.eql(e.sqr(t),r))throw Error("Cannot find square root")}function c4(e,t){let r=(e.ORDER+Xt)/o4,n=e.pow(t,r);return u6(e,n,t),n}function Hne(e,t){let r=(e.ORDER-i4)/s4,n=e.mul(t,Ra),o=e.pow(n,r),i=e.mul(t,o),s=e.mul(e.mul(i,Ra),o),a=e.mul(i,e.sub(s,e.ONE));return u6(e,a,t),a}function jne(e){let t=gs(e),r=u4(e),n=r(t,t.neg(t.ONE)),o=r(t,n),i=r(t,t.neg(n)),s=(e+$ne)/a4;return(a,c)=>{let u=a.pow(c,s),l=a.mul(u,n),p=a.mul(u,o),f=a.mul(u,i),d=a.eql(a.sqr(l),c),h=a.eql(a.sqr(p),c);u=a.cmov(u,l,d),l=a.cmov(f,p,h);let m=a.eql(a.sqr(l),c),y=a.cmov(u,l,m);return u6(a,y,c),y}}function u4(e){if(e<n4)throw Error("sqrt is not defined for small field");let t=e-Xt,r=0;while(t%Ra===lr)t/=Ra,r++;let n=Ra,o=gs(e);while(r4(o,n)===1)if(n++>1000)throw Error("Cannot find square root: probably non-prime P");if(r===1)return c4;let i=o.pow(n,t),s=(t+Xt)/Ra;return function(c,u){if(c.is0(u))return u;if(r4(c,u)!==1)throw Error("Cannot find square root");let l=r,p=c.mul(c.ONE,i),f=c.pow(u,t),d=c.pow(u,s);while(!c.eql(f,c.ONE)){if(c.is0(f))return c.ZERO;let h=1,m=c.sqr(f);while(!c.eql(m,c.ONE))if(h++,m=c.sqr(m),h===l)throw Error("Cannot find square root");let y=Xt<<BigInt(l-h-1),g=c.pow(p,y);l=h,p=c.sqr(g),f=c.mul(f,p),d=c.mul(d,g)}return d}}function qne(e){if(e%o4===n4)return c4;if(e%s4===i4)return Hne;if(e%a4===Une)return jne(e);return u4(e)}var zne=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function l6(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},r=zne.reduce((n,o)=>(n[o]="function",n),t);return Hf(e,r),e}function Gne(e,t,r){if(r<lr)throw Error("invalid exponent, negatives unsupported");if(r===lr)return e.ONE;if(r===Xt)return t;let n=e.ONE,o=t;while(r>lr){if(r&Xt)n=e.mul(n,o);o=e.sqr(o),r>>=Xt}return n}function $0(e,t,r=!1){let n=Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((s,a,c)=>{if(e.is0(a))return s;return n[c]=s,e.mul(s,a)},e.ONE),i=e.inv(o);return t.reduceRight((s,a,c)=>{if(e.is0(a))return s;return n[c]=e.mul(s,n[c]),e.mul(s,a)},i),n}function r4(e,t){let r=(e.ORDER-Xt)/Ra,n=e.pow(t,r),o=e.eql(n,e.ONE),i=e.eql(n,e.ZERO),s=e.eql(n,e.neg(e.ONE));if(!o&&!i&&!s)throw Error("invalid Legendre symbol result");return o?1:i?0:-1}function U0(e,t){if(t!==void 0)xr(t);let r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function gs(e,t,r=!1,n={}){if(e<=lr)throw Error("invalid field: expected ORDER > 0, got "+e);let o=void 0,i=void 0,s=!1,a=void 0;if(typeof t==="object"&&t!=null){if(n.sqrt||r)throw Error("cannot specify opts in two arguments");let f=t;if(f.BITS)o=f.BITS;if(f.sqrt)i=f.sqrt;if(typeof f.isLE==="boolean")r=f.isLE;if(typeof f.modFromBytes==="boolean")s=f.modFromBytes;a=f.allowedLengths}else{if(typeof t==="number")o=t;if(n.sqrt)i=n.sqrt}let{nBitLength:c,nByteLength:u}=U0(e,o);if(u>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let l,p=Object.freeze({ORDER:e,isLE:r,BITS:c,BYTES:u,MASK:ys(c),ZERO:lr,ONE:Xt,allowedLengths:a,create:(f)=>Or(f,e),isValid:(f)=>{if(typeof f!=="bigint")throw Error("invalid field element: expected bigint, got "+typeof f);return lr<=f&&f<e},is0:(f)=>f===lr,isValidNot0:(f)=>!p.is0(f)&&p.isValid(f),isOdd:(f)=>(f&Xt)===Xt,neg:(f)=>Or(-f,e),eql:(f,d)=>f===d,sqr:(f)=>Or(f*f,e),add:(f,d)=>Or(f+d,e),sub:(f,d)=>Or(f-d,e),mul:(f,d)=>Or(f*d,e),pow:(f,d)=>Gne(p,f,d),div:(f,d)=>Or(f*t4(d,e),e),sqrN:(f)=>f*f,addN:(f,d)=>f+d,subN:(f,d)=>f-d,mulN:(f,d)=>f*d,inv:(f)=>t4(f,e),sqrt:i||((f)=>{if(!l)l=qne(e);return l(p,f)}),toBytes:(f)=>r?a6(f,u):M0(f,u),fromBytes:(f,d=!0)=>{if(a){if(!a.includes(f.length)||f.length>u)throw Error("Field.fromBytes: expected "+a+" bytes, got "+f.length);let m=new Uint8Array(u);m.set(f,r?0:m.length-f.length),f=m}if(f.length!==u)throw Error("Field.fromBytes: expected "+u+" bytes, got "+f.length);let h=r?s6(f):Vu(f);if(s)h=Or(h,e);if(!d){if(!p.isValid(h))throw Error("invalid field element: outside of range 0..ORDER")}return h},invertBatch:(f)=>$0(p,f),cmov:(f,d,h)=>h?d:f});return Object.freeze(p)}function l4(e){if(typeof e!=="bigint")throw Error("field order must be bigint");let t=e.toString(2).length;return Math.ceil(t/8)}function p6(e){let t=l4(e);return t+Math.ceil(t/2)}function f6(e,t,r=!1){let n=e.length,o=l4(t),i=p6(t);if(n<16||n<i||n>1024)throw Error("expected "+i+"-1024 bytes of input, got "+n);let s=r?s6(e):Vu(e),a=Or(s,t-Xt)+Xt;return r?a6(a,o):M0(a,o)}Su();Cf();Fr();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */var Wu=BigInt(0),Pa=BigInt(1);function jf(e,t){let r=t.negate();return e?r:t}function H0(e,t){let r=$0(e.Fp,t.map((n)=>n.Z));return t.map((n,o)=>e.fromAffine(n.toAffine(r[o])))}function m4(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function d6(e,t){m4(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),o=2**e,i=ys(e),s=BigInt(e);return{windows:r,windowSize:n,mask:i,maxNumber:o,shiftBy:s}}function p4(e,t,r){let{windowSize:n,mask:o,maxNumber:i,shiftBy:s}=r,a=Number(e&o),c=e>>s;if(a>n)a-=i,c+=Pa;let u=t*n,l=u+Math.abs(a)-1,p=a===0,f=a<0,d=t%2!==0;return{nextN:c,offset:l,isZero:p,isNeg:f,isNegF:d,offsetF:u}}function Vne(e,t){if(!Array.isArray(e))throw Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw Error("invalid point at index "+n)})}function Wne(e,t){if(!Array.isArray(e))throw Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw Error("invalid scalar at index "+n)})}var m6=new WeakMap,h4=new WeakMap;function h6(e){return h4.get(e)||1}function f4(e){if(e!==Wu)throw Error("invalid wNAF")}class y6{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,r=this.ZERO){let n=e;while(t>Wu){if(t&Pa)r=r.add(n);n=n.double(),t>>=Pa}return r}precomputeWindow(e,t){let{windows:r,windowSize:n}=d6(t,this.bits),o=[],i=e,s=i;for(let a=0;a<r;a++){s=i,o.push(s);for(let c=1;c<n;c++)s=s.add(i),o.push(s);i=s.double()}return o}wNAF(e,t,r){if(!this.Fn.isValid(r))throw Error("invalid scalar");let n=this.ZERO,o=this.BASE,i=d6(e,this.bits);for(let s=0;s<i.windows;s++){let{nextN:a,offset:c,isZero:u,isNeg:l,isNegF:p,offsetF:f}=p4(r,s,i);if(r=a,u)o=o.add(jf(p,t[f]));else n=n.add(jf(l,t[c]))}return f4(r),{p:n,f:o}}wNAFUnsafe(e,t,r,n=this.ZERO){let o=d6(e,this.bits);for(let i=0;i<o.windows;i++){if(r===Wu)break;let{nextN:s,offset:a,isZero:c,isNeg:u}=p4(r,i,o);if(r=s,c)continue;else{let l=t[a];n=n.add(u?l.negate():l)}}return f4(r),n}getPrecomputes(e,t,r){let n=m6.get(t);if(!n){if(n=this.precomputeWindow(t,e),e!==1){if(typeof r==="function")n=r(n);m6.set(t,n)}}return n}cached(e,t,r){let n=h6(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)}unsafe(e,t,r,n){let o=h6(e);if(o===1)return this._unsafeLadder(e,t,n);return this.wNAFUnsafe(o,this.getPrecomputes(o,e,r),t,n)}createCache(e,t){m4(t,this.bits),h4.set(e,t),m6.delete(e)}hasCache(e){return h6(e)!==1}}function y4(e,t,r,n){let o=t,{ZERO:i,ZERO:s}=e;while(r>Wu||n>Wu){if(r&Pa)i=i.add(o);if(n&Pa)s=s.add(o);o=o.double(),r>>=Pa,n>>=Pa}return{p1:i,p2:s}}function g4(e,t,r,n){Vne(r,e),Wne(n,t);let o=r.length,i=n.length;if(o!==i)throw Error("arrays of points and scalars must have equal length");let s=e.ZERO,a=L0(BigInt(o)),c=1;if(a>12)c=a-3;else if(a>4)c=a-2;else if(a>0)c=2;let u=ys(c),l=Array(Number(u)+1).fill(s),p=Math.floor((t.BITS-1)/c)*c,f=s;for(let d=p;d>=0;d-=c){l.fill(s);for(let m=0;m<i;m++){let y=n[m],g=Number(y>>BigInt(d)&u);l[g]=l[g].add(r[m])}let h=s;for(let m=l.length-1,y=s;m>0;m--)y=y.add(l[m]),h=h.add(y);if(f=f.add(h),d!==0)for(let m=0;m<c;m++)f=f.double()}return f}function d4(e,t,r){if(t){if(t.ORDER!==e)throw Error("Field.ORDER must match order: Fp == p, Fn == n");return l6(t),t}else return gs(e,{isLE:r})}function b4(e,t,r={},n){if(n===void 0)n=e==="edwards";if(!t||typeof t!=="object")throw Error(`expected valid ${e} CURVE object`);for(let c of["p","n","h"]){let u=t[c];if(!(typeof u==="bigint"&&u>Wu))throw Error(`CURVE.${c} must be positive bigint`)}let o=d4(t.p,r.Fp,n),i=d4(t.n,r.Fn,n),a=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(let c of a)if(!o.isValid(t[c]))throw Error(`CURVE.${c} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:o,Fn:i}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */var x4=(e,t)=>(e+(e>=0?t:-t)/T4)/t;function Kne(e,t,r){let[[n,o],[i,s]]=t,a=x4(s*e,r),c=x4(-o*e,r),u=e-a*n-c*i,l=-a*o-c*s,p=u<Si,f=l<Si;if(p)u=-u;if(f)l=-l;let d=ys(Math.ceil(L0(r)/2))+Yu;if(u<Si||u>=d||l<Si||l>=d)throw Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:p,k1:u,k2neg:f,k2:l}}function b6(e){if(!["compact","recovered","der"].includes(e))throw Error('Signature format must be "compact", "recovered", or "der"');return e}function g6(e,t){let r={};for(let n of Object.keys(t))r[n]=e[n]===void 0?t[n]:e[n];if($f(r.lowS,"lowS"),$f(r.prehash,"prehash"),r.format!==void 0)b6(r.format);return r}class w4 extends Error{constructor(e=""){super(e)}}var vi={Err:w4,_tlv:{encode:(e,t)=>{let{Err:r}=vi;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length&1)throw new r("tlv.encode: unpadded data");let n=t.length/2,o=Uf(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");let i=n>127?Uf(o.length/2|128):"";return Uf(e)+i+o+t},decode(e,t){let{Err:r}=vi,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let o=t[n++],i=!!(o&128),s=0;if(!i)s=o;else{let c=o&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");let u=t.subarray(n,n+c);if(u.length!==c)throw new r("tlv.decode: length bytes not complete");if(u[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let l of u)s=s<<8|l;if(n+=c,s<128)throw new r("tlv.decode(long): not minimal encoding")}let a=t.subarray(n,n+s);if(a.length!==s)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(n+s)}}},_int:{encode(e){let{Err:t}=vi;if(e<Si)throw new t("integer: negative integers are not allowed");let r=Uf(e);if(Number.parseInt(r[0],16)&8)r="00"+r;if(r.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=vi;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return Vu(e)}},toSig(e){let{Err:t,_int:r,_tlv:n}=vi,o=Jt("signature",e),{v:i,l:s}=n.decode(48,o);if(s.length)throw new t("invalid signature: left bytes after parsing");let{v:a,l:c}=n.decode(2,i),{v:u,l}=n.decode(2,c);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(u)}},hexFromSig(e){let{_tlv:t,_int:r}=vi,n=t.encode(2,r.encode(e.r)),o=t.encode(2,r.encode(e.s)),i=n+o;return t.encode(48,i)}},Si=BigInt(0),Yu=BigInt(1),T4=BigInt(2),j0=BigInt(3),Yne=BigInt(4);function Ku(e,t){let{BYTES:r}=e,n;if(typeof t==="bigint")n=t;else{let o=Jt("private key",t);try{n=e.fromBytes(o)}catch(i){throw Error(`invalid private key: expected ui8a of size ${r}, got ${typeof t}`)}}if(!e.isValidNot0(n))throw Error("invalid private key: out of range [1..N-1]");return n}function Zne(e,t={}){let r=b4("weierstrass",e,t),{Fp:n,Fn:o}=r,i=r.CURVE,{h:s,n:a}=i;Hf(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});let{endo:c}=t;if(c){if(!n.is0(i.a)||typeof c.beta!=="bigint"||!Array.isArray(c.basises))throw Error('invalid endo: expected "beta": bigint and "basises": array')}let u=v4(n,o);function l(){if(!n.isOdd)throw Error("compression is not supported: Field does not have .isOdd()")}function p(S,k,I){let{x:C,y:P}=k.toAffine(),N=n.toBytes(C);if($f(I,"isCompressed"),I){l();let L=!n.isOdd(P);return St(E4(L),N)}else return St(Uint8Array.of(4),N,n.toBytes(P))}function f(S){hs(S,void 0,"Point");let{publicKey:k,publicKeyUncompressed:I}=u,C=S.length,P=S[0],N=S.subarray(1);if(C===k&&(P===2||P===3)){let L=n.fromBytes(N);if(!n.isValid(L))throw Error("bad point: is not on curve, wrong x");let F=m(L),j;try{j=n.sqrt(F)}catch(te){let G=te instanceof Error?": "+te.message:"";throw Error("bad point: is not on curve, sqrt error"+G)}l();let V=n.isOdd(j);if((P&1)===1!==V)j=n.neg(j);return{x:L,y:j}}else if(C===I&&P===4){let L=n.BYTES,F=n.fromBytes(N.subarray(0,L)),j=n.fromBytes(N.subarray(L,L*2));if(!y(F,j))throw Error("bad point: is not on curve");return{x:F,y:j}}else throw Error(`bad point: got length ${C}, expected compressed=${k} or uncompressed=${I}`)}let d=t.toBytes||p,h=t.fromBytes||f;function m(S){let k=n.sqr(S),I=n.mul(k,S);return n.add(n.add(I,n.mul(S,i.a)),i.b)}function y(S,k){let I=n.sqr(k),C=m(S);return n.eql(I,C)}if(!y(i.Gx,i.Gy))throw Error("bad curve params: generator point");let g=n.mul(n.pow(i.a,j0),Yne),x=n.mul(n.sqr(i.b),BigInt(27));if(n.is0(n.add(g,x)))throw Error("bad curve params: a or b");function b(S,k,I=!1){if(!n.isValid(k)||I&&n.is0(k))throw Error(`bad point coordinate ${S}`);return k}function w(S){if(!(S instanceof A))throw Error("ProjectivePoint expected")}function v(S){if(!c||!c.basises)throw Error("no endo");return Kne(S,c.basises,o.ORDER)}let D=c6((S,k)=>{let{X:I,Y:C,Z:P}=S;if(n.eql(P,n.ONE))return{x:I,y:C};let N=S.is0();if(k==null)k=N?n.ONE:n.inv(P);let L=n.mul(I,k),F=n.mul(C,k),j=n.mul(P,k);if(N)return{x:n.ZERO,y:n.ZERO};if(!n.eql(j,n.ONE))throw Error("invZ was invalid");return{x:L,y:F}}),O=c6((S)=>{if(S.is0()){if(t.allowInfinityPoint&&!n.is0(S.Y))return;throw Error("bad point: ZERO")}let{x:k,y:I}=S.toAffine();if(!n.isValid(k)||!n.isValid(I))throw Error("bad point: x or y not field elements");if(!y(k,I))throw Error("bad point: equation left != right");if(!S.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});function T(S,k,I,C,P){return I=new A(n.mul(I.X,S),I.Y,I.Z),k=jf(C,k),I=jf(P,I),k.add(I)}class A{constructor(S,k,I){this.X=b("x",S),this.Y=b("y",k,!0),this.Z=b("z",I),Object.freeze(this)}static CURVE(){return i}static fromAffine(S){let{x:k,y:I}=S||{};if(!S||!n.isValid(k)||!n.isValid(I))throw Error("invalid affine point");if(S instanceof A)throw Error("projective point not allowed");if(n.is0(k)&&n.is0(I))return A.ZERO;return new A(k,I,n.ONE)}static fromBytes(S){let k=A.fromAffine(h(hs(S,void 0,"point")));return k.assertValidity(),k}static fromHex(S){return A.fromBytes(Jt("pointHex",S))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(S=8,k=!0){if(R.createCache(this,S),!k)this.multiply(j0);return this}assertValidity(){O(this)}hasEvenY(){let{y:S}=this.toAffine();if(!n.isOdd)throw Error("Field doesn't support isOdd");return!n.isOdd(S)}equals(S){w(S);let{X:k,Y:I,Z:C}=this,{X:P,Y:N,Z:L}=S,F=n.eql(n.mul(k,L),n.mul(P,C)),j=n.eql(n.mul(I,L),n.mul(N,C));return F&&j}negate(){return new A(this.X,n.neg(this.Y),this.Z)}double(){let{a:S,b:k}=i,I=n.mul(k,j0),{X:C,Y:P,Z:N}=this,{ZERO:L,ZERO:F,ZERO:j}=n,V=n.mul(C,C),z=n.mul(P,P),te=n.mul(N,N),G=n.mul(C,P);return G=n.add(G,G),j=n.mul(C,N),j=n.add(j,j),L=n.mul(S,j),F=n.mul(I,te),F=n.add(L,F),L=n.sub(z,F),F=n.add(z,F),F=n.mul(L,F),L=n.mul(G,L),j=n.mul(I,j),te=n.mul(S,te),G=n.sub(V,te),G=n.mul(S,G),G=n.add(G,j),j=n.add(V,V),V=n.add(j,V),V=n.add(V,te),V=n.mul(V,G),F=n.add(F,V),te=n.mul(P,N),te=n.add(te,te),V=n.mul(te,G),L=n.sub(L,V),j=n.mul(te,z),j=n.add(j,j),j=n.add(j,j),new A(L,F,j)}add(S){w(S);let{X:k,Y:I,Z:C}=this,{X:P,Y:N,Z:L}=S,{ZERO:F,ZERO:j,ZERO:V}=n,z=i.a,te=n.mul(i.b,j0),G=n.mul(k,P),Y=n.mul(I,N),ne=n.mul(C,L),he=n.add(k,I),Te=n.add(P,N);he=n.mul(he,Te),Te=n.add(G,Y),he=n.sub(he,Te),Te=n.add(k,C);let ye=n.add(P,L);return Te=n.mul(Te,ye),ye=n.add(G,ne),Te=n.sub(Te,ye),ye=n.add(I,C),F=n.add(N,L),ye=n.mul(ye,F),F=n.add(Y,ne),ye=n.sub(ye,F),V=n.mul(z,Te),F=n.mul(te,ne),V=n.add(F,V),F=n.sub(Y,V),V=n.add(Y,V),j=n.mul(F,V),Y=n.add(G,G),Y=n.add(Y,G),ne=n.mul(z,ne),Te=n.mul(te,Te),Y=n.add(Y,ne),ne=n.sub(G,ne),ne=n.mul(z,ne),Te=n.add(Te,ne),G=n.mul(Y,Te),j=n.add(j,G),G=n.mul(ye,Te),F=n.mul(he,F),F=n.sub(F,G),G=n.mul(he,Y),V=n.mul(ye,V),V=n.add(V,G),new A(F,j,V)}subtract(S){return this.add(S.negate())}is0(){return this.equals(A.ZERO)}multiply(S){let{endo:k}=t;if(!o.isValidNot0(S))throw Error("invalid scalar: out of range");let I,C,P=(N)=>R.cached(this,N,(L)=>H0(A,L));if(k){let{k1neg:N,k1:L,k2neg:F,k2:j}=v(S),{p:V,f:z}=P(L),{p:te,f:G}=P(j);C=z.add(G),I=T(k.beta,V,te,N,F)}else{let{p:N,f:L}=P(S);I=N,C=L}return H0(A,[I,C])[0]}multiplyUnsafe(S){let{endo:k}=t,I=this;if(!o.isValid(S))throw Error("invalid scalar: out of range");if(S===Si||I.is0())return A.ZERO;if(S===Yu)return I;if(R.hasCache(this))return this.multiply(S);if(k){let{k1neg:C,k1:P,k2neg:N,k2:L}=v(S),{p1:F,p2:j}=y4(A,I,P,L);return T(k.beta,F,j,C,N)}else return R.unsafe(I,S)}multiplyAndAddUnsafe(S,k,I){let C=this.multiplyUnsafe(k).add(S.multiplyUnsafe(I));return C.is0()?void 0:C}toAffine(S){return D(this,S)}isTorsionFree(){let{isTorsionFree:S}=t;if(s===Yu)return!0;if(S)return S(A,this);return R.unsafe(this,a).is0()}clearCofactor(){let{clearCofactor:S}=t;if(s===Yu)return this;if(S)return S(A,this);return this.multiplyUnsafe(s)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}toBytes(S=!0){return $f(S,"isCompressed"),this.assertValidity(),d(A,this,S)}toHex(S=!0){return Rn(this.toBytes(S))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(S=!0){return this.toBytes(S)}_setWindowSize(S){this.precompute(S)}static normalizeZ(S){return H0(A,S)}static msm(S,k){return g4(A,o,S,k)}static fromPrivateKey(S){return A.BASE.multiply(Ku(o,S))}}A.BASE=new A(i.Gx,i.Gy,n.ONE),A.ZERO=new A(n.ZERO,n.ONE,n.ZERO),A.Fp=n,A.Fn=o;let E=o.BITS,R=new y6(A,t.endo?Math.ceil(E/2):E);return A.BASE.precompute(8),A}function E4(e){return Uint8Array.of(e?2:3)}function v4(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function Jne(e,t={}){let{Fn:r}=e,n=t.randomBytes||Pc,o=Object.assign(v4(e.Fp,r),{seed:p6(r.ORDER)});function i(d){try{return!!Ku(r,d)}catch(h){return!1}}function s(d,h){let{publicKey:m,publicKeyUncompressed:y}=o;try{let g=d.length;if(h===!0&&g!==m)return!1;if(h===!1&&g!==y)return!1;return!!e.fromBytes(d)}catch(g){return!1}}function a(d=n(o.seed)){return f6(hs(d,o.seed,"seed"),r.ORDER)}function c(d,h=!0){return e.BASE.multiply(Ku(r,d)).toBytes(h)}function u(d){let h=a(d);return{secretKey:h,publicKey:c(h)}}function l(d){if(typeof d==="bigint")return!1;if(d instanceof e)return!0;let{secretKey:h,publicKey:m,publicKeyUncompressed:y}=o;if(r.allowedLengths||h===m)return;let g=Jt("key",d).length;return g===m||g===y}function p(d,h,m=!0){if(l(d)===!0)throw Error("first arg must be private key");if(l(h)===!1)throw Error("second arg must be public key");let y=Ku(r,d);return e.fromHex(h).multiply(y).toBytes(m)}return Object.freeze({getPublicKey:c,getSharedSecret:p,keygen:u,Point:e,utils:{isValidSecretKey:i,isValidPublicKey:s,randomSecretKey:a,isValidPrivateKey:i,randomPrivateKey:a,normPrivateKeyToScalar:(d)=>Ku(r,d),precompute(d=8,h=e.BASE){return h.precompute(d,!1)}},lengths:o})}function Xne(e,t,r={}){Rc(t),Hf(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let n=r.randomBytes||Pc,o=r.hmac||((I,...C)=>Io(t,I,St(...C))),{Fp:i,Fn:s}=e,{ORDER:a,BITS:c}=s,{keygen:u,getPublicKey:l,getSharedSecret:p,utils:f,lengths:d}=Jne(e,r),h={prehash:!1,lowS:typeof r.lowS==="boolean"?r.lowS:!1,format:void 0,extraEntropy:!1},m="compact";function y(I){let C=a>>Yu;return I>C}function g(I,C){if(!s.isValidNot0(C))throw Error(`invalid signature ${I}: out of range 1..Point.Fn.ORDER`);return C}function x(I,C){b6(C);let P=d.signature,N=C==="compact"?P:C==="recovered"?P+1:void 0;return hs(I,N,`${C} signature`)}class b{constructor(I,C,P){if(this.r=g("r",I),this.s=g("s",C),P!=null)this.recovery=P;Object.freeze(this)}static fromBytes(I,C=m){x(I,C);let P;if(C==="der"){let{r:j,s:V}=vi.toSig(hs(I));return new b(j,V)}if(C==="recovered")P=I[0],C="compact",I=I.subarray(1);let N=s.BYTES,L=I.subarray(0,N),F=I.subarray(N,N*2);return new b(s.fromBytes(L),s.fromBytes(F),P)}static fromHex(I,C){return this.fromBytes(oi(I),C)}addRecoveryBit(I){return new b(this.r,this.s,I)}recoverPublicKey(I){let C=i.ORDER,{r:P,s:N,recovery:L}=this;if(L==null||![0,1,2,3].includes(L))throw Error("recovery id invalid");if(a*T4<C&&L>1)throw Error("recovery id is ambiguous for h>1 curve");let j=L===2||L===3?P+a:P;if(!i.isValid(j))throw Error("recovery id 2 or 3 invalid");let V=i.toBytes(j),z=e.fromBytes(St(E4((L&1)===0),V)),te=s.inv(j),G=v(Jt("msgHash",I)),Y=s.create(-G*te),ne=s.create(N*te),he=e.BASE.multiplyUnsafe(Y).add(z.multiplyUnsafe(ne));if(he.is0())throw Error("point at infinify");return he.assertValidity(),he}hasHighS(){return y(this.s)}toBytes(I=m){if(b6(I),I==="der")return oi(vi.hexFromSig(this));let C=s.toBytes(this.r),P=s.toBytes(this.s);if(I==="recovered"){if(this.recovery==null)throw Error("recovery bit must be present");return St(Uint8Array.of(this.recovery),C,P)}return St(C,P)}toHex(I){return Rn(this.toBytes(I))}assertValidity(){}static fromCompact(I){return b.fromBytes(Jt("sig",I),"compact")}static fromDER(I){return b.fromBytes(Jt("sig",I),"der")}normalizeS(){return this.hasHighS()?new b(this.r,s.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return Rn(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return Rn(this.toBytes("compact"))}}let w=r.bits2int||function(C){if(C.length>8192)throw Error("input is too large");let P=Vu(C),N=C.length*8-c;return N>0?P>>BigInt(N):P},v=r.bits2int_modN||function(C){return s.create(w(C))},D=ys(c);function O(I){return QB("num < 2^"+c,I,Si,D),s.toBytes(I)}function T(I,C){return hs(I,void 0,"message"),C?hs(t(I),void 0,"prehashed message"):I}function A(I,C,P){if(["recovered","canonical"].some((ne)=>(ne in P)))throw Error("sign() legacy options not supported");let{lowS:N,prehash:L,extraEntropy:F}=g6(P,h);I=T(I,L);let j=v(I),V=Ku(s,C),z=[O(V),O(j)];if(F!=null&&F!==!1){let ne=F===!0?n(d.secretKey):F;z.push(Jt("extraEntropy",ne))}let te=St(...z),G=j;function Y(ne){let he=w(ne);if(!s.isValidNot0(he))return;let Te=s.inv(he),ye=e.BASE.multiply(he).toAffine(),mr=s.create(ye.x);if(mr===Si)return;let ji=s.create(Te*s.create(G+mr*V));if(ji===Si)return;let qi=(ye.x===mr?0:2)|Number(ye.y&Yu),Qn=ji;if(N&&y(ji))Qn=s.neg(ji),qi^=1;return new b(mr,Qn,qi)}return{seed:te,k2sig:Y}}function E(I,C,P={}){I=Jt("message",I);let{seed:N,k2sig:L}=A(I,C,P);return e4(t.outputLen,s.BYTES,o)(N,L)}function R(I){let C=void 0,P=typeof I==="string"||oa(I),N=!P&&I!==null&&typeof I==="object"&&typeof I.r==="bigint"&&typeof I.s==="bigint";if(!P&&!N)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(N)C=new b(I.r,I.s);else if(P){try{C=b.fromBytes(Jt("sig",I),"der")}catch(L){if(!(L instanceof vi.Err))throw L}if(!C)try{C=b.fromBytes(Jt("sig",I),"compact")}catch(L){return!1}}if(!C)return!1;return C}function S(I,C,P,N={}){let{lowS:L,prehash:F,format:j}=g6(N,h);if(P=Jt("publicKey",P),C=T(Jt("message",C),F),"strict"in N)throw Error("options.strict was renamed to lowS");let V=j===void 0?R(I):b.fromBytes(Jt("sig",I),j);if(V===!1)return!1;try{let z=e.fromBytes(P);if(L&&V.hasHighS())return!1;let{r:te,s:G}=V,Y=v(C),ne=s.inv(G),he=s.create(Y*ne),Te=s.create(te*ne),ye=e.BASE.multiplyUnsafe(he).add(z.multiplyUnsafe(Te));if(ye.is0())return!1;return s.create(ye.x)===te}catch(z){return!1}}function k(I,C,P={}){let{prehash:N}=g6(P,h);return C=T(C,N),b.fromBytes(I,"recovered").recoverPublicKey(C).toBytes()}return Object.freeze({keygen:u,getPublicKey:l,getSharedSecret:p,utils:f,lengths:d,Point:e,sign:E,verify:S,recoverPublicKey:k,Signature:b,hash:t})}function Qne(e){let t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r=e.Fp,n=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map((s)=>Math.ceil(s/2)))):void 0,o=gs(t.n,{BITS:e.nBitLength,allowedLengths:n,modFromBytes:e.wrapPrivateKey}),i={Fp:r,Fn:o,allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes};return{CURVE:t,curveOpts:i}}function eoe(e){let{CURVE:t,curveOpts:r}=Qne(e),n={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:r,hash:e.hash,ecdsaOpts:n}}function toe(e,t){let r=t.Point;return Object.assign({},t,{ProjectivePoint:r,CURVE:Object.assign({},e,U0(r.Fn.ORDER,r.Fn.BITS))})}function S4(e){let{CURVE:t,curveOpts:r,hash:n,ecdsaOpts:o}=eoe(e),i=Zne(t,r),s=Xne(i,n,o);return toe(e,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function A4(e,t){let r=(n)=>S4({...e,hash:n});return{...r(t),create:r}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */var w6={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},roe={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]};var C4=BigInt(2);function noe(e){let t=w6.p,r=BigInt(3),n=BigInt(6),o=BigInt(11),i=BigInt(22),s=BigInt(23),a=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,p=jr(l,r,t)*l%t,f=jr(p,r,t)*l%t,d=jr(f,C4,t)*u%t,h=jr(d,o,t)*d%t,m=jr(h,i,t)*h%t,y=jr(m,a,t)*m%t,g=jr(y,c,t)*y%t,x=jr(g,a,t)*m%t,b=jr(x,r,t)*l%t,w=jr(b,s,t)*h%t,v=jr(w,n,t)*u%t,D=jr(v,C4,t);if(!x6.eql(x6.sqr(D),e))throw Error("Cannot find square root");return D}var x6=gs(w6.p,{sqrt:noe}),Ro=A4({...w6,Fp:x6,lowS:!0,endo:roe},Do);Cf();Su();Fr();/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Zu(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function v6(e,...t){if(!Zu(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function R4(e,t){if(!Array.isArray(t))return!1;if(t.length===0)return!0;if(e)return t.every((r)=>typeof r==="string");else return t.every((r)=>Number.isSafeInteger(r))}function S6(e){if(typeof e!=="function")throw Error("function expected");return!0}function bs(e,t){if(typeof t!=="string")throw Error(`${e}: string expected`);return!0}function Ju(e){if(!Number.isSafeInteger(e))throw Error(`invalid integer: ${e}`)}function z0(e){if(!Array.isArray(e))throw Error("array expected")}function G0(e,t){if(!R4(!0,t))throw Error(`${e}: array of strings expected`)}function A6(e,t){if(!R4(!1,t))throw Error(`${e}: array of numbers expected`)}function kr(...e){let t=(i)=>i,r=(i,s)=>(a)=>i(s(a)),n=e.map((i)=>i.encode).reduceRight(r,t),o=e.map((i)=>i.decode).reduce(r,t);return{encode:n,decode:o}}function qr(e){let t=typeof e==="string"?e.split(""):e,r=t.length;G0("alphabet",t);let n=new Map(t.map((o,i)=>[o,i]));return{encode:(o)=>(z0(o),o.map((i)=>{if(!Number.isSafeInteger(i)||i<0||i>=r)throw Error(`alphabet.encode: digit index outside alphabet "${i}". Allowed: ${e}`);return t[i]})),decode:(o)=>(z0(o),o.map((i)=>{bs("alphabet.decode",i);let s=n.get(i);if(s===void 0)throw Error(`Unknown letter: "${i}". Allowed: ${e}`);return s}))}}function zr(e=""){return bs("join",e),{encode:(t)=>(G0("join.decode",t),t.join(e)),decode:(t)=>(bs("join.decode",t),t.split(e))}}function W0(e,t="="){return Ju(e),bs("padding",t),{encode(r){G0("padding.encode",r);while(r.length*e%8)r.push(t);return r},decode(r){G0("padding.decode",r);let n=r.length;if(n*e%8)throw Error("padding: invalid, string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--)if((n-1)*e%8===0)throw Error("padding: invalid, string has too much padding");return r.slice(0,n)}}}function P4(e){return S6(e),{encode:(t)=>t,decode:(t)=>e(t)}}function D4(e,t,r){if(t<2)throw Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(z0(e),!e.length)return[];let n=0,o=[],i=Array.from(e,(a)=>{if(Ju(a),a<0||a>=t)throw Error(`invalid integer: ${a}`);return a}),s=i.length;while(!0){let a=0,c=!0;for(let u=n;u<s;u++){let l=i[u],p=t*a,f=p+l;if(!Number.isSafeInteger(f)||p/t!==a||f-l!==p)throw Error("convertRadix: carry overflow");let d=f/r;a=f%r;let h=Math.floor(d);if(i[u]=h,!Number.isSafeInteger(h)||h*r+a!==f)throw Error("convertRadix: carry overflow");if(!c)continue;else if(!h)n=u;else c=!1}if(o.push(a),c)break}for(let a=0;a<e.length-1&&e[a]===0;a++)o.push(0);return o.reverse()}var _4=(e,t)=>t===0?e:_4(t,e%t),V0=(e,t)=>e+(t-_4(e,t)),q0=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function T6(e,t,r,n){if(z0(e),t<=0||t>32)throw Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw Error(`convertRadix2: wrong to=${r}`);if(V0(t,r)>32)throw Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${V0(t,r)}`);let o=0,i=0,s=q0[t],a=q0[r]-1,c=[];for(let u of e){if(Ju(u),u>=s)throw Error(`convertRadix2: invalid data word=${u} from=${t}`);if(o=o<<t|u,i+t>32)throw Error(`convertRadix2: carry overflow pos=${i} from=${t}`);i+=t;for(;i>=r;i-=r)c.push((o>>i-r&a)>>>0);let l=q0[i];if(l===void 0)throw Error("invalid carry");o&=l-1}if(o=o<<r-i&a,!n&&i>=t)throw Error("Excess padding");if(!n&&o>0)throw Error(`Non-zero padding: ${o}`);if(n&&i>0)c.push(o>>>0);return c}function ooe(e){Ju(e);let t=256;return{encode:(r)=>{if(!Zu(r))throw Error("radix.encode input should be Uint8Array");return D4(Array.from(r),t,e)},decode:(r)=>(A6("radix.decode",r),Uint8Array.from(D4(r,e,t)))}}function sn(e,t=!1){if(Ju(e),e<=0||e>32)throw Error("radix2: bits should be in (0..32]");if(V0(8,e)>32||V0(e,8)>32)throw Error("radix2: carry overflow");return{encode:(r)=>{if(!Zu(r))throw Error("radix2.encode input should be Uint8Array");return T6(Array.from(r),8,e,!t)},decode:(r)=>(A6("radix2.decode",r),Uint8Array.from(T6(r,e,8,t)))}}function I4(e){return S6(e),function(...t){try{return e.apply(null,t)}catch(r){}}}function ioe(e,t){return Ju(e),S6(t),{encode(r){if(!Zu(r))throw Error("checksum.encode: input should be Uint8Array");let n=t(r).slice(0,e),o=new Uint8Array(r.length+e);return o.set(r),o.set(n,r.length),o},decode(r){if(!Zu(r))throw Error("checksum.decode: input should be Uint8Array");let n=r.slice(0,-e),o=r.slice(-e),i=t(n).slice(0,e);for(let s=0;s<e;s++)if(i[s]!==o[s])throw Error("Invalid checksum");return n}}}var eet=kr(sn(4),qr("0123456789ABCDEF"),zr("")),tet=kr(sn(5),qr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),W0(5),zr("")),ret=kr(sn(5),qr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),zr("")),net=kr(sn(5),qr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),W0(5),zr("")),oet=kr(sn(5),qr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),zr("")),iet=kr(sn(5),qr("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),zr(""),P4((e)=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),B4=(()=>typeof Uint8Array.from([]).toBase64==="function"&&typeof Uint8Array.fromBase64==="function")(),N4=(e,t)=>{bs("base64",e);let r=t?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,n=t?"base64url":"base64";if(e.length>0&&!r.test(e))throw Error("invalid base64");return Uint8Array.fromBase64(e,{alphabet:n,lastChunkHandling:"strict"})},set=B4?{encode(e){return v6(e),e.toBase64()},decode(e){return N4(e,!1)}}:kr(sn(6),qr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),W0(6),zr("")),aet=kr(sn(6),qr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),zr("")),cet=B4?{encode(e){return v6(e),e.toBase64({alphabet:"base64url"})},decode(e){return N4(e,!0)}}:kr(sn(6),qr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),W0(6),zr("")),uet=kr(sn(6),qr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),zr("")),C6=(e)=>kr(ooe(58),qr(e),zr("")),soe=C6("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),pet=C6("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),fet=C6("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");var F4=(e)=>kr(ioe(4,(t)=>e(e(t))),soe);var E6=kr(qr("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),zr("")),O4=[996825010,642813549,513874426,1027748829,705979059];function qf(e){let t=e>>25,r=(e&33554431)<<5;for(let n=0;n<O4.length;n++)if((t>>n&1)===1)r^=O4[n];return r}function k4(e,t,r=1){let n=e.length,o=1;for(let i=0;i<n;i++){let s=e.charCodeAt(i);if(s<33||s>126)throw Error(`Invalid prefix (${e})`);o=qf(o)^s>>5}o=qf(o);for(let i=0;i<n;i++)o=qf(o)^e.charCodeAt(i)&31;for(let i of t)o=qf(o)^i;for(let i=0;i<6;i++)o=qf(o);return o^=r,E6.encode(T6([o%q0[30]],30,5,!1))}function M4(e){let t=e==="bech32"?1:734539939,r=sn(5),{decode:n,encode:o}=r,i=I4(n);function s(p,f,d=90){if(bs("bech32.encode prefix",p),Zu(f))f=Array.from(f);A6("bech32.encode",f);let h=p.length;if(h===0)throw TypeError(`Invalid prefix length ${h}`);let m=h+7+f.length;if(d!==!1&&m>d)throw TypeError(`Length ${m} exceeds limit ${d}`);let y=p.toLowerCase(),g=k4(y,f,t);return`${y}1${E6.encode(f)}${g}`}function a(p,f=90){bs("bech32.decode input",p);let d=p.length;if(d<8||f!==!1&&d>f)throw TypeError(`invalid string length: ${d} (${p}). Expected (8..${f})`);let h=p.toLowerCase();if(p!==h&&p!==p.toUpperCase())throw Error("String must be lowercase or uppercase");let m=h.lastIndexOf("1");if(m===0||m===-1)throw Error('Letter "1" must be present between prefix and data only');let y=h.slice(0,m),g=h.slice(m+1);if(g.length<6)throw Error("Data must be at least 6 characters long");let x=E6.decode(g).slice(0,-6),b=k4(y,x,t);if(!g.endsWith(b))throw Error(`Invalid checksum in ${p}: expected "${b}"`);return{prefix:y,words:x}}let c=I4(a);function u(p){let{prefix:f,words:d}=a(p,!1);return{prefix:f,words:d,bytes:n(d)}}function l(p,f){return s(p,o(f))}return{encode:s,decode:a,encodeFromBytes:l,decodeToBytes:u,decodeUnsafe:c,fromWords:n,fromWordsUnsafe:i,toWords:o}}var det=M4("bech32"),met=M4("bech32m");var aoe=(()=>typeof Uint8Array.from([]).toHex==="function"&&typeof Uint8Array.fromHex==="function")(),coe={encode(e){return v6(e),e.toHex()},decode(e){return bs("hex",e),Uint8Array.fromHex(e)}},het=aoe?coe:kr(sn(4),qr("0123456789abcdef"),zr(""),P4((e)=>{if(typeof e!=="string"||e.length%2!==0)throw TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));/*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */var K0=Ro.ProjectivePoint,D6=F4(Do);function L4(e){tt(e);let t=e.length===0?"0":Rn(e);return BigInt("0x"+t)}function uoe(e){if(typeof e!=="bigint")throw Error("bigint expected");return oi(e.toString(16).padStart(64,"0"))}var loe=Jp("Bitcoin seed"),I6={private:76066276,public:76067358},O6=2147483648,poe=(e)=>pB(Do(e)),foe=(e)=>po(e).getUint32(0,!1),Y0=(e)=>{if(!Number.isSafeInteger(e)||e<0||e>4294967295)throw Error("invalid number, should be from 0 to 2**32-1, got "+e);let t=new Uint8Array(4);return po(t).setUint32(0,e,!1),t};class xs{get fingerprint(){if(!this.pubHash)throw Error("No publicKey set!");return foe(this.pubHash)}get identifier(){return this.pubHash}get pubKeyHash(){return this.pubHash}get privateKey(){return this.privKeyBytes||null}get publicKey(){return this.pubKey||null}get privateExtendedKey(){let e=this.privateKey;if(!e)throw Error("No private key");return D6.encode(this.serialize(this.versions.private,St(new Uint8Array([0]),e)))}get publicExtendedKey(){if(!this.pubKey)throw Error("No public key");return D6.encode(this.serialize(this.versions.public,this.pubKey))}static fromMasterSeed(e,t=I6){if(tt(e),8*e.length<128||8*e.length>512)throw Error("HDKey: seed length must be between 128 and 512 bits; 256 bits is advised, got "+e.length);let r=Io(Af,loe,e);return new xs({versions:t,chainCode:r.slice(32),privateKey:r.slice(0,32)})}static fromExtendedKey(e,t=I6){let r=D6.decode(e),n=po(r),o=n.getUint32(0,!1),i={versions:t,depth:r[4],parentFingerprint:n.getUint32(5,!1),index:n.getUint32(9,!1),chainCode:r.slice(13,45)},s=r.slice(45),a=s[0]===0;if(o!==t[a?"private":"public"])throw Error("Version mismatch");if(a)return new xs({...i,privateKey:s.slice(1)});else return new xs({...i,publicKey:s})}static fromJSON(e){return xs.fromExtendedKey(e.xpriv)}constructor(e){if(this.depth=0,this.index=0,this.chainCode=null,this.parentFingerprint=0,!e||typeof e!=="object")throw Error("HDKey.constructor must not be called directly");if(this.versions=e.versions||I6,this.depth=e.depth||0,this.chainCode=e.chainCode||null,this.index=e.index||0,this.parentFingerprint=e.parentFingerprint||0,!this.depth){if(this.parentFingerprint||this.index)throw Error("HDKey: zero depth with non-zero index/parent fingerprint")}if(e.publicKey&&e.privateKey)throw Error("HDKey: publicKey and privateKey at same time.");if(e.privateKey){if(!Ro.utils.isValidPrivateKey(e.privateKey))throw Error("Invalid private key");this.privKey=typeof e.privateKey==="bigint"?e.privateKey:L4(e.privateKey),this.privKeyBytes=uoe(this.privKey),this.pubKey=Ro.getPublicKey(e.privateKey,!0)}else if(e.publicKey)this.pubKey=K0.fromHex(e.publicKey).toRawBytes(!0);else throw Error("HDKey: no public or private key provided");this.pubHash=poe(this.pubKey)}derive(e){if(!/^[mM]'?/.test(e))throw Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(e))return this;let t=e.replace(/^[mM]'?\//,"").split("/"),r=this;for(let n of t){let o=/^(\d+)('?)$/.exec(n),i=o&&o[1];if(!o||o.length!==3||typeof i!=="string")throw Error("invalid child index: "+n);let s=+i;if(!Number.isSafeInteger(s)||s>=O6)throw Error("Invalid index");if(o[2]==="'")s+=O6;r=r.deriveChild(s)}return r}deriveChild(e){if(!this.pubKey||!this.chainCode)throw Error("No publicKey or chainCode set");let t=Y0(e);if(e>=O6){let s=this.privateKey;if(!s)throw Error("Could not derive hardened child key");t=St(new Uint8Array([0]),s,t)}else t=St(this.pubKey,t);let r=Io(Af,this.chainCode,t),n=L4(r.slice(0,32)),o=r.slice(32);if(!Ro.utils.isValidPrivateKey(n))throw Error("Tweak bigger than curve order");let i={versions:this.versions,chainCode:o,depth:this.depth+1,parentFingerprint:this.fingerprint,index:e};try{if(this.privateKey){let s=Or(this.privKey+n,Ro.CURVE.n);if(!Ro.utils.isValidPrivateKey(s))throw Error("The tweak was out of range or the resulted private key is invalid");i.privateKey=s}else{let s=K0.fromHex(this.pubKey).add(K0.fromPrivateKey(n));if(s.equals(K0.ZERO))throw Error("The tweak was equal to negative P, which made the result key invalid");i.publicKey=s.toRawBytes(!0)}return new xs(i)}catch(s){return this.deriveChild(e+1)}}sign(e){if(!this.privateKey)throw Error("No privateKey set!");return tt(e,32),Ro.sign(e,this.privKey).toCompactRawBytes()}verify(e,t){if(tt(e,32),tt(t,64),!this.publicKey)throw Error("No publicKey set!");let r;try{r=Ro.Signature.fromCompact(t)}catch(n){return!1}return Ro.verify(r,e,this.publicKey)}wipePrivateData(){if(this.privKey=void 0,this.privKeyBytes)this.privKeyBytes.fill(0),this.privKeyBytes=void 0;return this}toJSON(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}}serialize(e,t){if(!this.chainCode)throw Error("No chainCode set");return tt(t,33),St(Y0(e),new Uint8Array([this.depth]),Y0(this.parentFingerprint),Y0(this.index),this.chainCode,t)}}Cf();Fr();function doe(e,t,r,n){Rc(e);let o=jk({dkLen:32,asyncTick:10},n),{c:i,dkLen:s,asyncTick:a}=o;if(xr(i),xr(s),xr(a),i<1)throw Error("iterations (c) should be >= 1");let c=O2(t),u=O2(r),l=new Uint8Array(s),p=Io.create(e,c),f=p._cloneInto().update(u);return{c:i,dkLen:s,asyncTick:a,DK:l,PRF:p,PRFSalt:f}}function moe(e,t,r,n,o){if(e.destroy(),t.destroy(),n)n.destroy();return Nt(o),r}function $4(e,t,r,n){let{c:o,dkLen:i,DK:s,PRF:a,PRFSalt:c}=doe(e,t,r,n),u,l=new Uint8Array(4),p=po(l),f=new Uint8Array(a.outputLen);for(let d=1,h=0;h<i;d++,h+=a.outputLen){let m=s.subarray(h,h+a.outputLen);p.setInt32(0,d,!1),(u=c._cloneInto(u)).update(l).digestInto(f),m.set(f.subarray(0,m.length));for(let y=1;y<o;y++){a._cloneInto(u).update(f).digestInto(f);for(let g=0;g<m.length;g++)m[g]^=f[g]}}return moe(a,c,s,u,f)}Su();/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */function U4(e){if(typeof e!=="string")throw TypeError("invalid mnemonic type: "+typeof e);return e.normalize("NFKD")}function hoe(e){let t=U4(e),r=t.split(" ");if(![12,15,18,21,24].includes(r.length))throw Error("Invalid mnemonic");return{nfkd:t,words:r}}var yoe=(e)=>U4("mnemonic"+e);function H4(e,t=""){return $4(Af,hoe(e).nfkd,yoe(t),{c:2048,dkLen:64})}var goe="0x8010801080108010801080108010801080108010801080108010801080108010",boe=B0("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function j4(e){if(typeof e==="string"){if(Wt(e,-32)!==goe)throw new q4(e)}else t6(e.authorization)}function xoe(e){j4(e);let t=Ky(Wt(e,-64,-32)),r=Wt(e,-t-64,-64),n=Wt(e,0,-t-64),[o,i,s]=zu(boe,r);return{authorization:ZB({address:o.delegation,chainId:Number(o.chainId),nonce:o.nonce,yParity:o.yParity,r:o.r,s:o.s}),signature:n,...s&&s!=="0x"?{data:s,to:i}:{}}}function woe(e){try{return j4(e),!0}catch{return!1}}class q4 extends Q{constructor(e){super(`Value \`${e}\` is an invalid ERC-8010 wrapped signature.`);Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}_t();xo();Qy();Er();Pn();Eo();Pn();Eo();async function G4({address:e,authorization:t,signature:r}){return Ne(de(e),await cs({authorization:t,signature:r}))}st();X();If();st();vt();function Z0({r:e,s:t,to:r="hex",v:n,yParity:o}){let i=(()=>{if(o===0||o===1)return o;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw Error("Invalid `v` or `yParity` value")})(),s=`0x${new xi.Signature(_e(e),_e(t)).toCompactHex()}${i===0?"1b":"1c"}`;if(r==="hex")return s;return ht(s)}ns();async function Ts(e,t){let{address:r,chain:n=e.chain,hash:o,erc6492VerifierAddress:i=t.universalSignatureVerifierAddress??n?.contracts?.erc6492Verifier?.address,multicallAddress:s=t.multicallAddress??n?.contracts?.multicall3?.address,mode:a="auto"}=t;if(n?.verifyHash)return await n.verifyHash(e,t);let c=(()=>{let u=t.signature;if(oe(u))return u;if(typeof u==="object"&&"r"in u&&"s"in u)return Z0(u);return be(u)})();try{if(a==="eoa")try{if(Ne(de(r),await Of({hash:o,signature:c})))return!0}catch{}if(woe(c))return await Toe(e,{...t,multicallAddress:s,signature:c});return await Eoe(e,{...t,verifierAddress:i,signature:c})}catch(u){if(a!=="eoa")try{if(Ne(de(r),await Of({hash:o,signature:c})))return!0}catch{}if(u instanceof ws)return!1;throw u}}async function Toe(e,t){let{address:r,blockHash:n,blockNumber:o,blockTag:i,hash:s,multicallAddress:a,requireCanonical:c}=t,{authorization:u,data:l,signature:p,to:f}=xoe(t.signature);if(await Ca(e,{address:r,blockHash:n,blockNumber:o,blockTag:i,requireCanonical:c})===He(["0xef0100",u.address]))return await voe(e,{...t,signature:p});let h={address:u.address,chainId:Number(u.chainId),nonce:Number(u.nonce),r:M(u.r,{size:32}),s:M(u.s,{size:32}),yParity:u.yParity};if(!await G4({address:r,authorization:h}))throw new ws;let y=await q(e,we,"readContract")({...a?{address:a}:{code:wa},authorizationList:[h],abi:Jr,blockHash:n,blockNumber:o,blockTag:"pending",functionName:"aggregate3",requireCanonical:c,args:[[...l?[{allowFailure:!0,target:f??r,callData:l}]:[],{allowFailure:!0,target:r,callData:Be({abi:a2,functionName:"isValidSignature",args:[s,p]})}]]});if(y[y.length-1]?.returnData?.startsWith("0x1626ba7e"))return!0;throw new ws}async function Eoe(e,t){let{address:r,factory:n,factoryData:o,hash:i,signature:s,verifierAddress:a,...c}=t,u=await(async()=>{if(!n&&!o)return s;if(_ne(s))return s;return Pne({data:o,signature:s,to:n})})(),l=a?{to:a,data:Be({abi:$p,functionName:"isValidSig",args:[r,i,u]}),...c}:{data:Ta({abi:$p,args:[r,i,u],bytecode:aP}),...c},{data:p}=await q(e,Dr,"call")(l).catch((f)=>{if(f instanceof Ji)throw new ws;throw f});if(wy(p??"0x0"))return!0;throw new ws}async function voe(e,t){let{address:r,blockHash:n,blockNumber:o,blockTag:i,hash:s,requireCanonical:a,signature:c}=t;if((await q(e,we,"readContract")({address:r,abi:a2,args:[s,c],blockHash:n,blockNumber:o,blockTag:i,functionName:"isValidSignature",requireCanonical:a}).catch((l)=>{if(l instanceof jc)throw new ws;throw l})).startsWith("0x1626ba7e"))return!0;throw new ws}class ws extends Error{}Qr();var V4=`\x19Ethereum Signed Message:
288
+ `;yr();X();function W4(e){let t=(()=>{if(typeof e==="string")return zt(e);if(typeof e.raw==="string")return e.raw;return be(e.raw)})(),r=zt(`${V4}${fe(t)}`);return yt([r,t])}function Xu(e,t){return ke(W4(e),t)}async function K4(e,{address:t,message:r,factory:n,factoryData:o,signature:i,...s}){let a=Xu(r);return q(e,Ts,"verifyHash")({address:t,factory:n,factoryData:o,hash:a,signature:i,...s})}ho();X();Qr();et();In();se();class k6 extends B{constructor({domain:e}){super(`Invalid domain "${ue(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class R6 extends B{constructor({primaryType:e,types:t}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(t))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class P6 extends B{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}class _6 extends B{constructor({type:e}){let t=e.replace(/^(u?int)/,"$&256");super(`Type "${e}" is not a valid EIP-712 type.`,{metaMessages:[`Use "${t}" instead.`],name:"InvalidTypedDataTypeError"})}}or();yr();X();Oy();function Y4(e){let{domain:t,message:r,primaryType:n,types:o}=e,i=(c,u)=>{let l={...u};for(let p of c){let{name:f,type:d}=p;if(d==="address")l[f]=l[f].toLowerCase()}return l},s=(()=>{if(!o.EIP712Domain)return{};if(!t)return{};return i(o.EIP712Domain,t)})(),a=(()=>{if(n==="EIP712Domain")return;return i(o[n],r)})();return ue({domain:s,message:a,primaryType:n,types:o})}function J0(e){let{domain:t,message:r,primaryType:n,types:o}=e,i=(s,a)=>{for(let c of s){let{name:u,type:l}=c,p=a[u],f=l.replace(/(\[[0-9]*\])+$/,"");if(f==="int"||f==="uint")throw new _6({type:l});let d=l.match(Bc);if(d&&(typeof p==="number"||typeof p==="bigint")){let[y,g,x]=d;M(p,{signed:g==="int",size:Number.parseInt(x,10)/8})}if(l==="address"&&typeof p==="string"&&!J(p))throw new Me({address:p});let h=l.match(Iy);if(h){let[y,g]=h;if(g&&fe(p)!==Number.parseInt(g,10))throw new Gp({expectedSize:Number.parseInt(g,10),givenSize:fe(p)})}let m=o[l];if(m)Soe(l),i(m,p)}};if(o.EIP712Domain&&t){if(typeof t!=="object")throw new k6({domain:t});i(o.EIP712Domain,t)}if(n!=="EIP712Domain")if(o[n])i(o[n],r);else throw new R6({primaryType:n,types:o})}function X0({domain:e}){return[typeof e?.name==="string"&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},(typeof e?.chainId==="number"||typeof e?.chainId==="bigint")&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Soe(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new P6({type:e})}function Q0(e){let{domain:t={},message:r,primaryType:n}=e,o={EIP712Domain:X0({domain:t}),...e.types};J0({domain:t,message:r,primaryType:n,types:o});let i=["0x1901"];if(t)i.push(Aoe({domain:t,types:o}));if(n!=="EIP712Domain")i.push(Z4({data:r,primaryType:n,types:o}));return ke(yt(i))}function Aoe({domain:e,types:t}){return Z4({data:e,primaryType:"EIP712Domain",types:t})}function Z4({data:e,primaryType:t,types:r}){let n=J4({data:e,primaryType:t,types:r});return ke(n)}function J4({data:e,primaryType:t,types:r}){let n=[{type:"bytes32"}],o=[Coe({primaryType:t,types:r})];for(let i of r[t]){let[s,a]=Q4({types:r,name:i.name,type:i.type,value:e[i.name]});n.push(s),o.push(a)}return ct(n,o)}function Coe({primaryType:e,types:t}){let r=Ce(Doe({primaryType:e,types:t}));return ke(r)}function Doe({primaryType:e,types:t}){let r="",n=X4({primaryType:e,types:t});n.delete(e);let o=[e,...Array.from(n).sort()];for(let i of o)r+=`${i}(${t[i].map(({name:s,type:a})=>`${a} ${s}`).join(",")})`;return r}function X4({primaryType:e,types:t},r=new Set){let o=e.match(/^\w*/u)?.[0];if(r.has(o)||t[o]===void 0)return r;r.add(o);for(let i of t[o])X4({primaryType:i.type,types:t},r);return r}function Q4({types:e,name:t,type:r,value:n}){if(e[r]!==void 0)return[{type:"bytes32"},ke(J4({data:n,primaryType:r,types:e}))];if(r==="bytes")return[{type:"bytes32"},ke(n)];if(r==="string")return[{type:"bytes32"},ke(Ce(n))];if(r.lastIndexOf("]")===r.length-1){let o=r.slice(0,r.lastIndexOf("[")),i=n.map((s)=>Q4({name:t,type:o,types:e,value:s}));return[{type:"bytes32"},ke(ct(i.map(([s])=>s),i.map(([,s])=>s)))]}return[{type:r},n]}async function eN(e,t){let{address:r,factory:n,factoryData:o,signature:i,message:s,primaryType:a,types:c,domain:u,...l}=t,p=Q0({message:s,primaryType:a,types:c,domain:u});return q(e,Ts,"verifyHash")({address:r,factory:n,factoryData:o,hash:p,signature:i,...l})}ir();var eg=new Map,B6=new Map,Ioe=0;function kt(e,t,r){let n=++Ioe,o=()=>eg.get(e)||[],i=()=>{let p=o().filter((f)=>f.id!==n);if(p.length===0){eg.delete(e),B6.delete(e);return}eg.set(e,p)},s=()=>{let l=o();if(!l.some((f)=>f.id===n))return;let p=B6.get(e);if(l.length===1&&p){let f=p();if(f instanceof Promise)f.catch(()=>{})}i()},a=o();if(eg.set(e,[...a,{id:n,fns:t}]),a&&a.length>0)return s;let c={};for(let l in t)c[l]=(...p)=>{let f=o();if(f.length===0)return;for(let d of f)d.fns[l]?.(...p)};let u=r(c);if(typeof u==="function")B6.set(e,u);return s}async function zf(e,{signal:t}={}){return new Promise((r,n)=>{if(t?.aborted){n(Ft(t));return}let o=()=>t?.removeEventListener("abort",s),i=setTimeout(()=>{o(),r()},e),s=()=>{clearTimeout(i),o(),n(Ft(t))};t?.addEventListener("abort",s,{once:!0})})}function _a(e,{delay:t=100,retryCount:r=2,shouldRetry:n=()=>!0,signal:o}={}){return new Promise((i,s)=>{let a=async({count:c=0}={})=>{if(o?.aborted){s(Ft(o));return}let u=async({error:l})=>{let p=typeof t==="function"?t({count:c,error:l}):t;if(p)try{await zf(p,{signal:o})}catch(f){s(f);return}return a({count:c+1})};try{let l=await e();i(l)}catch(l){if(o?.aborted){s(Ft(o));return}if(vr(l)){s(l);return}if(c<r&&await n({count:c,error:l}))return u({error:l});s(l)}};a().catch(s)})}st();function an(e,{emitOnBegin:t,initialWaitTime:r,interval:n}){let o=!0,i=()=>o=!1;return(async()=>{let a;if(t)a=await e({unpoll:i});let c=await r?.(a)??n;await zf(c);let u=async()=>{if(!o)return;await e({unpoll:i}),await zf(n),u()};u()})(),i}function tg(e,{emitOnBegin:t=!1,emitMissed:r=!1,onBlockNumber:n,onError:o,poll:i,pollingInterval:s=e.pollingInterval}){let a=(()=>{if(typeof i<"u")return i;if(e.transport.type==="webSocket"||e.transport.type==="ipc")return!1;if(e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"))return!1;return!0})(),c;return a?(()=>{let p=ue(["watchBlockNumber",e.uid,t,r,s]);return kt(p,{onBlockNumber:n,onError:o},(f)=>an(async()=>{try{let d=await q(e,on,"getBlockNumber")({cacheTime:0});if(c!==void 0){if(d===c)return;if(d-c>1&&r)for(let h=c+1n;h<d;h++)f.onBlockNumber(h,c),c=h}if(c===void 0||d>c)f.onBlockNumber(d,c),c=d}catch(d){f.onError?.(d)}},{emitOnBegin:t,interval:s}))})():(()=>{let p=ue(["watchBlockNumber",e.uid,t,r]);return kt(p,{onBlockNumber:n,onError:o},(f)=>{let d=!0,h=()=>d=!1;return(async()=>{try{let m=(()=>{if(e.transport.type==="fallback"){let g=e.transport.transports.find((x)=>x.config.type==="webSocket"||x.config.type==="ipc");if(!g)return e.transport;return g.value}return e.transport})(),{unsubscribe:y}=await m.subscribe({params:["newHeads"],onData(g){if(!d)return;let x=_e(g.result?.number);f.onBlockNumber(x,c),c=x},onError(g){f.onError?.(g)}});if(h=y,!d)h()}catch(m){o?.(m)}})(),()=>h()})})()}async function rg(e,t){let{checkReplacement:r=e.chain?.supportsTransactionReplacementDetection??!0,confirmations:n=1,hash:o,onReplaced:i,retryCount:s=6,retryDelay:a=({count:v})=>~~(1<<v)*200,timeout:c=180000}=t,u=(()=>{if(t.pollingInterval)return t.pollingInterval;if(e.chain?.experimental_preconfirmationTime)return e.chain.experimental_preconfirmationTime;return e.pollingInterval})(),l=ue(["waitForTransactionReceipt",e.uid,o,{checkReplacement:r,confirmations:n,pollingInterval:u,retryCount:s,timeout:c}]),p,f,d,h=!1,m,y,{promise:g,resolve:x,reject:b}=xu(),w=c?setTimeout(()=>{y?.(),m?.(),b(new rT({hash:o}))},c):void 0;return m=kt(l,{onReplaced:i,resolve:x,reject:b},async(v)=>{if(d=await q(e,Mu,"getTransactionReceipt")({hash:o}).catch(()=>{return}),d&&n<=1){clearTimeout(w),v.resolve(d),m?.();return}y=q(e,tg,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(D){let O=(A)=>{clearTimeout(w),y?.(),A(),m?.()},T=D;if(h)return;try{if(d){if(n>1&&(!d.blockNumber||T-d.blockNumber+1n<n))return;O(()=>v.resolve(d));return}if(r&&!p)h=!0,await _a(async()=>{if(p=await q(e,Fu,"getTransaction")({hash:o}),p.blockNumber)T=p.blockNumber},{delay:a,retryCount:s}),h=!1;if(d=await q(e,Mu,"getTransactionReceipt")({hash:o}),n>1&&(!d.blockNumber||T-d.blockNumber+1n<n))return;O(()=>v.resolve(d))}catch(A){if(A instanceof la||A instanceof cf){if(!p){h=!1;return}try{f=p,h=!0;let E=await _a(()=>q(e,lt,"getBlock")({blockNumber:T,includeTransactions:!0}),{delay:a,retryCount:s,shouldRetry:({error:k})=>k instanceof Aa});h=!1;let R=E.transactions.find(({from:k,hash:I,nonce:C})=>k===f.from&&I!==f.hash&&C===f.nonce);if(!R)return;if(d=await q(e,Mu,"getTransactionReceipt")({hash:R.hash}),n>1&&(!d.blockNumber||T-d.blockNumber+1n<n))return;let S="replaced";if(R.to===f.to&&R.value===f.value&&R.input===f.input)S="repriced";else if(R.from===R.to&&R.value===0n)S="cancelled";O(()=>{v.onReplaced?.({reason:S,replacedTransaction:f,transaction:R,transactionReceipt:d}),v.resolve(d)})}catch(E){O(()=>v.reject(E))}}else O(()=>v.reject(A))}}})}),g}var Ooe=["size","totalDifficulty","transactions","uncles","withdrawals"];function tN(e,{onBlockHeader:t,onError:r}){let n,o=ue(["watchBlockHeaders",e.uid]);return kt(o,{onBlockHeader:t,onError:r},(i)=>{let s=!0,a=!1,c=()=>s=!1;return(async()=>{try{let u=(()=>{if(e.transport.type==="fallback"){let p=e.transport.transports.find((f)=>f.config.type==="webSocket"||f.config.type==="ipc");if(!p)return e.transport;return p.value}return e.transport})(),{unsubscribe:l}=await u.subscribe({params:["newHeads"],onData(p){if(!s)return;let f=(e.chain?.formatters?.block?.format||Cu)(p.result,"watchBlockHeaders");for(let d of Ooe)delete f[d];i.onBlockHeader(f,n),n=f},onError(p){if(a)i.onError?.(p)}});if(a=!0,c=l,!s)c()}catch(u){i.onError?.(u)}})(),()=>c()})}function rN(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:o,onError:i,includeTransactions:s,poll:a,pollingInterval:c=e.pollingInterval}){let u=(()=>{if(typeof a<"u")return a;if(e.transport.type==="webSocket"||e.transport.type==="ipc")return!1;if(e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"))return!1;return!0})(),l=s??!1,p;return u?(()=>{let h=ue(["watchBlocks",e.uid,t,r,n,l,c]);return kt(h,{onBlock:o,onError:i},(m)=>an(async()=>{try{let y=await q(e,lt,"getBlock")({blockTag:t,includeTransactions:l});if(y.number!==null&&p?.number!=null){if(y.number===p.number)return;if(y.number-p.number>1&&r)for(let g=p?.number+1n;g<y.number;g++){let x=await q(e,lt,"getBlock")({blockNumber:g,includeTransactions:l});m.onBlock(x,p),p=x}}if(p?.number==null||t==="pending"&&y?.number==null||y.number!==null&&y.number>p.number)m.onBlock(y,p),p=y}catch(y){m.onError?.(y)}},{emitOnBegin:n,interval:c}))})():(()=>{let h=!0,m=!0,y=()=>h=!1;return(async()=>{try{if(n)q(e,lt,"getBlock")({blockTag:t,includeTransactions:l}).then((b)=>{if(!h)return;if(!m)return;o(b,void 0),m=!1}).catch(i);let g=(()=>{if(e.transport.type==="fallback"){let b=e.transport.transports.find((w)=>w.config.type==="webSocket"||w.config.type==="ipc");if(!b)return e.transport;return b.value}return e.transport})(),{unsubscribe:x}=await g.subscribe({params:["newHeads"],async onData(b){if(!h)return;let w=await q(e,lt,"getBlock")({blockNumber:b.result?.number,includeTransactions:l}).catch(()=>{});if(!h)return;o(w,p),m=!1,p=w},onError(b){i?.(b)}});if(y=x,!h)y()}catch(g){i?.(g)}})(),()=>y()})()}et();pu();function nN(e,t){let{abi:r,address:n,args:o,batch:i=!0,eventName:s,fromBlock:a,onError:c,onLogs:u,poll:l,pollingInterval:p=e.pollingInterval,strict:f}=t;return(()=>{if(typeof l<"u")return l;if(typeof a==="bigint")return!0;if(e.transport.type==="webSocket"||e.transport.type==="ipc")return!1;if(e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"))return!1;return!0})()?(()=>{let y=f??!1,g=ue(["watchContractEvent",n,o,i,e.uid,s,p,y,a]);return kt(g,{onLogs:u,onError:c},(x)=>{let b;if(a!==void 0)b=a-1n;let w,v=!1,D=an(async()=>{if(!v){try{w=await q(e,i0,"createContractEventFilter")({abi:r,address:n,args:o,eventName:s,strict:y,fromBlock:a})}catch{}v=!0;return}try{let O;if(w)O=await q(e,ls,"getFilterChanges")({filter:w});else{let T=await q(e,on,"getBlockNumber")({});if(b&&b<T)O=await q(e,g0,"getContractEvents")({abi:r,address:n,args:o,eventName:s,fromBlock:b+1n,toBlock:T,strict:y});else O=[];b=T}if(O.length===0)return;if(i)x.onLogs(O);else for(let T of O)x.onLogs([T])}catch(O){if(w&&O instanceof tn)v=!1;x.onError?.(O)}},{emitOnBegin:!0,interval:p});return async()=>{if(w)await q(e,ms,"uninstallFilter")({filter:w});D()}})})():(()=>{let y=f??!1,g=ue(["watchContractEvent",n,o,i,e.uid,s,p,y]),x=!0,b=()=>x=!1;return kt(g,{onLogs:u,onError:c},(w)=>((async()=>{try{let v=(()=>{if(e.transport.type==="fallback"){let T=e.transport.transports.find((A)=>A.config.type==="webSocket"||A.config.type==="ipc");if(!T)return e.transport;return T.value}return e.transport})(),D=s?Co({abi:r,eventName:s,args:o}):[],{unsubscribe:O}=await v.subscribe({params:["logs",{address:n,topics:D}],onData(T){if(!x)return;let A=T.result;try{let{eventName:E,args:R}=Da({abi:r,data:A.data,topics:A.topics,strict:f}),S=Ot(A,{args:R,eventName:E});w.onLogs([S])}catch(E){let R,S;if(E instanceof Wi||E instanceof Qs){if(f)return;R=E.abiItem.name,S=E.abiItem.inputs?.some((I)=>!(("name"in I)&&I.name))}let k=Ot(A,{args:S?[]:{},eventName:R});w.onLogs([k])}},onError(T){w.onError?.(T)}});if(b=O,!x)b()}catch(v){c?.(v)}})(),()=>b()))})()}et();pu();function oN(e,{address:t,args:r,batch:n=!0,event:o,events:i,fromBlock:s,onError:a,onLogs:c,poll:u,pollingInterval:l=e.pollingInterval,strict:p}){let f=(()=>{if(typeof u<"u")return u;if(typeof s==="bigint")return!0;if(e.transport.type==="webSocket"||e.transport.type==="ipc")return!1;if(e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"))return!1;return!0})(),d=p??!1;return f?(()=>{let y=ue(["watchEvent",t,r,n,e.uid,o,l,s]);return kt(y,{onLogs:c,onError:a},(g)=>{let x;if(s!==void 0)x=s-1n;let b,w=!1,v=an(async()=>{if(!w){try{b=await q(e,s0,"createEventFilter")({address:t,args:r,event:o,events:i,strict:d,fromBlock:s})}catch{}w=!0;return}try{let D;if(b)D=await q(e,ls,"getFilterChanges")({filter:b});else{let O=await q(e,on,"getBlockNumber")({});if(x&&x!==O)D=await q(e,Nu,"getLogs")({address:t,args:r,event:o,events:i,fromBlock:x+1n,toBlock:O});else D=[];x=O}if(D.length===0)return;if(n)g.onLogs(D);else for(let O of D)g.onLogs([O])}catch(D){if(b&&D instanceof tn)w=!1;g.onError?.(D)}},{emitOnBegin:!0,interval:l});return async()=>{if(b)await q(e,ms,"uninstallFilter")({filter:b});v()}})})():(()=>{let y=!0,g=()=>y=!1;return(async()=>{try{let x=(()=>{if(e.transport.type==="fallback"){let D=e.transport.transports.find((O)=>O.config.type==="webSocket"||O.config.type==="ipc");if(!D)return e.transport;return D.value}return e.transport})(),b=i??(o?[o]:void 0),w=[];if(b){if(w=[b.flatMap((O)=>Co({abi:[O],eventName:O.name,args:r}))],o)w=w[0]}let{unsubscribe:v}=await x.subscribe({params:["logs",{address:t,topics:w}],onData(D){if(!y)return;let O=D.result;try{let{eventName:T,args:A}=Da({abi:b??[],data:O.data,topics:O.topics,strict:d}),E=Ot(O,{args:A,eventName:T});c([E])}catch(T){let A,E;if(T instanceof Wi||T instanceof Qs){if(p)return;A=T.abiItem.name,E=T.abiItem.inputs?.some((S)=>!(("name"in S)&&S.name))}let R=Ot(O,{args:E?[]:{},eventName:A});c([R])}},onError(D){a?.(D)}});if(g=v,!y)g()}catch(x){a?.(x)}})(),()=>g()})()}function iN(e,{batch:t=!0,onError:r,onTransactions:n,poll:o,pollingInterval:i=e.pollingInterval}){return(typeof o<"u"?o:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{let u=ue(["watchPendingTransactions",e.uid,t,i]);return kt(u,{onTransactions:n,onError:r},(l)=>{let p,f=an(async()=>{try{if(!p)try{p=await q(e,a0,"createPendingTransactionFilter")({});return}catch(h){throw f(),h}let d=await q(e,ls,"getFilterChanges")({filter:p});if(d.length===0)return;if(t)l.onTransactions(d);else for(let h of d)l.onTransactions([h])}catch(d){l.onError?.(d)}},{emitOnBegin:!0,interval:i});return async()=>{if(p)await q(e,ms,"uninstallFilter")({filter:p});f()}})})():(()=>{let u=!0,l=()=>u=!1;return(async()=>{try{let{unsubscribe:p}=await e.transport.subscribe({params:["newPendingTransactions"],onData(f){if(!u)return;let d=f.result;n([d])},onError(f){r?.(f)}});if(l=p,!u)l()}catch(p){r?.(p)}})(),()=>l()})()}var koe=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/;function Roe(e){if(!koe.test(e))return!1;return!Number.isNaN(new Date(e).getTime())}function N6(e){if(!Roe(e))return new Date(Number.NaN);return new Date(e)}function sN(e){let{scheme:t,statement:r,...n}=e.match(Poe)?.groups??{},{chainId:o,expirationTime:i,issuedAt:s,notBefore:a,requestId:c,resources:u,...l}=e.match(_oe)?.groups??{},p=u?.split(`
289
+ - `).slice(1);return{...n,...l,...o?{chainId:Number(o)}:{},...i?{expirationTime:N6(i)}:{},...s?{issuedAt:N6(s)}:{},...a?{notBefore:N6(a)}:{},...c?{requestId:c}:{},...p?{resources:p}:{},...t?{scheme:t}:{},...r?{statement:r}:{}}}var Poe=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+\-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,_oe=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.*))?(?:\nResources:(?<resources>(?:\n- .+)*))?/;or();Eo();function aN(e){let{address:t,domain:r,message:n,nonce:o,scheme:i,time:s=new Date}=e;if(r&&n.domain!==r)return!1;if(o&&n.nonce!==o)return!1;if(i&&n.scheme!==i)return!1;if(Number.isNaN(s.getTime()))return!1;if(n.expirationTime){if(Number.isNaN(n.expirationTime.getTime()))return!1;if(s>=n.expirationTime)return!1}if(n.notBefore){if(Number.isNaN(n.notBefore.getTime()))return!1;if(s<n.notBefore)return!1}try{if(!n.address)return!1;if(!J(n.address,{strict:!1}))return!1;if(t&&!Ne(n.address,t))return!1}catch{return!1}return!0}async function cN(e,t){let{address:r,domain:n,message:o,nonce:i,scheme:s,signature:a,time:c=new Date,...u}=t,l=sN(o);if(!l.address)return!1;if(!aN({address:r,domain:n,message:l,nonce:i,scheme:s,time:c}))return!1;let f=Xu(o);return Ts(e,{address:l.address,hash:f,signature:a,...u})}_t();se();class pt extends B{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
290
+ `),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class $n extends B{constructor({docsPath:e,metaMessages:t,type:r}){super(`Account type "${r}" is not supported.`,{docsPath:e,metaMessages:t,name:"AccountTypeNotSupportedError"})}}Er();se();of();function Qu({chain:e,currentChainId:t}){if(!e)throw new G2;if(t!==e.id)throw new z2({chain:e,currentChainId:t})}So();aa();Ao();async function el(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}var F6=new Mr(128);async function Es(e,t){let{account:r=e.account,assertChainId:n=!0,chain:o=e.chain,accessList:i,authorizationList:s,blobs:a,data:c,dataSuffix:u=typeof e.dataSuffix==="string"?e.dataSuffix:e.dataSuffix?.value,gas:l,gasPrice:p,maxFeePerBlobGas:f,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:m,type:y,value:g,...x}=t;if(typeof r>"u")throw new pt({docsPath:"/docs/actions/wallet/sendTransaction"});let b=r?ee(r):null,w;try{Dt(t);let v=await(async()=>{if(t.to)return t.to;if(t.to===null)return;if(s&&s.length>0)return await cs({authorization:s[0]}).catch(()=>{throw new B("`to` is required. Could not infer from `authorizationList`.")});return})();if(b?.type==="json-rpc"||b===null){let D;if(o!==null){if(D=await q(e,Zt,"getChainId")({}),n)Qu({currentChainId:D,chain:o})}let O=e.chain?.formatters?.transactionRequest?.format,A=(O||Ct)({...Cr(x,{format:O}),accessList:i,account:b,authorizationList:s,blobs:a,chainId:D,data:u?yt([c??"0x",u]):c,gas:l,gasPrice:p,maxFeePerBlobGas:f,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:m,to:v,type:y,value:g},"sendTransaction"),E=F6.get(e.uid),R=E?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:R,params:[A]},{retryCount:0})}catch(S){if(E===!1)throw S;let k=S;if(k.name==="InvalidInputRpcError"||k.name==="InvalidParamsRpcError"||k.name==="MethodNotFoundRpcError"||k.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[A]},{retryCount:0}).then((I)=>(F6.set(e.uid,!0),I)).catch((I)=>{let C=I;if(C.name==="MethodNotFoundRpcError"||C.name==="MethodNotSupportedRpcError")throw F6.set(e.uid,!1),k;throw C});throw k}}if(b?.type==="local"){let D=(()=>{if(!b.nonceManager||typeof m<"u")return b.nonceManager;let S=b.nonceManager;return{consume(k){return w={address:k.address,chainId:k.chainId},S.consume(k)},get(k){return S.get(k)},increment(k){return S.increment(k)},reset(k){return S.reset(k)}}})(),O=await q(e,Oo,"prepareTransactionRequest")({account:b,accessList:i,authorizationList:s,blobs:a,chain:o,data:u?yt([c??"0x",u]):c,gas:l,gasPrice:p,maxFeePerBlobGas:f,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:m,nonceManager:D,parameters:[...Pf,"sidecars"],type:y,value:g,...x,to:v}),T=o?.serializers?.transaction,A=await b.signTransaction(O,{serializer:T}),E=(o??e.chain)?.serializers?.transactionEnvelope,R=E?await E({serializedTransaction:A,transaction:O}):A;return await q(e,el,"sendRawTransaction")({serializedTransaction:R})}if(b?.type==="smart")throw new $n({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new $n({docsPath:"/docs/actions/wallet/sendTransaction",type:b?.type})}catch(v){if(v instanceof $n)throw v;if(w)b?.nonceManager?.reset(w);throw us(v,{...t,account:b,chain:t.chain||void 0})}}async function Un(e,t){return Un.internal(e,Es,"sendTransaction",t)}(function(e){async function t(r,n,o,i){let{abi:s,account:a=r.account,address:c,args:u,functionName:l,...p}=i;if(typeof a>"u")throw new pt({docsPath:"/docs/contract/writeContract"});let f=a?ee(a):null,d=Be({abi:s,args:u,functionName:l});try{return await q(r,n,o)({data:d,to:c,account:f,...p})}catch(h){throw Lr(h,{abi:s,address:c,args:u,docsPath:"/docs/contract/writeContract",functionName:l,sender:f?.address})}}e.internal=t})(Un||(Un={}));_t();or();Eo();sf();function Gr(e,t){return Fy(e,t)}sf();function Ai(e,t){return bR(e,t)}function tl(e,t){return{amount:e,decimals:t,formatted:Gr(e,t)}}function ng(e,t){if(typeof e==="bigint")return e;let r=e.decimals??t;return Ai(e.formatted,Boe(r))}function Boe(e){if(e===void 0)throw Error("Token decimals are required. Pass `amount.decimals` or select a declared token.");return e}function og(e,t){if(typeof e==="bigint")return t;return e.decimals??t}function Lt(e,t){let{decimals:r,token:n}=t,o=L6(e,n);if(o)return{address:o.address,decimals:r??o.decimals};if(J(n,{strict:!1}))return{address:n,decimals:r??Foe(e,n)};throw Error(`Token "${n}" is not a declared ERC-20 token on the client's \`tokens\` array (with an address for the client's chain), and is not a valid address.`)}function L6(e,t){let r=e.tokens,n=e.chain?.id;if(!r||n===void 0)return;let o=Noe(r,t);if(o)return M6(o,n);if(J(t,{strict:!1}))for(let i of r){let s=M6(i,n);if(s&&Ne(s.address,t))return s}return}function M6(e,t){let r=e.addresses[t];if(!r)return;return{address:r,currency:e.currency,decimals:e.decimals,name:e.name,popular:e.popular,symbol:e.symbol}}function Noe(e,t){let r=t.toLowerCase();for(let n of e)if(n.symbol?.toLowerCase()===r)return n;return}function Foe(e,t){let r=e.tokens,n=e.chain?.id;if(r&&n!==void 0)for(let o of r){let i=M6(o,n);if(i&&Ne(i.address,t))return i.decimals}return}async function rl(e,t){let{address:r,decimals:n}=Lt(e,t);if(n!==void 0)return{address:r,decimals:n};return{address:r,decimals:await we(e,{abi:ze,address:r,functionName:"decimals"})}}function nl(e){let{account:t,chain:r,gas:n,maxFeePerGas:o,maxPriorityFeePerGas:i,nonce:s}=e;return{account:t,chain:r,gas:n,maxFeePerGas:o,maxPriorityFeePerGas:i,nonce:s}}function Po(e){return{...e,data:Be(e),to:e.address}}async function Ci(e,t){return Ci.inner(Un,e,t)}(function(e){async function t(s,a,c){return await s(a,{...c,...e.call(a,c)})}e.inner=t;function r(s,a){return Po(Moe(s,a))}e.call=r;async function n(s,a){return _u(s,{...nl(a),...e.call(s,a)})}e.estimateGas=n;async function o(s,a){return Gu(s,{...nl(a),...e.call(s,a)})}e.simulate=o;function i(s){let[a]=ko({abi:ze,logs:s,eventName:"Approval",strict:!0});if(!a)throw Error("`Approval` event not found.");return a}e.extractEvent=i})(Ci||(Ci={}));function Moe(e,t){let{amount:r,spender:n,token:o}=t,{address:i,decimals:s}=Lt(e,{token:o});return{abi:ze,address:i,args:[n,ng(r,s)],functionName:"approve"}}se();ir();So();aa();Ao();ir();async function ol(e,{serializedTransaction:t,throwOnReceiptRevert:r,timeout:n}){let o=await e.request({method:"eth_sendRawTransactionSync",params:n?[t,n]:[t]},{retryCount:0}),s=(e.chain?.formatters?.transactionReceipt?.format||Bu)(o);if(s.status==="reverted"&&r)throw new Hc({receipt:s});return s}var $6=new Mr(128);async function ig(e,t){let{account:r=e.account,assertChainId:n=!0,chain:o=e.chain,accessList:i,authorizationList:s,blobs:a,data:c,dataSuffix:u=typeof e.dataSuffix==="string"?e.dataSuffix:e.dataSuffix?.value,gas:l,gasPrice:p,maxFeePerBlobGas:f,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:m,pollingInterval:y,throwOnReceiptRevert:g,type:x,value:b,...w}=t,v=t.timeout??Math.max((o?.blockTime??0)*3,5000);if(typeof r>"u")throw new pt({docsPath:"/docs/actions/wallet/sendTransactionSync"});let D=r?ee(r):null,O;try{Dt(t);let T=await(async()=>{if(t.to)return t.to;if(t.to===null)return;if(s&&s.length>0)return await cs({authorization:s[0]}).catch(()=>{throw new B("`to` is required. Could not infer from `authorizationList`.")});return})();if(D?.type==="json-rpc"||D===null){let A;if(o!==null){if(A=await q(e,Zt,"getChainId")({}),n)Qu({currentChainId:A,chain:o})}let E=e.chain?.formatters?.transactionRequest?.format,S=(E||Ct)({...Cr(w,{format:E}),accessList:i,account:D,authorizationList:s,blobs:a,chainId:A,data:u?yt([c??"0x",u]):c,gas:l,gasPrice:p,maxFeePerBlobGas:f,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:m,to:T,type:x,value:b},"sendTransaction"),k=$6.get(e.uid),I=k?"wallet_sendTransaction":"eth_sendTransaction",C=await(async()=>{try{return await e.request({method:I,params:[S]},{retryCount:0})}catch(N){if(k===!1)throw N;let L=N;if(L.name==="InvalidInputRpcError"||L.name==="InvalidParamsRpcError"||L.name==="MethodNotFoundRpcError"||L.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[S]},{retryCount:0}).then((F)=>($6.set(e.uid,!0),F)).catch((F)=>{let j=F;if(j.name==="MethodNotFoundRpcError"||j.name==="MethodNotSupportedRpcError")throw $6.set(e.uid,!1),L;throw j});throw L}})(),P=await q(e,rg,"waitForTransactionReceipt")({checkReplacement:!1,hash:C,pollingInterval:y,timeout:v});if(g&&P.status==="reverted")throw new Hc({receipt:P});return P}if(D?.type==="local"){let A=(()=>{if(!D.nonceManager||typeof m<"u")return D.nonceManager;let C=D.nonceManager;return{consume(P){return O={address:P.address,chainId:P.chainId},C.consume(P)},get(P){return C.get(P)},increment(P){return C.increment(P)},reset(P){return C.reset(P)}}})(),E=await q(e,Oo,"prepareTransactionRequest")({account:D,accessList:i,authorizationList:s,blobs:a,chain:o,data:u?yt([c??"0x",u]):c,gas:l,gasPrice:p,maxFeePerBlobGas:f,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:m,nonceManager:A,parameters:[...Pf,"sidecars"],type:x,value:b,...w,to:T}),R=o?.serializers?.transaction,S=await D.signTransaction(E,{serializer:R}),k=(o??e.chain)?.serializers?.transactionEnvelope,I=k?await k({serializedTransaction:S,transaction:E}):S;return await q(e,ol,"sendRawTransactionSync")({serializedTransaction:I,throwOnReceiptRevert:g,timeout:t.timeout})}if(D?.type==="smart")throw new $n({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new $n({docsPath:"/docs/actions/wallet/sendTransactionSync",type:D?.type})}catch(T){if(T instanceof $n)throw T;if(O&&!(T instanceof Hc))D?.nonceManager?.reset(O);throw us(T,{...t,account:D,chain:t.chain||void 0})}}async function il(e,t){return Un.internal(e,ig,"sendTransactionSync",t)}async function U6(e,t){let{amount:r,token:n,throwOnReceiptRevert:o=!0}=t,{decimals:i}=Lt(e,{token:n}),s=og(r,i),a=await Ci.inner(il,e,{...t,throwOnReceiptRevert:o}),{args:c}=Ci.extractEvent(a.logs);return{...c,...s===void 0?{}:{decimals:s,formatted:Gr(c.value,s)},receipt:a}}_t();async function sl(e,t){let{account:r,decimals:n,spender:o,token:i,...s}=t,[a,{decimals:c}]=await Promise.all([we(e,{...s,...sl.call(e,{account:r,spender:o,token:i})}),rl(e,{decimals:n,token:i})]);return tl(a,c)}(function(e){function t(r,n){return Po({address:Lt(r,n).address,abi:ze,functionName:"allowance",args:[n.account,n.spender]})}e.call=t})(sl||(sl={}));_t();async function al(e,t){let{account:r=e.account,decimals:n,token:o,...i}=t;if(!r)throw new pt;let s=ee(r).address,[a,{decimals:c}]=await Promise.all([we(e,{...i,...al.call(e,{account:s,token:o})}),rl(e,{decimals:n,token:o})]);return tl(a,c)}(function(e){function t(r,n){let o=n.account??r.account;if(!o)throw new pt;let i=ee(o).address;return Po({address:Lt(r,n).address,abi:ze,functionName:"balanceOf",args:[i]})}e.call=t})(al||(al={}));_t();async function H6(e,t){let{token:r,...n}=t,{address:o}=Lt(e,{token:r}),i=L6(e,r),[s,a,c]=await Promise.all([i?.decimals??we(e,{...n,abi:ze,address:o,functionName:"decimals"}),i?.name??we(e,{...n,abi:ze,address:o,functionName:"name"}),i?.symbol??we(e,{...n,abi:ze,address:o,functionName:"symbol"})]);return{decimals:s,name:a,symbol:c}}_t();async function cl(e,t){let{decimals:r,token:n,...o}=t,[i,{decimals:s}]=await Promise.all([we(e,{...o,...cl.call(e,{token:n})}),rl(e,{decimals:r,token:n})]);return tl(i,s)}(function(e){function t(r,n){return Po({address:Lt(r,n).address,abi:ze,args:[],functionName:"totalSupply"})}e.call=t})(cl||(cl={}));_t();async function Di(e,t){return Di.inner(Un,e,t)}(function(e){async function t(s,a,c){return await s(a,{...c,...e.call(a,c)})}e.inner=t;function r(s,a){return Po(Loe(s,a))}e.call=r;async function n(s,a){return _u(s,{...nl(a),...e.call(s,a)})}e.estimateGas=n;async function o(s,a){return Gu(s,{...nl(a),...e.call(s,a)})}e.simulate=o;function i(s){let[a]=ko({abi:ze,logs:s,eventName:"Transfer",strict:!0});if(!a)throw Error("`Transfer` event not found.");return a}e.extractEvent=i})(Di||(Di={}));function Loe(e,t){let{amount:r,from:n,to:o,token:i}=t,{address:s,decimals:a}=Lt(e,{token:i}),c=ng(r,a);if(n)return{abi:ze,address:s,args:[n,o,c],functionName:"transferFrom"};return{abi:ze,address:s,args:[o,c],functionName:"transfer"}}async function j6(e,t){let{amount:r,token:n,throwOnReceiptRevert:o=!0}=t,{decimals:i}=Lt(e,{token:n}),s=og(r,i),a=await Di.inner(il,e,{...t,throwOnReceiptRevert:o}),{args:c}=Di.extractEvent(a.logs);return{...c,...s===void 0?{}:{decimals:s,formatted:Gr(c.value,s)},receipt:a}}function Gf(e){return{call:(t)=>Dr(e,t),createAccessList:(t)=>AP(e,t),createBlockFilter:()=>CP(e),createContractEventFilter:(t)=>i0(e,t),createEventFilter:(t)=>s0(e,t),createPendingTransactionFilter:()=>a0(e),estimateContractGas:(t)=>_u(e,t),estimateGas:(t)=>Pu(e,t),getBalance:(t)=>h_(e,t),getBlobBaseFee:()=>y_(e),getBlock:(t)=>lt(e,t),getBlockNumber:(t)=>on(e,t),getBlockReceipts:(t)=>x_(e,t),getBlockTransactionCount:(t)=>w_(e,t),getBytecode:(t)=>Ca(e,t),getChainId:()=>Zt(e),getCode:(t)=>Ca(e,t),getContractEvents:(t)=>g0(e,t),getDelegation:(t)=>E_(e,t),getEip712Domain:(t)=>v_(e,t),getEnsAddress:(t)=>yP(e,t),getEnsAvatar:(t)=>EP(e,t),getEnsName:(t)=>vP(e,t),getEnsResolver:(t)=>SP(e,t),getEnsText:(t)=>o0(e,t),getFeeHistory:(t)=>A_(e,t),estimateFeesPerGas:(t)=>s_(e,t),getFilterChanges:(t)=>ls(e,t),getFilterLogs:(t)=>C_(e,t),getGasPrice:()=>Du(e),getLogs:(t)=>Nu(e,t),getProof:(t)=>I_(e,t),estimateMaxPriorityFeePerGas:(t)=>i_(e,t),fillTransaction:(t)=>Ru(e,t),getRawTransaction:(t)=>O_(e,t),getStorageAt:(t)=>k_(e,t),getStorageValues:(t)=>R_(e,t),getTransaction:(t)=>Fu(e,t),getTransactionConfirmations:(t)=>P_(e,t),getTransactionCount:(t)=>Iu(e,t),getTransactionReceipt:(t)=>Mu(e,t),multicall:(t)=>__(e,t),prepareTransactionRequest:(t)=>Oo(e,t),readContract:(t)=>we(e,t),sendRawTransaction:(t)=>el(e,t),sendRawTransactionSync:(t)=>ol(e,t),simulate:(t)=>Lu(e,t),simulateBlocks:(t)=>Lu(e,t),simulateCalls:(t)=>LB(e,t),simulateContract:(t)=>Gu(e,t),verifyHash:(t)=>Ts(e,t),verifyMessage:(t)=>K4(e,t),verifySiweMessage:(t)=>cN(e,t),verifyTypedData:(t)=>eN(e,t),uninstallFilter:(t)=>ms(e,t),waitForTransactionReceipt:(t)=>rg(e,t),watchBlockHeaders:(t)=>tN(e,t),watchBlocks:(t)=>rN(e,t),watchBlockNumber:(t)=>tg(e,t),watchContractEvent:(t)=>nN(e,t),watchEvent:(t)=>oN(e,t),watchPendingTransactions:(t)=>iN(e,t),token:$oe(e)}}function $oe(e){return{getAllowance:co(e,sl),getBalance:co(e,al),getMetadata:co(e,H6),getTotalSupply:co(e,cl)}}function Ii(e){let{key:t="public",name:r="Public Client"}=e;return uy({...e,key:t,name:r,type:"publicClient"}).extend(Gf)}async function uN(e,{hash:t}){await e.request({method:`${e.mode}_dropTransaction`,params:[t]})}async function lN(e){return e.request({method:`${e.mode}_dumpState`})}async function pN(e){if(e.mode==="ganache")return await e.request({method:"eth_mining"});return await e.request({method:`${e.mode}_getAutomine`})}async function fN(e){return await e.request({method:"txpool_content"})}st();async function dN(e){let{pending:t,queued:r}=await e.request({method:"txpool_status"});return{pending:Oe(t),queued:Oe(r)}}async function mN(e,{address:t}){await e.request({method:`${e.mode}_impersonateAccount`,params:[t]})}X();async function hN(e,{seconds:t}){return await e.request({method:"evm_increaseTime",params:[M(t)]})}async function yN(e){return await e.request({method:"txpool_inspect"})}async function gN(e,{state:t}){await e.request({method:`${e.mode}_loadState`,params:[t]})}X();async function bN(e,{blocks:t,interval:r}){if(e.mode==="ganache")await e.request({method:"evm_mine",params:[{blocks:M(t)}]});else await e.request({method:`${e.mode}_mine`,params:[M(t),M(r||0)]})}async function xN(e){await e.request({method:`${e.mode}_removeBlockTimestampInterval`})}async function wN(e,{blockNumber:t,jsonRpcUrl:r}={}){await e.request({method:`${e.mode}_reset`,params:[{forking:{blockNumber:Number(t),jsonRpcUrl:r}}]})}async function TN(e,{id:t}){await e.request({method:"evm_revert",params:[t]})}So();async function EN(e,t){let{accessList:r,data:n,from:o,gas:i,gasPrice:s,maxFeePerGas:a,maxPriorityFeePerGas:c,nonce:u,to:l,value:p,...f}=t,d=e.chain?.formatters?.transactionRequest?.format,m=(d||Ct)({...Cr(f,{format:d}),accessList:r,data:n,from:o,gas:i,gasPrice:s,maxFeePerGas:a,maxPriorityFeePerGas:c,nonce:u,to:l,value:p},"sendUnsignedTransaction");return await e.request({method:"eth_sendUnsignedTransaction",params:[m]})}async function vN(e,t){if(e.mode==="ganache")if(t)await e.request({method:"miner_start"});else await e.request({method:"miner_stop"});else await e.request({method:"evm_setAutomine",params:[t]})}X();async function SN(e,{address:t,value:r}){if(e.mode==="ganache")await e.request({method:"evm_setAccountBalance",params:[t,M(r)]});else await e.request({method:`${e.mode}_setBalance`,params:[t,M(r)]})}X();async function AN(e,{gasLimit:t}){await e.request({method:"evm_setBlockGasLimit",params:[M(t)]})}async function CN(e,{interval:t}){let r=(()=>{if(e.mode==="hardhat")return t*1000;return t})();await e.request({method:`${e.mode}_setBlockTimestampInterval`,params:[r]})}async function DN(e,{address:t,bytecode:r}){if(e.mode==="ganache")await e.request({method:"evm_setAccountCode",params:[t,r]});else await e.request({method:`${e.mode}_setCode`,params:[t,r]})}async function IN(e,{address:t}){await e.request({method:`${e.mode}_setCoinbase`,params:[t]})}async function ON(e,{interval:t}){let r=(()=>{if(e.mode==="hardhat")return t*1000;return t})();await e.request({method:"evm_setIntervalMining",params:[r]})}async function kN(e,t){await e.request({method:`${e.mode}_setLoggingEnabled`,params:[t]})}X();async function RN(e,{gasPrice:t}){await e.request({method:`${e.mode}_setMinGasPrice`,params:[M(t)]})}X();async function PN(e,{baseFeePerGas:t}){await e.request({method:`${e.mode}_setNextBlockBaseFeePerGas`,params:[M(t)]})}X();async function _N(e,{timestamp:t}){await e.request({method:"evm_setNextBlockTimestamp",params:[M(t)]})}X();async function BN(e,{address:t,nonce:r}){await e.request({method:`${e.mode}_setNonce`,params:[t,M(r)]})}async function NN(e,t){await e.request({method:`${e.mode}_setRpcUrl`,params:[t]})}X();async function FN(e,{address:t,index:r,value:n}){await e.request({method:`${e.mode}_setStorageAt`,params:[t,typeof r==="number"?M(r):r,n]})}async function MN(e){return await e.request({method:"evm_snapshot"})}async function LN(e,{address:t}){await e.request({method:`${e.mode}_stopImpersonatingAccount`,params:[t]})}function $N({mode:e}){return(t)=>{let r=t.extend(()=>({mode:e}));return{dropTransaction:(n)=>uN(r,n),dumpState:()=>lN(r),getAutomine:()=>pN(r),getTxpoolContent:()=>fN(r),getTxpoolStatus:()=>dN(r),impersonateAccount:(n)=>mN(r,n),increaseTime:(n)=>hN(r,n),inspectTxpool:()=>yN(r),loadState:(n)=>gN(r,n),mine:(n)=>bN(r,n),removeBlockTimestampInterval:()=>xN(r),reset:(n)=>wN(r,n),revert:(n)=>TN(r,n),sendUnsignedTransaction:(n)=>EN(r,n),setAutomine:(n)=>vN(r,n),setBalance:(n)=>SN(r,n),setBlockGasLimit:(n)=>AN(r,n),setBlockTimestampInterval:(n)=>CN(r,n),setCode:(n)=>DN(r,n),setCoinbase:(n)=>IN(r,n),setIntervalMining:(n)=>ON(r,n),setLoggingEnabled:(n)=>kN(r,n),setMinGasPrice:(n)=>RN(r,n),setNextBlockBaseFeePerGas:(n)=>PN(r,n),setNextBlockTimestamp:(n)=>_N(r,n),setNonce:(n)=>BN(r,n),setRpcUrl:(n)=>NN(r,n),setStorageAt:(n)=>FN(r,n),snapshot:()=>MN(r),stopImpersonatingAccount:(n)=>LN(r,n)}}}function q6(e){let{key:t="test",name:r="Test Client",mode:n}=e;return uy({...e,key:t,name:r,type:"testClient"}).extend((i)=>({mode:n,...$N({mode:n})(i)}))}X();async function UN(e,{chain:t}){let{id:r,name:n,nativeCurrency:o,rpcUrls:i,blockExplorers:s}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:M(r),chainName:n,nativeCurrency:o,rpcUrls:i.default.http,blockExplorerUrls:s?Object.values(s).map(({url:a})=>a):void 0}]},{dedupe:!0,retryCount:0})}Qy();function HN(e,t){let{abi:r,args:n,bytecode:o,...i}=t,s=Ta({abi:r,args:n,bytecode:o});return Es(e,{...i,...i.authorizationList?{to:null}:{},data:s})}Pn();async function jN(e){if(e.account?.type==="local")return[e.account.address];return(await e.request({method:"eth_accounts"},{dedupe:!0})).map((r)=>fo(r))}ii();st();se();pu();Er();st();X();var z6="0x5792579257925792579257925792579257925792579257925792579257925792",G6=M(0,{size:32});async function sg(e,t){let{account:r=e.account,chain:n=e.chain,experimental_fallback:o,experimental_fallbackDelay:i=32,forceAtomic:s=!1,id:a,version:c="2.0.0"}=t,u=r?ee(r):null,l=t.capabilities;if(e.dataSuffix&&!t.capabilities?.dataSuffix)if(typeof e.dataSuffix==="string")l={...t.capabilities,dataSuffix:{value:e.dataSuffix,optional:!0}};else l={...t.capabilities,dataSuffix:{value:e.dataSuffix.value,...e.dataSuffix.required?{}:{optional:!0}}};let p=t.calls.map((f)=>{let d=f,h=d.abi?Be({abi:d.abi,functionName:d.functionName,args:d.args}):d.data;return{data:d.dataSuffix&&h?yt([h,d.dataSuffix]):h,to:d.to,value:d.value?M(d.value):void 0}});try{let f=await e.request({method:"wallet_sendCalls",params:[{atomicRequired:s,calls:p,capabilities:l,chainId:M(n.id),from:u?.address,id:a,version:c}]},{retryCount:0});if(typeof f==="string")return{id:f};return f}catch(f){let d=f;if(o&&(d.name==="MethodNotFoundRpcError"||d.name==="MethodNotSupportedRpcError"||d.name==="UnknownRpcError"||d.details.toLowerCase()==="this request method is not supported"||d.details.toLowerCase().includes("does not exist / is not available")||d.details.toLowerCase().includes("missing or invalid. request()")||d.details.toLowerCase().includes("did not match any variant of untagged enum")||d.details.toLowerCase().includes("account upgraded to unsupported contract")||d.details.toLowerCase().includes("eip-7702 not supported")||d.details.toLowerCase().includes("unsupported wc_ method")||d.details.toLowerCase().includes("feature toggled misconfigured")||d.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(l){if(Object.values(l).some((g)=>!g.optional))throw new Qi(new B("non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.",{details:"non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`."}))}if(s&&p.length>1)throw new es(new B("`forceAtomic` is not supported on fallback to `eth_sendTransaction`.",{details:"`forceAtomic` is not supported on fallback to `eth_sendTransaction`."}));let h=[];for(let y of p){try{let g=await Es(e,{account:u,chain:n,data:y.data,to:y.to,value:y.value?_e(y.value):void 0});h.push({status:"fulfilled",value:g})}catch(g){h.push({reason:g,status:"rejected"})}if(i>0)await new Promise((g)=>setTimeout(g,i))}if(h.every((y)=>y.status==="rejected"))throw h[0].reason;let m=h.map((y)=>{if(y.status==="fulfilled")return y.value;return G6});return{id:yt([...m,M(n.id,{size:32}),z6])}}throw us(f,{...t,account:u,chain:t.chain})}}async function ag(e,t){async function r(l){if(l.endsWith(z6.slice(2))){let f=Bt(Dy(l,-64,-32)),d=Dy(l,0,-64).slice(2).match(/.{1,64}/g),h=await Promise.all(d.map((y)=>G6.slice(2)!==y?e.request({method:"eth_getTransactionReceipt",params:[`0x${y}`]},{dedupe:!0}):void 0)),m=(()=>{if(h.some((y)=>y===null))return 100;if(h.every((y)=>y?.status==="0x1"))return 200;if(h.every((y)=>y?.status==="0x0"))return 500;return 600})();return{atomic:!1,chainId:Oe(f),receipts:h.filter(Boolean),status:m,version:"2.0.0"}}return e.request({method:"wallet_getCallsStatus",params:[l]})}let{atomic:n=!1,chainId:o,receipts:i,version:s="2.0.0",...a}=await r(t.id),[c,u]=(()=>{let l=a.status;if(l>=100&&l<200)return["pending",l];if(l>=200&&l<300)return["success",l];if(l>=300&&l<700)return["failure",l];if(l==="CONFIRMED")return["success",200];if(l==="PENDING")return["pending",100];return[void 0,l]})();return{...a,atomic:n,chainId:o?Oe(o):void 0,receipts:i?.map((l)=>({...l,blockNumber:_e(l.blockNumber),gasUsed:_e(l.gasUsed),status:gE[l.status]}))??[],statusCode:u,status:c,version:s}}X();async function qN(e,t={}){let{account:r=e.account,chainId:n}=t,o=r?ee(r):void 0,i=n?[o?.address,[M(n)]]:[o?.address],s=await e.request({method:"wallet_getCapabilities",params:i}),a={};for(let[c,u]of Object.entries(s)){a[Number(c)]={};for(let[l,p]of Object.entries(u)){if(l==="addSubAccount")l="unstable_addSubAccount";a[Number(c)][l]=p}}return typeof n==="number"?a[n]:a}async function zN(e){return await e.request({method:"wallet_getPermissions"},{dedupe:!0})}Eo();async function cg(e,t){let{account:r=e.account,chainId:n,nonce:o}=t;if(!r)throw new pt({docsPath:"/docs/eip7702/prepareAuthorization"});let i=ee(r),s=(()=>{if(!t.executor)return;if(t.executor==="self")return t.executor;return ee(t.executor)})(),a={address:t.contractAddress??t.address,chainId:n,nonce:o};if(typeof a.chainId>"u")a.chainId=e.chain?.id??await q(e,Zt,"getChainId")({});if(typeof a.nonce>"u"){if(a.nonce=await q(e,Iu,"getTransactionCount")({address:i.address,blockTag:"pending"}),s==="self"||s?.address&&Ne(s.address,i.address))a.nonce+=1}return a}Pn();async function GN(e){return(await e.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map((r)=>de(r))}async function VN(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}se();se();class V6 extends B{constructor(e){super(`Call bundle failed with status: ${e.statusCode}`,{name:"BundleFailedError"});Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=e}}async function ug(e,t){let{id:r,pollingInterval:n=e.pollingInterval,status:o=({statusCode:m})=>m===200||m>=300,retryCount:i=4,retryDelay:s=({count:m})=>~~(1<<m)*200,timeout:a=60000,throwOnFailure:c=!1}=t,u=ue(["waitForCallsStatus",e.uid,r]),{promise:l,resolve:p,reject:f}=xu(),d,h=kt(u,{resolve:p,reject:f},(m)=>{let y=an(async()=>{let g=(x)=>{clearTimeout(d),y(),x(),h()};try{let x=await _a(async()=>{let b=await q(e,ag,"getCallsStatus")({id:r});if(c&&b.status==="failure")throw new V6(b);return b},{retryCount:i,delay:s});if(!o(x))return;g(()=>m.resolve(x))}catch(x){g(()=>m.reject(x))}},{interval:n,emitOnBegin:!0});return y});return d=a?setTimeout(()=>{h(),clearTimeout(d),f(new WN({id:r}))},a):void 0,await l}class WN extends B{constructor({id:e}){super(`Timed out while waiting for call bundle with id "${e}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}async function KN(e,t){let{chain:r=e.chain}=t,n=t.timeout??Math.max((r?.blockTime??0)*3,5000),o=await q(e,sg,"sendCalls")(t);return await q(e,ug,"waitForCallsStatus")({...t,id:o.id,timeout:n})}async function YN(e,t){let{id:r}=t;await e.request({method:"wallet_showCallsStatus",params:[r]});return}async function ZN(e,t){let{account:r=e.account}=t;if(!r)throw new pt({docsPath:"/docs/eip7702/signAuthorization"});let n=ee(r);if(!n.signAuthorization)throw new $n({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});let o=await cg(e,t);return n.signAuthorization(o)}X();async function JN(e,{account:t=e.account,message:r}){if(!t)throw new pt({docsPath:"/docs/actions/wallet/signMessage"});let n=ee(t);if(n.signMessage)return n.signMessage({message:r});let o=(()=>{if(typeof r==="string")return zt(r);if(r.raw instanceof Uint8Array)return Ce(r.raw);return r.raw})();return e.request({method:"personal_sign",params:[o,n.address]},{retryCount:0})}X();So();Ao();async function XN(e,t){let{account:r=e.account,chain:n=e.chain,...o}=t;if(!r)throw new pt({docsPath:"/docs/actions/wallet/signTransaction"});let i=ee(r);Dt({account:i,...t});let s=await q(e,Zt,"getChainId")({});if(n!==null)Qu({currentChainId:s,chain:n});let c=(n?.formatters||e.chain?.formatters)?.transactionRequest?.format||Ct;if(i.signTransaction)return i.signTransaction({...o,account:i,chainId:s},{serializer:e.chain?.serializers?.transaction});return await e.request({method:"eth_signTransaction",params:[{...c({...o,account:i},"signTransaction"),chainId:M(s),from:i.address}]},{retryCount:0})}async function QN(e,t){let{account:r=e.account,domain:n,message:o,primaryType:i}=t;if(!r)throw new pt({docsPath:"/docs/actions/wallet/signTypedData"});let s=ee(r),a={EIP712Domain:X0({domain:n}),...t.types};if(J0({domain:n,message:o,primaryType:i,types:a}),s.signTypedData)return s.signTypedData({domain:n,message:o,primaryType:i,types:a});let c=Y4({domain:n,message:o,primaryType:i,types:a});return e.request({method:"eth_signTypedData_v4",params:[s.address,c]},{retryCount:0})}X();async function eF(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:M(t)}]},{retryCount:0})}async function tF(e,t){return await e.request({method:"wallet_watchAsset",params:t},{retryCount:0})}function W6(e){return{addChain:(t)=>UN(e,t),deployContract:(t)=>HN(e,t),fillTransaction:(t)=>Ru(e,t),getAddresses:()=>jN(e),getCallsStatus:(t)=>ag(e,t),getCapabilities:(t)=>qN(e,t),getChainId:()=>Zt(e),getPermissions:()=>zN(e),prepareAuthorization:(t)=>cg(e,t),prepareTransactionRequest:(t)=>Oo(e,t),requestAddresses:()=>GN(e),requestPermissions:(t)=>VN(e,t),sendCalls:(t)=>sg(e,t),sendCallsSync:(t)=>KN(e,t),sendRawTransaction:(t)=>el(e,t),sendRawTransactionSync:(t)=>ol(e,t),sendTransaction:(t)=>Es(e,t),sendTransactionSync:(t)=>ig(e,t),showCallsStatus:(t)=>YN(e,t),signAuthorization:(t)=>ZN(e,t),signMessage:(t)=>JN(e,t),signTransaction:(t)=>XN(e,t),signTypedData:(t)=>QN(e,t),switchChain:(t)=>eF(e,t),waitForCallsStatus:(t)=>ug(e,t),watchAsset:(t)=>tF(e,t),writeContract:(t)=>Un(e,t),writeContractSync:(t)=>il(e,t),token:{approve:co(e,Ci),approveSync:co(e,U6),transfer:co(e,Di),transferSync:co(e,j6)}}}da();se();class K6 extends B{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}t0();da();function rF(e,{errorInstance:t=Error("timed out"),timeout:r,signal:n}){return new Promise((o,i)=>{(async()=>{let s,a=new AbortController;try{if(r>0)s=setTimeout(()=>{if(n)a.abort();else i(t)},r);o(await e({signal:a?.signal||null}))}catch(c){if(a?.signal.aborted&&vr(c)){i(t);return}i(c)}finally{clearTimeout(s)}})()})}function Uoe(){return{current:0,take(){return this.current++},reset(){this.current=0}}}var Y6=Uoe();var Hoe=10485760;function nF(e,t={}){let{url:r,headers:n}=qoe(e);return{async request(o){let{body:i,fetchFn:s=t.fetchFn??fetch,maxResponseBodySize:a=t.maxResponseBodySize??Hoe,onRequest:c=t.onRequest,onResponse:u=t.onResponse,timeout:l=t.timeout??1e4}=o,p={...t.fetchOptions??{},...o.fetchOptions??{}},{headers:f,method:d,signal:h}=p;try{let m=await rF(async({signal:x})=>{let b={...p,body:Array.isArray(i)?ue(i.map((O)=>({jsonrpc:"2.0",id:O.id??Y6.take(),...O}))):ue({jsonrpc:"2.0",id:i.id??Y6.take(),...i}),headers:{...n,"Content-Type":"application/json",...f},method:d||"POST",signal:h||(l>0?x:null)},w=new Request(r,b),v=await c?.(w,b)??{...b,url:r};return await s(v.url??r,v)},{errorInstance:new jy({body:i,url:r}),timeout:l,signal:!0});if(u)await u(m);let y,g=await joe(m,{maxResponseBodySize:a});if(m.headers.get("Content-Type")?.startsWith("application/json"))y=JSON.parse(g);else{y=g;try{y=JSON.parse(y||"{}")}catch(x){if(m.ok)throw x;y={error:y}}}if(!m.ok){if(typeof y.error?.code==="number"&&typeof y.error?.message==="string")return y;throw new _n({body:i,details:ue(y.error)||m.statusText,headers:m.headers,status:m.status,url:r})}return y}catch(m){if(h?.aborted)throw Ft(h);if(vr(m))throw m;if(m instanceof _n)throw m;if(m instanceof Gc)throw m;if(m instanceof jy)throw m;throw new _n({body:i,cause:m,url:r})}}}}async function joe(e,{maxResponseBodySize:t}){if(t===!1)return e.text();let r=e.headers.get("Content-Length");if(r){let a=Number(r);if(a>t)throw new Gc({maxSize:t,size:a})}if(!e.body){let a=await e.text(),c=new TextEncoder().encode(a).length;if(c>t)throw new Gc({maxSize:t,size:c});return a}let n=e.body.getReader(),o=new TextDecoder,i="",s=0;try{while(!0){let{done:a,value:c}=await n.read();if(a)break;if(s+=c.byteLength,s>t)throw await n.cancel(),new Gc({maxSize:t,size:s});i+=o.decode(c,{stream:!0})}return i+=o.decode(),i}finally{n.releaseLock()}}function qoe(e){try{let t=new URL(e),r=(()=>{if(t.username){let n=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(n)}`}}}return})();return{url:t.toString(),...r}}catch{return{url:e}}}se();da();pu();aa();var lg=new Mr(8192);function oF(e,{enabled:t=!0,id:r}){if(!t||!r)return e();if(lg.get(r))return lg.get(r);let n=e().finally(()=>lg.delete(r));return lg.set(r,n),n}function iF(e,t={}){return async(r,n={})=>{let{dedupe:o=!1,methods:i,retryDelay:s=150,retryCount:a=3,signal:c,uid:u}={...t,...n},{method:l}=r;if(i?.exclude?.includes(l))throw new Xi(Error("method not supported"),{method:l});if(i?.include&&!i.include.includes(l))throw new Xi(Error("method not supported"),{method:l});if(c?.aborted)throw Ft(c);let p=o?Goe(`${u}.${ue(r)}`):void 0;return oF(()=>_a(async()=>{try{return await e(r,c?{signal:c}:void 0)}catch(f){if(c?.aborted)throw Ft(c);if(vr(f))throw f;let d=f;switch(d.code){case Vc.code:throw new Vc(d);case Wc.code:throw new Wc(d);case Kc.code:throw new Kc(d,{method:r.method});case Yc.code:throw new Yc(d);case ui.code:throw new ui(d);case tn.code:throw new tn(d);case Zc.code:throw new Zc(d);case Jc.code:throw new Jc(d);case Xc.code:throw new Xc(d);case Xi.code:throw new Xi(d,{method:r.method});case ma.code:throw new ma(d);case Qc.code:throw new Qc(d);case ha.code:throw new ha(d);case eu.code:throw new eu(d);case tu.code:throw new tu(d);case ru.code:throw new ru(d);case nu.code:throw new nu(d);case ou.code:throw new ou(d);case Qi.code:throw new Qi(d);case iu.code:throw new iu(d);case su.code:throw new su(d);case au.code:throw new au(d);case cu.code:throw new cu(d);case uu.code:throw new uu(d);case es.code:throw new es(d);case 5000:throw new ha(d);case lu.code:throw new lu(d);default:if(f instanceof B)throw f;throw new aT(d)}}},{delay:({count:f,error:d})=>{if(d&&d instanceof _n){let h=d?.headers?.get("Retry-After");if(h?.match(/\d/))return Number.parseInt(h,10)*1000}return~~(1<<f)*s},retryCount:a,signal:c,shouldRetry:({error:f})=>zoe(f)}),{enabled:o,id:p})}}function zoe(e){if(vr(e))return!1;if("code"in e&&typeof e.code==="number"){if(e.code===-1)return!0;if(e.code===ma.code)return!0;if(e.code===ui.code)return!0;if(e.code===429)return!0;if(e.code===-32007)return!0;return!1}if(e instanceof _n&&e.status){if(e.status===403)return!0;if(e.status===408)return!0;if(e.status===413)return!0;if(e.status===429)return!0;if(e.status===500)return!0;if(e.status===502)return!0;if(e.status===503)return!0;if(e.status===504)return!0;return!1}return!0}function Goe(e,t=0){let r=3735928559^t,n=1103547991^t;for(let o=0;o<e.length;o++){let i=e.charCodeAt(o);r=Math.imul(r^i,2654435761),n=Math.imul(n^i,1597334677)}return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>16,3266489909),n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>16,3266489909),(4294967296*(2097151&n)+(r>>>0)).toString(36)}function sF({key:e,methods:t,name:r,request:n,retryCount:o=3,retryDelay:i=150,timeout:s,type:a},c){let u=cy();return{config:{key:e,methods:t,name:r,request:n,retryCount:o,retryDelay:i,timeout:s,type:a},request:iF(n,{methods:t,retryCount:o,retryDelay:i,uid:u}),value:c}}var Voe=0,aF=new WeakMap;function Woe(e){if(!e)return"default";let t=aF.get(e);if(t!==void 0)return t;let r=Voe++;return aF.set(e,r),r}function Hn(e,t={}){let{batch:r,fetchFn:n,fetchOptions:o,key:i="http",maxResponseBodySize:s,methods:a,name:c="HTTP JSON-RPC",onFetchRequest:u,onFetchResponse:l,retryDelay:p,raw:f}=t;return({chain:d,retryCount:h,timeout:m})=>{let{batchSize:y=1000,wait:g=0}=typeof r==="object"?r:{},x=t.retryCount??h,b=m??t.timeout??1e4,w=e||d?.rpcUrls.default.http[0];if(!w)throw new K6;let v=nF(w,{fetchFn:n,fetchOptions:o,maxResponseBodySize:s,onRequest:u,onResponse:l,timeout:b});return sF({key:i,methods:a,name:c,async request({method:D,params:O},T){let A={method:D,params:O},E=T?.signal?{signal:T.signal}:void 0,{schedule:R}=wu({id:`${w}.${Woe(T?.signal)}`,wait:g,shouldSplitBatch(C){return C.length>y},fn:(C)=>v.request({body:C,fetchOptions:E}),sort:(C,P)=>C.id-P.id}),S=async(C)=>r?R(C):[await v.request({body:C,fetchOptions:E})],[{error:k,result:I}]=await S(A);if(f)return{error:k,result:I};if(k)throw new fa({body:A,error:k,url:w});return I},retryCount:x,retryDelay:p,timeout:b,type:"http"},{fetchOptions:o,url:w})}}_t();var Ba="0x0000000000000000000000000000000000000000000000000000000000000000";se();xo();ho();et();In();or();Oc();X();Oy();function Vf(e,t){if(e.length!==t.length)throw new jp({expectedLength:e.length,givenLength:t.length});let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n];r.push(cF(o,i))}return He(r)}function cF(e,t,r=!1){if(e==="address"){let s=t;if(!J(s))throw new Me({address:s});return gr(s.toLowerCase(),{size:r?32:null})}if(e==="string")return zt(t);if(e==="bytes")return t;if(e==="bool")return gr(kc(t),{size:r?32:1});let n=e.match(Bc);if(n){let[s,a,c="256"]=n,u=Number.parseInt(c,10)/8;return M(t,{size:r?32:u,signed:a==="int"})}let o=e.match(Iy);if(o){let[s,a]=o;if(Number.parseInt(a,10)!==(t.length-2)/2)throw new Gp({expectedSize:Number.parseInt(a,10),givenSize:(t.length-2)/2});return gr(t,{dir:"right",size:r?32:null})}let i=e.match(tR);if(i&&Array.isArray(t)){let[s,a]=i,c=[];for(let u=0;u<t.length;u++)c.push(cF(a,t[u],!0));if(c.length===0)return"0x";return He(c)}throw new T2(e)}Pn();or();Eo();function Na(e){let t={formatters:void 0,fees:void 0,serializers:void 0,...e};function r(n){return(o)=>{let i=typeof o==="function"?o(n):o,s={...n,...i};return Object.assign(s,{extend:r(s)})}}return Object.assign(t,{extend:r(t)})}st();X();function ul(e){return oe(e)&&e.length===66}var Wf=Na({id:31337,name:"Anvil",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"],webSocket:["ws://127.0.0.1:8545"]}}});var Z6=Na({id:31337,name:"Foundry",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"],webSocket:["ws://127.0.0.1:8545"]}}});import{extname as eie}from"node:path";/*!
291
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
292
+ * SPDX-License-Identifier: BSD-3-Clause
293
+ *
294
+ * Redistribution and use in source and binary forms, with or without
295
+ * modification, are permitted provided that the following conditions are met:
296
+ *
297
+ * 1. Redistributions of source code must retain the above copyright notice, this
298
+ * list of conditions and the following disclaimer.
299
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
300
+ * this list of conditions and the following disclaimer in the
301
+ * documentation and/or other materials provided with the distribution.
302
+ * 3. Neither the name of the copyright holder nor the names of its contributors
303
+ * may be used to endorse or promote products derived from this software without
304
+ * specific prior written permission.
305
+ *
306
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
307
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
308
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
309
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
310
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
311
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
312
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
313
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
314
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
315
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
316
+ */function Koe(e,t){let r=e.slice(0,t).split(/\r?\n/);return[r.length,r.pop().length+1]}function Yoe(e,t,r){let n=e.split(/\r?\n/),o="",i=(Math.log10(t+1)|0)+1;for(let s=t-1;s<=t+1;s++){let a=n[s-1];if(!a)continue;if(o+=s.toString().padEnd(i," "),o+=": ",o+=a,o+=`
317
+ `,s===t)o+=" ".repeat(i+r+2),o+=`^
318
+ `}return o}class ie extends Error{line;column;codeblock;constructor(e,t){let[r,n]=Koe(t.toml,t.ptr),o=Yoe(t.toml,r,n);super(`Invalid TOML document: ${e}
319
+
320
+ ${o}`,t);this.line=r,this.column=n,this.codeblock=o}static x(e,t,r){throw new ie(e,{toml:t.s,ptr:r??t.p})}}/*!
321
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
322
+ * SPDX-License-Identifier: BSD-3-Clause
323
+ *
324
+ * Redistribution and use in source and binary forms, with or without
325
+ * modification, are permitted provided that the following conditions are met:
326
+ *
327
+ * 1. Redistributions of source code must retain the above copyright notice, this
328
+ * list of conditions and the following disclaimer.
329
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
330
+ * this list of conditions and the following disclaimer in the
331
+ * documentation and/or other materials provided with the distribution.
332
+ * 3. Neither the name of the copyright holder nor the names of its contributors
333
+ * may be used to endorse or promote products derived from this software without
334
+ * specific prior written permission.
335
+ *
336
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
337
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
338
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
339
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
340
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
341
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
342
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
343
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
344
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
345
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
346
+ */function pg(e){let t=e.p,r=e.s.charCodeAt(e.p++),n=r,o=r===39,i=r===e.s.charCodeAt(e.p)&&r===e.s.charCodeAt(e.p+1);if(i){if((r=e.s.charCodeAt(e.p+=2))===10)e.p++;else if(r===13&&e.s.charCodeAt(e.p+1)===10)e.p+=2}let s="",a=e.p,c=0;for(;e.p<e.s.length;e.p++)if(r=e.s.charCodeAt(e.p),i&&(r===10||r===13&&e.s.charCodeAt(e.p+1)===10))c=c&&3;else if(r<32&&r!==9||r===127)ie.x("control characters are not allowed in strings",e);else if((!c||c===3)&&r===n&&(!i||e.s.charCodeAt(e.p+1)===n&&e.s.charCodeAt(e.p+2)===n)){if(i){if(e.s.charCodeAt(e.p+3)===n)e.p++;if(e.s.charCodeAt(e.p+3)===n)e.p++}if(!c){let u=e.s.slice(a,e.p);s=s?s+u:u}return e.p+=i?3:1,s}else if(!c){if(!o&&r===92)s+=e.s.slice(a,a=e.p),c=1}else if(c===1)if(r===120||r===117||r===85){let u=e.p++-1,l=0,p=r===120?2:r===117?4:8;for(let f=0;f<p;f++,e.p++){let d=e.s.charCodeAt(e.p),h=d>=48&&d<=57?d-48:d>=65&&d<=70?d-65+10:d>=97&&d<=102?d-97+10:-1;if(h<0)ie.x("invalid non-hex character in unicode escape",e);l=l<<4|h}if(l<0||l>1114111||l>=55296&&l<=57343)ie.x("invalid unicode escape",e,u);s+=String.fromCodePoint(l),a=e.p--,c=0}else if(i&&(r===32||r===9))c=2;else{if(r===98)s+="\b";else if(r===116)s+="\t";else if(r===110)s+=`
347
+ `;else if(r===102)s+="\f";else if(r===114)s+="\r";else if(r===101)s+="\x1B";else if(r===34)s+='"';else if(r===92)s+="\\";else ie.x("unrecognised escape sequence",e);a=e.p+1,c=0}else if(r!==32&&r!==9){if(c===2)ie.x("invalid escape: only line-ending whitespace may be escaped",e,a);c=!o&&r===92?1:0,a=e.p}ie.x("unfinished string",e,t)}/*!
348
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
349
+ * SPDX-License-Identifier: BSD-3-Clause
350
+ *
351
+ * Redistribution and use in source and binary forms, with or without
352
+ * modification, are permitted provided that the following conditions are met:
353
+ *
354
+ * 1. Redistributions of source code must retain the above copyright notice, this
355
+ * list of conditions and the following disclaimer.
356
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
357
+ * this list of conditions and the following disclaimer in the
358
+ * documentation and/or other materials provided with the distribution.
359
+ * 3. Neither the name of the copyright holder nor the names of its contributors
360
+ * may be used to endorse or promote products derived from this software without
361
+ * specific prior written permission.
362
+ *
363
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
364
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
365
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
366
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
367
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
368
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
369
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
370
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
371
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
372
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
373
+ */var Zoe=/^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i;class vs extends Date{#n=!1;#r=!1;#t=null;constructor(e,t,r){let n=!0,o=!0,i="Z",s;if(typeof e==="string")if(t)e:{if(t<3){if(+e.slice(11,13)>23){e="";break e}if(t===2)i=null,e+="Z";else if((s=e.charCodeAt(e.length-1))!==90&&s!==122)i=e.slice(e.length-6);if(r)e=e.slice(0,10)+"T"+e.slice(11)}else if(t===4)e=+e.slice(0,2)>23?"":`0000-01-01T${e}Z`;n=t!==4,o=t!==3}else{let a=e.match(Zoe);if(a){if(!a[1])n=!1,e=`0000-01-01T${e}`;if(o=!!a[2],o&&e[10]===" "&&(e=e.replace(" ","T")),a[2]&&+a[2]>23)e="";else if(i=a[3]||null,!i&&o)e+="Z"}else e=""}super(e);if(!isNaN(this.getTime()))this.#n=n,this.#r=o,this.#t=i}isDateTime(){return this.#n&&this.#r}isLocal(){return!this.#n||!this.#r||!this.#t}isDate(){return this.#n&&!this.#r}isTime(){return this.#r&&!this.#n}isValid(){return this.#n||this.#r}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#t===null)return e.slice(0,-1);if(this.#t==="Z"||this.#t==="z")return e;let t=+this.#t.slice(1,3)*60+ +this.#t.slice(4,6);return t=this.#t[0]==="-"?t:-t,new Date(this.getTime()-t*60000).toISOString().slice(0,-1)+this.#t}static wrapAsOffsetDateTime(e,t="Z"){let r=new vs(e);return r.#t=t,r}static wrapAsLocalDateTime(e){let t=new vs(e);return t.#t=null,t}static wrapAsLocalDate(e){let t=new vs(e);return t.#r=!1,t.#t=null,t}static wrapAsLocalTime(e){let t=new vs(e);return t.#n=!1,t.#t=null,t}}/*!
374
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
375
+ * SPDX-License-Identifier: BSD-3-Clause
376
+ *
377
+ * Redistribution and use in source and binary forms, with or without
378
+ * modification, are permitted provided that the following conditions are met:
379
+ *
380
+ * 1. Redistributions of source code must retain the above copyright notice, this
381
+ * list of conditions and the following disclaimer.
382
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
383
+ * this list of conditions and the following disclaimer in the
384
+ * documentation and/or other materials provided with the distribution.
385
+ * 3. Neither the name of the copyright holder nor the names of its contributors
386
+ * may be used to endorse or promote products derived from this software without
387
+ * specific prior written permission.
388
+ *
389
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
390
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
391
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
392
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
393
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
394
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
395
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
396
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
397
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
398
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
399
+ */function Vr(e,t=10){return t===16?e>47&&e<58||e>64&&e<71||e>96&&e<103:e>47&&e<48+t}function X6(e,t){return e===32||e===9||e===10||e===13||t&&(e===t||e===44)||e===35}function Yf(e,t){let r=e.p,n=e.s.charCodeAt(e.p);if(n===91||n===123){e.d--||ie.x("document contains excessively nested structures. aborting.",e);let o=n===91?pF(e):lF(e);return e.d++,o}if(n===34||n===39)return pg(e);if(n===116){if(e.s.charCodeAt(++e.p)!==114||e.s.charCodeAt(++e.p)!==117||e.s.charCodeAt(++e.p)!==101)ie.x("invalid value",e,r);return e.p++,!0}if(n===102){if(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==108||e.s.charCodeAt(++e.p)!==115||e.s.charCodeAt(++e.p)!==101)ie.x("invalid value",e,r);return e.p++,!1}if(n===43||n===45)return fg(e,e.p,e.s.charCodeAt(++e.p),44-n,t);if(e.s.charCodeAt(e.p+4)===45&&e.s.charCodeAt(e.p+7)===45)return Joe(e,n,t);if(e.s.charCodeAt(e.p+2)===58)return Xoe(e,n,t);return fg(e,e.p,n,0,t)}function fg(e,t,r,n,o){let i=r,s=0,a=!1;if(i===105){if(e.s.charCodeAt(++e.p)!==110||e.s.charCodeAt(++e.p)!==102)ie.x("invalid value",e,t);return e.p++,(n||1)/0}if(i===110){if(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==110)ie.x("invalid value",e,t);return e.p++,NaN}if(i===48){if(++e.p>=e.s.length||X6(i=e.s.charCodeAt(e.p),o))return e.bi===!0?0n:0;if(!n){if(i===120)return J6(e,t,16,o);else if(i===98)return J6(e,t,2,o);else if(i===111)return J6(e,t,8,o)}if(i===46)s=2;else if(i===101||i===69)s=4;else ie.x("illegal leading zero",e,t)}else if(!Vr(i))ie.x("invalid value",e,t);while(++e.p<e.s.length&&(i=e.s.charCodeAt(e.p),!X6(i,o))){if(!s)s=1;if(i===95){if(!(s&1))ie.x("illegal underscore",e);s+=11,a=!0}else if(s===1&&i===46)s=2;else if((s===1||s===3)&&(i===101||i===69))s=4;else if(s===4&&(i===43||i===45));else if(!Vr(i))ie.x("illegal character in numeric literal",e);else if(s>9)s-=11;else if(!(s&1))s++}if(!s){let u=(r-48)*(n||1);return e.bi===!0?BigInt(u):u}if(!(s&1))ie.x("unfinished numeric value",e,t);let c=e.s.slice(t,e.p);if(a)c=c.replaceAll("_","");return s>1?parseFloat(c):uF(e,c,10,t)}function J6(e,t,r,n){let o,i=1;while(++e.p<e.s.length&&(o=e.s.charCodeAt(e.p),!X6(o,n)))if(o===95){if(i&1)ie.x("illegal underscore",e);i=3}else if(!Vr(o,r))ie.x("illegal character in numeric literal",e);else if(i&1)i--;if(i&1)ie.x("unfinished numeric value",e);let s=e.s.slice(t+2,e.p);if(i)s=s.replaceAll("_","");return uF(e,s,r,t)}function uF(e,t,r,n){if(e.bi!==!0)e:{let o=parseInt(t,r);if(!Number.isSafeInteger(o)){if(e.bi)break e;ie.x("integer value cannot be represented losslessly",e,n)}return o}return r===10?BigInt(t):BigInt((r===2?"0b":r===8?"0o":"0x")+t)}function Joe(e,t,r){let n=e.p++,o;if(!Vr(t)||!Vr(e.s.charCodeAt(e.p++))||!Vr(e.s.charCodeAt(e.p++))||!Vr(e.s.charCodeAt(e.p++)))return fg(e,e.p=n,t,0,r);if(e.p+=5,!Vr(e.s.charCodeAt(e.p++)))ie.x("invalid date-time: date part is malformed",e,n);if(e.p>=e.s.length||((t=e.s.charCodeAt(e.p))!==32||(o=!0,!Vr(e.s.charCodeAt(e.p+1))))&&t!==84&&t!==116){let s=e.s.slice(n,e.p);return Kf(e,s,3,!1,n)}if(e.s.charCodeAt(e.p+=3)!==58)ie.x("invalid date-time: time part is malformed",e,n);if(e.s.charCodeAt(e.p+=3)===58)e.p+=3;if(e.s.charCodeAt(e.p)===46)while(Vr(e.s.charCodeAt(++e.p)));if(t=e.s.charCodeAt(e.p)){if(t===90||t===122){let s=e.s.slice(n,++e.p);return Kf(e,s,1,o,n,"[+00:00]")}if(t===43||t===45){let s=e.s.slice(n,e.p+=6);return Kf(e,s,1,o,n,!e.ld&&"["+e.s.slice(e.p-6,e.p)+"]")}}let i=e.s.slice(n,e.p);return Kf(e,i,2,o,n)}function Xoe(e,t,r){let n=e.p;if(!Vr(t)||!Vr(e.s.charCodeAt(++e.p)))return fg(e,--e.p,t,0,r);if(e.s.charCodeAt(e.p+=4)===58)e.p+=3;if(e.s.charCodeAt(e.p)===46)while(Vr(e.s.charCodeAt(++e.p)));let o=e.s.slice(n,e.p);return Kf(e,o,4,!1,n)}function Kf(e,t,r,n,o,i){if(e.ld){let s=new vs(t,r,n);if(!s.isValid())ie.x("invalid date",e,o);return s}try{if(i)t+=i;switch(r){case 1:return Temporal.ZonedDateTime.from(t);case 2:return Temporal.PlainDateTime.from(t);case 3:return Temporal.PlainDate.from(t);case 4:return Temporal.PlainTime.from(t)}}catch(s){ie.x(s instanceof Error?s.message:""+s,e,o)}}/*!
400
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
401
+ * SPDX-License-Identifier: BSD-3-Clause
402
+ *
403
+ * Redistribution and use in source and binary forms, with or without
404
+ * modification, are permitted provided that the following conditions are met:
405
+ *
406
+ * 1. Redistributions of source code must retain the above copyright notice, this
407
+ * list of conditions and the following disclaimer.
408
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
409
+ * this list of conditions and the following disclaimer in the
410
+ * documentation and/or other materials provided with the distribution.
411
+ * 3. Neither the name of the copyright holder nor the names of its contributors
412
+ * may be used to endorse or promote products derived from this software without
413
+ * specific prior written permission.
414
+ *
415
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
416
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
417
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
418
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
419
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
420
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
421
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
422
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
423
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
424
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
425
+ */function Qoe(e){for(;e.p<e.s.length;e.p++){let t=e.s.charCodeAt(e.p);if(t===10)break;if(t===13&&e.s.charCodeAt(e.p+1)===10){e.p++;break}if(t<32&&t!==9||t===127)ie.x("control characters are not allowed in comments",e)}}function jn(e,t,r){let n;while(e.p<e.s.length){while(e.p<e.s.length&&((n=e.s.charCodeAt(e.p))===32||n===9||!t&&(n===10||n===13&&e.s.charCodeAt(e.p+1)===10)))e.p++;if(r||n!==35)break;Qoe(e)}}/*!
426
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
427
+ * SPDX-License-Identifier: BSD-3-Clause
428
+ *
429
+ * Redistribution and use in source and binary forms, with or without
430
+ * modification, are permitted provided that the following conditions are met:
431
+ *
432
+ * 1. Redistributions of source code must retain the above copyright notice, this
433
+ * list of conditions and the following disclaimer.
434
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
435
+ * this list of conditions and the following disclaimer in the
436
+ * documentation and/or other materials provided with the distribution.
437
+ * 3. Neither the name of the copyright holder nor the names of its contributors
438
+ * may be used to endorse or promote products derived from this software without
439
+ * specific prior written permission.
440
+ *
441
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
442
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
443
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
444
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
445
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
446
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
447
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
448
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
449
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
450
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
451
+ */function dg(e,t=61){let r,n=0,o=[],i,s=e.s.charCodeAt(r=e.p);do if(s===t){if(!n)ie.x("unexpected end of key",e);if(n===1)o.push(e.s.slice(i,e.p));return e.p++,o}else if(s===46){if(!n)ie.x("illegal empty bare key",e);if(n===1)o.push(e.s.slice(i,e.p));n=0}else if(!n&&(s===34||s===39)){if(s===e.s.charCodeAt(e.p+1)&&s===e.s.charCodeAt(e.p+2))ie.x("illegal quoted key: multiline strings are not allowed",e);o.push(pg(e)),n=2,e.p--}else if(s===32||s===9){if(n===1)o.push(e.s.slice(i,e.p)),n=2}else if(n===2||s<48&&s!==45||s>57&&s<65||s>90&&s<97&&s!==95||s>122)ie.x("illegal character in key",e);else if(!n)n=1,i=e.p;while(s=e.s.charCodeAt(++e.p));ie.x("incomplete key-value: cannot find end of key",e,r)}function lF(e){let t=e.p++,r=Object.create(null),n=new Set,o;while(e.p<e.s.length){if(jn(e),(o=e.s.charCodeAt(e.p))===125)return e.p++,r;let i,s=r,a=!1,c=e.p,u=dg(e);for(let p=0;p<u.length;p++){if(p)s=a?s[i]:s[i]=Object.create(null);if(i=u[p],(a=Object.hasOwn(s,i))&&(typeof s[i]!=="object"||n.has(s[i])))ie.x("trying to redefine an already defined value",e,c);let f=i==="__proto__";if(e.uk&&(f||i==="constructor")){s=e.uk!==1&&ie.x("document contains an unsafe property",e,c);break}if(!a&&f)Object.defineProperty(s,i,{enumerable:!0,configurable:!0,writable:!0})}if(a)ie.x("trying to redefine an already defined value",e,c);jn(e,!0,!0);let l=Yf(e,125);if(s&&typeof(s[i]=l)==="object")n.add(l);if(jn(e),(o=e.s.charCodeAt(e.p++))===125)return r;if(o!==44)ie.x("expected comma or end of structure",e,e.p-1)}ie.x("unfinished table",e,t)}function pF(e){let t=e.p++,r=[],n;while(e.p<e.s.length){if(jn(e),(n=e.s.charCodeAt(e.p))===93)return e.p++,r;if(r.push(Yf(e,93)),jn(e),(n=e.s.charCodeAt(e.p++))===93)return r;if(n!==44)ie.x("expected comma or end of structure",e,e.p-1)}ie.x("unfinished array",e,t)}/*!
452
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
453
+ * SPDX-License-Identifier: BSD-3-Clause
454
+ *
455
+ * Redistribution and use in source and binary forms, with or without
456
+ * modification, are permitted provided that the following conditions are met:
457
+ *
458
+ * 1. Redistributions of source code must retain the above copyright notice, this
459
+ * list of conditions and the following disclaimer.
460
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
461
+ * this list of conditions and the following disclaimer in the
462
+ * documentation and/or other materials provided with the distribution.
463
+ * 3. Neither the name of the copyright holder nor the names of its contributors
464
+ * may be used to endorse or promote products derived from this software without
465
+ * specific prior written permission.
466
+ *
467
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
468
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
469
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
470
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
471
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
472
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
473
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
474
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
475
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
476
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
477
+ */function fF(e,t,r,n,o){let i=r,s=n,a,c=!1,u;for(let l=0;l<t.length;l++){if(l){if(i=c?i[a]:i[a]=Object.create(null),s=(u=s[a]).c,o===0&&(u.t===1||u.t===2))return null;if(u.t===2){let p=i.length-1;i=i[p],s=s[p].c}}if(a=t[l],(c=Object.hasOwn(i,a))&&s[a]?.t===0&&s[a]?.d)return null;if(!c){let p=a==="__proto__";if(e.uk&&(p||a==="constructor"))return!1;if(p)Object.defineProperty(i,a,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(s,a,{enumerable:!0,configurable:!0,writable:!0});s[a]={t:l<t.length-1&&o===2?3:o,d:!1,i:0,c:Object.create(null)}}}if(u=s[a],u.t!==o&&!(o===1&&u.t===3))return null;if(o===2){if(!u.d)u.d=!0,i[a]=[];i[a].push(i=Object.create(null)),u.c[u.i++]=u={t:1,d:!1,i:0,c:Object.create(null)}}if(u.d)return null;if(u.d=!0,o===1)i=c?i[a]:i[a]=Object.create(null);else if(o===0&&c)return null;return[a,i,u.c]}function dF(e,t,r){if(t===null||e.uk===2)ie.x(t===null?"trying to redefine an already defined table or value":"document contains an unsafe property",e,r)}function Q6(e,t={}){let r={s:e,p:0,d:t.maxDepth??1000,bi:t.integersAsBigInt??!1,ld:t.useLegacyDate??!0,uk:t.unsafeKeyBehaviour==="throw"?2:t.unsafeKeyBehaviour==="drop"?1:0},n=Object.create(null),o=Object.create(null),i,s=!1,a=n,c=o;if(e.charCodeAt(0)===65279)r.p++;jn(r);while(r.p<e.length){if(e.charCodeAt(r.p)===91){let u=e.charCodeAt(++r.p)===91;i=r.p+=+u,s=!1;let l=dg(r,93);if(u){if(e.charCodeAt(r.p)!==93)ie.x("expected end of table array declaration",r);r.p++}let p=fF(r,l,n,o,u?2:1);if(!p)dF(r,p,i),s=!0;else c=p[2],a=p[1]}else{i=r.p;let u=dg(r),l=fF(r,u,a,c,0);if(!l&&!s)dF(r,l,i);jn(r,!0,!0);let p=Yf(r,void 0);if(l&&!s)l[1][l[0]]=p}if(jn(r,!0),r.p<e.length&&(i=e.charCodeAt(r.p))!==10&&(i!==13||e.charCodeAt(r.p+1)!==10))ie.x("each key-value declaration must be followed by an end-of-line",r);jn(r)}return n}/*!
478
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
479
+ * SPDX-License-Identifier: BSD-3-Clause
480
+ *
481
+ * Redistribution and use in source and binary forms, with or without
482
+ * modification, are permitted provided that the following conditions are met:
483
+ *
484
+ * 1. Redistributions of source code must retain the above copyright notice, this
485
+ * list of conditions and the following disclaimer.
486
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
487
+ * this list of conditions and the following disclaimer in the
488
+ * documentation and/or other materials provided with the distribution.
489
+ * 3. Neither the name of the copyright holder nor the names of its contributors
490
+ * may be used to endorse or promote products derived from this software without
491
+ * specific prior written permission.
492
+ *
493
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
494
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
495
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
496
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
497
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
498
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
499
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
500
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
501
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
502
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
503
+ */var L$t=!!"".isWellFormed;/*!
504
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
505
+ * SPDX-License-Identifier: BSD-3-Clause
506
+ *
507
+ * Redistribution and use in source and binary forms, with or without
508
+ * modification, are permitted provided that the following conditions are met:
509
+ *
510
+ * 1. Redistributions of source code must retain the above copyright notice, this
511
+ * list of conditions and the following disclaimer.
512
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
513
+ * this list of conditions and the following disclaimer in the
514
+ * documentation and/or other materials provided with the distribution.
515
+ * 3. Neither the name of the copyright holder nor the names of its contributors
516
+ * may be used to endorse or promote products derived from this software without
517
+ * specific prior written permission.
518
+ *
519
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
520
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
521
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
522
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
523
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
524
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
525
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
526
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
527
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
528
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
529
+ */var Xf=4096,yF=8,un=(e)=>typeof e==="object"&&e!==null&&!(e instanceof Date)?JSON.stringify(e,(t,r)=>typeof r==="bigint"?r.toString():r):String(e);class gF extends Error{constructor(e){super(`Invalid builder: ${un(e)}`);this.name="InvalidBuilder"}}class n5 extends Error{constructor(e){super(`Invalid drive format: ${un(e)}`);this.name="InvalidDriveFormatError"}}class bF extends Error{constructor(e){super(`Invalid empty drive format: ${un(e)}`);this.name="InvalidEmptyDriveFormatError"}}class Fa extends Error{constructor(e){super(`Invalid string value: ${un(e)}`);this.name="InvalidStringValueError"}}class o5 extends Error{constructor(e){super(`Invalid boolean value: ${un(e)}`);this.name="InvalidBooleanValueError"}}class xF extends Error{constructor(e,t){super(`Invalid number value: ${un(e)}${t?` for key: ${t}`:""}`);this.name="InvalidNumberValueError"}}class wF extends Error{constructor(e,t){super(`Invalid address value: ${un(e)}${t?` for key: ${t}`:""}`);this.name="InvalidAddressValueError"}}class TF extends Error{constructor(e){super(`Invalid bytes value: ${un(e)}`);this.name="InvalidBytesValueError"}}class i5 extends Error{constructor(e){super(`Missing required field: ${un(e)}`);this.name="RequiredFieldError"}}class EF extends Error{constructor(){super("Invalid string array");this.name="InvalidStringArrayError"}}class vF extends Error{constructor(e){super(`Invalid env configuration: ${un(e)}`);this.name="InvalidEnvError"}}class yg extends Error{constructor(e){super(`Nvram '${e}' must define either 'size' or 'filename'`);this.name="MissingNvramSourceError"}}class SF extends Error{constructor(e,t){super(`Invalid size ${t} for nvram '${e}': must be a positive multiple of ${Xf}`);this.name="InvalidNvramSizeError"}}class AF extends Error{constructor(e){super(`Too many nvrams: ${e}, maximum is ${yF}`);this.name="TooManyNvramsError"}}class CF extends Error{constructor(e){super(`Label '${e}' is used by both a drive and an nvram`);this.name="DuplicateLabelError"}}class DF extends Error{constructor(e){super(`Only one drive or nvram can be the accounts drive, but ${e.map((t)=>`'${t}'`).join(", ")} are marked with accounts_drive = true`);this.name="MultipleAccountsDrivesError"}}class cn extends Error{constructor(e,t){super(`Invalid accounts drive '${e}': ${t}`);this.name="InvalidAccountsDriveError"}}class Ma extends Error{constructor(e){super(`Invalid [withdrawal]: ${e}`);this.name="InvalidWithdrawalConfigError"}}var s5="ext2",IF="128Mi",La="0.12.0-alpha.44",Qf="cartesi/sdk",ed=6751,$a=5,a5=(e)=>e?.account_size!==void 0?Math.log2(e.account_size)-$a:0,OF=(e)=>[...Object.entries(e.drives).map(([t,r])=>({kind:"flash_drive",label:t,config:r})),...Object.entries(e.nvrams).map(([t,r])=>({kind:"nvram",label:t,config:r}))].filter((t)=>t.config.accountsDrive),c5=(e)=>OF(e)[0],u5=(e)=>{let t=e,r="";for(let n of["Ki","Mi","Gi","Ti"]){if(t===0||t%1024!==0)break;t/=1024,r=n}return{value:t,unit:r}},tie=(e)=>{let{value:t,unit:r}=u5(e);return`${t}${r}`},kF=(e)=>{let t=Number.isInteger(e)?e.toString(2):"";return/^10*$/.test(t)?t.length-1:void 0},rie=(e)=>2**(e-1).toString(2).length,l5=(e,t,r)=>{let{label:n}=t,{accountsDriveSize:o}=t.config,i=a5(e.withdrawal),s=o??r;if(s===void 0)return;let a=kF(s);if(a===void 0){let u=s>0?`, use "${tie(rie(s))}"`:"";throw new cn(n,o!==void 0?`accounts_drive_size ${s} is not a power of two${u}`:`size ${s} is not a power of two${u}, or set accounts_drive_size to keep the accounts at the beginning of a larger drive`)}let c=$a+i;if(a<c)throw new cn(n,`size ${s} is smaller than one account of ${2**c} bytes`);if(o!==void 0&&r!==void 0&&o>r)throw new cn(n,`accounts_drive_size ${o} is larger than the drive itself (${r} bytes)`);return{length:s,log2Length:a}},nie=()=>({builder:"docker",buildArgs:[],context:".",dockerfile:"Dockerfile",extraSize:0,format:s5,tags:[]}),oie=()=>({assertRollingTemplate:void 0,bootargs:[],entrypoint:void 0,env:{},envFile:void 0,maxMCycle:void 0,ramLength:IF,useDockerEnv:!0,useDockerWorkdir:!0,user:void 0});var mF=(e,t)=>{if(e===void 0)return t;if(typeof e==="boolean")return e;throw new o5(e)},Ss=(e)=>{if(e===void 0)return;if(typeof e==="boolean")return e;throw new o5(e)},hg=(e,t)=>{if(e===void 0)return t;if(typeof e==="string")return e;throw new Fa(e)},r5=(e)=>{if(e===void 0)return[];if(typeof e==="string")return[e];if(typeof e==="object"&&Array.isArray(e))return e.map((t)=>{if(typeof t==="string")return t;throw new Fa(t)});throw new EF},iie=(e)=>{if(e===void 0)return{};if(!Jf(e))throw new vF(e);return Object.entries(e).reduce((t,[r,n])=>{if(typeof n==="string")t[r]=n;else if(typeof n==="number"||typeof n==="bigint"||typeof n==="boolean")t[r]=String(n);else throw new Fa(n);return t},{})},e5=(e,t)=>{if(e===void 0)throw new i5(t);if(typeof e==="string")return e;throw new Fa(e)},hF=(e,t)=>{if(e===void 0)throw new i5(t);if(typeof e==="string"&&J(e))return de(e);throw new wF(e,t)},Wr=(e)=>{if(e===void 0)return;if(typeof e==="string")return e;throw new Fa(e)},Zf=(e)=>{if(e===void 0)return;if(typeof e==="string")return e;if(typeof e==="boolean")return e;throw new Fa(e)},sie=(e)=>{if(e===void 0)return;if(typeof e==="bigint")return e;if(typeof e==="number")return BigInt(e);throw new xF(e)},aie={"":1,b:1,k:1024,ki:1024,kb:1024,kib:1024,m:1048576,mi:1048576,mb:1048576,mib:1048576,g:1073741824,gi:1073741824,gb:1073741824,gib:1073741824,t:1099511627776,ti:1099511627776,tb:1099511627776,tib:1099511627776,p:1125899906842624,pi:1125899906842624,pb:1125899906842624,pib:1125899906842624},gg=(e)=>{if(e===void 0)return;let t;if(typeof e==="number")t=e;else if(typeof e==="string"){let r=/^\s*(\d+(?:\.\d+)?)\s*([a-z]*)\s*$/i.exec(e),n=r?aie[r[2].toLowerCase()]:void 0;if(r&&n!==void 0)t=Number(r[1])*n}if(t!==void 0&&Number.isInteger(t)&&t<=Number.MAX_SAFE_INTEGER)return t;throw new TF(e)},mg=(e,t)=>gg(e)??t,RF=(e)=>{let t=Ss(e.accounts_drive),r=gg(e.accounts_drive_size);return{...t!==void 0&&{accountsDrive:t},...r!==void 0&&{accountsDriveSize:r}}},cie=(e,t)=>{let r=Jf(t)?t:{},n=gg(r.size),o=Wr(r.filename);if(n===void 0&&o===void 0)throw new yg(e);if(n!==void 0&&(n<=0||n%Xf!==0))throw new SF(e,n);return{...RF(r),filename:o,size:n,shared:Ss(r.shared),user:Wr(r.user)}},uie=(e)=>{let t=Object.entries(e??{});if(t.length>yF)throw new AF(t.length);return t.reduce((r,[n,o])=>(r[n]=cie(n,o),r),{})},ll=(e)=>`${e}.raw`,pl=(e)=>e.filename!==void 0||e.shared===!0,lie=(e)=>{if(e===void 0)return"docker";if(typeof e==="string")switch(e){case"directory":return"directory";case"docker":return"docker";case"empty":return"empty";case"none":return"none";case"tar":return"tar"}throw new gF(e)},t5=(e)=>{if(e===void 0)return s5;if(typeof e==="string")switch(e){case"ext2":return"ext2";case"sqfs":return"sqfs"}throw new n5(e)},pie=(e)=>{if(e===void 0)return s5;if(typeof e==="string")switch(e){case"ext2":return"ext2";case"raw":return"raw"}throw new bF(e)},fie=(e)=>{if(e===void 0)return oie();if(typeof e!=="object")throw Error(`Invalid machine configuration: ${e}`);let t=e;return{assertRollingTemplate:Ss(t.assert_rolling_template),bootargs:r5(t.boot_args),entrypoint:Wr(t.entrypoint),env:iie(t.env),envFile:Wr(t.env_file),maxMCycle:sie(t.max_mcycle),ramLength:hg(t.ram_length,IF),ramImage:Wr(t.ram_image),useDockerEnv:mF(t.use_docker_env,!0),useDockerWorkdir:mF(t.use_docker_workdir,!0),user:Wr(t.user)}},p5=(e)=>{let t=eie(e);switch(t){case".ext2":return"ext2";case".sqfs":return"sqfs";default:throw new n5(t)}},die=(e)=>{let t=e;return{...mie(t),...RF(t)}},mie=(e)=>{switch(lie(e.builder)){case"directory":{let{extra_size:r,format:n,mount:o,directory:i,shared:s,user:a}=e;return{builder:"directory",extraSize:mg(r,0),format:t5(n),mount:Zf(o),directory:e5(i,"directory"),shared:Ss(s),user:Wr(a)}}case"docker":{let{build_args:r,context:n,dockerfile:o,extra_size:i,format:s,image:a,mount:c,shared:u,tags:l,target:p,user:f}=e;return{builder:"docker",buildArgs:r5(r),image:Wr(a),context:hg(n,"."),dockerfile:hg(o,"Dockerfile"),extraSize:mg(i,0),format:t5(s),mount:Zf(c),shared:Ss(u),user:Wr(f),tags:r5(l),target:Wr(p)}}case"empty":{let{format:r,mount:n,size:o,shared:i,user:s}=e;return{builder:"empty",format:pie(r),mount:Zf(n),shared:Ss(i),size:mg(o,0),user:Wr(s)}}case"tar":{let{extra_size:r,filename:n,format:o,mount:i,shared:s,user:a}=e;return{builder:"tar",extraSize:mg(r,0),filename:e5(n,"filename"),format:t5(o),mount:Zf(i),shared:Ss(s),user:Wr(a)}}case"none":{let{shared:r,mount:n,user:o}=e,i=e5(e.filename,"filename"),s=p5(i);return{builder:"none",filename:i,format:s,mount:Zf(n),shared:Ss(r),user:Wr(o)}}}},hie=(e)=>{let t=Object.entries(e??{}).reduce((n,[o,i])=>(n[o]=die(i),n),{});if(t.root===void 0)t.root=nie();return t},yie=(e)=>{let t=gg(e);if(t===void 0||t<2**$a||kF(t)===void 0)throw new Ma(`account_size ${un(e)} must be a power of two of at least 32 bytes, such as 32 or 64`);return t},gie=(e)=>{if(e===void 0)return;if(!Jf(e))throw new Ma(`expected a table, got ${un(e)}`);let t=(n,o)=>e[n]===void 0?void 0:o(e[n],n);return{guardian:t("guardian",hF),withdrawal_output_builder:t("withdrawal_output_builder",hF),account_size:t("account_size",yie)}},bie=(e)=>{let t=OF(e);if(t.length>1)throw new DF(t.map(({label:i})=>i));for(let[i,s]of[...Object.entries(e.drives),...Object.entries(e.nvrams)])if(s.accountsDriveSize!==void 0&&!s.accountsDrive)throw new cn(i,"accounts_drive_size requires accounts_drive = true");let[r]=t;if(!r){if(e.withdrawal)throw new Ma("emergency withdrawal needs an accounts drive, mark a raw drive or an nvram with accounts_drive = true");return}let{label:n}=r,o;if(r.kind==="flash_drive"){let i=e.drives[n];if(i.builder!=="empty"||i.format!=="raw")throw new cn(n,`it must not have a filesystem, use builder = "empty" and format = "raw", or declare it under [nvrams.${n}]`);if(i.mount!==void 0&&i.mount!==!1)throw new cn(n,"it can't be mounted, remove 'mount' or set it to false");o=i.size}else o=e.nvrams[n].size;l5(e,r,o)},PF=(e)=>{let t={};for(let i of e)t=_F(t,Q6(i));let r=hie(t.drives),n=uie(t.nvrams);for(let i of Object.keys(n))if(r[i]!==void 0)throw new CF(i);let o={withdrawal:gie(t.withdrawal),drives:r,machine:fie(t.machine),nvrams:n,sdk:hg(t.sdk,`${Qf}:${La}`)};return bie(o),o};function Jf(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)&&!("toISOString"in e)}function _F(e,t){let r={...e};for(let[n,o]of Object.entries(t)){let i=r[n];if(Jf(i)&&Jf(o))r[n]=_F(i,o);else r[n]=o}return r}var BF="0x35Cd91f13141Bb6A6FC69E1eeDD241bbA1Ddd45F";var NF="0xB4d29c86e36385b5321a453C34D288AEB0ad11f9";var f5=[{type:"constructor",inputs:[{name:"inputBox",internalType:"contract IInputBox",type:"address"},{name:"appFactory",internalType:"contract IApplicationFactory",type:"address"},{name:"tournamentFactory",internalType:"contract ITournamentFactory",type:"address"}],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"templateHash",internalType:"bytes32",type:"bytes32"},{name:"claimStagingPeriod",internalType:"uint256",type:"uint256"},{name:"sentryManager",internalType:"address",type:"address"},{name:"sentries",internalType:"address[]",type:"address[]"},{name:"withdrawalConfig",internalType:"struct WithdrawalConfig",type:"tuple",components:[{name:"guardian",internalType:"address",type:"address"},{name:"log2LeavesPerAccount",internalType:"uint8",type:"uint8"},{name:"log2MaxNumOfAccounts",internalType:"uint8",type:"uint8"},{name:"accountsDriveStartIndex",internalType:"uint64",type:"uint64"},{name:"withdrawalOutputBuilder",internalType:"contract IWithdrawalOutputBuilder",type:"address"}]},{name:"salt",internalType:"bytes32",type:"bytes32"}],name:"calculateDaveAppAddress",outputs:[{name:"appContractAddress",internalType:"address",type:"address"},{name:"daveConsensusAddress",internalType:"address",type:"address"}],stateMutability:"view"},{type:"function",inputs:[{name:"templateHash",internalType:"bytes32",type:"bytes32"},{name:"claimStagingPeriod",internalType:"uint256",type:"uint256"},{name:"sentryManager",internalType:"address",type:"address"},{name:"sentries",internalType:"address[]",type:"address[]"},{name:"withdrawalConfig",internalType:"struct WithdrawalConfig",type:"tuple",components:[{name:"guardian",internalType:"address",type:"address"},{name:"log2LeavesPerAccount",internalType:"uint8",type:"uint8"},{name:"log2MaxNumOfAccounts",internalType:"uint8",type:"uint8"},{name:"accountsDriveStartIndex",internalType:"uint64",type:"uint64"},{name:"withdrawalOutputBuilder",internalType:"contract IWithdrawalOutputBuilder",type:"address"}]},{name:"salt",internalType:"bytes32",type:"bytes32"}],name:"newDaveApp",outputs:[{name:"appContract",internalType:"contract IApplication",type:"address"},{name:"daveConsensus",internalType:"contract IDaveConsensus",type:"address"}],stateMutability:"nonpayable"},{type:"event",anonymous:!1,inputs:[{name:"appContract",internalType:"contract IApplication",type:"address",indexed:!1},{name:"daveConsensus",internalType:"contract IDaveConsensus",type:"address",indexed:!1}],name:"DaveAppCreated"},{type:"error",inputs:[{name:"sentryId",internalType:"uint256",type:"uint256"},{name:"sentry",internalType:"address",type:"address"}],name:"DuplicatedSentryAddress"},{type:"error",inputs:[{name:"withdrawalConfig",internalType:"struct WithdrawalConfig",type:"tuple",components:[{name:"guardian",internalType:"address",type:"address"},{name:"log2LeavesPerAccount",internalType:"uint8",type:"uint8"},{name:"log2MaxNumOfAccounts",internalType:"uint8",type:"uint8"},{name:"accountsDriveStartIndex",internalType:"uint64",type:"uint64"},{name:"withdrawalOutputBuilder",internalType:"contract IWithdrawalOutputBuilder",type:"address"}]}],name:"InvalidWithdrawalConfig"},{type:"error",inputs:[],name:"ZeroSentryAddress"}],fl={1:"0x009Bc68f12E7566116EBf7342FA32fA31F805F7F",10:"0xf0aa5e541E81b07586829AC929D49949072C3728",8453:"0xf0aa5e541E81b07586829AC929D49949072C3728",31337:"0xd34BEC37Fa5816ABA2f87BdaD2E13dd1B161370f",42161:"0xdA5273c1268fF64fb2D367320B09ebA2D590f49C",84532:"0xD00A64c280Dc947912cfAbd1a30a0A78048CCFB8",421614:"0xFC9feCEd6b4eCE0491809662A123dE9507EB0FA7",11155111:"0xa996694F79A8458B17DfC67673CA8BfDb2012030",11155420:"0xD00A64c280Dc947912cfAbd1a30a0A78048CCFB8"};var d5=[{type:"function",inputs:[{name:"token",internalType:"contract IERC1155",type:"address"},{name:"appContract",internalType:"address",type:"address"},{name:"tokenIds",internalType:"uint256[]",type:"uint256[]"},{name:"values",internalType:"uint256[]",type:"uint256[]"},{name:"baseLayerData",internalType:"bytes",type:"bytes"},{name:"execLayerData",internalType:"bytes",type:"bytes"}],name:"depositBatchErc1155Token",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"version",outputs:[{name:"major",internalType:"uint64",type:"uint64"},{name:"minor",internalType:"uint64",type:"uint64"},{name:"patch",internalType:"uint64",type:"uint64"},{name:"preRelease",internalType:"string",type:"string"},{name:"buildMetadata",internalType:"string",type:"string"}],stateMutability:"pure"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"}],name:"ApplicationForeclosed"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"}],name:"ApplicationNotDeployed"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"error",internalType:"bytes",type:"bytes"}],name:"ApplicationReverted"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"data",internalType:"bytes",type:"bytes"}],name:"IllformedApplicationReturnData"},{type:"error",inputs:[{name:"inputBox",internalType:"address",type:"address"}],name:"InputBoxNotDeployed"}],dl="0xee33550a22e3Cf6Cc265524dC9bcfD99D2307EBe",bg={address:"0xee33550a22e3Cf6Cc265524dC9bcfD99D2307EBe",abi:d5},m5=[{type:"function",inputs:[{name:"token",internalType:"contract IERC1155",type:"address"},{name:"appContract",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"},{name:"value",internalType:"uint256",type:"uint256"},{name:"baseLayerData",internalType:"bytes",type:"bytes"},{name:"execLayerData",internalType:"bytes",type:"bytes"}],name:"depositSingleErc1155Token",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"version",outputs:[{name:"major",internalType:"uint64",type:"uint64"},{name:"minor",internalType:"uint64",type:"uint64"},{name:"patch",internalType:"uint64",type:"uint64"},{name:"preRelease",internalType:"string",type:"string"},{name:"buildMetadata",internalType:"string",type:"string"}],stateMutability:"pure"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"}],name:"ApplicationForeclosed"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"}],name:"ApplicationNotDeployed"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"error",internalType:"bytes",type:"bytes"}],name:"ApplicationReverted"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"data",internalType:"bytes",type:"bytes"}],name:"IllformedApplicationReturnData"},{type:"error",inputs:[{name:"inputBox",internalType:"address",type:"address"}],name:"InputBoxNotDeployed"}],ml="0x585F56351A66f131E176a345662215C772f80451",xg={address:"0x585F56351A66f131E176a345662215C772f80451",abi:m5},h5=[{type:"function",inputs:[{name:"token",internalType:"contract IERC20",type:"address"},{name:"appContract",internalType:"address",type:"address"},{name:"value",internalType:"uint256",type:"uint256"},{name:"execLayerData",internalType:"bytes",type:"bytes"}],name:"depositErc20Tokens",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"version",outputs:[{name:"major",internalType:"uint64",type:"uint64"},{name:"minor",internalType:"uint64",type:"uint64"},{name:"patch",internalType:"uint64",type:"uint64"},{name:"preRelease",internalType:"string",type:"string"},{name:"buildMetadata",internalType:"string",type:"string"}],stateMutability:"pure"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"}],name:"ApplicationForeclosed"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"}],name:"ApplicationNotDeployed"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"error",internalType:"bytes",type:"bytes"}],name:"ApplicationReverted"},{type:"error",inputs:[{name:"balanceBefore",internalType:"uint256",type:"uint256"},{name:"balanceAfter",internalType:"uint256",type:"uint256"}],name:"Erc20TransferDecreasedApplicationBalance"},{type:"error",inputs:[],name:"Erc20TransferFailed"},{type:"error",inputs:[{name:"value",internalType:"uint256",type:"uint256"},{name:"balanceDelta",internalType:"uint256",type:"uint256"}],name:"Erc20TransferValueIsNotBalanceDelta"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"data",internalType:"bytes",type:"bytes"}],name:"IllformedApplicationReturnData"},{type:"error",inputs:[{name:"inputBox",internalType:"address",type:"address"}],name:"InputBoxNotDeployed"}],hl="0x3332DE61a8BB9aC84893b2f552Fe81C9a6dC5419",wg={address:"0x3332DE61a8BB9aC84893b2f552Fe81C9a6dC5419",abi:h5},y5=[{type:"function",inputs:[{name:"token",internalType:"contract IERC721",type:"address"},{name:"appContract",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"},{name:"baseLayerData",internalType:"bytes",type:"bytes"},{name:"execLayerData",internalType:"bytes",type:"bytes"}],name:"depositErc721Token",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"version",outputs:[{name:"major",internalType:"uint64",type:"uint64"},{name:"minor",internalType:"uint64",type:"uint64"},{name:"patch",internalType:"uint64",type:"uint64"},{name:"preRelease",internalType:"string",type:"string"},{name:"buildMetadata",internalType:"string",type:"string"}],stateMutability:"pure"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"}],name:"ApplicationForeclosed"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"}],name:"ApplicationNotDeployed"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"error",internalType:"bytes",type:"bytes"}],name:"ApplicationReverted"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"data",internalType:"bytes",type:"bytes"}],name:"IllformedApplicationReturnData"},{type:"error",inputs:[{name:"inputBox",internalType:"address",type:"address"}],name:"InputBoxNotDeployed"}],yl="0x397c352d18DFf47CC8a6143403142cf7afd5Ff7E",Tg={address:"0x397c352d18DFf47CC8a6143403142cf7afd5Ff7E",abi:y5},g5=[{type:"function",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"execLayerData",internalType:"bytes",type:"bytes"}],name:"depositEther",outputs:[],stateMutability:"payable"},{type:"function",inputs:[],name:"version",outputs:[{name:"major",internalType:"uint64",type:"uint64"},{name:"minor",internalType:"uint64",type:"uint64"},{name:"patch",internalType:"uint64",type:"uint64"},{name:"preRelease",internalType:"string",type:"string"},{name:"buildMetadata",internalType:"string",type:"string"}],stateMutability:"pure"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"}],name:"ApplicationForeclosed"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"}],name:"ApplicationNotDeployed"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"error",internalType:"bytes",type:"bytes"}],name:"ApplicationReverted"},{type:"error",inputs:[],name:"EtherTransferFailed"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"data",internalType:"bytes",type:"bytes"}],name:"IllformedApplicationReturnData"},{type:"error",inputs:[{name:"inputBox",internalType:"address",type:"address"}],name:"InputBoxNotDeployed"}],Eg="0x035b11Be55656c6cfC822D1CaE568C1Af2e497b0",vg={address:"0x035b11Be55656c6cfC822D1CaE568C1Af2e497b0",abi:g5},Sg=[{type:"function",inputs:[{name:"output",internalType:"bytes",type:"bytes"},{name:"proof",internalType:"struct OutputValidityProof",type:"tuple",components:[{name:"outputIndex",internalType:"uint64",type:"uint64"},{name:"outputHashesSiblings",internalType:"bytes32[]",type:"bytes32[]"}]}],name:"executeOutput",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"foreclose",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"getAccountsDriveMerkleRoot",outputs:[{name:"wasAccountsDriveMerkleRootProved",internalType:"bool",type:"bool"},{name:"accountsDriveMerkleRoot",internalType:"bytes32",type:"bytes32"}],stateMutability:"view"},{type:"function",inputs:[],name:"getAccountsDriveStartIndex",outputs:[{name:"",internalType:"uint64",type:"uint64"}],stateMutability:"view"},{type:"function",inputs:[],name:"getDeploymentBlockNumber",outputs:[{name:"",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[],name:"getGuardian",outputs:[{name:"",internalType:"address",type:"address"}],stateMutability:"view"},{type:"function",inputs:[],name:"getInputBox",outputs:[{name:"",internalType:"contract IInputBox",type:"address"}],stateMutability:"view"},{type:"function",inputs:[],name:"getLog2LeavesPerAccount",outputs:[{name:"",internalType:"uint8",type:"uint8"}],stateMutability:"view"},{type:"function",inputs:[],name:"getLog2MaxNumOfAccounts",outputs:[{name:"",internalType:"uint8",type:"uint8"}],stateMutability:"view"},{type:"function",inputs:[],name:"getNumberOfExecutedOutputs",outputs:[{name:"",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[],name:"getNumberOfIssuedRefunds",outputs:[{name:"",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[],name:"getNumberOfWithdrawals",outputs:[{name:"",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[],name:"getOutputsMerkleRootValidator",outputs:[{name:"",internalType:"contract IOutputsMerkleRootValidator",type:"address"}],stateMutability:"view"},{type:"function",inputs:[],name:"getRefundOutputBuilder",outputs:[{name:"",internalType:"contract IRefundOutputBuilder",type:"address"}],stateMutability:"view"},{type:"function",inputs:[],name:"getTemplateHash",outputs:[{name:"",internalType:"bytes32",type:"bytes32"}],stateMutability:"view"},{type:"function",inputs:[],name:"getWithdrawalConfig",outputs:[{name:"withdrawalConfig",internalType:"struct WithdrawalConfig",type:"tuple",components:[{name:"guardian",internalType:"address",type:"address"},{name:"log2LeavesPerAccount",internalType:"uint8",type:"uint8"},{name:"log2MaxNumOfAccounts",internalType:"uint8",type:"uint8"},{name:"accountsDriveStartIndex",internalType:"uint64",type:"uint64"},{name:"withdrawalOutputBuilder",internalType:"contract IWithdrawalOutputBuilder",type:"address"}]}],stateMutability:"view"},{type:"function",inputs:[],name:"getWithdrawalOutputBuilder",outputs:[{name:"",internalType:"contract IWithdrawalOutputBuilder",type:"address"}],stateMutability:"view"},{type:"function",inputs:[],name:"isForeclosed",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"view"},{type:"function",inputs:[{name:"inputIndex",internalType:"uint256",type:"uint256"},{name:"input",internalType:"bytes",type:"bytes"}],name:"issueRefund",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"newOutputsMerkleRootValidator",internalType:"contract IOutputsMerkleRootValidator",type:"address"}],name:"migrateToOutputsMerkleRootValidator",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"owner",outputs:[{name:"",internalType:"address",type:"address"}],stateMutability:"view"},{type:"function",inputs:[{name:"accountsDriveMerkleRoot",internalType:"bytes32",type:"bytes32"},{name:"proof",internalType:"bytes32[]",type:"bytes32[]"}],name:"proveAccountsDriveMerkleRoot",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"newOwner",internalType:"address",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"account",internalType:"bytes",type:"bytes"},{name:"proof",internalType:"struct AccountValidityProof",type:"tuple",components:[{name:"accountIndex",internalType:"uint64",type:"uint64"},{name:"accountRootSiblings",internalType:"bytes32[]",type:"bytes32[]"}]}],name:"validateAccount",outputs:[],stateMutability:"view"},{type:"function",inputs:[{name:"accountMerkleRoot",internalType:"bytes32",type:"bytes32"},{name:"proof",internalType:"struct AccountValidityProof",type:"tuple",components:[{name:"accountIndex",internalType:"uint64",type:"uint64"},{name:"accountRootSiblings",internalType:"bytes32[]",type:"bytes32[]"}]}],name:"validateAccountMerkleRoot",outputs:[],stateMutability:"view"},{type:"function",inputs:[{name:"inputIndex",internalType:"uint256",type:"uint256"},{name:"input",internalType:"bytes",type:"bytes"}],name:"validateInput",outputs:[{name:"blockNumber",internalType:"uint256",type:"uint256"},{name:"inputSender",internalType:"address",type:"address"},{name:"inputPayload",internalType:"bytes",type:"bytes"}],stateMutability:"view"},{type:"function",inputs:[{name:"inputIndex",internalType:"uint256",type:"uint256"},{name:"inputHash",internalType:"bytes32",type:"bytes32"}],name:"validateInputHash",outputs:[],stateMutability:"view"},{type:"function",inputs:[{name:"output",internalType:"bytes",type:"bytes"},{name:"proof",internalType:"struct OutputValidityProof",type:"tuple",components:[{name:"outputIndex",internalType:"uint64",type:"uint64"},{name:"outputHashesSiblings",internalType:"bytes32[]",type:"bytes32[]"}]}],name:"validateOutput",outputs:[],stateMutability:"view"},{type:"function",inputs:[{name:"outputHash",internalType:"bytes32",type:"bytes32"},{name:"proof",internalType:"struct OutputValidityProof",type:"tuple",components:[{name:"outputIndex",internalType:"uint64",type:"uint64"},{name:"outputHashesSiblings",internalType:"bytes32[]",type:"bytes32[]"}]}],name:"validateOutputHash",outputs:[],stateMutability:"view"},{type:"function",inputs:[],name:"version",outputs:[{name:"major",internalType:"uint64",type:"uint64"},{name:"minor",internalType:"uint64",type:"uint64"},{name:"patch",internalType:"uint64",type:"uint64"},{name:"preRelease",internalType:"string",type:"string"},{name:"buildMetadata",internalType:"string",type:"string"}],stateMutability:"view"},{type:"function",inputs:[{name:"outputIndex",internalType:"uint256",type:"uint256"}],name:"wasOutputExecuted",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"view"},{type:"function",inputs:[{name:"inputIndex",internalType:"uint256",type:"uint256"}],name:"wasRefundForInputIssued",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"view"},{type:"function",inputs:[{name:"accountIndex",internalType:"uint256",type:"uint256"}],name:"wereAccountFundsWithdrawn",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"view"},{type:"function",inputs:[{name:"account",internalType:"bytes",type:"bytes"},{name:"proof",internalType:"struct AccountValidityProof",type:"tuple",components:[{name:"accountIndex",internalType:"uint64",type:"uint64"},{name:"accountRootSiblings",internalType:"bytes32[]",type:"bytes32[]"}]}],name:"withdraw",outputs:[],stateMutability:"nonpayable"},{type:"event",anonymous:!1,inputs:[{name:"accountsDriveMerkleRoot",internalType:"bytes32",type:"bytes32",indexed:!1}],name:"AccountsDriveMerkleRootProved"},{type:"event",anonymous:!1,inputs:[],name:"Foreclosure"},{type:"event",anonymous:!1,inputs:[{name:"outputIndex",internalType:"uint64",type:"uint64",indexed:!0},{name:"output",internalType:"bytes",type:"bytes",indexed:!1}],name:"OutputExecuted"},{type:"event",anonymous:!1,inputs:[{name:"newOutputsMerkleRootValidator",internalType:"contract IOutputsMerkleRootValidator",type:"address",indexed:!1}],name:"OutputsMerkleRootValidatorChanged"},{type:"event",anonymous:!1,inputs:[{name:"inputIndex",internalType:"uint256",type:"uint256",indexed:!0},{name:"input",internalType:"bytes",type:"bytes",indexed:!1},{name:"output",internalType:"bytes",type:"bytes",indexed:!1}],name:"RefundIssued"},{type:"event",anonymous:!1,inputs:[{name:"accountIndex",internalType:"uint64",type:"uint64",indexed:!0},{name:"account",internalType:"bytes",type:"bytes",indexed:!1},{name:"output",internalType:"bytes",type:"bytes",indexed:!1}],name:"Withdrawal"},{type:"error",inputs:[{name:"accountIndex",internalType:"uint64",type:"uint64"}],name:"AccountFundsAlreadyWithdrawn"},{type:"error",inputs:[],name:"AccountsDriveMerkleRootAlreadyProved"},{type:"error",inputs:[],name:"AccountsDriveMerkleRootNotProved"},{type:"error",inputs:[{name:"inputIndex",internalType:"uint256",type:"uint256"}],name:"CannotRefundFinalizedInput"},{type:"error",inputs:[{name:"log2DataBlockSize",internalType:"uint256",type:"uint256"},{name:"maxLog2DataBlockSize",internalType:"uint256",type:"uint256"}],name:"DataBlockTooLarge"},{type:"error",inputs:[{name:"driveSize",internalType:"uint256",type:"uint256"},{name:"dataSize",internalType:"uint256",type:"uint256"}],name:"DriveSmallerThanData"},{type:"error",inputs:[{name:"log2DriveSize",internalType:"uint256",type:"uint256"},{name:"log2DataBlockSize",internalType:"uint256",type:"uint256"}],name:"DriveSmallerThanDataBlock"},{type:"error",inputs:[{name:"log2DriveSize",internalType:"uint256",type:"uint256"},{name:"maxLog2DriveSize",internalType:"uint256",type:"uint256"}],name:"DriveTooLarge"},{type:"error",inputs:[],name:"Foreclosed"},{type:"error",inputs:[],name:"IllFormedInput"},{type:"error",inputs:[{name:"value",internalType:"uint256",type:"uint256"},{name:"balance",internalType:"uint256",type:"uint256"}],name:"InsufficientFunds"},{type:"error",inputs:[],name:"InvalidAccountRootSiblingsArrayLength"},{type:"error",inputs:[{name:"attemptedAccountSize",internalType:"uint256",type:"uint256"},{name:"accountSize",internalType:"uint64",type:"uint64"}],name:"InvalidAccountSize"},{type:"error",inputs:[{name:"accountsDriveMerkleRoot",internalType:"bytes32",type:"bytes32"}],name:"InvalidAccountsDriveMerkleRoot"},{type:"error",inputs:[],name:"InvalidAccountsDriveMerkleRootProofSize"},{type:"error",inputs:[{name:"storedInputHash",internalType:"bytes32",type:"bytes32"},{name:"invalidInputHash",internalType:"bytes32",type:"bytes32"}],name:"InvalidInputHash"},{type:"error",inputs:[{name:"invalidInputIndex",internalType:"uint256",type:"uint256"},{name:"numOfInputs",internalType:"uint256",type:"uint256"}],name:"InvalidInputIndex"},{type:"error",inputs:[{name:"machineMerkleRoot",internalType:"bytes32",type:"bytes32"}],name:"InvalidMachineMerkleRoot"},{type:"error",inputs:[{name:"nodeIndex",internalType:"uint256",type:"uint256"},{name:"height",internalType:"uint256",type:"uint256"}],name:"InvalidNodeIndex"},{type:"error",inputs:[],name:"InvalidOutputHashesSiblingsArrayLength"},{type:"error",inputs:[{name:"outputsMerkleRoot",internalType:"bytes32",type:"bytes32"}],name:"InvalidOutputsMerkleRoot"},{type:"error",inputs:[],name:"NotDeploymentBlock"},{type:"error",inputs:[],name:"NotForeclosed"},{type:"error",inputs:[],name:"NotGuardian"},{type:"error",inputs:[{name:"output",internalType:"bytes",type:"bytes"}],name:"OutputNotExecutable"},{type:"error",inputs:[{name:"output",internalType:"bytes",type:"bytes"}],name:"OutputNotReexecutable"},{type:"error",inputs:[{name:"inputIndex",internalType:"uint256",type:"uint256"}],name:"RefundAlreadyIssued"},{type:"error",inputs:[{name:"target",internalType:"address",type:"address"}],name:"TargetHasNoCode"},{type:"error",inputs:[{name:"stackDepth",internalType:"uint256",type:"uint256"}],name:"UnexpectedFinalStackDepth"},{type:"error",inputs:[{name:"inputSender",internalType:"address",type:"address"}],name:"UnknownInputSender"}];var FF=[{type:"function",inputs:[{name:"appContract",internalType:"address",type:"address"}],name:"getLastFinalizedMachineMerkleRoot",outputs:[{name:"",internalType:"bytes32",type:"bytes32"}],stateMutability:"view"},{type:"function",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"outputsMerkleRoot",internalType:"bytes32",type:"bytes32"}],name:"isOutputsMerkleRootValid",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"view"},{type:"function",inputs:[{name:"interfaceId",internalType:"bytes4",type:"bytes4"}],name:"supportsInterface",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"view"},{type:"function",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"inputIndex",internalType:"uint256",type:"uint256"},{name:"blockNumber",internalType:"uint256",type:"uint256"}],name:"wasInputFinalized",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"view"}];var b5=[{type:"function",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"payload",internalType:"bytes",type:"bytes"}],name:"addInput",outputs:[{name:"inputHash",internalType:"bytes32",type:"bytes32"}],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"getDeploymentBlockNumber",outputs:[{name:"",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"index",internalType:"uint256",type:"uint256"}],name:"getInputHash",outputs:[{name:"",internalType:"bytes32",type:"bytes32"}],stateMutability:"view"},{type:"function",inputs:[{name:"appContract",internalType:"address",type:"address"}],name:"getNumberOfInputs",outputs:[{name:"",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[],name:"version",outputs:[{name:"major",internalType:"uint64",type:"uint64"},{name:"minor",internalType:"uint64",type:"uint64"},{name:"patch",internalType:"uint64",type:"uint64"},{name:"preRelease",internalType:"string",type:"string"},{name:"buildMetadata",internalType:"string",type:"string"}],stateMutability:"pure"},{type:"event",anonymous:!1,inputs:[{name:"appContract",internalType:"address",type:"address",indexed:!0},{name:"index",internalType:"uint256",type:"uint256",indexed:!0},{name:"input",internalType:"bytes",type:"bytes",indexed:!1}],name:"InputAdded"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"}],name:"ApplicationForeclosed"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"}],name:"ApplicationNotDeployed"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"error",internalType:"bytes",type:"bytes"}],name:"ApplicationReverted"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"data",internalType:"bytes",type:"bytes"}],name:"IllformedApplicationReturnData"},{type:"error",inputs:[{name:"inputBox",internalType:"address",type:"address"}],name:"InputBoxNotDeployed"},{type:"error",inputs:[{name:"appContract",internalType:"address",type:"address"},{name:"inputLength",internalType:"uint256",type:"uint256"},{name:"maxInputLength",internalType:"uint256",type:"uint256"}],name:"InputTooLarge"}],gl="0xEbE9f4Dfc04ae10bBeE663859c3dc5A23f94eA3C",Ag={address:"0xEbE9f4Dfc04ae10bBeE663859c3dc5A23f94eA3C",abi:b5};var MF="0xff50b237b3e61cD810Bd1236644a887ec78762CF";var Cg="0x9e6866A965dC5f99f95EF6B0d8399dad18eEf98b";var Dg="0x86EA17052C8e335Ad830B54EF566274EAB46B852";var x5=[{type:"constructor",inputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"account",internalType:"address",type:"address"},{name:"id",internalType:"uint256",type:"uint256"}],name:"balanceOf",outputs:[{name:"",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[{name:"accounts",internalType:"address[]",type:"address[]"},{name:"ids",internalType:"uint256[]",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{name:"",internalType:"uint256[]",type:"uint256[]"}],stateMutability:"view"},{type:"function",inputs:[{name:"account",internalType:"address",type:"address"},{name:"operator",internalType:"address",type:"address"}],name:"isApprovedForAll",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"view"},{type:"function",inputs:[{name:"to",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"},{name:"value",internalType:"uint256",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"tokenId",internalType:"uint256",type:"uint256"},{name:"value",internalType:"uint256",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"tokenIds",internalType:"uint256[]",type:"uint256[]"},{name:"values",internalType:"uint256[]",type:"uint256[]"}],name:"mintBatch",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"to",internalType:"address",type:"address"},{name:"tokenIds",internalType:"uint256[]",type:"uint256[]"},{name:"values",internalType:"uint256[]",type:"uint256[]"}],name:"mintBatch",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"from",internalType:"address",type:"address"},{name:"to",internalType:"address",type:"address"},{name:"ids",internalType:"uint256[]",type:"uint256[]"},{name:"values",internalType:"uint256[]",type:"uint256[]"},{name:"data",internalType:"bytes",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"from",internalType:"address",type:"address"},{name:"to",internalType:"address",type:"address"},{name:"id",internalType:"uint256",type:"uint256"},{name:"value",internalType:"uint256",type:"uint256"},{name:"data",internalType:"bytes",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"operator",internalType:"address",type:"address"},{name:"approved",internalType:"bool",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"interfaceId",internalType:"bytes4",type:"bytes4"}],name:"supportsInterface",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"view"},{type:"function",inputs:[{name:"",internalType:"uint256",type:"uint256"}],name:"uri",outputs:[{name:"",internalType:"string",type:"string"}],stateMutability:"view"},{type:"event",anonymous:!1,inputs:[{name:"account",internalType:"address",type:"address",indexed:!0},{name:"operator",internalType:"address",type:"address",indexed:!0},{name:"approved",internalType:"bool",type:"bool",indexed:!1}],name:"ApprovalForAll"},{type:"event",anonymous:!1,inputs:[{name:"operator",internalType:"address",type:"address",indexed:!0},{name:"from",internalType:"address",type:"address",indexed:!0},{name:"to",internalType:"address",type:"address",indexed:!0},{name:"ids",internalType:"uint256[]",type:"uint256[]",indexed:!1},{name:"values",internalType:"uint256[]",type:"uint256[]",indexed:!1}],name:"TransferBatch"},{type:"event",anonymous:!1,inputs:[{name:"operator",internalType:"address",type:"address",indexed:!0},{name:"from",internalType:"address",type:"address",indexed:!0},{name:"to",internalType:"address",type:"address",indexed:!0},{name:"id",internalType:"uint256",type:"uint256",indexed:!1},{name:"value",internalType:"uint256",type:"uint256",indexed:!1}],name:"TransferSingle"},{type:"event",anonymous:!1,inputs:[{name:"value",internalType:"string",type:"string",indexed:!1},{name:"id",internalType:"uint256",type:"uint256",indexed:!0}],name:"URI"},{type:"error",inputs:[{name:"sender",internalType:"address",type:"address"},{name:"balance",internalType:"uint256",type:"uint256"},{name:"needed",internalType:"uint256",type:"uint256"},{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"ERC1155InsufficientBalance"},{type:"error",inputs:[{name:"approver",internalType:"address",type:"address"}],name:"ERC1155InvalidApprover"},{type:"error",inputs:[{name:"idsLength",internalType:"uint256",type:"uint256"},{name:"valuesLength",internalType:"uint256",type:"uint256"}],name:"ERC1155InvalidArrayLength"},{type:"error",inputs:[{name:"operator",internalType:"address",type:"address"}],name:"ERC1155InvalidOperator"},{type:"error",inputs:[{name:"receiver",internalType:"address",type:"address"}],name:"ERC1155InvalidReceiver"},{type:"error",inputs:[{name:"sender",internalType:"address",type:"address"}],name:"ERC1155InvalidSender"},{type:"error",inputs:[{name:"operator",internalType:"address",type:"address"},{name:"owner",internalType:"address",type:"address"}],name:"ERC1155MissingApprovalForAll"}],Ig="0xAaE893D28b7645B5E09bc16688dddd451aC89C19";var LF=[{type:"constructor",inputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"to",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"owner",internalType:"address",type:"address"}],name:"balanceOf",outputs:[{name:"",internalType:"uint256",type:"uint256"}],stateMutability:"view"},{type:"function",inputs:[{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"getApproved",outputs:[{name:"",internalType:"address",type:"address"}],stateMutability:"view"},{type:"function",inputs:[{name:"owner",internalType:"address",type:"address"},{name:"operator",internalType:"address",type:"address"}],name:"isApprovedForAll",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"view"},{type:"function",inputs:[{name:"to",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[],name:"name",outputs:[{name:"",internalType:"string",type:"string"}],stateMutability:"view"},{type:"function",inputs:[{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"ownerOf",outputs:[{name:"",internalType:"address",type:"address"}],stateMutability:"view"},{type:"function",inputs:[{name:"from",internalType:"address",type:"address"},{name:"to",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"from",internalType:"address",type:"address"},{name:"to",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"},{name:"data",internalType:"bytes",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"operator",internalType:"address",type:"address"},{name:"approved",internalType:"bool",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable"},{type:"function",inputs:[{name:"interfaceId",internalType:"bytes4",type:"bytes4"}],name:"supportsInterface",outputs:[{name:"",internalType:"bool",type:"bool"}],stateMutability:"view"},{type:"function",inputs:[],name:"symbol",outputs:[{name:"",internalType:"string",type:"string"}],stateMutability:"view"},{type:"function",inputs:[{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"tokenURI",outputs:[{name:"",internalType:"string",type:"string"}],stateMutability:"view"},{type:"function",inputs:[{name:"from",internalType:"address",type:"address"},{name:"to",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable"},{type:"event",anonymous:!1,inputs:[{name:"owner",internalType:"address",type:"address",indexed:!0},{name:"approved",internalType:"address",type:"address",indexed:!0},{name:"tokenId",internalType:"uint256",type:"uint256",indexed:!0}],name:"Approval"},{type:"event",anonymous:!1,inputs:[{name:"owner",internalType:"address",type:"address",indexed:!0},{name:"operator",internalType:"address",type:"address",indexed:!0},{name:"approved",internalType:"bool",type:"bool",indexed:!1}],name:"ApprovalForAll"},{type:"event",anonymous:!1,inputs:[{name:"from",internalType:"address",type:"address",indexed:!0},{name:"to",internalType:"address",type:"address",indexed:!0},{name:"tokenId",internalType:"uint256",type:"uint256",indexed:!0}],name:"Transfer"},{type:"error",inputs:[{name:"sender",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"},{name:"owner",internalType:"address",type:"address"}],name:"ERC721IncorrectOwner"},{type:"error",inputs:[{name:"operator",internalType:"address",type:"address"},{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"ERC721InsufficientApproval"},{type:"error",inputs:[{name:"approver",internalType:"address",type:"address"}],name:"ERC721InvalidApprover"},{type:"error",inputs:[{name:"operator",internalType:"address",type:"address"}],name:"ERC721InvalidOperator"},{type:"error",inputs:[{name:"owner",internalType:"address",type:"address"}],name:"ERC721InvalidOwner"},{type:"error",inputs:[{name:"receiver",internalType:"address",type:"address"}],name:"ERC721InvalidReceiver"},{type:"error",inputs:[{name:"sender",internalType:"address",type:"address"}],name:"ERC721InvalidSender"},{type:"error",inputs:[{name:"tokenId",internalType:"uint256",type:"uint256"}],name:"ERC721NonexistentToken"}],td="0x0761b8e3aB06F458632974393C48765E6Ddc61bB";var Og="0xB4D253c7a110241561B3eD6d632846dF7d4e9Af7";var $F="0x7a051EDffC0884cd88d4a377F4C87BE074CF6c81";var UF="0x60b8b3c0AecEb193755038fa9372FfE910E63e39";import xie from"node:os";var wie=(e,t)=>{e.stderr?.on("data",(r)=>{for(let n of r.toString().split(`
530
+ `))if(n.trim())t(n.trimEnd())})},ln=async(e,t,r)=>{let{reporter:n}=r;try{if(r.forceDocker){let o=new qt;throw o.code="ENOENT",o}return await We(e,t,r)}catch(o){if(o instanceof qt){if(o.code==="ENOENT"&&r.image){let i=xie.userInfo(),s=r.tty?["--tty"]:[],a=["--volume",`${r.cwd}:/work`,"--workdir","/work","--interactive",...s,"--rm","--user",`${i.uid}:${i.gid}`],c=We("docker",["run",...a,r.image,e,...t],r);if(n)wie(c,n);return await c}}throw o}};var Tie=async(e,t)=>{let r=`${Qf}:${La}`,n=Object.assign({},{image:r,cwd:process.cwd()},t);try{let{stdout:o}=await ln("cartesi-machine-stored-hash",[e],n);if(o!==void 0){let i=o.toString().trim(),s=i.startsWith("0x")?i:`0x${i}`;if(ul(s))return s}return}catch{return}};var Tl=ot(cd(),1);var Vg=new Tl.Range("^0.21.0"),Ace=(e,t)=>ln("cartesi-machine",e,t),P9=async(e)=>{try{let{stdout:t}=await ln("cartesi-machine",["--version-json"],{...e,cwd:e?.cwd??process.cwd()});if(typeof t==="string"){let r=JSON.parse(t);return Tl.parse(r.version)}return null}catch{return null}};class _9 extends Error{constructor(e){super(`cartesi-machine ${e.format()} found, but ${Vg.raw} is required`);this.name="UnsupportedVersionError"}}var Cce=(e)=>{if(e!==null&&!Tl.satisfies(e.format(),Vg))throw new _9(e)},Dce=async(e)=>Cce(await P9(e));var N5=ot(cd(),1);var ud=4096,Z7t=new N5.Range("^1.5.6"),B9=(e)=>["--block-size",ud.toString(),"--faketime","--readjustment",`+${e.extraBlocks}`],Ice=(e)=>{let{size:t,output:r,reporter:n}=e,o=Math.ceil(t/ud);return ln("xgenext2fs",["--block-size",ud.toString(),"--faketime","--size-in-blocks",o.toString(),r],{...e,reporter:n})},Oce=(e)=>{let{cwd:t,extraSize:r,image:n,input:o,output:i,reporter:s}=e,a=Math.ceil(r/ud);return ln("xgenext2fs",[...B9({extraBlocks:a}),"--root",o,i],{cwd:t,image:n,reporter:s})},N9=(e)=>{let{cwd:t,extraSize:r,image:n,input:o,output:i,reporter:s}=e,a=Math.ceil(r/ud);return ln("xgenext2fs",[...B9({extraBlocks:a}),"--tarball",o,i],{cwd:t,image:n,reporter:s})};var F5=ot(cd(),1);var kce="lzo",X7t=new F5.Range("^4.5.1"),F9=()=>["-all-time","0","-mkfs-time","0","-all-root","-noappend","-comp",kce,"-no-progress"],Rce=(e)=>{let{cwd:t,image:r,input:n,output:o,reporter:i}=e;return ln("mksquashfs",[n,o,...F9()],{cwd:t,image:r,reporter:i})},M9=(e)=>{let{cwd:t,image:r,input:n,output:o,reporter:i}=e;return ln("mksquashfs",["-",o,"-tar",...F9()],{cwd:t,image:r,reporter:i,inputFile:n})};function L9(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let o=t.length,i=0,s="";do s+=e.slice(i,n)+t+r,i=n+o,n=e.indexOf(t,i);while(n!==-1);return s+=e.slice(i),s}function $9(e,t,r,n){let o=0,i="";do{let s=e[n-1]==="\r";i+=e.slice(o,s?n-1:n)+t+(s?`\r
531
+ `:`
532
+ `)+r,o=n+1,n=e.indexOf(`
533
+ `,o)}while(n!==-1);return i+=e.slice(o),i}var U9=(e=0)=>(t)=>`\x1B[${t+e}m`,M5=(e=0)=>(t)=>`\x1B[${38+e};5;${t}m`,L5=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,Pce=(e)=>`\x1B[58;5;${e<90?e-30:e-90+8}m`,Re={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],underlineDouble:["4:2",24],underlineCurly:["4:3",24],underlineDotted:["4:4",24],underlineDashed:["4:5",24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},underlineColor:{underlineBlack:["58;5;0",59],underlineRed:["58;5;1",59],underlineGreen:["58;5;2",59],underlineYellow:["58;5;3",59],underlineBlue:["58;5;4",59],underlineMagenta:["58;5;5",59],underlineCyan:["58;5;6",59],underlineWhite:["58;5;7",59],underlineBlackBright:["58;5;8",59],underlineGray:["58;5;8",59],underlineGrey:["58;5;8",59],underlineRedBright:["58;5;9",59],underlineGreenBright:["58;5;10",59],underlineYellowBright:["58;5;11",59],underlineBlueBright:["58;5;12",59],underlineMagentaBright:["58;5;13",59],underlineCyanBright:["58;5;14",59],underlineWhiteBright:["58;5;15",59]}},tUt=Object.keys(Re.modifier),_ce=Object.keys(Re.color),Bce=Object.keys(Re.bgColor),rUt=Object.keys(Re.underlineColor),nUt=[..._ce,...Bce];function Nce(){let e=new Map;for(let[t,r]of Object.entries(Re)){for(let[n,o]of Object.entries(r))Re[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Re[n],e.set(Number.parseInt(o[0],10),o[1]);Object.defineProperty(Re,t,{value:r,enumerable:!1})}return Object.defineProperty(Re,"codes",{value:e,enumerable:!1}),Re.color.close="\x1B[39m",Re.bgColor.close="\x1B[49m",Re.underlineColor.close="\x1B[59m",Re.color.ansi=U9(),Re.color.ansi256=M5(),Re.color.ansi16m=L5(),Re.bgColor.ansi=U9(10),Re.bgColor.ansi256=M5(10),Re.bgColor.ansi16m=L5(10),Re.underlineColor.ansi=Pce,Re.underlineColor.ansi256=M5(20),Re.underlineColor.ansi16m=L5(20),Object.defineProperties(Re,{rgbToAnsi256:{value(t,r,n){if(t===r&&r===n){if(t<8)return 16;if(t>248)return 231;return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[\da-f]{6}|[\da-f]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;if(n.length===3)n=[...n].map((i)=>i+i).join("");let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:(t)=>Re.rgbToAnsi256(...Re.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,o;if(t>=232)r=((t-232)*10+8)/255,n=r,o=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let i=Math.max(r,n,o)*2;if(i===0)return 30;let s=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));if(i===2)s+=60;return s},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>Re.ansi256ToAnsi(Re.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:(t)=>Re.ansi256ToAnsi(Re.hexToAnsi256(t)),enumerable:!1}}),Re}var Fce=Nce(),Bo=Fce;import $5 from"node:process";import Mce from"node:os";import H9 from"node:tty";function dn(e,t=globalThis.Deno?globalThis.Deno.args:$5.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}var{env:Ve}=$5,Kg;if(dn("no-color")||dn("no-colors")||dn("color=false")||dn("color=never"))Kg=0;else if(dn("color")||dn("colors")||dn("color=true")||dn("color=always"))Kg=1;function q9(){return/^\d+$/.test(Ve.FORCE_COLOR)}function Lce(){if(!("FORCE_COLOR"in Ve))return;if(Ve.FORCE_COLOR==="false")return 0;if(Ve.FORCE_COLOR==="true"||Ve.FORCE_COLOR.length===0)return 1;if(!q9())return;return Math.min(Number.parseInt(Ve.FORCE_COLOR,10),3)}function $ce(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Uce(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=Lce();if(n!==void 0)Kg=n;let o=r?Kg:n;if(o===0)return 0;if(r){if(dn("color=16m")||dn("color=full")||dn("color=truecolor"))return 3;if(dn("color=256"))return 2}if(o!==void 0&&q9())return o;if("TF_BUILD"in Ve&&"AGENT_NAME"in Ve)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(Ve.TERM==="dumb")return i;if($5.platform==="win32"){let s=Mce.release().split(".");if(Number(s[0])>=10&&Number(s[2])>=10586)return Number(s[2])>=14931?3:2;return 1}if("CI"in Ve){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((s)=>(s in Ve)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((s)=>(s in Ve))||Ve.CI_NAME==="codeship")return 1;return i}if("TEAMCITY_VERSION"in Ve)return/^(?:9\.0*[1-9]\d*\.|\d{2,}\.)/.test(Ve.TEAMCITY_VERSION)?1:0;if(Ve.COLORTERM==="truecolor")return 3;if(Ve.TERM==="xterm-kitty")return 3;if(Ve.TERM==="xterm-ghostty")return 3;if(Ve.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Ve){let s=Number.parseInt((Ve.TERM_PROGRAM_VERSION||"").split(".",1)[0],10);switch(Ve.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(?:color)?$/i.test(Ve.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ve.TERM))return 1;if("COLORTERM"in Ve)return 1;return i}function j9(e,t={}){let r=Uce(e,{streamIsTTY:e&&e.isTTY,...t});return $ce(r)}var Hce={stdout:j9({isTTY:H9.isatty(1)}),stderr:j9({isTTY:H9.isatty(2)})},z9=Hce;var{stdout:G9,stderr:V9}=z9,pd=Symbol("GENERATOR"),fd=Symbol("STYLER"),Zg=Symbol("IS_EMPTY"),Yg=Symbol("LEVEL"),dd=Object.create(null),W9=(e)=>{if(!Number.isSafeInteger(e)||e<0||e>3)throw Error("The `level` should be an integer from 0 to 3")},jce={enumerable:!0,get(){return this[Yg]},set(e){W9(e),this[Yg]=e}},qce=(e,t={})=>{if(t.level!==void 0)W9(t.level);let r=G9?G9.level:0;e[Yg]=t.level===void 0?r:t.level};var zce=(e)=>{let t=(...r)=>r.join(" ");return qce(t,e),Object.setPrototypeOf(t,md.prototype),t};function md(e){return zce(e)}Object.setPrototypeOf(md.prototype,Function.prototype);for(let[e,t]of Object.entries(Bo))dd[e]={get(){let r=H5(this,K9(t.open,t.close,this[fd]),this[Zg]);return Object.defineProperty(this,e,{value:r}),r}};dd.visible={get(){let e=H5(this,this[fd],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Gce=(e,t)=>{let r=Bo[t];if(e==="rgb"){let o=(s,a,c)=>r.ansi(Bo.rgbToAnsi(s,a,c));return[o,o,(s,a,c)=>r.ansi256(Bo.rgbToAnsi256(s,a,c)),r.ansi16m]}if(e==="hex"){let o=(s)=>r.ansi(Bo.hexToAnsi(s));return[o,o,(s)=>r.ansi256(Bo.hexToAnsi256(s)),(s)=>r.ansi16m(...Bo.hexToRgb(s))]}let n=(o)=>r.ansi(Bo.ansi256ToAnsi(o));return[n,n,r.ansi256,r.ansi256]},Vce=["rgb","hex","ansi256"];for(let e of Vce){let t=e[0].toUpperCase()+e.slice(1);for(let[r,n]of[[e,"color"],["bg"+t,"bgColor"],["underline"+t,"underlineColor"]]){let{close:o}=Bo[n],i=Gce(e,n);dd[r]={get(){let s=function(a,c,u){let l=i[this.level](a,c,u);return H5(this,K9(l,o,this[fd]),this[Zg])};return Object.defineProperty(this,r,{value:s}),s}}}}var Wce=Object.defineProperties(()=>{},{...dd,level:{enumerable:!0,get(){return this[pd].level},set(e){this[pd].level=e}}}),K9=(e,t,r)=>{let n,o;if(r===void 0)n=e,o=t;else n=r.openAll+e,o=t+r.closeAll;return{open:e,close:t,openAll:n,closeAll:o,parent:r}},H5=(e,t,r)=>{let n=(...o)=>{if(o.length===1)return U5(n,""+o[0]);if(o.length===2)return U5(n,`${o[0]??""} ${o[1]??""}`);return U5(n,o.join(" "))};return Object.setPrototypeOf(n,Wce),n[pd]=e[pd]??e,n[fd]=t,n[Zg]=r,n},U5=(e,t)=>{if(e[pd][Yg]<=0||!t)return e[Zg]?"":t;let r=e[fd];if(r===void 0)return t;let{openAll:n,closeAll:o}=r;if(t.includes("\x1B"))while(r!==void 0)t=L9(t,r.close,r.open),r=r.parent;let i=t.indexOf(`
534
+ `);if(i!==-1)t=$9(t,o,n,i);return n+t+o};Object.defineProperties(md.prototype,{...dd,level:jce});var Kce=md(),fUt=md({level:V9?V9.level:0});var U=Kce;import ope,{setMaxListeners as ipe}from"node:events";import{inspect as spe,styleText as ape}from"node:util";import{format as cpe}from"util";import{EOL as No}from"os";import{StringDecoder as upe}from"string_decoder";import{Writable as lpe}from"stream";import{randomUUID as ppe}from"crypto";var w$={CURSOR_HIDE:"\x1B[?25l",CURSOR_SHOW:"\x1B[?25h"};var fpe=function(e){return e.WAITING="WAITING",e.STARTED="STARTED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.SKIPPED="SKIPPED",e.ROLLING_BACK="ROLLING_BACK",e.ROLLED_BACK="ROLLED_BACK",e.RETRY="RETRY",e.PAUSED="PAUSED",e.PROMPT="PROMPT",e.PROMPT_COMPLETED="PROMPT_COMPLETED",e.PROMPT_FAILED="PROMPT_FAILED",e.CANCELLED="CANCELLED",e}({}),C$=class{emitter=new ope;constructor(){this.emitter.setMaxListeners(0)}emit(e,t){this.emitter.emit(e,t)}on(e,t){if(!t)return;this.emitter.addListener(e,t)}once(e,t){if(!t)return;this.emitter.once(e,t)}off(e,t){if(t)this.emitter.off(e,t);else this.emitter.removeAllListeners(e)}complete(){this.emitter.removeAllListeners()}};var dpe=class extends Error{error;type;task;path;constructor(e,t,r){super(e.message);this.error=e,this.type=t,this.task=r,this.name="ListrError",this.path=r.path,this.stack=e?.stack}},T$=class extends Error{},mpe=class extends Error{};function hpe(e){return!!e&&typeof e==="object"&&typeof e.subscribe==="function"}function ype(e){return!!e&&typeof e==="object"&&e.readable===!0&&typeof e.read==="function"&&typeof e.on==="function"}function D$(){return!!process.env.LISTR_FORCE_UNICODE||process.platform!=="win32"||!!process.env.CI||!!process.env.WT_SESSION||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color"||process.env.TERM==="alacritty"}var gpe="(?:\\u001b|\\u009b)\\[[\\=><~/#&.:=?%@~_-]*[0-9]*[\\a-ln-tqyz=><~/#&.:=?%@~_-]+";function Dd(e){return String(e).replace(new RegExp(gpe,"gmi"),"").trim()}var Ee=Object.fromEntries(Object.keys(spe.colors).map((e)=>[e,(t)=>ape(e,String(t))]));function E$(e,t){return e.replace(/^(?!\s*$)/gm," ".repeat(t))}var I$={warning:"⚠",info:"ℹ",cross:"✖",arrowDown:"↓",tick:"✔",arrowRight:"→",pointer:"❯",checkboxOn:"☒",arrowLeft:"←",squareSmallFilled:"◼",pointerSmall:"›",circleSlash:"⊘"},bpe={...I$,warning:"‼",info:"i",cross:"×",tick:"√",pointer:">",checkboxOn:"[×]",squareSmallFilled:"■",circleSlash:"ø"},qe=D$()?I$:bpe;function Cd(e,...t){return cpe(String(e),...t)}var db={icon:{["STARTED"]:qe.pointer,["FAILED"]:qe.cross,["SKIPPED"]:qe.arrowDown,["COMPLETED"]:qe.tick,["OUTPUT"]:qe.pointerSmall,["TITLE"]:qe.arrowRight,["RETRY"]:qe.warning,["ROLLBACK"]:qe.arrowLeft,["PAUSED"]:qe.squareSmallFilled,["CANCELLED"]:qe.circleSlash},color:{["STARTED"]:Ee.yellow,["FAILED"]:Ee.red,["SKIPPED"]:Ee.yellow,["COMPLETED"]:Ee.green,["RETRY"]:Ee.yellowBright,["ROLLBACK"]:Ee.redBright,["PAUSED"]:Ee.yellowBright,["CANCELLED"]:Ee.red}},O$=["RETRY","ROLLBACK","FAILED"],mb=class{options;process;constructor(e){this.options=e,this.options={useIcons:!0,toStderr:[],...e??{}},this.options.fields??={},this.options.fields.prefix??=[],this.options.fields.suffix??=[],this.process=this.options.processOutput??new xpe}log(e,t,r){let n=this.format(e,t,r);if(this.options.toStderr.includes(e)){this.process.toStderr(n);return}this.process.toStdout(n)}toStdout(e,t,r=!0){this.process.toStdout(this.format(null,e,t),r)}toStderr(e,t,r=!0){this.process.toStderr(this.format(null,e,t),r)}wrap(e,t){if(!e)return e;return this.applyFormat(`[${e}]`,t)}splat(...e){let t=e.shift()??"";return e.length===0?t:Cd(t,e)}suffix(e,...t){return t.filter(Boolean).forEach((r)=>{if(e+=this.spacing(e),typeof r==="string")e+=this.wrap(r);else if(typeof r==="object"){if(r.args??=[],typeof r.condition==="function"?!r.condition(...r.args):!(r.condition??!0))return e;e+=this.wrap(typeof r.field==="function"?r.field(...r.args):r.field,{format:r?.format(...r.args)})}}),e}prefix(e,...t){return t.filter(Boolean).forEach((r)=>{if(e=this.spacing(e)+e,typeof r==="string")e=this.wrap(r)+e;else if(typeof r==="object"){if(r.args??=[],typeof r.condition==="function"?!r.condition(...r.args):!(r.condition??!0))return e;e=this.wrap(typeof r.field==="function"?r.field(...r.args):r.field,{format:r?.format()})+e}}),e}fields(e,t){if(this.options?.fields?.prefix)e=this.prefix(e,...this.options.fields.prefix);if(t?.prefix)e=this.prefix(e,...t.prefix);if(t?.suffix)e=this.suffix(e,...t.suffix);if(this.options?.fields?.suffix)e=this.suffix(e,...this.options.fields.suffix);return e}icon(e,t){if(!e)return null;if(!t){let n=this.options.icon?.[e];t=typeof n==="function"?n():n}let r=this.options.color?.[e];if(t&&r)t=r(t);return t}format(e,t,r){if(!Array.isArray(t))t=[t];return t=this.splat(t.shift(),...t).toString().split(No).filter((n)=>!n||n.trim()!=="").map((n)=>this.style(e,this.fields(n,{prefix:Array.isArray(r?.prefix)?r.prefix:[r?.prefix],suffix:Array.isArray(r?.suffix)?r.suffix:[r?.suffix]}))).join(No),t}style(e,t){if(!e||!t)return t;let r=this.icon(e,!this.options.useIcons&&this.wrap(e));if(r)t=r+" "+t;return t}applyFormat(e,t){if(t?.format)return t.format(e);return e}spacing(e){return typeof e>"u"||e.trim()===""?"":" "}},wv=class{options;buffer=[];decoder=new upe;constructor(e){this.options=e}get all(){return this.buffer}get last(){return this.buffer.at(-1)}get length(){return this.buffer.length}write(e,...t){let r=t[t.length-1];if(this.buffer.push({time:Date.now(),stream:this.options?.stream,entry:this.decoder.write(typeof e==="string"?Buffer.from(e,typeof t[0]==="string"?t[0]:void 0):Buffer.from(e))}),this.options?.limit)this.buffer=this.buffer.slice(-this.options.limit);if(typeof r==="function")r();return!0}reset(){this.buffer=[]}},v$=class{stream;method;buffer;constructor(e){this.stream=e,this.method=e.write,this.buffer=new wv({stream:e})}get out(){let e=this;return new Proxy(this.stream,{get(t,r,n){if(r==="write")return e.write.bind(e);return Reflect.get(t,r,n)}})}hijack(){this.stream.write=this.buffer.write.bind(this.buffer)}release(){this.stream.write=this.method;let e=[...this.buffer.all];return this.buffer.reset(),e}write(...e){return this.method.apply(this.stream,e)}},xpe=class{options;stream;active;constructor(e,t,r){this.options=r,this.stream={stdout:new v$(e??process.stdout),stderr:new v$(t??process.stderr)},this.options={dump:["stdout","stderr"],leaveEmptyLine:!0,...r}}get stdout(){return this.stream.stdout.out}get stderr(){return this.stream.stderr.out}hijack(){if(this.active)throw Error("ProcessOutput has been already hijacked!");this.stream.stdout.write(w$.CURSOR_HIDE),Object.values(this.stream).forEach((e)=>e.hijack()),this.active=!0}release(){let e=Object.entries(this.stream).map(([t,r])=>({name:t,buffer:r.release()})).filter((t)=>this.options.dump.includes(t.name)).flatMap((t)=>t.buffer).sort((t,r)=>t.time-r.time).map((t)=>({...t,entry:Dd(t.entry)})).filter((t)=>t.entry);if(e.length>0){if(this.options.leaveEmptyLine)this.stdout.write(No);e.forEach((t)=>{(t.stream??this.stdout).write(t.entry+No)})}this.stream.stdout.write(w$.CURSOR_SHOW),this.active=!1}toStdout(e,t=!0){if(t)e=e+No;return this.stream.stdout.write(e)}toStderr(e,t=!0){if(t)e=e+No;return this.stream.stderr.write(e)}};function wpe(e){let t=new lpe;return t.rows=1/0,t.columns=1/0,t.write=(r)=>(e(r.toString()),!0),t}var Tpe=class{spinner=!D$()?["-","\\","|","/"]:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];id;spinnerPosition=0;spin(){this.spinnerPosition=++this.spinnerPosition%this.spinner.length}fetch(){return this.spinner[this.spinnerPosition]}isRunning(){return!!this.id}start(e,t=100){this.id=setInterval(()=>{if(this.spin(),e)e()},t)}stop(){clearInterval(this.id),this.id=void 0}};var S$={icon:{["SKIPPED_WITH_COLLAPSE"]:qe.arrowDown,["SKIPPED_WITHOUT_COLLAPSE"]:qe.warning,["OUTPUT"]:qe.pointerSmall,["OUTPUT_WITH_BOTTOMBAR"]:qe.pointerSmall,["PENDING"]:qe.pointer,["COMPLETED"]:qe.tick,["COMPLETED_WITH_FAILED_SUBTASKS"]:qe.warning,["COMPLETED_WITH_SISTER_TASKS_FAILED"]:qe.squareSmallFilled,["RETRY"]:qe.warning,["ROLLING_BACK"]:qe.warning,["ROLLED_BACK"]:qe.arrowLeft,["FAILED"]:qe.cross,["FAILED_WITH_SUBTASKS"]:qe.pointer,["WAITING"]:qe.squareSmallFilled,["PAUSED"]:qe.squareSmallFilled,["CANCELLED"]:qe.circleSlash},color:{["SKIPPED_WITH_COLLAPSE"]:Ee.yellow,["SKIPPED_WITHOUT_COLLAPSE"]:Ee.yellow,["PENDING"]:Ee.yellow,["COMPLETED"]:Ee.green,["COMPLETED_WITH_FAILED_SUBTASKS"]:Ee.yellow,["COMPLETED_WITH_SISTER_TASKS_FAILED"]:Ee.red,["RETRY"]:Ee.yellowBright,["ROLLING_BACK"]:Ee.redBright,["ROLLED_BACK"]:Ee.redBright,["FAILED"]:Ee.red,["FAILED_WITH_SUBTASKS"]:Ee.red,["WAITING"]:Ee.dim,["PAUSED"]:Ee.yellowBright,["CANCELLED"]:Ee.red}};function Epe(e){let t=Math.floor(e/1000),r=Math.floor(t/60),n;if(t===0&&r===0)n=`0.${Math.floor(e/100)}s`;if(t>0)n=`${t%60}s`;if(r>0)n=`${r}m${n}`;return n}var Tv={condition:!0,field:Epe,format:()=>Ee.dim};var vpe=class e{tasks;options;events;static nonTTY=!1;static rendererOptions={indentation:2,clearOutput:!1,showSubtasks:!0,collapseSubtasks:!0,collapseSkips:!0,showSkipMessage:!0,suffixSkips:!1,collapseErrors:!0,showErrorMessage:!0,suffixRetries:!0,lazy:!1,removeEmptyLines:!0,formatOutput:"wrap",pausedTimer:{...Tv,format:()=>Ee.yellowBright}};static rendererTaskOptions={outputBar:!0};prompt;activePrompt;spinner;logger;updater;truncate;wrap;buffer={output:new Map,bottom:new Map};cache={render:new Map,rendererOptions:new Map,rendererTaskOptions:new Map};constructor(t,r,n){this.tasks=t,this.options=r,this.events=n,this.options={...e.rendererOptions,...this.options,icon:{...S$.icon,...r?.icon??{}},color:{...S$.color,...r?.color??{}}},this.spinner=this.options.spinner??new Tpe,this.logger=this.options.logger??new mb({useIcons:!0,toStderr:[]}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color}async render(){await Promise.resolve().then(() => b$());await Promise.resolve().then(() => x$());await Promise.resolve().then(() => iv());if(this.updater=lb(this.logger.process.stdout),this.truncate=bv,this.wrap=Td,this.logger.process.hijack(),!this.options?.lazy)this.spinner.start(()=>{this.update()});this.events.on("SHOUD_REFRESH_RENDER",this.refresh)}update(){this.updater(this.create())}end(){if(this.spinner.stop(),this.events.off("SHOUD_REFRESH_RENDER",this.refresh),this.updater.clear(),this.updater.done(),!this.options.clearOutput)this.logger.process.toStdout(this.create({prompt:!1}));this.logger.process.release()}create(t){t={tasks:!0,bottomBar:!0,prompt:!0,...t};let r=[],n=this.renderer(this.tasks),o=this.renderBottomBar(),i=this.renderPrompt();if(t.tasks&&n.length>0)r.push(...n);if(t.bottomBar&&o.length>0){if(r.length>0)r.push("");r.push(...o)}if(t.prompt&&i.length>0){if(r.length>0)r.push("");r.push(...i)}return r.join(No)}style(t,r=!1){let n=this.cache.rendererOptions.get(t.id);if(t.isSkipped()){if(r||n.collapseSkips)return this.logger.icon("SKIPPED_WITH_COLLAPSE");else if(n.collapseSkips===!1)return this.logger.icon("SKIPPED_WITHOUT_COLLAPSE")}if(r){if(this.shouldOutputToBottomBar(t))return this.logger.icon("OUTPUT_WITH_BOTTOMBAR");return this.logger.icon("OUTPUT")}if(t.hasSubtasks()){if(t.isStarted()||t.isPrompt()&&n.showSubtasks!==!1&&!t.subtasks.every((o)=>!o.hasTitle()))return this.logger.icon("PENDING");else if(t.isCompleted()&&t.subtasks.some((o)=>o.hasFailed()))return this.logger.icon("COMPLETED_WITH_FAILED_SUBTASKS");else if(t.hasFailed())return this.logger.icon("FAILED_WITH_SUBTASKS")}if(t.isStarted()||t.isPrompt())return this.logger.icon("PENDING",!this.options?.lazy&&this.spinner.fetch());else if(t.isCompleted())return this.logger.icon("COMPLETED");else if(t.isRetrying())return this.logger.icon("RETRY",!this.options?.lazy&&this.spinner.fetch());else if(t.isRollingBack())return this.logger.icon("ROLLING_BACK",!this.options?.lazy&&this.spinner.fetch());else if(t.hasRolledBack())return this.logger.icon("ROLLED_BACK");else if(t.hasFailed())return this.logger.icon("FAILED");else if(t.isCancelled())return this.logger.icon("CANCELLED");else if(t.isPaused())return this.logger.icon("PAUSED");return this.logger.icon("WAITING")}format(t,r,n){if(t.trim()==="")return[];if(r)t=r+" "+t;let o,i=(this.logger.process.stdout.columns??80)-n*this.options.indentation-2;switch(this.options.formatOutput){case"truncate":o=t.split(No).map((s,a)=>this.truncate(this.indent(s,a),i));break;case"wrap":o=this.wrap(t,i,{hard:!0,trim:!1}).split(No).map((s,a)=>this.indent(s,a));break;default:throw new T$("Format option for the renderer is wrong.")}if(this.options.removeEmptyLines)o=o.filter(Boolean);return o.map((s)=>E$(s,n*this.options.indentation))}shouldOutputToOutputBar(t){let r=this.cache.rendererTaskOptions.get(t.id).outputBar;return typeof r==="number"&&r!==0||typeof r==="boolean"&&r!==!1}shouldOutputToBottomBar(t){let r=this.cache.rendererTaskOptions.get(t.id).bottomBar;return typeof r==="number"&&r!==0||typeof r==="boolean"&&r!==!1||!t.hasTitle()}refresh=()=>{this.update()};renderer(t,r=0){return t.flatMap((n)=>{if(!n.isEnabled())return[];if(this.cache.render.has(n.id))return this.cache.render.get(n.id);this.calculate(n),this.setupBuffer(n);let o=this.cache.rendererOptions.get(n.id),i=this.cache.rendererTaskOptions.get(n.id),s=[];if(n.isPrompt()){if(this.activePrompt&&this.activePrompt!==n.id)throw new T$("Only one prompt can be active at the given time, please re-evaluate your task design.");else if(!this.activePrompt)n.on("PROMPT",(a)=>{let c=Dd(a);if(c)this.prompt=c}),n.on("STATE",(a)=>{if(a==="PROMPT_COMPLETED"||n.hasFinalized()||n.hasReset())this.prompt=null,this.activePrompt=null,n.off("PROMPT")}),this.activePrompt=n.id}if(n.hasTitle())if(!(t.some((a)=>a.hasFailed())&&!n.hasFailed()&&n.options.exitOnError!==!1&&!(n.isCompleted()||n.isSkipped()||n.isCancelled())))if(n.hasFailed()&&o.collapseErrors)s.push(...this.format(!n.hasSubtasks()&&n.message.error&&o.showErrorMessage?n.message.error:n.title,this.style(n),r));else if(n.isSkipped()&&o.collapseSkips)s.push(...this.format(this.logger.suffix(n.message.skip&&o.showSkipMessage?n.message.skip:n.title,{field:"SKIPPED",condition:o.suffixSkips,format:()=>Ee.dim}),this.style(n),r));else if(n.isRetrying())s.push(...this.format(this.logger.suffix(n.title,{field:`RETRY:${n.message.retry.count}`,format:()=>Ee.yellow,condition:o.suffixRetries}),this.style(n),r));else if(n.isCompleted()&&n.hasTitle()&&Rl(i.timer?.condition,n.message.duration))s.push(...this.format(this.logger.suffix(n?.title,{...i.timer,args:[n.message.duration]}),this.style(n),r));else if(n.isPaused())s.push(...this.format(this.logger.suffix(n.title,{...o.pausedTimer,args:[n.message.paused-Date.now()]}),this.style(n),r));else s.push(...this.format(n.title,this.style(n),r));else s.push(...this.format(n.title,this.logger.icon("COMPLETED_WITH_SISTER_TASKS_FAILED"),r));if(!n.hasSubtasks()||!o.showSubtasks){if(n.hasFailed()&&o.collapseErrors===!1&&(o.showErrorMessage||!o.showSubtasks))s.push(...this.dump(n,r,"FAILED"));else if(n.isSkipped()&&o.collapseSkips===!1&&(o.showSkipMessage||!o.showSubtasks))s.push(...this.dump(n,r,"SKIPPED"))}if(n.isPending()||i.persistentOutput)s.push(...this.renderOutputBar(n,r));if(o.showSubtasks!==!1&&n.hasSubtasks()&&(n.isPending()||n.hasFinalized()&&!n.hasTitle()||n.isCompleted()&&o.collapseSubtasks===!1&&!n.subtasks.some((a)=>this.cache.rendererOptions.get(a.id)?.collapseSubtasks===!0)||n.subtasks.some((a)=>this.cache.rendererOptions.get(a.id)?.collapseSubtasks===!1)||n.subtasks.some((a)=>a.hasFailed())||n.subtasks.some((a)=>a.hasRolledBack())||n.subtasks.some((a)=>a.isCancelled()))){let a=!n.hasTitle()?r:r+1,c=this.renderer(n.subtasks,a);s.push(...c)}if(n.hasFinalized()){if(!i.persistentOutput)this.buffer.bottom.delete(n.id),this.buffer.output.delete(n.id)}if(n.isClosed())this.cache.render.set(n.id,s),this.reset(n);return s})}renderOutputBar(t,r){let n=this.buffer.output.get(t.id);if(!n)return[];return n.all.flatMap((o)=>this.dump(t,r,"OUTPUT",o.entry))}renderBottomBar(){if(this.buffer.bottom.size===0)return[];return Array.from(this.buffer.bottom.values()).flatMap((t)=>t.all).sort((t,r)=>t.time-r.time).map((t)=>t.entry)}renderPrompt(){if(!this.prompt)return[];return[this.prompt]}calculate(t){if(this.cache.rendererOptions.has(t.id)&&this.cache.rendererTaskOptions.has(t.id))return;let r={...this.options,...t.rendererOptions};this.cache.rendererOptions.set(t.id,r),this.cache.rendererTaskOptions.set(t.id,{...e.rendererTaskOptions,timer:r.timer,...t.rendererTaskOptions})}setupBuffer(t){if(this.buffer.bottom.has(t.id)||this.buffer.output.has(t.id))return;if(t.hasFinalized())return;let r=this.cache.rendererTaskOptions.get(t.id);if(this.shouldOutputToBottomBar(t)&&!this.buffer.bottom.has(t.id))this.buffer.bottom.set(t.id,new wv({limit:typeof r.bottomBar==="number"?r.bottomBar:1})),t.on("OUTPUT",(n)=>{let o=this.dump(t,-1,"OUTPUT",n);this.buffer.bottom.get(t.id).write(o.join(No))}),t.on("OUTPUT_RESET",()=>{this.buffer.bottom.get(t.id)?.reset()}),t.on("STATE",(n)=>{if(n==="RETRY"||n==="ROLLING_BACK")this.buffer.bottom.delete(t.id)});else if(this.shouldOutputToOutputBar(t)&&!this.buffer.output.has(t.id))this.buffer.output.set(t.id,new wv({limit:typeof r.outputBar==="number"?r.outputBar:1})),t.on("OUTPUT",(n)=>{this.buffer.output.get(t.id).write(n)}),t.on("OUTPUT_RESET",()=>{this.buffer.output.get(t.id)?.reset()}),t.on("STATE",(n)=>{if(n==="RETRY"||n==="ROLLING_BACK")this.buffer.output.delete(t.id)})}reset(t){this.cache.rendererOptions.delete(t.id),this.cache.rendererTaskOptions.delete(t.id),this.buffer.output.delete(t.id)}dump(t,r,n="OUTPUT",o){if(!o)switch(n){case"OUTPUT":o=t.output;break;case"SKIPPED":o=t.message.skip;break;case"FAILED":o=t.message.error}if(t.hasTitle()&&n==="FAILED"&&o===t.title||typeof o!=="string")return[];if(n==="OUTPUT")o=Dd(o);return this.format(o,this.style(t,!0),r+1)}indent(t,r){return r>0?E$(t.trimEnd(),this.options.indentation):t.trimEnd()}},Spe=class{tasks;options;static nonTTY=!0;static rendererOptions;static rendererTaskOptions;constructor(e,t){this.tasks=e,this.options=t}render(){}end(){}},Ape=class e{tasks;options;static nonTTY=!0;static rendererOptions={pausedTimer:{...Tv,field:(t)=>`PAUSED:${t}`,format:()=>Ee.yellowBright}};static rendererTaskOptions={};logger;cache={rendererOptions:new Map,rendererTaskOptions:new Map};constructor(t,r){if(this.tasks=t,this.options=r,this.options={...e.rendererOptions,...r,icon:{...db.icon,...r?.icon??{}},color:{...db.color,...r?.color??{}}},this.logger=this.options.logger??new mb({useIcons:!0,toStderr:O$}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color,this.options.timestamp)this.logger.options.fields.prefix.unshift(this.options.timestamp)}end(){}render(){this.renderer(this.tasks)}renderer(t){t.forEach((r)=>{this.calculate(r),r.once("CLOSED",()=>{this.reset(r)});let n=this.cache.rendererOptions.get(r.id),o=this.cache.rendererTaskOptions.get(r.id);r.on("SUBTASK",(i)=>{this.renderer(i)}),r.on("STATE",(i)=>{if(!r.hasTitle())return;if(i==="STARTED")this.logger.log("STARTED",r.title);else if(i==="COMPLETED"){let s=o?.timer;this.logger.log("COMPLETED",r.title,s&&{suffix:{...s,condition:!!r.message?.duration&&s.condition,args:[r.message.duration]}})}else if(i==="PROMPT")this.logger.process.hijack(),r.on("PROMPT",(s)=>{this.logger.process.toStderr(s,!1)});else if(i==="PROMPT_COMPLETED")r.off("PROMPT"),this.logger.process.release();else if(i==="CANCELLED")this.logger.log("CANCELLED",r.title)}),r.on("OUTPUT",(i)=>{this.logger.log("OUTPUT",i)}),r.on("MESSAGE",(i)=>{if(i.error)this.logger.log("FAILED",r.title,{suffix:{field:`FAILED: ${i.error}`,format:()=>Ee.red}});else if(i.skip)this.logger.log("SKIPPED",r.title,{suffix:{field:`SKIPPED: ${i.skip}`,format:()=>Ee.yellow}});else if(i.rollback)this.logger.log("ROLLBACK",r.title,{suffix:{field:`ROLLBACK: ${i.rollback}`,format:()=>Ee.red}});else if(i.retry)this.logger.log("RETRY",r.title,{suffix:{field:`RETRY:${i.retry.count}`,format:()=>Ee.red}});else if(i.paused){let s=n?.pausedTimer;this.logger.log("PAUSED",r.title,s&&{suffix:{...s,condition:!!i?.paused&&s.condition,args:[i.paused-Date.now()]}})}})})}calculate(t){if(this.cache.rendererOptions.has(t.id)&&this.cache.rendererTaskOptions.has(t.id))return;let r={...this.options,...t.rendererOptions};this.cache.rendererOptions.set(t.id,r),this.cache.rendererTaskOptions.set(t.id,{...e.rendererTaskOptions,timer:r.timer,...t.rendererTaskOptions})}reset(t){this.cache.rendererOptions.delete(t.id),this.cache.rendererTaskOptions.delete(t.id)}},Cpe=class{options;constructor(e){this.options=e}serialize(e,t,r){return JSON.stringify(this.generate(e,t,r))}generate(e,t,r){let n={event:e,data:t};if(typeof this.options?.task!=="boolean"){let o=Object.fromEntries(this.options.task.map((i)=>{let s=r[i];if(typeof s==="function")return[i,s.call(r)];return[i,s]}));if(Object.keys(r).length>0)n.task=o}return n}},Dpe=class e{tasks;options;static nonTTY=!0;static rendererOptions={subtasks:!0,state:Object.values(fpe),output:!0,prompt:!0,title:!0,messages:["skip","error","retry","rollback","paused"],messagesToStderr:["error","rollback","retry"],task:["hasRolledBack","isRollingBack","isCompleted","isSkipped","hasFinalized","hasSubtasks","title","hasReset","hasTitle","isPrompt","isPaused","isPending","isCancelled","isStarted","hasFailed","isEnabled","isRetrying","path"]};static rendererTaskOptions;logger;serializer;constructor(t,r){this.tasks=t,this.options=r,this.options={...e.rendererOptions,...this.options},this.logger=this.options.logger??new mb({useIcons:!1}),this.serializer=new Cpe(this.options)}render(){this.renderer(this.tasks)}end(){}renderer(t){t.forEach((r)=>{if(this.options.subtasks)r.on("SUBTASK",(n)=>{this.renderer(n)});if(this.options.state)r.on("STATE",(n)=>{this.logger.toStdout(this.serializer.serialize("STATE",n,r))});if(this.options.output)r.on("OUTPUT",(n)=>{this.logger.toStdout(this.serializer.serialize("OUTPUT",n,r))});if(this.options.prompt)r.on("PROMPT",(n)=>{this.logger.toStdout(this.serializer.serialize("PROMPT",n,r))});if(this.options.title)r.on("TITLE",(n)=>{this.logger.toStdout(this.serializer.serialize("TITLE",n,r))});r.on("MESSAGE",(n)=>{let o=Object.fromEntries(Object.entries(n).map(([i,s])=>{if(this.options.messages.includes(i))return[i,s]}).filter(Boolean));if(Object.keys(o).length>0){let i=this.serializer.serialize("MESSAGE",o,r);if(this.options.messagesToStderr.some((s)=>Object.keys(o).includes(s)))this.logger.toStderr(i);else this.logger.toStdout(i)}})})}},Ipe=class e{tasks;options;static nonTTY=!0;static rendererOptions={logTitleChange:!1,pausedTimer:{...Tv,format:()=>Ee.yellowBright}};static rendererTaskOptions;logger;cache={rendererOptions:new Map,rendererTaskOptions:new Map};constructor(t,r){if(this.tasks=t,this.options=r,this.options={...e.rendererOptions,...this.options,icon:{...db.icon,...r?.icon??{}},color:{...db.color,...r?.color??{}}},this.logger=this.options.logger??new mb({useIcons:!1,toStderr:O$}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color,this.options.timestamp)this.logger.options.fields.prefix.unshift(this.options.timestamp)}render(){this.renderer(this.tasks)}end(){}renderer(t){t.forEach((r)=>{this.calculate(r),r.once("CLOSED",()=>{this.reset(r)});let n=this.cache.rendererOptions.get(r.id),o=this.cache.rendererTaskOptions.get(r.id);if(r.on("SUBTASK",(i)=>{this.renderer(i)}),r.on("STATE",(i)=>{if(!r.hasTitle())return;if(i==="STARTED")this.logger.log("STARTED",r.title);else if(i==="COMPLETED"){let s=o.timer;this.logger.log("COMPLETED",r.title,s&&{suffix:{...s,condition:!!r.message?.duration&&s.condition,args:[r.message.duration]}})}else if(i==="CANCELLED")this.logger.log("CANCELLED",r.title)}),r.on("OUTPUT",(i)=>{this.logger.log("OUTPUT",i)}),r.on("PROMPT",(i)=>{let s=Dd(i);if(s)this.logger.log("PROMPT",s)}),this.options?.logTitleChange!==!1)r.on("TITLE",(i)=>{this.logger.log("TITLE",i)});r.on("MESSAGE",(i)=>{if(i?.error)this.logger.log("FAILED",i.error);else if(i?.skip)this.logger.log("SKIPPED",i.skip);else if(i?.rollback)this.logger.log("ROLLBACK",i.rollback);else if(i?.retry)this.logger.log("RETRY",r.title,{suffix:i.retry.count.toString()});else if(i?.paused){let s=n?.pausedTimer;this.logger.log("PAUSED",r.title,s&&{suffix:{...s,condition:!!i?.paused&&s.condition,args:[i.paused-Date.now()]}})}})})}calculate(t){if(this.cache.rendererOptions.has(t.id)&&this.cache.rendererTaskOptions.has(t.id))return;let r={...this.options,...t.rendererOptions};this.cache.rendererOptions.set(t.id,r),this.cache.rendererTaskOptions.set(t.id,{...e.rendererTaskOptions,timer:r.timer,...t.rendererTaskOptions})}reset(t){this.cache.rendererOptions.delete(t.id),this.cache.rendererTaskOptions.delete(t.id)}},xv={default:vpe,simple:Ape,verbose:Ipe,test:Dpe,silent:Spe};function Ope(e){return process.stdout.isTTY===!0||e.nonTTY===!0}function fb(e){if(typeof e==="string")return xv[e]??xv.default;return typeof e==="function"?e:xv.default}function kpe(e){if(Rl(e?.silentRendererCondition))return{renderer:fb("silent"),selection:"SILENT"};let t={renderer:fb(e.renderer),options:e.rendererOptions,selection:"PRIMARY"};if(!Ope(t.renderer)||Rl(e?.fallbackRendererCondition))return{renderer:fb(e.fallbackRenderer),options:e.fallbackRendererOptions,selection:"SECONDARY"};return t}function Rl(e,...t){if(typeof e==="function")return e(...t);else return e}var Rpe=class{concurrency;count;queue;constructor(e){this.concurrency=e.concurrency,this.count=0,this.queue=new Set}add(e){if(this.count<this.concurrency)return this.run(e);return new Promise((t)=>{let r=()=>t(this.run(e));this.queue.add(r)})}flush(){for(let e of this.queue){if(this.count>=this.concurrency)break;this.queue.delete(e),e()}}run(e){this.count++;let t=e(),r=()=>{this.count--,this.flush()};return t.then(r,()=>{this.queue.clear()}),t}};function Ppe(e){return new Promise((t)=>{setTimeout(t,e)})}var _pe=class{task;constructor(e){this.task=e}get title(){return this.task.title}set title(e){e=Array.isArray(e)?e:[e],this.task.title$=Cd(e.shift(),...e)}get output(){return this.task.output}set output(e){if(e===null){this.task.outputReset$=null;return}e=Array.isArray(e)?e:[e],this.task.output$=Cd(e.shift(),...e)}set promptOutput(e){this.task.promptOutput$=e}get signal(){return this.task.listr.signal}cancel(){this.task.listr.cancel()}newListr(e,t){let r;if(typeof e==="function")r=e(this);else r=e;return new Pl(r,t,this.task)}report(e,t){if(this.task.options.collectErrors)this.task.listr.errors?.push(new dpe(e,t,this.task));this.task.message$={error:e.message??this.task?.title}}skip(e,...t){if(this.task.state$="SKIPPED",e)this.task.message$={skip:e?Cd(e,...t):this.task?.title}}isRetrying(){return this.task.isRetrying()?this.task.retry:{count:0}}prompt(e){if(this.task.prompt)return this.task.prompt;return new e(this.task,this)}stdout(e){return wpe((t)=>{switch(e){case"PROMPT":this.promptOutput=t;break;default:this.output=t}})}run(e){return this.task.run(e,this)}},Bpe=class extends C${},Npe=class extends Bpe{listr;task;options;rendererOptions;rendererTaskOptions;id=ppe();state="WAITING";subtasks;title;initialTitle;output;retry;message={};prompt;parent;enabled;taskFn;closed;constructor(e,t,r,n,o){super();if(this.listr=e,this.task=t,this.options=r,this.rendererOptions=n,this.rendererTaskOptions=o,t.title){let i=Array.isArray(t?.title)?t.title:[t.title];this.title=Cd(i.shift(),...i),this.initialTitle=this.title}this.taskFn=t.task,this.parent=e.parentTask}set state$(e){if(this.state=e,this.emit("STATE",e),this.hasSubtasks()&&this.hasFailed()){for(let t of this.subtasks)if(t.state==="STARTED")t.state$="FAILED"}this.listr.events.emit("SHOUD_REFRESH_RENDER")}set output$(e){this.output=e,this.emit("OUTPUT",e),this.listr.events.emit("SHOUD_REFRESH_RENDER")}set outputReset$(e){this.output=e,this.emit("OUTPUT_RESET"),this.listr.events.emit("SHOUD_REFRESH_RENDER")}set promptOutput$(e){if(this.emit("PROMPT",e),Dd(e))this.listr.events.emit("SHOUD_REFRESH_RENDER")}set message$(e){this.message={...this.message,...e},this.emit("MESSAGE",e),this.listr.events.emit("SHOUD_REFRESH_RENDER")}set title$(e){this.title=e,this.emit("TITLE",e),this.listr.events.emit("SHOUD_REFRESH_RENDER")}get path(){return[...this.listr.path,this.initialTitle]}async check(e){if(this.state==="WAITING")this.enabled=await Rl(this.task?.enabled??!0,e),this.emit("ENABLED",this.enabled),this.listr.events.emit("SHOUD_REFRESH_RENDER");return this.enabled}hasSubtasks(){return this.subtasks?.length>0}hasFinalized(){return this.isCompleted()||this.hasFailed()||this.isSkipped()||this.hasRolledBack()||this.isCancelled()}isPending(){return this.isStarted()||this.isPrompt()||this.hasReset()}isStarted(){return this.state==="STARTED"}isSkipped(){return this.state==="SKIPPED"}isCompleted(){return this.state==="COMPLETED"}hasFailed(){return this.state==="FAILED"}isCancelled(){return this.state==="CANCELLED"}isRollingBack(){return this.state==="ROLLING_BACK"}hasRolledBack(){return this.state==="ROLLED_BACK"}isRetrying(){return this.state==="RETRY"}hasReset(){return this.state==="RETRY"||this.state==="ROLLING_BACK"}isEnabled(){return this.enabled}hasTitle(){return typeof this?.title==="string"}isPrompt(){return this.state==="PROMPT"}isPaused(){return this.state==="PAUSED"}isClosed(){return this.closed}async pause(e){let t=this.state;this.state$="PAUSED",this.message$={paused:Date.now()+e},await Ppe(e),this.state$=t,this.message$={paused:null}}async run(e,t){let r=(i)=>{if(i instanceof Pl)i.options={...this.options,...i.options},i.rendererClass=fb("silent"),this.subtasks=i.tasks,i.errors=this.listr.errors,this.emit("SUBTASK",this.subtasks),i=i.run(e);else if(i instanceof Promise)i=i.then(r);else if(ype(i))i=new Promise((s,a)=>{i.on("data",(c)=>{this.output$=c.toString()}),i.on("error",(c)=>a(c)),i.on("end",()=>s(null))});else if(hpe(i))i=new Promise((s,a)=>{i.subscribe({next:(c)=>{this.output$=c},error:a,complete:s})});return i},n=Date.now();this.state$="STARTED";let o=await Rl(this.task?.skip??!1,e);if(o){if(typeof o==="string")this.message$={skip:o};else if(this.hasTitle())this.message$={skip:this.title};else this.message$={skip:"Skipped task without a title."};this.state$="SKIPPED";return}try{let i=typeof this.task?.retry==="number"&&this.task.retry>0?this.task.retry+1:typeof this.task?.retry==="object"&&this.task.retry.tries>0?this.task.retry.tries+1:1,s=typeof this.task.retry==="object"&&this.task.retry.delay;for(let a=1;a<=i;a++)try{await Promise.race([r(this.taskFn(e,t)),this.whenInterrupted()]);break}catch(c){if(this.listr.signal.aborted)throw c;if(a!==i){if(this.retry={count:a,error:c},this.message$={retry:this.retry},this.title$=this.initialTitle,this.output=void 0,t.report(c,"WILL_RETRY"),this.state$="RETRY",s)await this.pause(s)}else throw c}if(this.isStarted()||this.isRetrying())this.message$={duration:Date.now()-n},this.state$="COMPLETED"}catch(i){if(this.prompt instanceof mpe)i=this.prompt;if(this.task?.rollback){t.report(i,"WILL_ROLLBACK");try{this.state$="ROLLING_BACK",await this.task.rollback(e,t),this.message$={rollback:this.title},this.state$="ROLLED_BACK"}catch(s){throw this.state$="FAILED",t.report(s,"HAS_FAILED_TO_ROLLBACK"),this.close(),s}if(this.listr.options?.exitAfterRollback!==!1)throw this.close(),i}else{if(this.listr.signal.aborted)throw this.state$="CANCELLED",i;if(this.state$="FAILED",this.listr.options.exitOnError!==!1&&await Rl(this.task?.exitOnError,e)!==!1)throw t.report(i,"HAS_FAILED"),this.close(),i;else if(!this.hasSubtasks())t.report(i,"HAS_FAILED_WITHOUT_ERROR")}}finally{this.close()}}close(){this.emit("CLOSED"),this.listr.events.emit("SHOUD_REFRESH_RENDER"),this.complete()}whenInterrupted(){return new Promise((e,t)=>{let r=()=>{if(!this.hasSubtasks())t(Error("Interrupted."))};if(this.listr.signal.aborted){r();return}this.listr.signal.addEventListener("abort",r,{once:!0})})}},A$=class extends C${},Pl=class{task;options;parentTask;tasks=[];errors;ctx;events;path=[];rendererClass;rendererClassOptions;rendererSelection;boundSignalHandler;signal;concurrency;renderer;abortController;startedTasks=[];constructor(e,t,r){if(this.task=e,this.options=t,this.parentTask=r,this.options={concurrent:!1,renderer:"default",fallbackRenderer:"simple",exitOnError:!0,exitAfterRollback:!0,collectErrors:!1,registerSignalListeners:!0,...this.parentTask?.options??{},...t},this.options.concurrent===!0)this.options.concurrent=1/0;else if(typeof this.options.concurrent!=="number")this.options.concurrent=1;if(this.concurrency=new Rpe({concurrency:this.options.concurrent}),r)this.path=[...r.listr.path,r.title],this.errors=r.listr.errors;else this.errors=this.options.collectErrors?[]:null;if(this.parentTask?.listr.events instanceof A$)this.events=this.parentTask.listr.events;else this.events=new A$;if(this.parentTask?.listr.abortController instanceof AbortController)this.abortController=this.parentTask.listr.abortController;else this.abortController=new AbortController,ipe(0,this.abortController.signal);if(this.signal=this.abortController.signal,this.options?.forceTTY||process.env.LISTR_FORCE_TTY)process.stdout.isTTY=!0,process.stderr.isTTY=!0;if(this.options?.forceUnicode)process.env.LISTR_FORCE_UNICODE="1";let n=kpe({renderer:this.options.renderer,rendererOptions:this.options.rendererOptions,fallbackRenderer:this.options.fallbackRenderer,fallbackRendererOptions:this.options.fallbackRendererOptions,fallbackRendererCondition:this.options?.fallbackRendererCondition,silentRendererCondition:this.options?.silentRendererCondition});if(this.rendererClass=n.renderer,this.rendererClassOptions=n.options,this.rendererSelection=n.selection,this.add(e??[]),this.options.registerSignalListeners&&this.isRoot())this.boundSignalHandler=this.signalHandler.bind(this),process.on("SIGINT",this.boundSignalHandler).setMaxListeners(0)}isRoot(){return!this.parentTask}isSubtask(){return!!this.parentTask}add(e){this.tasks.push(...this.generate(e))}async run(e){if(!this.renderer)this.renderer=new this.rendererClass(this.tasks,this.rendererClassOptions,this.events);await this.renderer.render(),this.ctx=this.options?.ctx??e??{};let t,r=!1;try{await Promise.all(this.tasks.map((n)=>n.check(this.ctx))),await Promise.all(this.tasks.map((n)=>this.concurrency.add(()=>this.runTask(n))))}catch(n){r=!0,t=n}if(this.signal.aborted){if(await Promise.allSettled(this.startedTasks),this.isRoot())return this.cancelUnfinishedTasks(),this.renderer.end(),this.removeSignalHandler(),process.exit(127),this.ctx;throw t??Error("Interrupted.")}if(r&&this.options.exitOnError!==!1)throw this.renderer.end(t),this.removeSignalHandler(),t;if(!r)this.renderer.end(),this.removeSignalHandler();return this.ctx}cancel(){this.abortController.abort()}generate(e){return e=Array.isArray(e)?e:[e],e.map((t)=>{let r;if(this.rendererSelection==="PRIMARY")r=t.rendererOptions;else if(this.rendererSelection==="SECONDARY")r=t.fallbackRendererOptions;return new Npe(this,t,this.options,this.rendererClassOptions,r)})}async runTask(e){if(!await e.check(this.ctx))return;let t=new _pe(e).run(this.ctx);return this.startedTasks.push(t),t}signalHandler(){this.abortController.abort()}removeSignalHandler(){if(this.boundSignalHandler)process.removeListener("SIGINT",this.boundSignalHandler)}cancelUnfinishedTasks(e=this.tasks){for(let t of e){if(t.hasSubtasks())this.cancelUnfinishedTasks(t.subtasks);if(t.isEnabled()!==!1&&!t.hasFinalized())t.state$="CANCELLED"}}};var Fpe=Object.prototype.toString,Mpe=(e)=>Fpe.call(e)==="[object Error]",Lpe=new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function Ev(e){if(!(e&&Mpe(e)&&e.name==="TypeError"&&typeof e.message==="string"))return!1;let{message:r,stack:n}=e;if(r==="Load failed"||r.startsWith("Load failed (")&&r.endsWith(")"))return n===void 0||"__sentry_captured__"in e;if(r.startsWith("error sending request for url"))return!0;if(r==="Failed to fetch"||r.startsWith("Failed to fetch (")&&r.endsWith(")"))return!0;return Lpe.has(r)}function $pe(e){if(typeof e==="number"){if(e<0)throw TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(e))throw TypeError("Expected `retries` to be a valid number or Infinity, got NaN.");if(Number.isFinite(e)&&!Number.isInteger(e))throw TypeError("Expected `retries` to be a non-negative integer or Infinity.")}else if(e!==void 0)throw TypeError("Expected `retries` to be a number or Infinity.")}function hb(e,t,{min:r=0,allowInfinity:n=!1}={}){if(t===void 0)return;if(typeof t!=="number"||Number.isNaN(t))throw TypeError(`Expected \`${e}\` to be a number${n?" or Infinity":""}.`);if(!n&&!Number.isFinite(t))throw TypeError(`Expected \`${e}\` to be a finite number.`);if(t<r)throw TypeError(`Expected \`${e}\` to be ≥ ${r}.`)}function vv(e,t){if(t===void 0)return;if(typeof t!=="function")throw TypeError(`Expected \`${e}\` to be a function.`)}class gb extends Error{constructor(e){super();if(e instanceof Error)this.originalError=e,{message:e}=e;else this.originalError=Error(e),this.originalError.stack=this.stack;this.name="AbortError",this.message=e}}function Upe(e,t){let r=Math.max(1,e+1),n=t.randomize?Math.random()+1:1,o=Math.round(n*t.minTimeout*t.factor**(r-1));return o=Math.min(o,t.maxTimeout),o}function yb(e,t){if(!Number.isFinite(t))return t;return t-(performance.now()-e)}async function Hpe(e,t){if(e<=0)return;await new Promise((r,n)=>{let o=()=>{clearTimeout(i),t.signal?.removeEventListener("abort",o),n(t.signal.reason)},i=setTimeout(()=>{t.signal?.removeEventListener("abort",o),r()},e);if(t.unref)i.unref?.();t.signal?.addEventListener("abort",o,{once:!0})})}async function jpe({error:e,attemptNumber:t,retriesConsumed:r,startTime:n,options:o}){let i=e instanceof Error?e:TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(i instanceof gb)throw i.originalError;let s=Number.isFinite(o.retries)?Math.max(0,o.retries-r):o.retries,a=o.maxRetryTime??Number.POSITIVE_INFINITY,c=Upe(r,o);if(yb(n,a)<=0){let g=Object.freeze({error:i,attemptNumber:t,retriesLeft:s,retriesConsumed:r,retryDelay:0});throw await o.onFailedAttempt(g),i}let l=Object.freeze({error:i,attemptNumber:t,retriesLeft:s,retriesConsumed:r,retryDelay:s>0?c:0}),p=await o.shouldConsumeRetry(l),f=p&&s>0?c:0,d=Object.freeze({error:i,attemptNumber:t,retriesLeft:s,retriesConsumed:r,retryDelay:f});if(await o.onFailedAttempt(d),yb(n,a)<=0)throw i;if(yb(n,a)<=0||s<=0)throw i;if(i instanceof TypeError&&!Ev(i))throw i;if(!await o.shouldRetry(d))throw i;let m=yb(n,a);if(m<=0)throw i;if(!p)return o.signal?.throwIfAborted(),!1;let y=Math.min(f,m);return o.signal?.throwIfAborted(),await Hpe(y,o),o.signal?.throwIfAborted(),!0}async function Id(e,t={}){if(t={...t},$pe(t.retries),Object.hasOwn(t,"forever"))throw Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");if(t.retries??=10,t.factor??=2,t.minTimeout??=1000,t.maxTimeout??=Number.POSITIVE_INFINITY,t.maxRetryTime??=Number.POSITIVE_INFINITY,t.randomize??=!1,t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.shouldConsumeRetry??=()=>!0,vv("onFailedAttempt",t.onFailedAttempt),vv("shouldRetry",t.shouldRetry),vv("shouldConsumeRetry",t.shouldConsumeRetry),hb("factor",t.factor,{min:0,allowInfinity:!1}),hb("minTimeout",t.minTimeout,{min:0,allowInfinity:!1}),hb("maxTimeout",t.maxTimeout,{min:0,allowInfinity:!0}),hb("maxRetryTime",t.maxRetryTime,{min:0,allowInfinity:!0}),!(t.factor>0))t.factor=1;t.signal?.throwIfAborted();let r=0,n=0,o=performance.now();while(Number.isFinite(t.retries)?n<=t.retries:!0){r++;try{t.signal?.throwIfAborted();let i=await e(r);return t.signal?.throwIfAborted(),i}catch(i){if(await jpe({error:i,attemptNumber:r,retriesConsumed:n,startTime:o,options:t}))n++}}throw Error("Retry attempts exhausted without throwing an error.")}var exe=ES(),txe=Gd(),rxe=sS(),BS=Vd(),nxe=Rd(),Bs=xe(),oxe=Os(),ixe=ft(),sxe=Rs(),axe=Ps(),Kqt=rx(),cxe=RS(),uxe=PS(),lxe=_S(),sx=MU(),LU=Od();var pxe=exe.Composer,fxe=txe.Document,dxe=rxe.Schema,{YAMLError:mxe,YAMLParseError:hxe,YAMLWarning:yxe}=BS,gxe=nxe.Alias,{isAlias:bxe,isCollection:xxe,isDocument:wxe,isMap:Txe,isNode:Exe,isPair:vxe,isScalar:Sxe,isSeq:Axe}=Bs,Cxe=oxe.Pair,Dxe=ixe.Scalar,Ixe=sxe.YAMLMap,Oxe=axe.YAMLSeq;var kxe=cxe.Lexer,Rxe=uxe.LineCounter,Pxe=lxe.Parser,{parse:_xe,parseAllDocuments:Bxe,parseDocument:Nxe,stringify:ax}=sx,{visit:Fxe,visitAsync:Mxe}=LU;var Qt={start_period:"10s",start_interval:"200ms",interval:"10s",timeout:"1s",retries:5};var Lxe=(e)=>{let t=e?.blockTime??2,r=e?.imageTag??"latest",n=e?.forkConfig,o=n?["anvil","--chain-id","31337","--block-time",t.toString(),"--fork-url",n.url,...n.blockNumber!==void 0?["--fork-block-number",n.blockNumber.toString()]:[]]:["devnet","--block-time",t.toString()],i=n?.blockNumber?["CMD","eth_isready",n.blockNumber?.toString()]:["CMD","eth_isready"];return{image:`cartesi/sdk:${r}`,command:o,healthcheck:{...Qt,test:i},environment:{ANVIL_IP_ADDR:"0.0.0.0"}}},$xe=()=>({name:"anvil-proxy",content:`http:
535
+ routers:
536
+ anvil:
537
+ rule: "PathPrefix(\`/anvil\`)"
538
+ middlewares:
539
+ - "remove-anvil-prefix"
540
+ service: anvil
541
+ middlewares:
542
+ remove-anvil-prefix:
543
+ replacePathRegex:
544
+ regex: "^/anvil(.*)"
545
+ replacement: "$1"
546
+ services:
547
+ anvil:
548
+ loadBalancer:
549
+ servers:
550
+ - url: "http://anvil:8545"`}),$U=(e)=>({configs:{anvil_proxy:$xe()},services:{anvil:Lxe(e),proxy:{configs:[{source:"anvil_proxy",target:"/etc/traefik/conf.d/anvil.yaml"}]}}});var UU=(e)=>{if(e.length===0)return{};return e.reduce((t,r)=>Uxe(t,r),{})};function Uxe(e,t){let r={...e};if(t.name!==void 0)r.name=t.name;if(t.include)r.include=gn(e.include,t.include);if(t.services)r.services=zl(e.services||{},t.services,(n,o)=>Hxe(n,o));if(t.networks)r.networks=zl(e.networks||{},t.networks,(n,o)=>Vxe(n,o));if(t.volumes)r.volumes=zl(e.volumes||{},t.volumes,(n,o)=>Wxe(n,o));if(t.secrets)r.secrets=zl(e.secrets||{},t.secrets,(n,o)=>Kxe(n,o));if(t.configs)r.configs=zl(e.configs||{},t.configs,(n,o)=>Yxe(n,o));if(t.models)r.models=zl(e.models||{},t.models,(n,o)=>({...n,...o}));return r}function zl(e,t,r){let n={...e};for(let[o,i]of Object.entries(t)){let s=n[o];if(s!==void 0)n[o]=r(s,i);else n[o]=i}return n}function Hxe(e,t){let r={...e};if(t.command!==void 0)r.command=t.command;if(t.entrypoint!==void 0)r.entrypoint=t.entrypoint;if(t.healthcheck?.test!==void 0)r.healthcheck={...e.healthcheck,test:t.healthcheck.test};if(t.healthcheck)r.healthcheck={...e.healthcheck,...t.healthcheck,test:t.healthcheck.test??e.healthcheck?.test};if(t.ports)r.ports=jxe(e.ports||[],t.ports);if(t.volumes)r.volumes=qxe(e.volumes||[],t.volumes);if(t.secrets)r.secrets=zxe(e.secrets||[],t.secrets);if(t.configs)r.configs=Gxe(e.configs||[],t.configs);if(t.expose)r.expose=gn(e.expose,t.expose);if(t.depends_on)if(Array.isArray(t.depends_on))r.depends_on=gn(Array.isArray(e.depends_on)?e.depends_on:[],t.depends_on);else r.depends_on={...typeof e.depends_on==="object"&&!Array.isArray(e.depends_on)?e.depends_on:{},...t.depends_on};if(t.dns)r.dns=gn(Array.isArray(e.dns)?e.dns:e.dns?[e.dns]:[],Array.isArray(t.dns)?t.dns:[t.dns]);if(t.dns_search)r.dns_search=gn(Array.isArray(e.dns_search)?e.dns_search:e.dns_search?[e.dns_search]:[],Array.isArray(t.dns_search)?t.dns_search:[t.dns_search]);if(t.dns_opt)r.dns_opt=gn(e.dns_opt||[],t.dns_opt);if(t.env_file){let o=Array.isArray(e.env_file)?e.env_file:e.env_file?[e.env_file]:[],i=Array.isArray(t.env_file)?t.env_file:[t.env_file];r.env_file=[...o,...i]}if(t.labels)if(Array.isArray(t.labels))r.labels=gn(Array.isArray(e.labels)?e.labels:[],t.labels);else r.labels={...typeof e.labels==="object"&&!Array.isArray(e.labels)?e.labels:{},...t.labels};if(t.extra_hosts)if(Array.isArray(t.extra_hosts))r.extra_hosts=gn(Array.isArray(e.extra_hosts)?e.extra_hosts:[],t.extra_hosts);else r.extra_hosts={...typeof e.extra_hosts==="object"&&!Array.isArray(e.extra_hosts)?e.extra_hosts:{},...t.extra_hosts};if(t.sysctls)if(Array.isArray(t.sysctls))r.sysctls=gn(Array.isArray(e.sysctls)?e.sysctls:[],t.sysctls);else r.sysctls={...typeof e.sysctls==="object"&&!Array.isArray(e.sysctls)?e.sysctls:{},...t.sysctls};if(t.environment)if(Array.isArray(t.environment))r.environment=gn(Array.isArray(e.environment)?e.environment:[],t.environment);else r.environment={...typeof e.environment==="object"&&!Array.isArray(e.environment)?e.environment:{},...t.environment};if(t.networks)if(Array.isArray(t.networks))r.networks=gn(Array.isArray(e.networks)?e.networks:[],t.networks);else r.networks={...typeof e.networks==="object"&&!Array.isArray(e.networks)?e.networks:{},...t.networks};let n=["image","build","restart","container_name","hostname","network_mode","pid","ipc","deploy","develop","working_dir","user","cap_add","cap_drop","devices","external_links","gpus","group_add","mem_limit","mem_reservation","memswap_limit","oom_kill_disable","oom_score_adj","privileged","read_only","shm_size","stdin_open","tty","ulimits","volumes_from","cpus","cpuset","cpu_shares","cpu_quota","cpu_period","cpu_count","cpu_percent","annotations","cgroup","cgroup_parent","domainname","init","isolation","links","mac_address","platform","security_opt","stop_grace_period","stop_signal","tmpfs","attach","extends","provider","blkio_config","credential_spec","device_cgroup_rules","logging"];for(let o of n)if(t[o]!==void 0)r[o]=t[o];return r}function gn(e,t){return[...e||[],...t]}function jxe(e,t){let r=[...e],n=new Set;for(let o of e)n.add(NS(o));for(let o of t){let i=NS(o);if(!n.has(i))r.push(o),n.add(i);else{let s=r.findIndex((a)=>NS(a)===i);if(s!==-1)r[s]=o}}return r}function NS(e){if(typeof e==="string"){let i=e.split(":"),s=i[1]||"",[a,c]=s.split("/");return`${i[0]||""}:${a||""}:${c||"tcp"}`}let t=e.host_ip||"",r=e.target.toString(),n=e.published?.toString()||"",o=e.protocol||"tcp";return`${t}:${r}:${n}:${o}`}function qxe(e,t){let r=[...e],n=new Set;for(let o of e)n.add(FS(o));for(let o of t){let i=FS(o);if(!n.has(i))r.push(o),n.add(i);else{let s=r.findIndex((a)=>FS(a)===i);if(s!==-1)r[s]=o}}return r}function FS(e){if(typeof e==="string"){let t=e.split(":");return t[t.length-1]||e}return e.target}function zxe(e,t){let r=[...e],n=new Set;for(let o of e)n.add(MS(o));for(let o of t){let i=MS(o);if(!n.has(i))r.push(o),n.add(i);else{let s=r.findIndex((a)=>MS(a)===i);if(s!==-1)r[s]=o}}return r}function MS(e){if(typeof e==="string")return e;return e.target||e.source}function Gxe(e,t){let r=[...e],n=new Set;for(let o of e)n.add(LS(o));for(let o of t){let i=LS(o);if(!n.has(i))r.push(o),n.add(i);else{let s=r.findIndex((a)=>LS(a)===i);if(s!==-1)r[s]=o}}return r}function LS(e){if(typeof e==="string")return e;return e.target||e.source}function Vxe(e,t){return{...e,...t,ipam:t.ipam?{...e.ipam,...t.ipam,config:t.ipam.config?gn(e.ipam?.config,t.ipam.config):e.ipam?.config}:e.ipam,external:t.external!==void 0?t.external:e.external}}function Wxe(e,t){return{...e,...t,external:t.external!==void 0?t.external:e.external}}function Kxe(e,t){return{...e,...t,external:t.external!==void 0?t.external:e.external}}function Yxe(e,t){return{...e,...t,external:t.external!==void 0?t.external:e.external}}var Zxe=(e)=>({image:`cartesi/sdk:${e.imageTag??"latest"}`,command:["alto","--entrypoints","0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789,0x0000000071727De22E5E9d8BAf0edAc6f37da032","--log-level","info","--rpc-url","http://anvil:8545","--min-executor-balance","0","--utility-private-key","0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97","--executor-private-keys","0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6,0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356,0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e,0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba,0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a","--safe-mode","false","--port","4337","--public-client-log-level","error","--wallet-client-log-level","error","--enable-debug-endpoints"],healthcheck:{...Qt,test:["CMD","curl","-fsS","http://127.0.0.1:4337/health"]}}),Jxe=()=>({name:"bundler-proxy",content:`http:
551
+ routers:
552
+ bundler:
553
+ rule: "PathPrefix(\`/bundler\`)"
554
+ middlewares:
555
+ - "cors"
556
+ - "remove-bundler-prefix"
557
+ service: bundler
558
+ middlewares:
559
+ cors:
560
+ headers:
561
+ accessControlAllowMethods:
562
+ - GET
563
+ - OPTIONS
564
+ - PUT
565
+ accessControlAllowHeaders: "*"
566
+ accessControlAllowOriginList:
567
+ - "*"
568
+ accessControlMaxAge: 100
569
+ addVaryHeader: true
570
+ remove-bundler-prefix:
571
+ replacePathRegex:
572
+ regex: "^/bundler/(.*)"
573
+ replacement: "/$1"
574
+ services:
575
+ bundler:
576
+ loadBalancer:
577
+ servers:
578
+ - url: "http://bundler:4337"`}),HU=(e)=>({configs:{bundler_proxy:Jxe()},services:{bundler:Zxe(e),proxy:{configs:[{source:"bundler_proxy",target:"/etc/traefik/conf.d/bundler.yaml"}]}}});var Xxe=(e)=>({image:`cartesi/rollups-database:${e?.imageTag??"latest"}`,healthcheck:{...Qt,test:["CMD-SHELL","pg_isready -U postgres || exit 1"]},environment:{POSTGRES_PASSWORD:e?.password}}),jU=(e)=>({services:{database:Xxe(e)}});var Qxe=(e)=>{let t=e.imageTag??"latest",r=e.port??6571,n=`http://127.0.0.1:${r}/anvil`,o=`http://127.0.0.1:${r}/rpc`;return{image:`cartesi/rollups-explorer:${t}`,environment:{NODE_RPC_URL:n,CARTESI_NODE_RPC_URL:o},expose:["3000"],healthcheck:{...Qt,test:["CMD","wget","--spider","-q","http://127.0.0.1:3000/explorer/api/healthz"]},depends_on:{anvil:{condition:"service_healthy"},rollups_node:{condition:"service_healthy"}}}},ewe=()=>({name:"explorer-proxy",content:`http:
579
+ routers:
580
+ explorer:
581
+ rule: "PathPrefix(\`/explorer\`)"
582
+ service: explorer
583
+ services:
584
+ explorer:
585
+ loadBalancer:
586
+ servers:
587
+ - url: "http://explorer:3000"`}),qU=(e)=>({configs:{explorer_proxy:ewe()},services:{explorer:Qxe(e),proxy:{configs:[{source:"explorer_proxy",target:"/etc/traefik/conf.d/explorer.yaml"}]}}});var twe="test test test test test test test test test test test junk",$S=["CARTESI_AUTH_KIND","CARTESI_AUTH_MNEMONIC","CARTESI_AUTH_MNEMONIC_ACCOUNT_INDEX","CARTESI_AUTH_MNEMONIC_FILE","CARTESI_AUTH_PRIVATE_KEY","CARTESI_AUTH_PRIVATE_KEY_FILE","CARTESI_BLOCKCHAIN_DEFAULT_BLOCK","CARTESI_BLOCKCHAIN_HTTP_AUTHORIZATION","CARTESI_BLOCKCHAIN_HTTP_ENDPOINT","CARTESI_BLOCKCHAIN_ID","CARTESI_CONTRACTS_APPLICATION_FACTORY_ADDRESS","CARTESI_CONTRACTS_AUTHORITY_FACTORY_ADDRESS","CARTESI_CONTRACTS_DAVE_APP_FACTORY_ADDRESS","CARTESI_CONTRACTS_INPUT_BOX_ADDRESS","CARTESI_CONTRACTS_QUORUM_FACTORY_ADDRESS","CARTESI_CONTRACTS_SELF_HOSTED_APPLICATION_FACTORY_ADDRESS","CARTESI_DATABASE_CONNECTION","CARTESI_LOG_LEVEL","CARTESI_LOG_LEVEL_ADVANCER","CARTESI_LOG_LEVEL_CLAIMER","CARTESI_LOG_LEVEL_EVM_READER","CARTESI_LOG_LEVEL_JSONRPC_API","CARTESI_LOG_LEVEL_PRT","CARTESI_LOG_LEVEL_VALIDATOR","CARTESI_JSONRPC_MACHINE_LOG_LEVEL","CARTESI_PRT_AUTH_KIND","CARTESI_PRT_AUTH_MNEMONIC","CARTESI_PRT_AUTH_MNEMONIC_ACCOUNT_INDEX","CARTESI_PRT_AUTH_MNEMONIC_FILE","CARTESI_PRT_AUTH_PRIVATE_KEY","CARTESI_PRT_AUTH_PRIVATE_KEY_FILE","CARTESI_SNAPSHOTS_DIR"],rwe=(e)=>$S.reduce((r,n)=>{let o=e?.[n];if(o!==void 0&&o!==null)r[n]=o;return r},{}),nwe=(e)=>{let t=e.databasePassword,r=e.databaseHost??"database",n=e.databasePort??5432,o=e.defaultBlock??"latest",i=e.imageTag??"latest",s=e.logLevel??"info",a=e.mnemonic??twe,c=e.prt??!1,u=e.forkChainId??31337,l;if(c)l=fl[u];let p={CARTESI_AUTH_MNEMONIC:a,CARTESI_AUTH_MNEMONIC_ACCOUNT_INDEX:"0",CARTESI_BLOCKCHAIN_DEFAULT_BLOCK:o,CARTESI_BLOCKCHAIN_HTTP_ENDPOINT:"http://anvil:8545",CARTESI_BLOCKCHAIN_ID:Wf.id.toString(),...l&&{CARTESI_CONTRACTS_DAVE_APP_FACTORY_ADDRESS:l},CARTESI_CONTRACTS_INPUT_BOX_ADDRESS:gl,CARTESI_CONTRACTS_SELF_HOSTED_APPLICATION_FACTORY_ADDRESS:Cg,CARTESI_DATABASE_CONNECTION:`postgres://postgres:${t}@${r}:${n}/rollupsdb?sslmode=disable`,CARTESI_LOG_LEVEL:s,CARTESI_PRT_AUTH_MNEMONIC:a,CARTESI_SNAPSHOTS_DIR:"/var/lib/cartesi-rollups-node/snapshots"},f=rwe(e.cartesiEnvironmentVariables),d=Object.assign({},p,f);return{image:`cartesi/rollups-runtime:${i}`,init:!0,depends_on:{database:{condition:"service_healthy"},anvil:{condition:"service_healthy"}},deploy:{resources:{limits:{cpus:e.cpus!==void 0?e.cpus.toString():void 0,memory:e.memory!==void 0?`${e.memory.toString()}M`:void 0}}},expose:["10000","10011","10012"],healthcheck:{...Qt,test:["CMD","curl","-fsS","http://127.0.0.1:10000/livez"]},command:["cartesi-rollups-node"],environment:{...d},volumes:["./.cartesi:/var/lib/cartesi-rollups-node/snapshots:ro"]}},owe=()=>({name:"rollups-node-proxy",content:`
588
+ http:
589
+ routers:
590
+ inspect_server:
591
+ rule: "PathPrefix(\`/inspect\`)"
592
+ middlewares:
593
+ - "cors"
594
+ service: inspect_server
595
+ rpc_server:
596
+ rule: "PathPrefix(\`/rpc\`)"
597
+ middlewares:
598
+ - "cors"
599
+ service: rpc_server
600
+ middlewares:
601
+ cors:
602
+ headers:
603
+ accessControlAllowMethods:
604
+ - GET
605
+ - OPTIONS
606
+ - POST
607
+ accessControlAllowHeaders:
608
+ - "Origin"
609
+ - "Content-Type"
610
+ - "Accept"
611
+ accessControlAllowOriginList:
612
+ - "*"
613
+ accessControlMaxAge: 86400
614
+ addVaryHeader: true
615
+ services:
616
+ inspect_server:
617
+ loadBalancer:
618
+ servers:
619
+ - url: "http://rollups_node:10012"
620
+ rpc_server:
621
+ loadBalancer:
622
+ servers:
623
+ - url: "http://rollups_node:10011"
624
+ `}),zU=(e)=>({services:{proxy:{configs:[{source:"rollups_node_proxy",target:"/etc/traefik/conf.d/rollups-node.yaml"}]},rollups_node:nwe(e)},configs:{rollups_node_proxy:owe()}});var iwe=(e)=>({image:`cartesi/sdk:${e.imageTag??"latest"}`,command:["passkey-server"],healthcheck:{...Qt,test:["CMD","curl","-fsS","http://127.0.0.1:3000/health"]}}),swe=()=>({name:"passkey-proxy",content:`http:
625
+ routers:
626
+ passkey_server:
627
+ rule: "PathPrefix(\`/passkey\`)"
628
+ middlewares:
629
+ - "remove-passkey-server-prefix"
630
+ service: passkey_server
631
+ middlewares:
632
+ remove-passkey-server-prefix:
633
+ replacePathRegex:
634
+ regex: "^/passkey/(.*)"
635
+ replacement: "/$1"
636
+ services:
637
+ passkey_server:
638
+ loadBalancer:
639
+ servers:
640
+ - url: "http://passkey_server:3000"`}),GU=(e)=>({configs:{passkey_server_proxy:swe()},services:{passkey_server:iwe(e),proxy:{configs:[{source:"passkey_server_proxy",target:"/etc/traefik/conf.d/passkey_server.yaml"}]}}});var awe=(e)=>({image:`cartesi/sdk:${e.imageTag??"latest"}`,command:"mock-verifying-paymaster",environment:{ALTO_RPC:"http://bundler:4337",ANVIL_RPC:"http://anvil:8545"},healthcheck:{...Qt,test:["CMD","curl","-fsS","http://127.0.0.1:3000/ping"]}}),cwe=()=>({name:"paymaster-proxy",content:`http:
641
+ routers:
642
+ paymaster:
643
+ rule: "PathPrefix(\`/paymaster\`)"
644
+ middlewares:
645
+ - "remove-paymaster-prefix"
646
+ service: paymaster
647
+ middlewares:
648
+ remove-paymaster-prefix:
649
+ replacePathRegex:
650
+ regex: "^/paymaster/(.*)"
651
+ replacement: "/$1"
652
+ services:
653
+ paymaster:
654
+ loadBalancer:
655
+ servers:
656
+ - url: "http://paymaster:3000"`}),VU=(e)=>({configs:{paymaster_proxy:cwe()},services:{paymaster:awe(e),proxy:{configs:[{source:"paymaster_proxy",target:"/etc/traefik/conf.d/paymaster.yaml"}]}}});var uwe=(e)=>{let t=e.imageTag??"latest",r=e.port??6751;return{image:`traefik:${t}`,healthcheck:{...Qt,test:["CMD","traefik","healthcheck","--ping"]},command:["--ping=true","--entryPoints.web.address=:8088","--entryPoints.traefik.address=:8080","--metrics.prometheus=true","--metrics.prometheus.addServicesLabels=true","--providers.file.directory=/etc/traefik/conf.d","--providers.file.watch=true","--log","--log.level=INFO"],ports:[`${r}:8088`]}},WU=(e)=>({services:{proxy:uwe(e)}});var Wa=(e)=>{let{json:t,wait:r,waitTimeout:n,yes:o}=e,i=[];if(o)i.push("--yes");if(t)i.push("--json");if(r===!1)i.push("--no-wait");if(n)i.push("--wait-timeout",n);return i},US=(e)=>{let{accountIndex:t,command:r,env:n,interactive:o,projectName:i,service:s="rollups_node",workdir:a}=e,c=["compose","--project-name",i,"exec"];if(!o)c.push("-T");for(let u of Object.keys(n??{}))c.push("-e",u);if(t!==void 0)c.push("-e",`CARTESI_AUTH_MNEMONIC_ACCOUNT_INDEX=${t}`);if(a)c.push("--workdir",a);return[...c,s,...r]},Ka=(e)=>We("docker",US({...e,interactive:!!process.stdin.isTTY}),{env:e.env,stdin:"inherit",stdout:e.stdout==="stderr"?2:"inherit",stderr:"inherit"}),wt=async(e)=>{let{input:t,...r}=e;try{let{stdout:n}=await We("docker",US({...r,interactive:!1}),{input:t});return n}catch(n){if(n instanceof qt)throw Error(String(n.stderr??"").trim()||n.shortMessage);throw n}},cx=async(e)=>{let{content:t,projectName:r}=e;return(await wt({command:["sh","-c",'f=$(mktemp) && cat > "$f" && echo "$f"'],input:t,projectName:r})).trim()},Xd=(e)=>wt({command:["rm","-rf",e.path],projectName:e.projectName}),KU=async(e)=>{let{exitCode:t}=await We("docker",US({command:["test","-e",e.path],interactive:!1,projectName:e.projectName}),{reject:!1});return t===0},Gl=(e)=>{if(e instanceof qt){process.exitCode=e.exitCode??1;return}throw e},lwe=`kind="\${CARTESI_AUTH_KIND:-mnemonic}"
657
+ printf '%s\\n' "$kind"
658
+ case "$kind" in
659
+ mnemonic|mnemonic_file)
660
+ if [ -n "$CARTESI_AUTH_MNEMONIC" ]; then
661
+ printf '%s\\n' "$CARTESI_AUTH_MNEMONIC"
662
+ elif [ -n "$CARTESI_AUTH_MNEMONIC_FILE" ]; then
663
+ cat "$CARTESI_AUTH_MNEMONIC_FILE"
664
+ fi
665
+ ;;
666
+ esac`,pwe=(e)=>{let[t="",...r]=e.trim().split(`
667
+ `);switch(t.trim()){case"mnemonic":case"mnemonic_file":{let n=r.join(" ").trim();if(!n)throw Error("The rollups node has no mnemonic configured");return{kind:"mnemonic",mnemonic:n}}case"private_key":case"private_key_file":return{kind:"private_key"};default:throw Error(`Signer kind ${t.trim()} of the rollups node isn't supported by the CLI`)}},YU=async(e)=>{let t=await wt({command:["sh","-c",lwe],projectName:e.projectName});return pwe(t)},ZU=(e)=>{let{CARTESI_AUTH_KIND:t,CARTESI_AUTH_MNEMONIC:r,CARTESI_AUTH_PRIVATE_KEY:n}=e;if(!t&&!r&&!n)return;if(!t&&r&&n)throw Error("Both CARTESI_AUTH_MNEMONIC and CARTESI_AUTH_PRIVATE_KEY are set, set CARTESI_AUTH_KIND to mnemonic or private_key to choose");let o=t??(r?"mnemonic":"private_key");switch(o){case"mnemonic":if(!r)throw Error("CARTESI_AUTH_KIND is mnemonic, but CARTESI_AUTH_MNEMONIC is not set");return{kind:"mnemonic",mnemonic:r};case"private_key":if(!n||!oe(n))throw Error("CARTESI_AUTH_KIND is private_key, but CARTESI_AUTH_PRIVATE_KEY is not a 0x-prefixed private key");return{kind:"private_key",privateKey:n};default:throw Error(`CARTESI_AUTH_KIND ${o} isn't supported for a single command, use mnemonic or private_key`)}},JU=(e)=>e.kind==="private_key"?{CARTESI_AUTH_KIND:"private_key",CARTESI_AUTH_PRIVATE_KEY:e.privateKey}:{CARTESI_AUTH_KIND:"mnemonic",CARTESI_AUTH_MNEMONIC:e.mnemonic};var ux=["DIVERGED","CORRUPTED","GUEST_EXCEPTION","MACHINE_HALTED","MCYCLE_OVERFLOW","UNEXPECTED_YIELD","INVALID_OUTPUTS_ROOT"],fwe=(e)=>({accountsDriveStartIndex:_e(e.accounts_drive_start_index),guardian:de(e.guardian),log2LeavesPerAccount:_e(e.log2_leaves_per_account),log2MaxNumOfAccounts:_e(e.log2_max_num_of_accounts),withdrawalOutputBuilder:de(e.withdrawal_output_builder)}),XU=(e)=>({address:e.iapplication_address,consensus:e.iconsensus_address,epochLength:Oe(e.epoch_length),name:e.name,status:e.status,reason:e.reason??void 0,enabled:e.enabled,templateHash:e.template_hash,withdrawalConfig:e.withdrawal_config?fwe(e.withdrawal_config):void 0}),QU=(e)=>JSON.parse(e).map(XU),Qd=async(e)=>{try{let t=await wt({command:["cartesi-rollups-cli","app","list"],projectName:e.projectName});return QU(t)}catch{return[]}},lx=async(e)=>{let{application:t,projectName:r}=e,n=await wt({command:["cartesi-rollups-cli","app","list"],projectName:r}),o=QU(n).find((i)=>Ne(i.address,t));if(!o)throw Error(`Application ${t} isn't registered in the node`);if(!o.withdrawalConfig)throw Error(`The node has no withdrawal config for application ${t}`);return o.withdrawalConfig},dwe=(e)=>JSON.parse(e).data.raw_data,eH=async(e)=>{let{application:t,inputIndex:r,projectName:n}=e,o=await wt({command:["cartesi-rollups-cli","read","inputs",t,r.toString()],projectName:n});return dwe(o)},mwe=(e)=>{let{data:t}=JSON.parse(e),[r]=t;return r?{index:_e(r.index),machineHash:r.machine_hash??void 0}:void 0},tH=async(e)=>{let{application:t,projectName:r}=e,n=await wt({command:["cartesi-rollups-cli","read","epochs",t,"--status","CLAIM_ACCEPTED","--descending","--limit","1"],projectName:r});return mwe(n)},hwe=async(e)=>{let t=await Ya();if(!t)return;return(await Qd(e)).find((n)=>n.templateHash===t)},Vl=async(e)=>{let t=De(e??{});return(await hwe({projectName:t}))?.address},rH=async(e)=>{let t=De(e??{});try{let r=await wwe({projectName:t}),n=r?.forkConfig?.forkUrl,o=r?.forkConfig?.forkBlockNumber;if(n)return{chainId:await Ii({transport:Hn(n)}).getChainId(),url:n,blockNumber:o?BigInt(o):void 0}}catch{return}return},Ri="http://127.0.0.1",ywe=5000,gwe=[{name:"anvil",healthySemaphore:"anvil",healthyTitle:(e)=>`${U.cyan("anvil")} service ready at ${U.cyan(`${Ri}:${e}/anvil`)}`,waitTitle:`${U.cyan("anvil")} service starting...`,errorTitle:`${U.red("anvil")} service failed`},{name:"proxy"},{name:"database"},{name:"rpc",healthySemaphore:"rollups_node",healthyTitle:(e)=>`${U.cyan("rpc")} service ready at ${U.cyan(`${Ri}:${e}/rpc`)}`,waitTitle:`${U.cyan("rpc")} service starting...`,errorTitle:`${U.red("rpc")} service failed`},{name:"inspect",healthySemaphore:"rollups_node",healthyTitle:(e,t)=>`${U.cyan("inspect")} service ready at ${U.cyan(`${Ri}:${e}/inspect/${t??"<application_address>"}`)}`,waitTitle:`${U.cyan("inspect")} service starting...`,errorTitle:`${U.red("inspect")} service failed`}],HS=[{name:"bundler",healthySemaphore:"bundler",healthyTitle:(e)=>`${U.cyan("bundler")} service ready at ${U.cyan(`${Ri}:${e}/bundler/rpc`)}`,waitTitle:`${U.cyan("bundler")} service starting...`,errorTitle:`${U.red("bundler")} service failed`},{name:"explorer",healthySemaphore:"explorer",healthyTitle:(e)=>`${U.cyan("explorer")} service ready at ${U.cyan(`${Ri}:${e}/explorer`)}`,waitTitle:`${U.cyan("explorer")} service starting...`,errorTitle:`${U.red("explorer")} service failed`},{name:"paymaster",healthySemaphore:"paymaster",healthyTitle:(e)=>`${U.cyan("paymaster")} service ready at ${U.cyan(`${Ri}:${e}/paymaster`)}`,waitTitle:`${U.cyan("paymaster")} service starting...`,errorTitle:`${U.red("paymaster")} service failed`},{name:"passkey",healthySemaphore:"passkey_server",healthyTitle:(e)=>`${U.cyan("passkey")} service ready at ${U.cyan(`${Ri}:${e}/passkey`)}`,waitTitle:`${U.cyan("passkey")} service starting...`,errorTitle:`${U.red("passkey")} service failed`}],nH=HS.map(({name:e})=>e),bwe=(e)=>{let{errorTitle:t,healthyTitle:r,service:n,waitTitle:o}=e;return{task:async(i,s)=>{await Id(async()=>{let a=await em(e);if(a?.State==="exited"||a?.State==="dead")throw new gb(t??`Service ${U.cyan(n)} exited`);if(a?.Health!=="healthy")throw Error(t??`Service ${U.cyan(n)} is not healthy`)},{retries:100,minTimeout:500,maxTimeout:ywe,factor:1.1}),s.title=r??`Service ${U.cyan(n)} is ready`},title:o??`Starting ${U.cyan(n)}...`}},oH=async(e)=>{let{blockTime:t,cpus:r,defaultBlock:n,detach:o,dryRun:i,forkConfig:s,memory:a,port:c,projectName:u,prt:l,runtimeVersion:p,services:f,verbose:d}=e,h={CARTESI_BLOCKCHAIN_DEFAULT_BLOCK:n,CARTESI_LISTEN_PORT:c.toString(),CARTESI_LOG_LEVEL:d?"debug":"info"},m="password",y=fx(),g=[$U({blockTime:t,forkConfig:s,imageTag:p}),jU({imageTag:p,password:"password"}),zU({cpus:r,databasePassword:"password",defaultBlock:n,forkChainId:s?.chainId,imageTag:p,logLevel:d?"debug":"info",memory:a,prt:l,cartesiEnvironmentVariables:y}),WU({imageTag:"v3.3.4",port:c})];if(f.includes("explorer"))g.push(qU({imageTag:"2.0.0-alpha.4",port:c}));if(f.includes("bundler"))g.push(HU({imageTag:p}));if(f.includes("paymaster"))g.push(VU({imageTag:p}));if(f.includes("passkey"))g.push(GU({imageTag:p}));let x=["compose","-f","-","--project-directory","."],b=o?["--detach"]:[],w=UU([{name:u},...g]);if(i){let{stdout:D}=await We("docker",[...x,"config","--format","yaml"],{env:h,input:ax(w,{lineWidth:0,indent:2})});return{config:D}}let v=We("docker",[...x,"up",...b],{env:h,input:ax(w,{lineWidth:0,indent:2})});if(o)await v;return{cmd:v}},iH=async(e)=>{let{name:t,port:r,projectName:n,services:o}=e,i=o.length===1&&o[0]==="all"?HS:HS.filter(({name:c})=>o.includes(c)),s=[...gwe,...i].filter(({healthySemaphore:c})=>!!c).map((c)=>{let u=typeof c.healthyTitle==="function"?c.healthyTitle(r,t):c.healthyTitle;return bwe({projectName:n,service:c.healthySemaphore,errorTitle:c.errorTitle,waitTitle:c.waitTitle,healthyTitle:u})});await new Pl(s,{concurrent:!0}).run()};var sH=async(e)=>{let{projectName:t}=e;return We("docker",["compose","--project-name",t,"down","--volumes"])};var xwe=(e)=>{let{consensus:t,epochLength:r,name:n,prt:o,salt:i,snapshotPath:s,withdrawalConfig:a,claimStagingPeriod:c}=e,u=[n,s];if(t)u.push("--consensus",t);else u.push("--epoch-length",r.toString());if(i)u.push("--salt",i);if(o)u.push("--prt");if(u.push("--claim-staging-period",c.toString()),a)u.push("--withdrawal-config",JSON.stringify(a));return u.push("--json"),u},aH=async(e)=>{let{projectName:t}=e,r=xwe(e),n=await wt({command:["cartesi-rollups-cli","deploy","application",...r],projectName:t}),o=n?XU(JSON.parse(n)):void 0;if(o)return o;throw Error("Failed to deploy application")},cH=async(e)=>{let{application:t,force:r,projectName:n}=e;await wt({command:["cartesi-rollups-cli","app","status",t,"disabled"],projectName:n});let o=[t];if(r)o.push("--yes");return wt({command:["cartesi-rollups-cli","app","remove",...o],projectName:n})},px=async(e)=>{let{projectName:t}=e,{stdout:r}=await We("docker",["compose","--project-name",t,"port","proxy","8088"]);return r},wwe=async(e)=>{let{projectName:t}=e,r=await wt({command:["cast","rpc","anvil_nodeInfo"],projectName:t,service:"anvil"});return JSON.parse(r)};class dx extends Error{constructor(e,t){super(`An error happened during validation of fork chain ${e}${t?`:
668
+ ${t}`:""}`);this.name="ForkChainValidationError"}}class Wl extends Error{constructor(e,t){super(`Unsupported fork chain ${e}${t?`:
669
+ ${t}`:""}`);this.name="UnsupportedForkChainError"}}var Twe=(e)=>{let t=[{name:"InputBox",getAddress(){return Ag.address},abi:Ag.abi,getReadContractParameters(){return{address:this.getAddress(),abi:Ag.abi,functionName:"getDeploymentBlockNumber",args:[],blockNumber:e.blockNumber}}},{name:"EtherPortal",getAddress(){return vg.address},abi:vg.abi,getReadContractParameters(){return{address:this.getAddress(),abi:vg.abi,functionName:"version",args:[],blockNumber:e.blockNumber}}},{name:"ERC20Portal",getAddress(){return wg.address},abi:wg.abi,getReadContractParameters(){return{address:this.getAddress(),abi:wg.abi,functionName:"version",args:[],blockNumber:e.blockNumber}}},{name:"ERC721Portal",getAddress(){return Tg.address},abi:Tg.abi,getReadContractParameters(){return{address:this.getAddress(),abi:Tg.abi,functionName:"version",args:[],blockNumber:e.blockNumber}}},{name:"ERC1155SinglePortal",getAddress(){return xg.address},abi:xg.abi,getReadContractParameters(){return{address:this.getAddress(),abi:xg.abi,functionName:"version",args:[],blockNumber:e.blockNumber}}},{name:"ERC1155BatchPortal",getAddress(){return bg.address},abi:bg.abi,getReadContractParameters(){return{address:this.getAddress(),abi:bg.abi,functionName:"version",args:[],blockNumber:e.blockNumber}}}];if(e.includePRT)t.push({name:"DaveAppFactory",getAddress(){let r=fl[e.chainId];if(!r)throw new Wl(e.chainId,"DaveAppFactory address not found for this chain.");return r},abi:f5,getReadContractParameters(){return{address:this.getAddress(),abi:f5,functionName:"calculateDaveAppAddress",args:[Ba,0n,Ln,[],{accountsDriveStartIndex:0n,guardian:Ln,log2LeavesPerAccount:0,log2MaxNumOfAccounts:0,withdrawalOutputBuilder:Ln},Ba],blockNumber:e.blockNumber}}});return t},mx=async(e,t)=>{let{chainId:r,url:n,blockNumber:o}=e,i=Ii({transport:Hn(n),batch:{multicall:!0}}),s=o??await i.getBlockNumber(),a=Twe({chainId:r,blockNumber:s,...t}),c=await Promise.allSettled(a.map((p)=>i.getCode({address:p.getAddress(),blockNumber:s}))),u=[];if(c.forEach((p,f)=>{if(p.status==="rejected"){let d=`Contract ${a[f].name} at address ${a[f].getAddress()} on chain ${r} at block ${s} got a problem when fetching its bytecode
670
+ `,h=p.reason.shortMessage??p.reason.message??"Unknown error";throw new dx(r,`${d}Original error: ${h}`)}else if(p.value==="0x"||p.value===void 0)u.push(`No deployment found at address ${a[f].getAddress()} for contract ${a[f].name} on chain ${r} at block ${s}`)}),u.length>0)throw new Wl(r,u.join(`
671
+ `));if((await Promise.allSettled(a.map((p)=>i.readContract(p.getReadContractParameters())))).forEach((p,f)=>{if(p.status==="rejected"){let d=p.reason.shortMessage??p.reason.message??"Unknown error";u.push(`Contract ${a[f].name} at address ${a[f].getAddress()} on chain ${r} at block ${s} got a problem when calling function ${a[f].getReadContractParameters().functionName}
672
+ Original error: ${d}`)}}),u.length>0)throw new Wl(r,u.join(`
673
+ `));return!0};var bn=(...e)=>uH.join(".cartesi",...e),Ewe=()=>{try{return Ns(["cartesi.toml"]).sdk}catch{return}},Ya=async(e)=>{let t=bn("image");if(jS.existsSync(t)){let r=e?.sdk??Ewe();return await Tie(t,r?{image:r}:void 0)}return},Ns=(e)=>{let t=e.map((r)=>{if(jS.existsSync(r))return jS.readFileSync(r).toString();if(r==="cartesi.toml")return"";throw Error(`Config file ${r} does not exist`)});return PF(t)},De=(e)=>e.projectName??uH.basename(process.cwd());function fx(){let e={};for(let[t,r]of Object.entries(process.env))if(t.startsWith("CARTESI_")&&r!==void 0)e[t]=r;return e}var lH=async(e)=>{let t=await rH(e),r=await Vl(e);if(t)await mx(t,{includePRT:!0});let n=t?.chainId??Z6.id,o=fl[n],i={EntryPointV06:"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",EntryPointV07:"0x0000000071727De22E5E9d8BAf0edAc6f37da032",EntryPointV08:"0x4337084d9e255ff0702461cf8895ce9e3b5ff108",EntryPointV09:"0x433709009B8330FDa32311DF1C2AFA402eD8D009",LightAccountFactory:"0x00004EC70002a32400f8ae005A26081065620D20",SimpleAccountFactory:"0x9406Cc6185a346906296840746125a0E44976454",SmartAccountFactory:"0x000000a56Aaca3e9a4C479ea6b6CD0DbcB6634F5",KernelFactoryV2:"0x5de4839a76cf55d0c90e2061ef4386d962E15ae3",KernelFactoryV3:"0x6723b44Abeec4E71eBE3232BD5B455805baDD22f",KernelFactoryV3_1:"0xaac5D4240AF87249B3f71BC8E4A2cae074A3E419",VerifyingPaymasterV06:"0x28ec0633192d0cBd9E1156CE05D5FdACAcB93947",VerifyingPaymasterV07:"0xc5c97885C67F7361aBAfD2B95067a5bBdA603608"},s={TestToken:Dg,TestNFT:td,TestMultiToken:Ig,TestUsdc:$F,TestUsdWithdrawalOutputBuilder:Og},a={ApplicationFactory:BF,AuthorityFactory:NF,DaveAppFactory:o,Erc1155BatchPortal:dl,Erc1155SinglePortal:ml,Erc20Portal:hl,Erc721Portal:yl,EtherPortal:Eg,InputBox:gl,RefundOutputBuilder:MF,SelfHostedApplicationFactory:Cg,UsdWithdrawalOutputBuilderFactory:UF},c=t!==void 0?{...a,...i}:{...a,...s};if(r)c.Application=r;return c},em=async(e)=>{let{projectName:t,service:r}=e,{stdout:n}=await We("docker",["compose","--project-name",t,"ps","--all",r,"--format","json"]);return n?JSON.parse(n):void 0},hx=async(e)=>(await em(e))?.State;var pH=(e)=>{if(J(e))return de(e);if(e!=="")throw new eo(`Invalid address: ${e}`);return};var fH=(e)=>{let t=Number(e);if(!Number.isSafeInteger(t)||t<0)throw new eo("Not a valid account index.");return t},dH=(e)=>{if(!/^(0x[0-9a-fA-F]+|[0-9]+)$/.test(e))throw new eo("Not a valid input index.");return BigInt(e)};var hH=()=>new re("address-book").description("Prints the addresses of all smart contracts deployed to the runtime environment of the application.").argument("[contract]","name of a contract; when provided, prints only its address (useful for scripting)").option("--json","Format output as json.").option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").action(async(e,t,r)=>{let{json:n}=t,o=De(t),i=await lH({projectName:o});if(e!==void 0){let s=Object.entries(i).find(([c])=>c.toLowerCase()===e.toLowerCase());if(!s){r.error(`Contract not found: ${e}`);return}let[,a]=s;if(!n)console.log(a);else process.stdout.write(JSON.stringify(a));return}if(!n){let s=new mH.default({head:["Contract","Address"],chars:{top:"","top-mid":"","top-left":"","top-right":"",bottom:"","bottom-mid":"","bottom-left":"","bottom-right":"",left:"","left-mid":"",mid:"","mid-mid":"",right:"","right-mid":"",middle:" "},style:{"padding-left":0,"padding-right":0}});s.push(...Object.entries(i)),console.log(s.toString())}else process.stdout.write(JSON.stringify(i))});var pA=ot(Kr(),1);import aq from"node:path";var qx=ot(Kr(),1);import F2e from"node:path";var nA=async(e,t,r,n,o,i)=>{let s=`${e}.${t.format}`,a=F2e.join(n,e);await qx.default.mkdirp(a),await qx.default.copy(t.directory,a);try{switch(t.format){case"ext2":{await Oce({extraSize:t.extraSize,input:e,output:s,cwd:n,image:r,reporter:i});break}case"sqfs":{await Rce({input:e,output:s,cwd:n,image:r,reporter:i});break}}}finally{if(!o)await qx.default.remove(a)}};var nm=ot(Kr(),1);import M2e from"node:os";import Ql from"node:path";var Vj=async(e)=>{let{buildArgs:t,context:r,destination:n,dockerfile:o,dockerfileContent:i,reporter:s,tags:a,target:c}=e,u=["buildx","build","--platform","linux/riscv64","--file",i?"-":o,"--output","type=docker","--output",`type=tar,dest=${n}`,"--progress",s?"plain":"quiet"];u.push(...a.flatMap((f)=>["--tag",f])),u.push(...t.flatMap((f)=>["--build-arg",f]));let l=await nm.default.mkdtemp(Ql.join(M2e.tmpdir(),"cartesi-buildx-")),p=Ql.join(l,"metadata.json");if(u.push("--metadata-file",p),c)u.push("--target",c);if(u.push(r),s)s(`Building docker image with args: ${u.join(" ")}`);try{let f=We("docker",u,{input:i});if(s)f.stderr?.on("data",(h)=>{for(let m of h.toString().split(`
674
+ `))if(m.trim())s(m.trimEnd())});await f;let d=JSON.parse(nm.default.readFileSync(p,"utf-8"));return d["containerimage.config.digest"]??d["containerimage.digest"]??""}finally{await nm.default.remove(l)}},L2e=async(e)=>{let{stdout:t}=await We("docker",["image","inspect",e]),[r]=JSON.parse(t);if(r.Architecture!=="riscv64")throw Error(`Invalid image Architecture: ${r.Architecture}. Expected riscv64`);return{cmd:r.Config.Cmd??[],entrypoint:r.Config.Entrypoint??[],env:r.Config.Env||[],workdir:r.Config.WorkingDir}},oA=async(e,t,r,n,o,i)=>{let{format:s}=t,a=`${e}.tar`,c=`${e}.${s}`,u;if(t.image)u=await Vj({...t,destination:Ql.join(n,a),dockerfileContent:`FROM ${t.image}`,reporter:i});else u=await Vj({...t,destination:Ql.join(n,a),reporter:i});let l=await L2e(u);try{switch(s){case"ext2":{await N9({extraSize:t.extraSize,input:a,output:c,cwd:n,image:r,reporter:i});break}case"sqfs":{await M9({input:Ql.join(n,a),output:c,cwd:n,image:r,reporter:i});break}}}finally{if(!o)await nm.default.remove(Ql.join(n,a))}return l};var Wj=ot(Kr(),1);import $2e from"node:path";var iA=async(e,t,r,n)=>{let o=`${e}.${t.format}`;switch(t.format){case"ext2":{await Ice({output:o,size:t.size,cwd:n,image:r});break}case"raw":{await Wj.default.writeFile($2e.join(n,o),Buffer.alloc(t.size));break}}};var Kj=ot(Kr(),1);import U2e from"node:path";var sA=async(e,t,r)=>{let n=t.filename,o=p5(n),i=U2e.join(r,`${e}.${o}`);await Kj.default.copyFile(n,i)};var zx=ot(Kr(),1);import H2e from"node:path";var aA=async(e,t,r)=>{if(!pl(t))return;let n=H2e.join(r,ll(e)),o=t.filename;if(o===void 0){if(t.size===void 0)throw new yg(e);await zx.default.writeFile(n,Buffer.alloc(t.size));return}let{size:i}=await zx.default.stat(o);if(t.size!==void 0&&t.size!==i)throw Error(`Size ${t.size} of nvram '${e}' does not match the ${i} bytes of ${o}`);if(i%Xf!==0)throw Error(`Image ${o} of nvram '${e}' has ${i} bytes, which is not a multiple of ${Xf}`);await zx.default.copyFile(o,n)};var Zj=ot(Kr(),1);import Yj from"node:path";var cA=async(e,t,r,n,o)=>{let i=`${e}.tar`,s=`${e}.${t.format}`;switch(await Zj.default.copy(t.filename,Yj.join(n,i)),t.format){case"ext2":{await N9({extraSize:t.extraSize,input:i,output:s,cwd:n,image:r,reporter:o});break}case"sqfs":{await M9({input:Yj.join(n,i),output:s,cwd:n,image:r,reporter:o});break}}};var eq=ot(Qj(),1);import z2e from"node:fs";var G2e=(e,t)=>{let{accountsDrive:r,format:n,mount:o,shared:i,user:s}=t,a=`${e}.${n}`,c=[`label:${e}`,`data_filename:${a}`];if(o!==void 0)c.push(`mount:${o}`);else if(r)c.push("mount:false");if(s)c.push(`user:${s}`);if(i)c.push("shared");return`--flash-drive=${c.join(",")}`},V2e=(e,t)=>{let{shared:r,size:n,user:o}=t,i=[`label:${e}`];if(n!==void 0)i.push(`length:${n}`);if(pl(t))i.push(`data_filename:${ll(e)}`);if(o)i.push(`user:${o}`);if(r)i.push("shared");return`--nvram=${i.join(",")}`},W2e=(e,t,r)=>{let{machine:n}=e,{assertRollingTemplate:o,env:i,envFile:s,maxMCycle:a,ramLength:c,ramImage:u,useDockerEnv:l,useDockerWorkdir:p,user:f}=n,d={};if(l)for(let v of t?.env??[]){let[D,O=""]=v.split("=");d[D]=O}if(s)Object.assign(d,eq.default.parse(z2e.readFileSync(s)));Object.assign(d,i);let h=Object.entries(d).map(([v,D])=>`--env=${v}="${D}"`);if(e.drives.root?.format==="sqfs"){if(!e.machine.bootargs.find((D)=>D.startsWith("rootfstype=")))e.machine.bootargs.push("rootfstype=squashfs")}let y=n.bootargs.map((v)=>`--append-bootargs="${v}"`),g;if(n.entrypoint)g=n.entrypoint;else if(t&&(t.entrypoint.length>0||t.cmd.length>0))g=[...t.entrypoint,...t.cmd].join(" ");if(!g)throw Error("Undefined machine entrypoint. Please define an entrypoint in your cartesi.toml config or in your Dockerfile.");let x=Object.entries(e.drives).map(([v,D])=>G2e(v,D)),b=Object.entries(e.nvrams).map(([v,D])=>V2e(v,D)),w=[...y,...h,...x,...b,`--ram-length=${c}`];if(u)w.push(`--ram-image=${u}`);if(o)w.push("--assert-rolling-template");if(r.finalHash)w.push("--final-hash");if(p&&t?.workdir)w.push(`--workdir="${t.workdir}"`);if(r.interactive)w.push("-it");if(a)w.push(`--max-mcycle=${a.toString()}`);if(r.store)w.push(`--store=${r.store}`);if(f)w.push(`--user=${f}`);return w.push("--"),w.push(g),w},Vx=async(e,t,r,n)=>{let o=W2e(e,t,r);return await Dce({image:e.sdk}),Ace(o,{image:e.sdk,...n})};import tq from"node:fs";import K2e from"node:path";var oq="0x70997970C51812dc3A010C7d01b50e0d17dc79C8",uA=Og,Y2e=(e)=>{let t=K2e.join(e,"config.json");if(!tq.existsSync(t))throw Error(`Machine configuration ${t} not found, run 'cartesi build'`);return JSON.parse(tq.readFileSync(t,"utf-8"))},Wx=(e)=>`0x${e.toString(16)}`,Z2e=(e,t)=>{let r=c5(e);if(!r)return;let{kind:n,label:o}=r,i=t.config[n]??[],s=i.findIndex((d)=>d.label===o);if(s<0)throw new cn(o,"not found in the built machine, run 'cartesi build'");let a=i[s];if(!Number.isSafeInteger(a.start)||!Number.isSafeInteger(a.length))throw new cn(o,`its start ${a.start} or length ${a.length} in the built machine can't be read without losing precision`);let{start:c,length:u}=a,l=l5(e,r,u);if(!l)throw new cn(o,"unknown size");let{length:p,log2Length:f}=l;if(c%p!==0)throw new cn(o,`start ${Wx(c)} is not aligned to its size ${Wx(p)}, so its start index is not an integer`);return{kind:n,label:o,device:n==="nvram"?`/dev/uio${s}`:`/dev/pmem${s}`,driveLength:u,length:p,log2Length:f,start:c,startIndex:c/p}},J2e=(e,t,r)=>{let n=e.withdrawal,o=a5(n),i=2**($a+o),s=t.log2Length-o-$a,a=n?.withdrawal_output_builder??uA;if(Ne(a,uA)&&i!==32)throw new Ma(`the devnet withdrawal output builder expects accounts of 32 bytes, but they are set to ${i} bytes. Remove account_size, or set withdrawal_output_builder to a builder for ${i}-byte accounts`);if(r?.fork&&n?.withdrawal_output_builder===void 0)throw new Ma("the devnet withdrawal output builder doesn't exist on a fork, set withdrawal_output_builder");return{guardian:n?.guardian??oq,log2_leaves_per_account:o,log2_max_num_of_accounts:s,accounts_drive_start_index:t.startIndex,withdrawal_output_builder:a}},rq=(e)=>{let{value:t,unit:r}=u5(e);return r?`${t} ${r}B`:`${t} bytes`},nq=(e,t="")=>{let r=Math.max(...e.map(([o])=>o.length)),n=Math.max(...e.map(([,o])=>o.length));return e.map(([o,i,s])=>`${t}${o.padEnd(r)} ${s?`${i.padEnd(n)} ${U.dim(s)}`:i}`.trimEnd())},iq=(e,t,r)=>{let n=e.withdrawal,o=2**($a+r.log2_leaves_per_account),i=2**r.log2_max_num_of_accounts,s=(u,l,p)=>[u,r[u],n?.[u]===void 0&&r[u]===l?`devnet ${p}`:void 0],a=n?.guardian===void 0||n?.withdrawal_output_builder===void 0,c=[...nq([["accounts drive",`${U.cyan(t.label)} (${t.kind==="nvram"?"nvram":"flash drive"}) → ${U.cyan(t.device)}`],["start",Wx(t.start)],["size",`${rq(t.length)} (2^${t.log2Length} bytes)${t.length===t.driveLength?"":`, at the beginning of ${rq(t.driveLength)}`}`],["accounts",`${i} × ${o} bytes`]]),"","withdrawal config",...nq([s("guardian",oq,"account 1"),s("withdrawal_output_builder",uA,"TestUsdWithdrawalOutputBuilder"),["account_size",`${o} bytes`,n?.account_size===void 0?"default":void 0],["log2_leaves_per_account",r.log2_leaves_per_account.toString(),"derived"],["log2_max_num_of_accounts",r.log2_max_num_of_accounts.toString(),"derived"],["accounts_drive_start_index",`${r.accounts_drive_start_index} (${Wx(r.accounts_drive_start_index)})`,"derived"]]," "),"",`--withdrawal-config '${JSON.stringify(r)}'`];if(a)c.push(U.yellow("devnet defaults in use: set guardian and withdrawal_output_builder under [withdrawal] to deploy elsewhere"));return c.join(`
675
+ `)},lA=(e,t,r)=>{if(!c5(e))return;let n=Z2e(e,Y2e(t));return n&&{layout:n,withdrawal:J2e(e,n,r)}},sq=(e,t,r)=>lA(e,t,r)?.withdrawal;var X2e=(e,t)=>({title:`Building drive ${U.cyan(e)}`,task:async(r,n)=>{let{config:o,debug:i,destination:s}=r,a=o.sdk,c=(u)=>{n.output=u};switch(t.builder){case"directory":{await nA(e,t,a,s,i,c);break}case"docker":{let u=await oA(e,t,a,s,i,c);if(u&&e==="root")r.imageInfo=u;break}case"empty":{await iA(e,t,a,s);break}case"tar":{await cA(e,t,a,s,c);break}case"none":{await sA(e,t,s);break}}n.title=`Build drive ${U.cyan(e)}`}}),Q2e=(e,t)=>({title:`Building nvram ${U.cyan(e)}`,task:async(r,n)=>{await aA(e,t,r.destination),n.title=`Build nvram ${U.cyan(e)}`}}),cq=()=>new re("build").description("Build application by building Cartesi machine drives, configuring a machine and booting it.").option("-c, --config <config>","path to the configuration file",(e,t)=>t.concat([e]),["cartesi.toml"]).addOption(new $e("--debug","enable debug mode (do not remove intermediate files)").default(!1).hideHelp()).option("-d, --drives-only","only build drives, do not boot machine").option("-v, --verbose","verbose output",!1).action(async(e)=>{let{debug:t,drivesOnly:r,verbose:n}=e,o=Ns(e.config),i=aq.resolve(bn());await pA.default.emptyDir(i);let s={config:o,debug:t,destination:i,verbose:n,imageInfo:void 0},a=Object.entries(o.drives).map(([h,m])=>X2e(h,m)),c=Object.entries(o.nvrams).map(([h,m])=>Q2e(h,m)),u=[{title:"Build drives",task:async(h,m)=>m.newListr(a,{concurrent:!0,rendererOptions:{collapseSubtasks:!1},ctx:s})}];if(c.length>0)u.push({title:"Build nvrams",task:async(h,m)=>m.newListr(c,{concurrent:!0,rendererOptions:{collapseSubtasks:!1},ctx:s})});let p=await new Pl(u,{ctx:s,renderer:n?"verbose":"default"}).run();if(r)return;await Vx(o,p.imageInfo,{finalHash:!0,store:"image"},{cwd:i,stdio:"inherit"});let f=aq.join(i,"image");await pA.default.chmod(f,493);let d=lA(o,f);if(d){let{layout:h,withdrawal:m}=d;console.log(),console.log(iq(o,h,m))}});var uq=ot(Kr(),1);var lq=()=>new re("clean").description("Deletes all cached build artifacts of application.").action(async()=>{await uq.default.emptyDir(bn())});import cm from"node:process";import{stripVTControlCharacters as ETe}from"node:util";var pq=(e=0)=>(t)=>`\x1B[${t+e}m`,fq=(e=0)=>(t)=>`\x1B[${38+e};5;${t}m`,dq=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,Ye={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]}},LVt=Object.keys(Ye.modifier),eTe=Object.keys(Ye.color),tTe=Object.keys(Ye.bgColor),$Vt=[...eTe,...tTe];function rTe(){let e=new Map;for(let[t,r]of Object.entries(Ye)){for(let[n,o]of Object.entries(r))Ye[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Ye[n],e.set(o[0],o[1]);Object.defineProperty(Ye,t,{value:r,enumerable:!1})}return Object.defineProperty(Ye,"codes",{value:e,enumerable:!1}),Ye.color.close="\x1B[39m",Ye.bgColor.close="\x1B[49m",Ye.color.ansi=pq(),Ye.color.ansi256=fq(),Ye.color.ansi16m=dq(),Ye.bgColor.ansi=pq(10),Ye.bgColor.ansi256=fq(10),Ye.bgColor.ansi16m=dq(10),Object.defineProperties(Ye,{rgbToAnsi256:{value(t,r,n){if(t===r&&r===n){if(t<8)return 16;if(t>248)return 231;return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;if(n.length===3)n=[...n].map((i)=>i+i).join("");let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:(t)=>Ye.rgbToAnsi256(...Ye.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,o;if(t>=232)r=((t-232)*10+8)/255,n=r,o=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let i=Math.max(r,n,o)*2;if(i===0)return 30;let s=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));if(i===2)s+=60;return s},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>Ye.ansi256ToAnsi(Ye.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:(t)=>Ye.ansi256ToAnsi(Ye.hexToAnsi256(t)),enumerable:!1}}),Ye}var nTe=rTe(),Kn=nTe;import fA from"node:process";import oTe from"node:os";import mq from"node:tty";function Tn(e,t=globalThis.Deno?globalThis.Deno.args:fA.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}var{env:Ze}=fA,Kx;if(Tn("no-color")||Tn("no-colors")||Tn("color=false")||Tn("color=never"))Kx=0;else if(Tn("color")||Tn("colors")||Tn("color=true")||Tn("color=always"))Kx=1;function iTe(){if("FORCE_COLOR"in Ze){if(Ze.FORCE_COLOR==="true")return 1;if(Ze.FORCE_COLOR==="false")return 0;return Ze.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Ze.FORCE_COLOR,10),3)}}function sTe(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function aTe(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=iTe();if(n!==void 0)Kx=n;let o=r?Kx:n;if(o===0)return 0;if(r){if(Tn("color=16m")||Tn("color=full")||Tn("color=truecolor"))return 3;if(Tn("color=256"))return 2}if("TF_BUILD"in Ze&&"AGENT_NAME"in Ze)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(Ze.TERM==="dumb")return i;if(fA.platform==="win32"){let s=oTe.release().split(".");if(Number(s[0])>=10&&Number(s[2])>=10586)return Number(s[2])>=14931?3:2;return 1}if("CI"in Ze){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((s)=>(s in Ze)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((s)=>(s in Ze))||Ze.CI_NAME==="codeship")return 1;return i}if("TEAMCITY_VERSION"in Ze)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ze.TEAMCITY_VERSION)?1:0;if(Ze.COLORTERM==="truecolor")return 3;if(Ze.TERM==="xterm-kitty")return 3;if(Ze.TERM==="xterm-ghostty")return 3;if(Ze.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Ze){let s=Number.parseInt((Ze.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ze.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(Ze.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ze.TERM))return 1;if("COLORTERM"in Ze)return 1;return i}function hq(e,t={}){let r=aTe(e,{streamIsTTY:e&&e.isTTY,...t});return sTe(r)}var cTe={stdout:hq({isTTY:mq.isatty(1)}),stderr:hq({isTTY:mq.isatty(2)})},yq=cTe;function gq(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let o=t.length,i=0,s="";do s+=e.slice(i,n)+t+r,i=n+o,n=e.indexOf(t,i);while(n!==-1);return s+=e.slice(i),s}function bq(e,t,r,n){let o=0,i="";do{let s=e[n-1]==="\r";i+=e.slice(o,s?n-1:n)+t+(s?`\r
676
+ `:`
677
+ `)+r,o=n+1,n=e.indexOf(`
678
+ `,o)}while(n!==-1);return i+=e.slice(o),i}var{stdout:xq,stderr:wq}=yq,dA=Symbol("GENERATOR"),tp=Symbol("STYLER"),im=Symbol("IS_EMPTY"),Tq=["ansi","ansi","ansi256","ansi16m"],rp=Object.create(null),uTe=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let r=xq?xq.level:0;e.level=t.level===void 0?r:t.level};var lTe=(e)=>{let t=(...r)=>r.join(" ");return uTe(t,e),Object.setPrototypeOf(t,sm.prototype),t};function sm(e){return lTe(e)}Object.setPrototypeOf(sm.prototype,Function.prototype);for(let[e,t]of Object.entries(Kn))rp[e]={get(){let r=Yx(this,hA(t.open,t.close,this[tp]),this[im]);return Object.defineProperty(this,e,{value:r}),r}};rp.visible={get(){let e=Yx(this,this[tp],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var mA=(e,t,r,...n)=>{if(e==="rgb"){if(t==="ansi16m")return Kn[r].ansi16m(...n);if(t==="ansi256")return Kn[r].ansi256(Kn.rgbToAnsi256(...n));return Kn[r].ansi(Kn.rgbToAnsi(...n))}if(e==="hex")return mA("rgb",t,r,...Kn.hexToRgb(...n));return Kn[r][e](...n)},pTe=["rgb","hex","ansi256"];for(let e of pTe){rp[e]={get(){let{level:r}=this;return function(...n){let o=hA(mA(e,Tq[r],"color",...n),Kn.color.close,this[tp]);return Yx(this,o,this[im])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);rp[t]={get(){let{level:r}=this;return function(...n){let o=hA(mA(e,Tq[r],"bgColor",...n),Kn.bgColor.close,this[tp]);return Yx(this,o,this[im])}}}}var fTe=Object.defineProperties(()=>{},{...rp,level:{enumerable:!0,get(){return this[dA].level},set(e){this[dA].level=e}}}),hA=(e,t,r)=>{let n,o;if(r===void 0)n=e,o=t;else n=r.openAll+e,o=t+r.closeAll;return{open:e,close:t,openAll:n,closeAll:o,parent:r}},Yx=(e,t,r)=>{let n=(...o)=>dTe(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,fTe),n[dA]=e,n[tp]=t,n[im]=r,n},dTe=(e,t)=>{if(e.level<=0||!t)return e[im]?"":t;let r=e[tp];if(r===void 0)return t;let{openAll:n,closeAll:o}=r;if(t.includes("\x1B"))while(r!==void 0)t=gq(t,r.close,r.open),r=r.parent;let i=t.indexOf(`
679
+ `);if(i!==-1)t=bq(t,o,n,i);return n+t+o};Object.defineProperties(sm.prototype,rp);var mTe=sm(),YVt=sm({level:wq?wq.level:0});var Eq=mTe;W5();var yA={dots:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},dots2:{interval:80,frames:["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},dots3:{interval:80,frames:["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},dots4:{interval:80,frames:["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},dots5:{interval:80,frames:["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},dots6:{interval:80,frames:["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},dots7:{interval:80,frames:["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},dots8:{interval:80,frames:["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},dots9:{interval:80,frames:["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},dots10:{interval:80,frames:["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},dots11:{interval:100,frames:["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},dots12:{interval:80,frames:["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},dots13:{interval:80,frames:["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},dots14:{interval:80,frames:["⠉⠉","⠈⠙","⠀⠹","⠀⢸","⠀⣰","⢀⣠","⣀⣀","⣄⡀","⣆⠀","⡇⠀","⠏⠀","⠋⠁"]},dots8Bit:{interval:80,frames:["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},dotsCircle:{interval:80,frames:["⢎ ","⠎⠁","⠊⠑","⠈⠱"," ⡱","⢀⡰","⢄⡠","⢆⡀"]},sand:{interval:80,frames:["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["⠂","-","–","—","–","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["┤","┘","┴","└","├","┌","┬","┐"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["✶","✸","✹","✺","✹","✷"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","´","-","_","_","_"]},hamburger:{interval:100,frames:["☱","☲","☴"]},growVertical:{interval:120,frames:["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},growHorizontal:{interval:120,frames:["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","°","O","o","."]},noise:{interval:100,frames:["▓","▒","░"]},bounce:{interval:120,frames:["⠁","⠂","⠄","⠂"]},boxBounce:{interval:120,frames:["▖","▘","▝","▗"]},boxBounce2:{interval:100,frames:["▌","▀","▐","▄"]},triangle:{interval:50,frames:["◢","◣","◤","◥"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["◜","◠","◝","◞","◡","◟"]},circle:{interval:120,frames:["◡","⊙","◠"]},squareCorners:{interval:180,frames:["◰","◳","◲","◱"]},circleQuarters:{interval:120,frames:["◴","◷","◶","◵"]},circleHalves:{interval:50,frames:["◐","◓","◑","◒"]},squish:{interval:100,frames:["╫","╪"]},toggle:{interval:250,frames:["⊶","⊷"]},toggle2:{interval:80,frames:["▫","▪"]},toggle3:{interval:120,frames:["□","■"]},toggle4:{interval:100,frames:["■","□","▪","▫"]},toggle5:{interval:100,frames:["▮","▯"]},toggle6:{interval:300,frames:["ဝ","၀"]},toggle7:{interval:80,frames:["⦾","⦿"]},toggle8:{interval:100,frames:["◍","◌"]},toggle9:{interval:100,frames:["◉","◎"]},toggle10:{interval:100,frames:["㊂","㊀","㊁"]},toggle11:{interval:50,frames:["⧇","⧆"]},toggle12:{interval:120,frames:["☗","☖"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["←","↖","↑","↗","→","↘","↓","↙"]},arrow2:{interval:80,frames:["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},arrow3:{interval:120,frames:["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},smiley:{interval:200,frames:["😄 ","😝 "]},monkey:{interval:300,frames:["🙈 ","🙈 ","🙉 ","🙊 "]},hearts:{interval:100,frames:["💛 ","💙 ","💜 ","💚 ","💗 "]},clock:{interval:100,frames:["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},earth:{interval:180,frames:["🌍 ","🌎 ","🌏 "]},material:{interval:17,frames:["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},moon:{interval:80,frames:["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},runner:{interval:140,frames:["🚶 ","🏃 "]},pong:{interval:80,frames:["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},shark:{interval:120,frames:["▐|\\____________▌","▐_|\\___________▌","▐__|\\__________▌","▐___|\\_________▌","▐____|\\________▌","▐_____|\\_______▌","▐______|\\______▌","▐_______|\\_____▌","▐________|\\____▌","▐_________|\\___▌","▐__________|\\__▌","▐___________|\\_▌","▐____________|\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},christmas:{interval:400,frames:["🌲","🎄"]},grenade:{interval:80,frames:["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},point:{interval:125,frames:["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},layer:{interval:150,frames:["-","=","≡"]},betaWave:{interval:80,frames:["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},fingerDance:{interval:160,frames:["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},fistBump:{interval:80,frames:["🤜    🤛 ","🤜    🤛 ","🤜    🤛 "," 🤜  🤛  ","  🤜🤛   "," 🤜✨🤛   ","🤜 ✨ 🤛  "]},soccerHeader:{interval:80,frames:[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},mindblown:{interval:160,frames:["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ ","  ","  ","  "]},speaker:{interval:160,frames:["🔈 ","🔉 ","🔊 ","🔉 "]},orangePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},bluePulse:{interval:100,frames:["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},orangeBluePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},timeTravel:{interval:100,frames:["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},aesthetic:{interval:80,frames:["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},dwarfFortress:{interval:80,frames:[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]},fish:{interval:80,frames:["~~~~~~~~~~~~~~~~~~~~","> ~~~~~~~~~~~~~~~~~~","º> ~~~~~~~~~~~~~~~~~","(º> ~~~~~~~~~~~~~~~~","((º> ~~~~~~~~~~~~~~~","<((º> ~~~~~~~~~~~~~~","><((º> ~~~~~~~~~~~~~"," ><((º> ~~~~~~~~~~~~","~ ><((º> ~~~~~~~~~~~","~~ <>((º> ~~~~~~~~~~","~~~ ><((º> ~~~~~~~~~","~~~~ <>((º> ~~~~~~~~","~~~~~ ><((º> ~~~~~~~","~~~~~~ <>((º> ~~~~~~","~~~~~~~ ><((º> ~~~~~","~~~~~~~~ <>((º> ~~~~","~~~~~~~~~ ><((º> ~~~","~~~~~~~~~~ <>((º> ~~","~~~~~~~~~~~ ><((º> ~","~~~~~~~~~~~~ <>((º> ","~~~~~~~~~~~~~ ><((º>","~~~~~~~~~~~~~~ <>((º","~~~~~~~~~~~~~~~ ><((","~~~~~~~~~~~~~~~~ <>(","~~~~~~~~~~~~~~~~~ ><","~~~~~~~~~~~~~~~~~~ <","~~~~~~~~~~~~~~~~~~~~"]}};var am=yA,QVt=Object.keys(yA);var Zx=qs(),yTe=SD(Zx?"ℹ":"i"),gTe=ED(Zx?"✔":"√"),bTe=vD(Zx?"⚠":"‼"),xTe=TD(Zx?"✖":"×");xd();function gA({stream:e=process.stdout}={}){return Boolean(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import Jx from"node:process";var wTe=3;class Sq{#n=0;#r;#t=!1;#e=!1;#i=(e)=>{if(!e?.length)return;if((typeof e==="string"?e.codePointAt(0):e[0])===wTe)Jx.kill(Jx.pid,"SIGINT")};start(){if(this.#n++,this.#n===1)this.#o()}stop(){if(this.#n===0)return;if(--this.#n===0)this.#s()}#o(){let{stdin:e}=Jx;if(Jx.platform==="win32"||!e?.isTTY||typeof e.setRawMode!=="function"){this.#r=void 0;return}if(this.#r=e,this.#t=e.isPaused(),this.#e=Boolean(e.isRaw),e.setRawMode(!0),e.prependListener("data",this.#i),this.#t)e.resume()}#s(){if(!this.#r)return;let e=this.#r;if(e.off("data",this.#i),e.isTTY)e.setRawMode?.(this.#e);if(this.#t)e.pause();this.#r=void 0,this.#t=!1,this.#e=!1}}var TTe=new Sq,bA=Object.freeze(TTe);var vTe=200,STe="\x1B[?2026h",ATe="\x1B[?2026l",Xx=new Map,CTe=new Set(["black","red","green","yellow","blue","magenta","cyan","white","gray"]);class Aq{#n=0;#r=-1;#t=0;#e;#i;#o;#s;#c=new Map;#p=!1;#u;#a;#d=!1;#f;#l(e){this.#p=!0;try{return e()}finally{this.#p=!1}}#h(){if(this.isSpinning)this.render()}#T(e,t){if(e===void 0||e===null)return"";if(typeof e==="string")return e;if(Buffer.isBuffer(e)||ArrayBuffer.isView(e)){let r=typeof t==="string"&&t&&t!=="buffer"?t:"utf8";return Buffer.from(e).toString(r)}return String(e)}#E(e){if(!e)return!1;let t=e.at(-1);return t===`
680
+ `||t==="\r"}#v(){if(this.#a)return;if(this.#a=setTimeout(()=>{if(this.#a=void 0,this.isSpinning)this.#h()},vTe),typeof this.#a?.unref==="function")this.#a.unref()}#y(){if(this.#a)clearTimeout(this.#a),this.#a=void 0}#g(e,t,r,n){let o=this.#x(r," "),s=typeof t==="string"?(e?" ":"")+t:"",a=this.#w(n," ");return o+e+s+a}constructor(e){if(typeof e==="string")e={text:e};if(this.#e={color:"cyan",stream:cm.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#e.color,this.#o=this.#e.stream,typeof this.#e.isEnabled!=="boolean")this.#e.isEnabled=gA({stream:this.#o});if(typeof this.#e.isSilent!=="boolean")this.#e.isSilent=!1;if(this.#e.interval!==void 0&&!(Number.isInteger(this.#e.interval)&&this.#e.interval>0))throw Error("The `interval` option must be a positive integer");let t=this.#e.interval;if(this.spinner=this.#e.spinner,this.#e.interval=t,this.text=this.#e.text,this.prefixText=this.#e.prefixText,this.suffixText=this.#e.suffixText,this.indent=this.#e.indent,cm.env.NODE_ENV==="test")this._stream=this.#o,this._isEnabled=this.#e.isEnabled,Object.defineProperty(this,"_linesToClear",{get(){return this.#n},set(r){this.#n=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#r}}),Object.defineProperty(this,"_lineCount",{get(){let r=this.#o.columns??80,n=typeof this.#e.prefixText==="function"?"":this.#e.prefixText,o=typeof this.#e.suffixText==="function"?"":this.#e.suffixText,i=typeof n==="string"&&n!==""?n+" ":"",s=typeof o==="string"&&o!==""?" "+o:"",a="-",c=" ".repeat(this.#e.indent)+i+"-"+(typeof this.#e.text==="string"?" "+this.#e.text:"")+s;return this.#m(c,r)}})}get indent(){return this.#e.indent}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw Error("The `indent` option must be an integer from 0 and up");this.#e.indent=e}get interval(){return this.#e.interval??this.#i.interval??100}get spinner(){return this.#i}set spinner(e){if(this.#r=-1,this.#e.interval=void 0,typeof e==="object"){if(!Array.isArray(e.frames)||e.frames.length===0||e.frames.some((t)=>typeof t!=="string"))throw Error("The given spinner must have a non-empty `frames` array of strings");if(e.interval!==void 0&&!(Number.isInteger(e.interval)&&e.interval>0))throw Error("`spinner.interval` must be a positive integer if provided");this.#i=e}else if(!qs())this.#i=am.line;else if(e===void 0)this.#i=am.dots;else if(e!=="default"&&am[e])this.#i=am[e];else throw Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#e.text}set text(e=""){this.#e.text=e}get prefixText(){return this.#e.prefixText}set prefixText(e=""){this.#e.prefixText=e}get suffixText(){return this.#e.suffixText}set suffixText(e=""){this.#e.suffixText=e}get isSpinning(){return this.#s!==void 0}#b(e,t,r=!1){let n=typeof e==="function"?e():e;if(typeof n==="string"&&n!=="")return r?t+n:n+t;return""}#x(e=this.#e.prefixText,t=" "){return this.#b(e,t,!1)}#w(e=this.#e.suffixText,t=" "){return this.#b(e,t,!0)}#m(e,t){let r=0;for(let n of ETe(e).split(`
681
+ `))r+=Math.max(1,Math.ceil(fr(n)/t));return r}get color(){return this.#f}set color(e){if(e!==void 0&&e!==!1&&!CTe.has(e))throw Error("The `color` option must be a valid color or `false` to disable");this.#f=e}get isEnabled(){return this.#e.isEnabled&&!this.#e.isSilent}set isEnabled(e){if(typeof e!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this.#e.isEnabled=e}get isSilent(){return this.#e.isSilent}set isSilent(e){if(typeof e!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this.#e.isSilent=e}frame(){let e=Date.now();if(this.#r===-1||e-this.#t>=this.interval)this.#r=(this.#r+1)%this.#i.frames.length,this.#t=e;let{frames:t}=this.#i,r=t[this.#r];if(this.#f)r=Eq[this.#f](r);let n=this.#x(this.#e.prefixText," "),o=typeof this.text==="string"?" "+this.text:"",i=this.#w(this.#e.suffixText," ");return n+r+o+i}clear(){if(!this.isEnabled||!this.#o.isTTY)return this;return this.#l(()=>{this.#o.cursorTo(0);for(let e=0;e<this.#n;e++){if(e>0)this.#o.moveCursor(0,-1);this.#o.clearLine(1)}if(this.#e.indent)this.#o.cursorTo(this.#e.indent)}),this.#n=0,this}#S(e){if(!e||this.#c.has(e)||!e.isTTY||typeof e.write!=="function")return;if(Xx.has(e))console.warn("[ora] Multiple concurrent spinners detected. This may cause visual corruption. Use one spinner at a time.");let t=e.write;this.#c.set(e,t),Xx.set(e,this),e.write=(r,n,o)=>this.#D(e,t,r,n,o)}#A(){if(!this.isEnabled||this.#c.size>0)return;let e=new Set([this.#o,cm.stdout,cm.stderr]);for(let t of e)this.#S(t)}#C(){for(let[e,t]of this.#c)if(e.write=t,Xx.get(e)===this)Xx.delete(e);this.#c.clear()}#D(e,t,r,n,o){if(typeof n==="function")o=n,n=void 0;if(this.#p)return t.call(e,r,n,o);this.clear();let i=this.#T(r,n),s=this.#E(i),a=t.call(e,r,n,o);if(s)this.#y();else if(i.length>0)this.#v();if(this.isSpinning&&!this.#a)this.render();return a}render(){if(!this.isEnabled||this.#u||this.#a)return this;let e=this.#o.isTTY,t=!1;try{if(e)this.#l(()=>this.#o.write(STe)),t=!0;this.clear();let r=this.frame(),n=this.#o.columns??80,o=this.#m(r,n),i=this.#o.rows;if(i&&i>1&&o>i){let a=r.split(`
682
+ `),c=i-1;r=[...a.slice(0,c),"... (content truncated to fit terminal)"].join(`
683
+ `)}if(this.#l(()=>this.#o.write(r))===!1&&this.#o.isTTY)this.#u=()=>{this.#u=void 0,this.#h()},this.#o.once("drain",this.#u);this.#n=this.#m(r,n)}finally{if(t)this.#l(()=>this.#o.write(ATe))}return this}start(e){if(e!==void 0)this.text=e;if(this.isSilent)return this;if(!this.isEnabled){let t=this.text?"-":"",r=" ".repeat(this.#e.indent)+this.#g(t,this.text,this.#e.prefixText,this.#e.suffixText);if(r.trim()!=="")this.#l(()=>this.#o.write(r+`
684
+ `));return this}if(this.isSpinning)return this;if(this.#e.hideCursor)Al.hide(this.#o);if(this.#e.discardStdin&&cm.stdin.isTTY)bA.start(),this.#d=!0;return this.#A(),this.render(),this.#s=setInterval(this.render.bind(this),this.interval),this}stop(){if(clearInterval(this.#s),this.#s=void 0,this.#r=-1,this.#t=0,this.#y(),this.#C(),this.#u)this.#o.removeListener("drain",this.#u),this.#u=void 0;if(this.isEnabled){if(this.clear(),this.#e.hideCursor)Al.show(this.#o)}if(this.#d)this.#d=!1,bA.stop();return this}succeed(e){return this.stopAndPersist({symbol:gTe,text:e})}fail(e){return this.stopAndPersist({symbol:xTe,text:e})}warn(e){return this.stopAndPersist({symbol:bTe,text:e})}info(e){return this.stopAndPersist({symbol:yTe,text:e})}stopAndPersist(e={}){if(this.isSilent)return this;let t=e.symbol??" ",r=e.text??this.text,n=e.prefixText??this.#e.prefixText,o=e.suffixText??this.#e.suffixText,i=this.#g(t,r,n,o)+`
685
+ `;return this.stop(),this.#l(()=>this.#o.write(i)),this}}function Xe(e){return new Aq(e)}var $q=ot(Kr(),1);var vA="file",SA="link",AA="symlink",CA="directory";var DTe={"0":"file","1":"link","2":"symlink","3":"character-device","4":"block-device","5":"directory","6":"fifo",x:"pax-header",g:"pax-global-header",L:"gnu-long-name",K:"gnu-long-link-name"};var xA=new Uint8Array(0);var EA=new TextDecoder;function Pi(e,t,r){if(e[t]===0)return"";let n=e.indexOf(0,t),o=n===-1||n>t+r?t+r:n;return EA.decode(e.subarray(t,o))}function DA(e,t,r){let n=0,o=t+r;for(let i=t;i<o;i++){let s=e[i];if(s===0)break;if(s===32)continue;n=n*8+(s-48)}return n}function Qx(e,t,r){if(e[t]&128){let n=0;n=e[t]&127;for(let o=1;o<r;o++)n=n*256+e[t+o];if(!Number.isSafeInteger(n))throw Error("TAR number too large");return n}return DA(e,t,r)}var ITe=(e)=>e.type==="directory"||e.type==="symlink"||e.type==="link"||e.type==="character-device"||e.type==="block-device"||e.type==="fifo";var Cq=(e,t)=>{let r=e.split("/").filter(Boolean);return t>=r.length?"":r.slice(t).join("/")};function kq(e,t){let{strip:r,filter:n,map:o}=t;if(!r&&!n&&!o)return e;let i={...e};if(r&&r>0){let a=Cq(i.name,r);if(!a)return null;if(i.name=i.type==="directory"&&!a.endsWith("/")?`${a}/`:a,i.linkname){let c=i.linkname.startsWith("/");if(c||i.type==="link"){let u=Cq(i.linkname,r);i.linkname=c?`/${u}`||"/":u}}}if(n?.(i)===!1)return null;let s=o?o(i):i;if(s&&(!s.name?.trim()||s.name==="."||s.name==="/"))return null;return s}var wA=256;function OTe(){let e=Array(wA),t=e.length-1,r=0,n=0,o=0,i=(a)=>{let c=e[r];if(a===c.length)e[r]=xA,r=r+1&t;else e[r]=c.subarray(a);if(o-=a,o===0&&e.length>wA)e=Array(wA),t=255,r=0,n=0};function s(a,c){if(c){let d=0,h=Math.min(a,o);while(h>0){let m=e[r],y=Math.min(h,m.length),g=y===m.length?m:m.subarray(0,y);if(i(y),h-=y,d+=y,!c(g))break}return d}if(o<a)return null;if(a===0)return xA;let u=e[r];if(u.length>=a){let d=u.length===a?u:u.subarray(0,a);return i(a),d}let l=new Uint8Array(a),p=0,f=a;while(f>0){let d=e[r],h=Math.min(f,d.length);l.set(h===d.length?d:d.subarray(0,h),p),p+=h,f-=h,i(h)}return l}return{push:(a)=>{if(a.length===0)return;let c=n+1&t;if(c===r){let u=e.length,l=u*2,p=Array(l),f=n-r+u&u-1;if(r<n)for(let d=0;d<f;d++)p[d]=e[r+d];else{let d=u-r;for(let h=0;h<d;h++)p[h]=e[r+h];for(let h=0;h<n;h++)p[d+h]=e[h]}e=p,t=l-1,r=0,n=f,c=n+1&t}e[n]=a,n=c,o+=a.length},available:()=>o,peek:(a)=>{if(o<a)return null;if(a===0)return xA;let c=e[r];if(c.length>=a)return c.length===a?c:c.subarray(0,a);let u=new Uint8Array(a),l=0,p=r;while(l<a){let f=e[p],d=Math.min(a-l,f.length);if(d===f.length)u.set(f,l);else u.set(f.subarray(0,d),l);l+=d,p=p+1&t}return u},discard:(a)=>{if(a>o)throw Error("Too many bytes consumed");if(a===0)return;let c=a;while(c>0){let u=e[r],l=Math.min(c,u.length);i(l),c-=l}},pull:s}}var kTe=32;function RTe(e){let t=DA(e,148,8),r=0;for(let n=0;n<e.length;n++)if(n>=148&&n<156)r+=kTe;else r+=e[n];return t===r}function PTe(e,t){if(t&&!RTe(e))throw Error("Invalid tar header checksum.");let r=Pi(e,156,1),n={name:Pi(e,0,100),mode:DA(e,100,8),uid:Qx(e,108,8),gid:Qx(e,116,8),size:Qx(e,124,12),mtime:new Date(Qx(e,136,12)*1000),type:DTe[r]||"file",linkname:Pi(e,157,100)},o=Pi(e,257,6);if(o.trim()==="ustar")n.uname=Pi(e,265,32),n.gname=Pi(e,297,32);if(o==="ustar")n.prefix=Pi(e,345,155);return n}var Dq={path:["name",(e)=>e],linkpath:["linkname",(e)=>e],size:["size",(e)=>/^\d+$/.test(e)&&Number.isSafeInteger(+e)?+e:NaN],mtime:["mtime",parseFloat],uid:["uid",(e)=>parseInt(e,10)],gid:["gid",(e)=>parseInt(e,10)],uname:["uname",(e)=>e],gname:["gname",(e)=>e]};function _Te(e){let t=Object.create(null),r=Object.create(null),n=!1,o=0;while(o<e.length){let i=e.indexOf(32,o);if(i===-1)break;let s=parseInt(EA.decode(e.subarray(o,i)),10);if(!(s>0))break;let a=o+s,c=EA.decode(e.subarray(i+1,a-1)),u=c.indexOf("=");if(u>0){let l=c.slice(0,u),p=c.slice(u+1);if(r[l]=p,n=!0,Object.hasOwn(Dq,l)){let[f,d]=Dq[l],h=d(p);if(typeof h==="string"||!Number.isNaN(h))t[f]=h}}o=a}if(n)t.pax=r;return t}function Iq(e,t){if(t.name!==void 0)e.name=t.name;if(t.linkname!==void 0)e.linkname=t.linkname;if(t.size!==void 0)e.size=t.size;if(t.mtime!==void 0)e.mtime=new Date(t.mtime*1000);if(t.uid!==void 0)e.uid=t.uid;if(t.gid!==void 0)e.gid=t.gid;if(t.uname!==void 0)e.uname=t.uname;if(t.gname!==void 0)e.gname=t.gname;if(t.pax)e.pax=Object.assign({},e.pax??{},t.pax)}function BTe(e){switch(e){case"pax-global-header":case"pax-header":return _Te;case"gnu-long-name":return(t)=>({name:Pi(t,0,t.length)});case"gnu-long-link-name":return(t)=>({linkname:Pi(t,0,t.length)});default:return}}var TA=0,um=1,NTe=8388608,ew=Error("Tar archive is truncated.");function Rq(e={}){let t=e.strict??!1,{available:r,peek:n,push:o,discard:i,pull:s}=OTe(),a=TA,c=!1,u=!1,l=!1,p=null,f={},d={},h={isEntryActive:()=>a===um,isBodyComplete:()=>!p||p.remaining===0,canFinish:()=>!p||r()>=p.remaining+p.padding,bodyBytes:()=>p&&p.remaining>0?Math.min(p.remaining,r()):0,available:r,write(m){if(c)throw Error("Archive already ended.");o(m)},end(){c=!0},readHeader(){if(a!==TA)throw Error("Cannot read header while an entry is active");if(u)return;while(!u){if(r()<512){if(c){if(r()>0&&t)throw ew;u=!0;return}return null}let m=n(512);if(Oq(m)){if(r()<1024){if(c){if(t)throw ew;u=!0;return}return null}if(Oq(n(1024).subarray(512))){i(1024),u=!0,l=!0;return}if(t)throw Error("Invalid tar header.");i(512);continue}let y;try{y=PTe(m,t)}catch(w){if(t)throw w;i(512);continue}let g=BTe(y.type);if(g){if(y.size>NTe)throw Error("Tar metadata entry exceeds maximum size.");let w=y.size+(-y.size&511);if(r()<512+w){if(c&&t)throw ew;return null}i(512);let v=g(s(w).subarray(0,y.size));if(d.pax)d={};let D=y.type==="pax-global-header"?f:d;for(let O in v)D[O]=v[O];continue}i(512);let x=y;if(y.prefix)x.name=`${y.prefix}/${x.name}`;Iq(x,f),Iq(x,d);let b=x.size;if(ITe(x))b=0,x.size=0;else if(x.name.endsWith("/")&&x.type==="file")x.type="directory",x.size=0;return d={},p={header:x,remaining:b,padding:-b&511},a=um,x}},streamBody(m){if(a!==um||!p||p.remaining===0)return 0;let y=Math.min(p.remaining,r());if(y===0)return 0;let g=s(y,m);return p.remaining-=g,g},skipPadding(){if(a!==um||!p)return!0;if(p.remaining>0)throw Error("Body not fully consumed");if(r()<p.padding)return!1;return i(p.padding),p=null,a=TA,!0},skipEntry(){if(a!==um||!p)return!0;let m=Math.min(p.remaining,r());if(m>0)i(m),p.remaining-=m;if(p.remaining>0)return!1;return h.skipPadding()},validateEOF(){if(t){if(!l)throw ew;if(r()>0){if(s(r()).some((m)=>m!==0))throw Error("Invalid EOF.")}}}};return h}function Oq(e){if(e[0]!==0)return!1;if(e.byteOffset%8===0){let t=new BigUint64Array(e.buffer,e.byteOffset,e.length/8);for(let r=0;r<t.length;r++)if(t[r]!==0n)return!1;return!0}for(let t=0;t<e.length;t++)if(e[t]!==0)return!1;return!0}import*as Pe from"node:fs";import*as ce from"node:fs/promises";import{cpus as FTe}from"node:os";import*as le from"node:path";import{Readable as SWt,Writable as MTe}from"node:stream";function _i(e,t,r){let n=le.resolve(e),o=le.resolve(t);if(n!==o&&!n.startsWith(o+le.sep))throw Error(r)}var LTe={":":"","<":"",">":"","|":"","?":"","*":"",'"':""},$Te=/\/\/|(?:^|\/)\.(?:\/|$)/;function UTe(e){let t=e.replace(/\\/g,"/");if(t.split("/").includes("..")||/^[a-zA-Z]:\.\./.test(t))throw Error(`${e} points outside extraction directory`);let r=t;if(/^[a-zA-Z]:/.test(r))r=r.replace(/^[a-zA-Z]:[/\\]?/,"");else if(r.startsWith("/"))r=r.replace(/^\/+/,"");if(process.platform==="win32")return r.replace(/[<>:"|?*]/g,(n)=>LTe[n]);return r}var HTe=(e)=>{let t=UTe(e.replace(/[\\/]+$/,""));return $Te.test(t)?le.posix.normalize(t):t};var jTe=(e)=>{let t=0,r=[],n=0,o=null,i=null,s=()=>o??=new Promise((c)=>i=c),a=()=>{while(t<e&&n<r.length){let c=r[n++];t++,c().finally(()=>{t--,a()})}if(n===r.length){if(r.length=0,n=0,t===0&&i)i(),o=null,i=null}};return{add(c){let u=t===0&&n===r.length;return new Promise((l,p)=>{if(r.push(()=>Promise.resolve().then(c).then(l,p)),u)s();a()})},onIdle(){return t===0&&n===r.length?Promise.resolve():s()}}},Pq=262144,IA=8388608,tw=1024,_q=Pe.constants.O_WRONLY|Pe.constants.O_CREAT|Pe.constants.O_TRUNC|(Pe.constants.O_NOFOLLOW??0)|Pe.constants.O_EXCL,rw=1,Bi=2,lm=3,Bq=4,Nq=Promise.resolve(),Fq=(e)=>Pe.ftruncate(e,0,()=>Pe.close(e));function qTe(e,{mode:t=438,mtime:r}={},n){let o=rw,i=!1,s=null,a=[],c=[],u=0,l=null,p=null,f=null,d=null,h=null,m=null,y=null,g=null,x=(k)=>{if(!m)return;let I=y,C=g;if(m=null,y=null,g=null,k)C?.(k);else I?.()},b=()=>{u=0,a.length=0,c.length=0},w=()=>{if(o===Bq)return;o=lm,d?.(),x()},v=(k)=>{if(l)return;l=k,o=Bq;let I=i;b();let C=s;if(s=null,C!==null)if(I)p=C;else Fq(C);if(i=!1,h)h(k);else n?.(k);x(k)},D=()=>{if(s===null){w();return}let k=s;if(s=null,r)Pe.futimes(k,r,r,(I)=>{if(o!==Bi){Pe.close(k);return}if(I){Pe.close(k,()=>v(I));return}Pe.close(k,(C)=>{if(o!==Bi)return;if(C)v(C);else w()})});else Pe.close(k,(I)=>{if(o!==Bi)return;if(I)v(I);else w()})},O=()=>{if(i||a.length===0||o!==Bi)return;i=!0;let k=a;a=c,c=k,a.length=0;let I=u,C=(P,N=0)=>{if(o!==Bi){if(p!==null){let L=p;p=null,Fq(L)}return}if(P){i=!1,v(P);return}if(N<=0||N>I){i=!1,v(Error("File write made no progress."));return}if(u-=N,I-=N,I>0){let L=N,F=0;while(L>=k[F].length)L-=k[F++].length;if(k=k.slice(F),L>0)k[0]=k[0].subarray(L);if(k.length===1){let j=k[0];Pe.write(s,j,0,j.length,null,C)}else Pe.writev(s,k,C);return}if(i=!1,c.length=0,u<IA)x();if(a.length>0)O();else if(d)D()};if(k.length===1){let P=k[0];Pe.write(s,P,0,P.length,null,C)}else Pe.writev(s,k,C)},T=(k,I)=>{if(k)return v(k);if(o>=lm){Pe.close(I);return}if(s=I,o=Bi,d)if(a.length>0)O();else D();else if(u>=Pq||a.length>=tw)O();else x()},A=(k)=>{if(o>=lm||d)return!1;if(a.push(k),u+=k.length,o===Bi&&!i&&(u>=Pq||a.length>=tw))O();return u<IA&&a.length<tw},E=()=>{if(l)return Promise.reject(l);if(o===rw||o===Bi&&(u>=IA||a.length>=tw))return m??=new Promise((k,I)=>{y=k,g=I});return Nq},R=()=>{if(l)return Promise.reject(l);if(o>=lm)return Nq;if(f)return f;return f=new Promise((k,I)=>{if(d=k,h=I,o===Bi&&!i)if(a.length>0)O();else D()}),f},S=(k)=>{if(k){v(k);return}if(o>=lm)return;if(b(),i=!1,s!==null){let I=s;s=null,Pe.close(I)}w()};return Pe.open(e,_q,t,(k,I)=>{if(k?.code!=="EEXIST")return T(k,I);if(o!==rw)return;Pe.rm(e,{force:!0},(C)=>{if(C)return v(C);if(o!==rw)return;Pe.open(e,_q,t,T)})}),{write:A,end:R,destroy:S,waitDrain:E}}var Mq=()=>{let e=new Map;return{get(t){let r=e.get(t);if(e.delete(t))e.set(t,r);return r},set(t,r){if(e.set(t,r).size>1e4)e.delete(e.keys().next().value)},clear(){e.clear()}}},qo="ENOENT",zTe=64,GTe=process.platform==="win32"?/[/\\]/:"/",nw=(e)=>e.split(GTe).filter((t)=>t&&t!=="."),VTe=(e,t,r,n)=>{let{maxDepth:o=1024,dmode:i}=t,s=Mq(),a=new Map,c=[],u,l=Mq(),f=(async(m)=>{let y=le.resolve(m);try{await ce.mkdir(y,{recursive:!0})}catch(g){if(g.code===qo){let x=le.dirname(y);if(x===y)throw g;await ce.mkdir(x,{recursive:!0}),await ce.mkdir(y,{recursive:!0})}else throw g}try{return{symbolic:y,real:await ce.realpath(y)}}catch(g){if(g.code===qo)return{symbolic:y,real:y};throw g}})(e);f.catch(()=>{});let d=async(m,y)=>{let g=await f;if(m===g.symbolic)return g.real;let x=l.get(m);if(!x)x=ce.realpath(m).then((b)=>(_i(b,g.real,y),b)),l.set(m,x);return x},h=async(m,y)=>{let g=s.get(m);if(g)return g;return g=(async()=>{if(m===(await f).symbolic)return;await h(le.dirname(m));try{let x=await ce.lstat(m);if(x.isDirectory())return;if(x.isSymbolicLink())try{let b=await d(m,`Symlink "${m}" points outside the extraction directory.`);if((await ce.stat(b)).isDirectory())return}catch(b){if(b.code===qo)throw Error(`Symlink "${m}" points outside the extraction directory.`);throw b}throw Error(`"${m}" is not a valid directory component.`)}catch(x){if(x.code===qo){await ce.mkdir(m,{mode:y??t.dmode});return}throw x}})(),s.set(m,g),g};return{async ready(){await f},async preparePath(m){let{name:y,linkname:g,type:x,mode:b,mtime:w}=m,v=HTe(y),D=await f,O=le.join(D.symbolic,v);if(o!==1/0){let E=1;for(let R of v)if(R==="/"&&++E>o)throw Error("Tar exceeds max specified depth.")}let T=a.get(v);if(T){if(T==="directory"&&x!=="directory"||T!=="directory"&&x==="directory")throw Error(`Path conflict ${x} over existing ${T} at "${y}"`);return}let A=le.dirname(O);switch(x){case CA:{a.set(v,CA);let E=b===void 0?void 0:b&511;if(await h(O,i??E),w)await ce.lutimes(O,w,w).catch(()=>{});return}case vA:return a.set(v,vA),await h(A),le.join(await d(A,`File "${y}" points outside the extraction directory.`),le.basename(O));case AA:{if(a.set(v,AA),!g)return;_i(le.resolve(A,g),D.symbolic,`Symlink "${g}" points outside the extraction directory.`),await h(A);let E=await ce.realpath(A);_i(E,D.real,"Symlink parent changed."),_i(le.resolve(E,g),D.real,`Symlink "${g}" points outside the extraction directory.`);let R=le.join(E,le.basename(O));try{await ce.symlink(g,R)}catch(S){if(S.code!=="EEXIST")throw S;if(await ce.rm(R,{force:!0}),await ce.realpath(A)!==E)throw Error("Symlink parent changed.");await ce.symlink(g,R)}if((u??=[]).push([v,g]),s.clear(),l.clear(),w)await ce.lutimes(O,w,w).catch(()=>{});return}case SA:{if(a.set(v,SA),!g)return;if(le.isAbsolute(g))throw Error(`Hardlink "${g}" points outside the extraction directory.`);let E=le.join(D.symbolic,g);if(_i(E,D.symbolic,`Hardlink "${g}" points outside the extraction directory.`),await h(A),E!==O)c.push({linkTarget:E,outPath:O});return}default:return}},async checkSymlinks(){if(!u)return;let{symbolic:m,real:y}=await f,g=y+le.sep,x=le.parse(y).root,b=nw(y.slice(x.length)).length,w=(D,O,T)=>{if(!le.isAbsolute(D))return nw(D);_i(D,y,T),O.length=0;let A=nw(D.slice(x.length));return A.splice(0,b),A},v=async([D,O])=>{let T=le.join(m,D);try{try{let C=await ce.realpath(T);if(C!==y&&!C.startsWith(g))throw Error(`Symlink "${O}" points outside the extraction directory.`);return}catch(C){if(C.code!==qo)throw C}if(!(await ce.lstat(T)).isSymbolicLink())return;let A=await ce.readlink(T),E=`Symlink "${A}" points outside the extraction directory.`,R=await ce.realpath(le.dirname(T));_i(R,y,E);let S=nw(le.relative(y,R)),k=w(A,S,E),I=0;for(let C=0;C<k.length;C++){let P=k[C];if(P===".."){if(!S.length)throw Error(E);S.pop();continue}S.push(P);let N=le.join(y,...S),L;try{L=await ce.lstat(N)}catch(j){if(j.code===qo)continue;throw j}if(!L.isSymbolicLink())continue;if(++I>zTe)throw Error(E);let F=await ce.readlink(N);S.pop(),k.splice(C+1,0,...w(F,S,E))}}catch(A){if(A.code!==qo)return A}};for(let D=0;D<u.length;D+=n){let O=u.slice(D,D+n),T=await Promise.all(O.map((A)=>r.add(()=>v(A))));for(let[A,E]of T.entries()){if(E===void 0)continue;throw await ce.rm(le.join(m,O[A][0]),{force:!0}),E}}},async applyLinks(){let m=(await f).real;for(let{linkTarget:y,outPath:g}of c)try{let x=await ce.realpath(le.dirname(y));_i(x,m,`Hardlink "${y}" points outside the extraction directory.`);let b=le.join(x,le.basename(y)),[w,v]=await Promise.allSettled([r.add(()=>ce.lstat(b)),r.add(()=>ce.realpath(le.dirname(g)))]);if(w.status==="rejected")throw w.reason;let D=w.value;if(D.isSymbolicLink())throw Error(`Hardlink "${y}" is a symlink.`);if(v.status==="rejected")throw v.reason;let O=v.value;_i(O,m,`Hardlink "${g}" points outside the extraction directory.`);let T=le.join(O,le.basename(g));try{await ce.link(b,T)}catch(E){let R=E.code;if(R!=="EEXIST"&&R!==qo)throw E;try{let S=await ce.lstat(T);if(S.dev===D.dev&&S.ino===D.ino)continue;await ce.rm(T,{force:!0})}catch(S){if(S.code!==qo)throw S}await ce.link(b,T)}let A=await ce.lstat(T);if(A.dev!==D.dev||A.ino!==D.ino)throw await ce.rm(T,{force:!0}),Error(`Hardlink target "${y}" changed during creation for link at "${g}".`)}catch(x){if(x.code===qo)throw Error(`Hardlink target "${y}" does not exist for link at "${g}".`);throw x}}}};function Lq(e,t={}){let r=Rq(t),n=t.concurrency||FTe().length||8,o=jTe(n),i,s=VTe(e,t,o,n),a=null,c=new Set,u=!1,l=(h)=>{let m=a.write(h);if(!m)u=!0;return m},p=(h)=>{if(!d.destroyed)d.destroy(h)},f=()=>{let h=a;a=null,o.add(()=>h.end()).then(()=>c.delete(h),(m)=>{c.delete(h),p(m)})},d=new MTe({async write(h,m,y){let g,x;try{if(r.write(h),r.isEntryActive()){if(a){while(!r.isBodyComplete()){u=!1;let b=r.streamBody(l);if(u)await a.waitDrain();else if(b===0)return}if(!r.skipPadding())return;f()}else if(!r.skipEntry())return}while(!0){let b=r.readHeader();if(b===void 0||b===null)return;let w=kq(b,t);if(!w){if(!r.skipEntry())return;continue}let v=await o.add(()=>s.preparePath(w));if(i)throw i;if(v){let D=w.mode===void 0?void 0:w.mode&511;a=qTe(v,{mode:t.fmode??D,mtime:w.mtime??void 0},p),c.add(a),(g??=[]).push(a.waitDrain().catch((O)=>O));while(!r.isBodyComplete()){u=!1;let O=r.streamBody(l);if(u)await a.waitDrain();else if(O===0)return}if(!r.skipPadding())return;f()}else if(!r.skipEntry())return}}catch(b){x=b}finally{let b=g?(await Promise.all(g)).find((w)=>w):void 0;y(i??b??x)}},async final(h){try{if(r.end(),r.validateEOF(),a)f();if(await s.ready(),await o.onIdle(),i)throw i;await s.checkSymlinks(),await s.applyLinks(),h()}catch(m){h(m)}},destroy(h,m){let y=c.size>0||d.writableLength>0||d.writableEnded&&!d.writableFinished;if(!h&&!y){m(null);return}i=h??AbortSignal.abort().reason;for(let g of c)g.destroy(i);c.clear(),a=null,m(i)}});return d}import WTe from"node:path";import{pipeline as KTe}from"node:stream/promises";import{createGunzip as YTe}from"node:zlib";var Uq=async(e,t,r)=>{let o=`https://codeload.github.com/cartesi/application-templates/tar.gz/refs/heads/${t}`;await $q.ensureDir(r);let i=await fetch(o);if(!i.ok)throw Error(`Failed to download template: ${i.statusText}`);let s=Lq(r,{filter:(a)=>a.name.split("/").splice(1).join("/").startsWith(`${e}/`),map:(a)=>{let c=a.name.split("/").splice(1).join("/");return a.name=WTe.relative(e,c),a}});return await KTe(i.body,YTe(),s),{dir:r,source:"https://github.com/cartesi/application-templates"}};var ZTe="prerelease/sdk-12",JTe=["cpp","cpp-low-level","go","java","javascript","lua","python","ruby","rust","typescript"],Hq=()=>new re("create").argument("<name>","application and directory name").addOption(new $e("-t, --template <template>","template name to use").choices(JTe).makeOptionMandatory()).option("-b, --branch <branch>","cartesi/application-templates repository branch name to use",ZTe).action(async(e,{branch:t,template:r})=>{let n=Xe("Creating application...").start();try{let{dir:o}=await Uq(r,t,e);n.succeed(`Application created at ${U.cyan(o)}`)}catch(o){n.fail(o instanceof Error?`Error creating application: ${U.red(o.message)}`:String(o))}});var jq=()=>new re("build").description("DEPRECATED: Package the application in a Docker image ready to be deployed.").action(async()=>{console.warn(U.yellow("deploy build command is deprecated"))});var qq=()=>{let e=new re("deploy").description("DEPRECATED: Package and deploy the application to a supported live network.").action(async()=>{console.warn(U.yellow("deploy command is deprecated, use 'cartesi-rollups-cli' directly instead"))});return e.addCommand(jq(),{hidden:!0}),e};var XTe=["emacs","vim"],QTe=new Set(XTe);function eEe(e){return QTe.has(e)}function zq(){let e=process.env.INQUIRER_KEYBINDINGS;if(!e)return[];return Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(eEe)))}var pm=(e,t=[])=>e.name==="up"||t.includes("vim")&&e.name==="k"||t.includes("emacs")&&e.ctrl&&e.name==="p",ow=(e,t=[])=>e.name==="down"||t.includes("vim")&&e.name==="j"||t.includes("emacs")&&e.ctrl&&e.name==="n";var fm=(e)=>e.name==="backspace",dm=(e)=>e.name==="tab",OA=(e)=>"1234567890".includes(e.name),Xa=(e)=>e.name==="enter"||e.name==="return";class mm extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(e){super();this.cause=e?.cause}}class kA extends Error{name="CancelPromptError";message="Prompt was canceled"}class np extends Error{name="ExitPromptError"}class RA extends Error{name="HookError"}class hm extends Error{name="ValidationError"}import{AsyncResource as oEe}from"node:async_hooks";import{AsyncLocalStorage as tEe,AsyncResource as rEe}from"node:async_hooks";var Gq=new tEe;function nEe(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Vq(e,t){let r=nEe(e);function n(o){r.handleChange=()=>{r.index=0,o()},r.handleChange()}return Gq.run(r,()=>t(n))}function Qa(){let e=Gq.getStore();if(!e)throw new RA("[Inquirer] Hook functions can only be called from within a prompt");return e}function PA(){return Qa().rl}function _A(e){let t=(...r)=>{let n=Qa(),o=!1,i=n.handleChange;n.handleChange=()=>{o=!0};let s=e(...r);if(o)i();return n.handleChange=i,s};return rEe.bind(t)}function op(e){let t=Qa(),{index:r}=t,n={get(){return t.hooks[r]},set(i){t.hooks[r]=i},initialized:r in t.hooks},o=e(n);return t.index++,o}function Wq(){Qa().handleChange()}var ym={queue(e){let t=Qa(),{index:r}=t;t.hooksEffect.push(()=>{t.hooksCleanup[r]?.();let n=e(PA());if(n!=null&&typeof n!=="function")throw new hm("useEffect return value must be a cleanup function or nothing.");t.hooksCleanup[r]=n})},run(){let e=Qa();_A(()=>{e.hooksEffect.forEach((t)=>{t()}),e.hooksEffect.length=0})()},clearAll(){let e=Qa();e.hooksCleanup.forEach((t)=>{t?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function iEe(e){return typeof e==="function"}function sEe(e){return typeof e==="function"}function Tt(e){return op((t)=>{let r=oEe.bind(function(i){let s=t.get(),a=sEe(i)?i(s):i;if(!Object.is(s,a))t.set(a),Wq()});if(t.initialized)return[t.get(),r];let n=iEe(e)?e():e;return t.set(n),[n,r]})}function Ni(e,t){op((r)=>{let n=r.get();if(!Array.isArray(n)||t.some((i,s)=>!Object.is(i,n[s])))ym.queue(e);r.set(t)})}import{styleText as Zn}from"node:util";import Yn from"node:process";function aEe(){if(!Yn.platform.startsWith("win"))return Yn.env.TERM!=="linux";return Boolean(Yn.env.CI)||Boolean(Yn.env.WT_SESSION)||Boolean(Yn.env.TERMINUS_SUBLIME)||Yn.env.ConEmuTask==="{cmd::Cmder}"||Yn.env.TERM_PROGRAM==="Terminus-Sublime"||Yn.env.TERM_PROGRAM==="vscode"||Yn.env.TERM==="xterm-256color"||Yn.env.TERM==="alacritty"||Yn.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Kq={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},Yq={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},cEe={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},uEe={...Kq,...Yq},lEe={...Kq,...cEe},pEe=aEe(),fEe=pEe?uEe:lEe,ip=fEe,eKt=Object.entries(Yq);var dEe={prefix:{idle:Zn("blue","?"),done:Zn("green",ip.tick)},spinner:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map((e)=>Zn("yellow",e))},keybindings:[],style:{answer:(e)=>Zn("cyan",e),message:(e)=>Zn("bold",e),error:(e)=>Zn("red",`> ${e}`),defaultAnswer:(e)=>Zn("dim",`(${e})`),help:(e)=>Zn("dim",e),highlight:(e)=>Zn("cyan",e),key:(e)=>Zn("cyan",Zn("bold",`<${e}>`))}};function Zq(){return{...dEe,keybindings:zq()}}function Jq(e){if(typeof e!=="object"||e===null)return!1;let t=e;while(Object.getPrototypeOf(t)!==null)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Xq(...e){let t={};for(let r of e)for(let[n,o]of Object.entries(r)){let i=t[n];t[n]=Jq(i)&&Jq(o)?Xq(i,o):o}return t}function Fi(...e){let t=[Zq(),...e.filter((r)=>r!=null)];return Xq(...t)}function ec({status:e="idle",theme:t}){let[r,n]=Tt(!1),[o,i]=Tt(0),{prefix:s,spinner:a}=Fi(t);if(Ni(()=>{if(e==="loading"){let u,l=-1,p=setTimeout(()=>{n(!0),u=setInterval(()=>{l=l+1,i(l%a.frames.length)},a.interval)},300);return()=>{clearTimeout(p),clearInterval(u)}}else n(!1)},[e]),r)return a.frames[o];return typeof s==="string"?s:s[e==="loading"?"idle":e]??s.idle}function gm(e,t){return op((r)=>{let n=r.get();if(!r.initialized||n.dependencies.length!==t.length||n.dependencies.some((o,i)=>o!==t[i])){let o=e();return r.set({value:o,dependencies:t}),o}return n.value})}function tc(e){return Tt({current:e})[0]}function Mi(e){let t=tc(e);t.current=e,Ni((r)=>{let n=!1,o=_A((i,s)=>{if(n)return;t.current(s,r)});return r.input.on("keypress",o),()=>{n=!0,r.input.removeListener("keypress",o)}},[])}var yz=ot(ez(),1);var tz=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return(t)=>{let r=0;e.lastIndex=0;while(e.test(t))r+=1;return t.length-r}})(),rz=(e)=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,nz=(e)=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141;var yEe=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,gEe=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,oz=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,bEe=/\t{1,1000}/y,iz=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,xEe=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,wEe=/\p{M}+/gu,TEe={limit:1/0,ellipsis:""},sz=(e,t={},r={})=>{let n=t.limit??1/0,o=t.ellipsis??"",i=t?.ellipsisWidth??(o?sz(o,TEe,r).width:0),s=0,a=r.controlWidth??0,c=r.tabWidth??8,u=r.emojiWidth??2,l=2,p=r.regularWidth??1,f=r.wideWidth??2,d=[[xEe,p],[yEe,0],[gEe,a],[bEe,c],[iz,u],[oz,f]],h=0,m=0,y=e.length,g=0,x=!1,b=y,w=Math.max(0,n-i),v=0,D=0,O=0,T=0;e:while(!0){if(D>v||m>=y&&m>h){let A=e.slice(v,D)||e.slice(h,m);g=0;for(let E of A.replaceAll(wEe,"")){let R=E.codePointAt(0)||0;if(rz(R))T=2;else if(nz(R))T=f;else T=p;if(O+T>w)b=Math.min(b,Math.max(v,h)+g);if(O+T>n){x=!0;break e}g+=E.length,O+=T}v=D=0}if(m>=y)break e;for(let A=0,E=d.length;A<E;A++){let[R,S]=d[A];if(R.lastIndex=m,R.test(e)){if(g=R===oz?tz(e.slice(m,R.lastIndex)):R===iz?1:R.lastIndex-m,T=g*S,O+T>w)b=Math.min(b,m+Math.floor((w-O)/S));if(O+T>n){x=!0;break e}O+=T,v=h,D=m,m=h=R.lastIndex;continue e}}m+=1}return{width:x?w:O,index:x?b:y,truncated:x,ellipsed:x&&n>=i}},az=sz;var EEe={limit:1/0,ellipsis:"",ellipsisWidth:0},vEe=(e,t={})=>az(e,EEe,t).width,Li=vEe;var iw="\x1B",fz="›",SEe=39,NA="\x07",dz="[",AEe="]",mz="m",FA=`${AEe}8;;`,cz=new RegExp(`(?:\\${dz}(?<code>\\d+)m|\\${FA}(?<uri>.*)${NA})`,"y"),uz=(e)=>{if(e>=30&&e<=37)return 39;if(e>=90&&e<=97)return 39;if(e>=40&&e<=47)return 49;if(e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0;return},lz=(e)=>`${iw}${dz}${e}${mz}`,pz=(e)=>`${iw}${FA}${e}${NA}`,BA=(e,t,r)=>{let n=t[Symbol.iterator](),o=!1,i=!1,s=e.at(-1),a=s===void 0?0:Li(s),c=n.next(),u=n.next(),l=0;while(!c.done){let p=c.value,f=Li(p);if(a+f<=r)e[e.length-1]+=p;else e.push(p),a=0;if(p===iw||p===fz)o=!0,i=t.startsWith(FA,l+1);if(o){if(i){if(p===NA)o=!1,i=!1}else if(p===mz)o=!1}else if(a+=f,a===r&&!u.done)e.push(""),a=0;c=u,u=n.next(),l+=p.length}if(s=e.at(-1),!a&&s!==void 0&&s.length&&e.length>1)e[e.length-2]+=e.pop()},CEe=(e)=>{let t=e.split(" "),r=t.length;while(r){if(Li(t[r-1]))break;r--}if(r===t.length)return e;return t.slice(0,r).join(" ")+t.slice(r).join("")},DEe=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",o,i,s=e.split(" "),a=[""],c=0;for(let p=0;p<s.length;p++){let f=s[p];if(r.trim!==!1){let h=a.at(-1)??"",m=h.trimStart();if(h.length!==m.length)a[a.length-1]=m,c=Li(m)}if(p!==0){if(c>=t&&(r.wordWrap===!1||r.trim===!1))a.push(""),c=0;if(c||r.trim===!1)a[a.length-1]+=" ",c++}let d=Li(f);if(r.hard&&d>t){let h=t-c,m=1+Math.floor((d-h-1)/t);if(Math.floor((d-1)/t)<m)a.push("");BA(a,f,t),c=Li(a.at(-1)??"");continue}if(c+d>t&&c&&d){if(r.wordWrap===!1&&c<t){BA(a,f,t),c=Li(a.at(-1)??"");continue}a.push(""),c=0}if(c+d>t&&r.wordWrap===!1){BA(a,f,t),c=Li(a.at(-1)??"");continue}a[a.length-1]+=f,c+=d}if(r.trim!==!1)a=a.map((p)=>CEe(p));let u=a.join(`
686
+ `),l=!1;for(let p=0;p<u.length;p++){let f=u[p];if(n+=f,!l){if(l=f>="\uD800"&&f<="\uDBFF",l)continue}else l=!1;if(f===iw||f===fz){cz.lastIndex=p+1;let h=cz.exec(u)?.groups;if(h?.code!==void 0){let m=Number.parseFloat(h.code);o=m===SEe?void 0:m}else if(h?.uri!==void 0)i=h.uri.length===0?void 0:h.uri}if(u[p+1]===`
687
+ `){if(i)n+=pz("");let d=o?uz(o):void 0;if(o&&d)n+=lz(d)}else if(f===`
688
+ `){if(o&&uz(o))n+=lz(o);if(i)n+=pz(i)}}return n},IEe=/\r?\n/;function hz(e,t,r){return String(e).normalize().split(IEe).map((n)=>DEe(n,t,r)).join(`
689
+ `)}function bm(e,t){return e.split(`
690
+ `).flatMap((r)=>hz(r,t,{trim:!1,wordWrap:!1}).split(`
691
+ `).map((n)=>n.trimEnd())).join(`
692
+ `)}function sw(){return yz.default({defaultWidth:80,output:PA().output})}function OEe({active:e,renderedItems:t,pageSize:r,loop:n}){let o=tc({lastPointer:e,lastActive:void 0}),{lastPointer:i,lastActive:s}=o.current,a=Math.floor(r/2),c=t.reduce((p,f)=>p+f.length,0),u=t.slice(0,e).reduce((p,f)=>p+f.length,0),l=u;if(c>r)if(n){if(l=i,s!=null&&s<e&&e-s<r)l=Math.min(a,Math.abs(e-s)===1?Math.min(i+(t[s]?.length??0),Math.max(u,i)):i+e-s)}else{let p=t.slice(e).reduce((f,d)=>f+d.length,0);l=p<r-a?r-p:Math.min(u,a)}return o.current.lastPointer=l,o.current.lastActive=e,l}function MA({items:e,active:t,renderItem:r,pageSize:n,loop:o=!0}){let i=sw(),s=(g)=>(g%e.length+e.length)%e.length,a=e.map((g,x)=>{if(g==null)return[];return bm(r({item:g,index:x,isActive:x===t}),i).split(`
693
+ `)}),c=a.reduce((g,x)=>g+x.length,0),u=(g)=>a[g]??[],l=OEe({active:t,renderedItems:a,pageSize:n,loop:o}),p=u(t).slice(0,n),f=l+p.length<=n?l:n-p.length,d=Array.from({length:n});d.splice(f,p.length,...p);let h=new Set([t]),m=f+p.length,y=s(t+1);while(m<n&&!h.has(y)&&(o&&c>n?y!==t:y>t)){let x=u(y).slice(0,n-m);d.splice(m,x.length,...x),h.add(y),m+=x.length,y=s(y+1)}m=f-1,y=s(t-1);while(m>=0&&!h.has(y)&&(o&&c>n?y!==t:y<t)){let g=u(y),x=g.slice(Math.max(0,g.length-m-1));d.splice(m-x.length+1,x.length,...x),h.add(y),m-=x.length,y=s(y-1)}return d.filter((g)=>typeof g==="string").join(`
694
+ `)}import*as Az from"node:readline";import{AsyncResource as _Ee}from"node:async_hooks";function gz(){let e,t;return{promise:new Promise((n,o)=>{e=n,t=o}),resolve:e,reject:t}}Ph();var Cz=ot(wz(),1);import{stripVTControlCharacters as REe}from"node:util";var LA="\x1B[G",Ez="\x1B[?25l",vz="\x1B[?25h",$A=(e=1)=>e>0?`\x1B[${e}A`:"",UA=(e=1)=>e>0?`\x1B[${e}B`:"",HA=(e,t)=>{if(typeof t==="number"&&!Number.isNaN(t))return`\x1B[${t+1};${e+1}H`;return`\x1B[${e+1}G`},Tz="\x1B[2K",jA=(e)=>e>0?(Tz+$A(1)).repeat(e-1)+Tz+LA:"";var Sz=(e)=>e.split(`
695
+ `).length,PEe=(e)=>e.split(`
696
+ `).pop()??"";class aw{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(e){this.rl=e,this.cursorPos=e.getCursorPos()}write(e){this.rl.output.unmute(),this.rl.output.write(e),this.rl.output.mute()}render(e,t=""){let r=PEe(e),n=REe(r),o=n;if(this.rl.line.length>0)o=o.slice(0,-this.rl.line.length);this.rl.setPrompt(o),this.cursorPos=this.rl.getCursorPos();let i=sw();if(e=bm(e,i),t=bm(t,i),n.length%i===0)e+=`
697
+ `;let s=e+(t?`
698
+ `+t:""),c=Math.floor(n.length/i)-this.cursorPos.rows+(t?Sz(t):0);if(c>0)s+=$A(c);s+=HA(this.cursorPos.cols),this.write(UA(this.extraLinesUnderPrompt)+jA(this.height)+s),this.extraLinesUnderPrompt=c,this.height=Sz(s)}checkCursorPos(){let e=this.rl.getCursorPos();if(e.cols!==this.cursorPos.cols)this.write(HA(e.cols)),this.cursorPos=e}done({clearContent:e}){this.rl.setPrompt("");let t=UA(this.extraLinesUnderPrompt);t+=e?jA(this.height):`
699
+ `,t+=LA,t+=vz,this.write(t),this.rl.close()}}import BEe from"node:path";var NEe=globalThis.setImmediate;function cw(e,t,r){if("on"in e)return e.on(t,r),()=>e.removeListener(t,r);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)}function FEe(){let e=Error.prepareStackTrace,t=[];try{Error.prepareStackTrace=(r,n)=>{let o=n.slice(1);return t=o,o},Error().stack}catch{return t}return Error.prepareStackTrace=e,t}function $i(e){let t=FEe();return(n,o={})=>{let{input:i=process.stdin,signal:s}=o,a=new Set,c=new Cz.default;c.pipe(o.output??process.stdout);let u=Az.createInterface({terminal:!0,input:i,output:c});c.mute();let l=new aw(u),{promise:p,resolve:f,reject:d}=gz();return Vq(u,(h)=>{let m=_Ee.bind(()=>ym.clearAll()),y=(v)=>{try{m(),v()}catch(D){d(D)}},g=(v)=>y(()=>f(v)),x=(v)=>y(()=>d(v)),b=Object.assign(p.finally(()=>{a.forEach((v)=>v()),l.done({clearContent:Boolean(o.clearPromptOnDone)}),c.end()}).then(()=>p),{cancel:()=>x(new kA)});if(s){let v=()=>x(new mm({cause:s.reason}));if(s.aborted)return v(),b;a.add(cw(s,"abort",v))}a.add(Tc((v,D)=>{x(new np(`User force closed the prompt with ${v} ${D}`))})),a.add(cw(u,"SIGINT",()=>x(new np("User force closed the prompt with SIGINT")))),a.add(cw(u,"close",m));let w=()=>{a.add(cw(u.input,"keypress",()=>l.checkCursorPos()));let v=null;h(()=>{let D=!1;try{let O=e(n,(E)=>{if(D)g(E);else v={value:E}});if(O===void 0){let E=t[1]?.getFileName();if(E&&!E.startsWith("file://"))E=BEe.resolve(E);throw Error(`Prompt functions must return a string.
700
+ at ${E}`)}let[T,A]=typeof O==="string"?[O]:O;l.render(T,A),ym.run()}catch(O){x(O)}if(D=!0,v!==null){let{value:O}=v;v=null,g(O)}})};if("readableFlowing"in i)NEe(w);else w();return b})}}import{styleText as MEe}from"node:util";class zo{separator=MEe("dim",Array.from({length:15}).join(ip.line));type="separator";constructor(e){if(e)this.separator=e}static isSeparator(e){return Boolean(e&&typeof e==="object"&&"type"in e&&e.type==="separator")}}import{styleText as xm}from"node:util";var LEe={icon:{cursor:ip.pointer},style:{disabled:(e)=>xm("dim",e),description:(e)=>xm("cyan",e),keysHelpTip:(e)=>e.map(([t,r])=>`${xm("bold",t)} ${xm("dim",r)}`).join(xm("dim"," • "))},i18n:{disabledError:"This option is disabled and cannot be selected."},indexMode:"hidden"};function qA(e){return!zo.isSeparator(e)&&!e.disabled}function zA(e){return!zo.isSeparator(e)}function $Ee(e){return e.map((t)=>{if(zo.isSeparator(t))return t;if(typeof t!=="object"||t===null||!("value"in t)){let o=String(t);return{value:t,name:o,short:o,disabled:!1}}let r=t.name??String(t.value),n={value:t.value,name:r,short:t.short??r,disabled:t.disabled??!1};if(t.description)n.description=t.description;return n})}var uw=$i((e,t)=>{let{loop:r=!0,pageSize:n=7}=e,o=Fi(LEe,e.theme),{keybindings:i}=o,[s,a]=Tt("idle"),c=ec({status:s,theme:o}),u=tc(),l=!i.includes("vim"),p=gm(()=>$Ee(e.choices),[e.choices]),f=gm(()=>{let A=p.findIndex(zA),E=p.findLastIndex(zA);if(A===-1)throw new hm("[select prompt] No selectable choices. All choices are disabled.");return{first:A,last:E}},[p]),d=gm(()=>{if(!("default"in e))return-1;return p.findIndex((A)=>qA(A)&&A.value===e.default)},[e.default,p]),[h,m]=Tt(d===-1?f.first:d),y=p[h];if(y==null||zo.isSeparator(y))throw Error("Active index does not point to a choice");let[g,x]=Tt();Mi((A,E)=>{if(clearTimeout(u.current),g)x(void 0);if(Xa(A))if(y.disabled)x(o.i18n.disabledError);else a("done"),t(y.value);else if(pm(A,i)||ow(A,i)){if(E.clearLine(0),r||pm(A,i)&&h!==f.first||ow(A,i)&&h!==f.last){let R=pm(A,i)?-1:1,S=h;do S=(S+R+p.length)%p.length;while(!zA(p[S]));m(S)}}else if(OA(A)&&!Number.isNaN(Number(E.line))){let R=Number(E.line)-1,S=-1,k=p.findIndex((C)=>{if(zo.isSeparator(C))return!1;return S++,S===R}),I=p[k];if(I!=null&&qA(I))m(k);u.current=setTimeout(()=>{E.clearLine(0)},700)}else if(fm(A))E.clearLine(0);else if(l){let R=E.line.toLowerCase(),S=p.findIndex((k)=>{if(zo.isSeparator(k)||!qA(k))return!1;return k.name.toLowerCase().startsWith(R)});if(S!==-1)m(S);u.current=setTimeout(()=>{E.clearLine(0)},700)}}),Ni(()=>()=>{clearTimeout(u.current)},[]);let b=o.style.message(e.message,s),w=o.style.keysHelpTip([["↑↓","navigate"],["⏎","select"]]),v=0,D=MA({items:p,active:h,renderItem({item:A,isActive:E,index:R}){if(zo.isSeparator(A))return v++,` ${A.separator}`;let S=E?o.icon.cursor:" ",k=o.indexMode==="number"?`${R+1-v}. `:"";if(A.disabled){let C=typeof A.disabled==="string"?A.disabled:"(disabled)",P=E?o.icon.cursor:"-";return o.style.disabled(`${P} ${k}${A.name} ${C}`)}return(E?o.style.highlight:(C)=>C)(`${S} ${k}${A.name}`)},pageSize:n,loop:r});if(s==="done")return[c,b,o.style.answer(y.short)].filter(Boolean).join(" ");let{description:O}=y;return`${[[c,b].filter(Boolean).join(" "),D," ",O?o.style.description(O):"",g?o.style.error(g):"",w].filter(Boolean).join(`
701
+ `).trimEnd()}${Ez}`});var UEe={validationFailureMode:"keep"},_r=$i((e,t)=>{let{prefill:r="tab"}=e,n=Fi(UEe,e.theme),[o,i]=Tt("idle"),[s,a]=Tt(String(e.default??"")),[c,u]=Tt(),[l,p]=Tt(""),f=ec({status:o,theme:n});async function d(x){let{required:b,pattern:w,patternError:v="Invalid input"}=e;if(b&&!x)return"You must provide a value";if(w&&!w.test(x))return v;if(typeof e.validate==="function")return await e.validate(x)||"You must provide a valid value";return!0}Mi(async(x,b)=>{if(o!=="idle")return;if(Xa(x)){let w=l||s;i("loading");let v=await d(w);if(v===!0)p(w),i("done"),t(w);else{if(n.validationFailureMode==="clear")p("");else b.write(l);u(v),i("idle")}}else if(fm(x)&&!l)a("");else if(dm(x)&&!l)a(""),b.clearLine(0),b.write(s),p(s);else p(b.line),u(void 0)}),Ni((x)=>{if(r==="editable"&&s)x.write(s),p(s)},[]);let h=n.style.message(e.message,o),m=l;if(typeof e.transformer==="function")m=e.transformer(l,{isFinal:o==="done"});else if(o==="done")m=n.style.answer(l);let y;if(s&&o!=="done"&&!l)y=n.style.defaultAnswer(s);let g="";if(c)g=n.style.error(c);return[[f,h,y,m].filter((x)=>x!==void 0).join(" "),g]});import{styleText as HEe}from"node:util";var jEe={keywords:{yes:"Yes",no:"No",error:({yes:e,no:t})=>`You must answer with "${e}" or "${t}"`},style:{confirmDefault:(e)=>{let t=e[0]??"";if(t.toLowerCase()===t.toUpperCase())return HEe("cyan",e);return t.toUpperCase()+e.slice(1)}}},Dz=$i((e,t)=>{let[r,n]=Tt("idle"),[o,i]=Tt(""),[s,a]=Tt(),c=Fi(jEe,e.theme),u=ec({status:r,theme:c}),{yes:l,no:p}=c.keywords,f=(l[0]??"").toLowerCase(),d=(p[0]??"").toLowerCase(),h=e.default===!1?`${f}/${c.style.confirmDefault(d)}`:`${c.style.confirmDefault(f)}/${d}`;function m(D){return D?l:p}let{transformer:y=m}=e;function g(D){let O=D.trim().toLowerCase();if(O==="")return e.default!==!1;if(l.toLowerCase().startsWith(O))return!0;if(p.toLowerCase().startsWith(O))return!1;if("yes".startsWith(O))return!0;if("no".startsWith(O))return!1;return}Mi((D,O)=>{if(r!=="idle")return;if(Xa(D)){let T=g(o);if(T===void 0){O.write(o),a(c.keywords.error({yes:l,no:p}));return}i(y(T)),n("done"),t(T)}else if(dm(D)){let T=m(!(g(o)??e.default!==!1));O.clearLine(0),O.write(T),i(T)}else i(O.line),a(void 0)});let x=o,b="";if(r==="done")x=c.style.answer(o);else b=` ${c.style.defaultAnswer(h)}`;let w=c.style.message(e.message,r),v="";if(s)v=c.style.error(s);return[`${u} ${w}${b} ${x}`,v]});var Ui=async(e)=>{let t=await _r({...e,validate:(r)=>J(r)||"Enter a valid address"});return de(t)},qEe=async(e)=>await _r({...e,validate:(r)=>oe(r)||"Enter a valid hex value"}),Hi=async(e)=>{let t=e.default!==void 0?Gr(e.default,e.decimals):void 0,r=await _r({...e,default:t});return Ai(r,e.decimals)},GA=async(e)=>{let t=e.encoding??await uw({...e,choices:[{value:"string",name:"String encoding",description:"Convert UTF-8 string to bytes"},{value:"hex",name:"Hex string encoding",description:"Convert a hex string to bytes (must start with 0x)"},{value:"abi",name:"ABI encoding",description:"Input as ABI encoding parameters https://abitype.dev/api/human#parseabiparameters"},{value:"abi-packed",name:"ABI packed encoding",description:"Input as ABI encoding parameters https://abitype.dev/api/human#parseabiparameters"}]});switch(t){case"hex":return await qEe({...e,default:"0x",message:`${e.message} (as hex-string)`});case"string":{let r=await _r({...e,message:`${e.message} (as string)`});return zt(r)}case"abi":return Iz(e);case"abi-packed":return Iz(e,!0);default:throw Error(`Unsupported encoding ${t}`)}},Iz=async(e,t)=>{let r=e.abiParams??await _r({message:`${e.message} (as ABI encoded https://abitype.dev/api/human#parseabiparameters )`,validate:(i)=>{try{return Xs(i),!0}catch{return"Invalid ABI parameters"}}}),n=Xs(r),o=[];for(let i of n){let s=`${e.message} -> ${i.type} ${i.name??""}`;switch(i.type){case"string":{o.push(await _r({message:s}));break}case"bool":{o.push(await Dz({message:s}));break}case"uint":case"uint8":case"uint16":case"uint32":case"uint64":case"uint128":case"uint256":case"int":case"int8":case"int16":case"int32":case"int64":case"int128":case"int256":{o.push(await _r({message:s,validate:(a)=>{try{return BigInt(a),!0}catch{return"Invalid number"}}}));break}case"bytes":{o.push(await GA({message:s}));break}case"address":{o.push(await _r({message:s,validate:(a)=>J(a)||"Invalid address"}));break}default:throw Error(`Unsupported type ${i.type}`)}}return t?Vf(n.map((i)=>i.type),o):ct(n,o)},Oz=$i((e,t)=>{let r=e.choices,n=e.separator??"\t",o=r.map((i)=>`(${U.cyan(i.value)}) ${i.name??""}`).join(n);return Mi((i)=>{let s=r.find((a)=>a.value===i.name);if(s)t(s.value)}),`${o} `}),Jn=async(e)=>{let{application:t,projectName:r}=e;if(t&&J(t))return t;let n=await Vl({projectName:r});if(n)return n;return await Ui({message:"Application address"})};X();If();X();In();or();function kz(e){if(typeof e==="string"){if(!J(e,{strict:!1}))throw new Me({address:e});return{address:e,type:"json-rpc"}}if(!J(e.address,{strict:!1}))throw new Me({address:e.address});return{address:e.address,nonceManager:e.nonceManager,sign:e.sign,signAuthorization:e.signAuthorization,signMessage:e.signMessage,signTransaction:e.signTransaction,signTypedData:e.signTypedData,source:"custom",type:"local"}}If();vt();X();var VA=!1;async function Go({hash:e,privateKey:t,to:r="object"}){let{r:n,s:o,recovery:i}=xi.sign(e.slice(2),t.slice(2),{lowS:!0,extraEntropy:oe(VA,{strict:!1})?ht(VA):VA}),s={r:M(n,{size:32}),s:M(o,{size:32}),v:i?28n:27n,yParity:i};return(()=>{if(r==="bytes"||r==="hex")return Z0({...s,to:r});return s})()}async function Rz(e){let{chainId:t,nonce:r,privateKey:n,to:o="object"}=e,i=e.contractAddress??e.address,s=await Go({hash:p0({address:i,chainId:t,nonce:r}),privateKey:n,to:o});if(o==="object")return{address:i,chainId:t,nonce:r,...s};return s}async function Pz({message:e,privateKey:t}){return await Go({hash:Xu(e),privateKey:t,to:"hex"})}Qr();ir();X();function _z(e){if(!e||e.length===0)return[];let t=[];for(let r of e){let{chainId:n,nonce:o,...i}=r,s=r.address;t.push([n?Ce(n):"0x",s,o?Ce(o):"0x",...sp({},i)])}return t}X();BT();In();se();of();hi();or();yr();ii();st();function Bz(e){let{authorizationList:t}=e;if(t)for(let r of t){let{chainId:n}=r,o=r.address;if(!J(o))throw new Me({address:o});if(n<0)throw new Lc({chainId:n})}lw(e)}function Nz(e){let{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new Rf;for(let r of t){let n=fe(r),o=Oe(wr(r,0,1));if(n!==32)throw new mE({hash:r,size:n});if(o!==m0)throw new hE({hash:r,version:o})}}lw(e)}function lw(e){let{chainId:t,maxPriorityFeePerGas:r,maxFeePerGas:n,to:o}=e;if(t<=0)throw new Lc({chainId:t});if(o&&!J(o))throw new Me({address:o});if(n&&n>Eu)throw new Nn({maxFeePerGas:n});if(r&&n&&r>n)throw new mi({maxFeePerGas:n,maxPriorityFeePerGas:r})}function Fz(e){let{chainId:t,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:o,to:i}=e;if(t<=0)throw new Lc({chainId:t});if(i&&!J(i))throw new Me({address:i});if(r||o)throw new B("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>Eu)throw new Nn({maxFeePerGas:n})}function Mz(e){let{chainId:t,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:o,to:i}=e;if(i&&!J(i))throw new Me({address:i});if(typeof t<"u"&&t<=0)throw new Lc({chainId:t});if(r||o)throw new B("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>Eu)throw new Nn({maxFeePerGas:n})}In();ir();or();function wm(e){if(!e||e.length===0)return[];let t=[];for(let r=0;r<e.length;r++){let{address:n,storageKeys:o}=e[r];for(let i=0;i<o.length;i++)if(o[i].length-2!==64)throw new eT({storageKey:o[i]});if(!J(n,{strict:!1}))throw new Me({address:n});t.push([n,o])}return t}function Lz(e,t){let r=y0(e);if(r==="eip1559")return VEe(e,t);if(r==="eip2930")return WEe(e,t);if(r==="eip4844")return GEe(e,t);if(r==="eip7702")return zEe(e,t);return KEe(e,t)}function zEe(e,t){let{authorizationList:r,chainId:n,gas:o,nonce:i,to:s,value:a,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:l,data:p}=e;Bz(e);let f=wm(l),d=_z(r);return He(["0x04",wi([M(n),i?M(i):"0x",u?M(u):"0x",c?M(c):"0x",o?M(o):"0x",s??"0x",a?M(a):"0x",p??"0x",f,d,...sp(e,t)])])}function GEe(e,t){let{chainId:r,gas:n,nonce:o,to:i,value:s,maxFeePerBlobGas:a,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:l,data:p}=e;Nz(e);let{blobVersionedHashes:f,sidecars:d}=e;if(e.blobs&&(typeof f>"u"||typeof d>"u")){let b=typeof e.blobs[0]==="string"?e.blobs:e.blobs.map((D)=>be(D)),w=e.kzg,v=Ou({blobs:b,kzg:w});if(typeof f>"u")f=d0({commitments:v});if(typeof d>"u"){let D=ku({blobs:b,commitments:v,kzg:w});d=h0({blobs:b,commitments:v,proofs:D})}}let h=wm(l),m=[M(r),o?M(o):"0x",u?M(u):"0x",c?M(c):"0x",n?M(n):"0x",i??"0x",s?M(s):"0x",p??"0x",h,a?M(a):"0x",f??[],...sp(e,t)],y=[],g=[],x=[];if(d)for(let b=0;b<d.length;b++){let{blob:w,commitment:v,proof:D}=d[b];y.push(w),g.push(v),x.push(D)}return He(["0x03",d?wi([m,y,g,x]):wi(m)])}function VEe(e,t){let{chainId:r,gas:n,nonce:o,to:i,value:s,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:u,data:l}=e;lw(e);let p=wm(u),f=[M(r),o?M(o):"0x",c?M(c):"0x",a?M(a):"0x",n?M(n):"0x",i??"0x",s?M(s):"0x",l??"0x",p,...sp(e,t)];return He(["0x02",wi(f)])}function WEe(e,t){let{chainId:r,gas:n,data:o,nonce:i,to:s,value:a,accessList:c,gasPrice:u}=e;Fz(e);let l=wm(c),p=[M(r),i?M(i):"0x",u?M(u):"0x",n?M(n):"0x",s??"0x",a?M(a):"0x",o??"0x",l,...sp(e,t)];return He(["0x01",wi(p)])}function KEe(e,t){let{chainId:r=0,gas:n,data:o,nonce:i,to:s,value:a,gasPrice:c}=e;Mz(e);let u=[i?M(i):"0x",c?M(c):"0x",n?M(n):"0x",s??"0x",a?M(a):"0x",o??"0x"];if(t){let l=(()=>{if(t.v>=35n){if((t.v-35n)/2n>0)return t.v;return 27n+(t.v===35n?0n:1n)}if(r>0)return BigInt(r*2)+BigInt(35n+t.v-27n);let d=27n+(t.v===27n?0n:1n);if(t.v!==d)throw new X2({v:t.v});return d})(),p=Bt(t.r),f=Bt(t.s);u=[...u,M(l),p==="0x00"?"0x":p,f==="0x00"?"0x":f]}else if(r>0)u=[...u,M(r),"0x","0x"];return wi(u)}function sp(e,t){let r=t??e,{v:n,yParity:o}=r;if(typeof r.r>"u")return[];if(typeof r.s>"u")return[];if(typeof n>"u"&&typeof o>"u")return[];let i=Bt(r.r),s=Bt(r.s);return[(()=>{if(typeof o==="number")return o?M(1):"0x";if(n===0n)return"0x";if(n===1n)return M(1);return n===27n?"0x":M(1)})(),i==="0x00"?"0x":i,s==="0x00"?"0x":s]}async function $z(e){let{privateKey:t,transaction:r,serializer:n=Lz}=e,o=(()=>{if(r.type==="eip4844")return{...r,sidecars:!1};return r})(),i=await Go({hash:ke(await n(o)),privateKey:t});return await n(r,i)}async function Uz(e){let{privateKey:t,...r}=e;return await Go({hash:Q0(r),privateKey:t,to:"hex"})}function Tm(e,t={}){let{nonceManager:r}=t,n=Ce(xi.getPublicKey(e.slice(2),!1)),o=c0(n);return{...kz({address:o,nonceManager:r,async sign({hash:s}){return Go({hash:s,privateKey:e,to:"hex"})},async signAuthorization(s){return Rz({...s,privateKey:e})},async signMessage({message:s}){return Pz({message:s,privateKey:e})},async signTransaction(s,{serializer:a}={}){return $z({privateKey:e,transaction:s,serializer:a})},async signTypedData(s){return Uz({...s,privateKey:e})}}),publicKey:n,source:"privateKey"}}function Hz(e,{accountIndex:t=0,addressIndex:r=0,changeIndex:n=0,path:o,...i}={}){let s=e.derive(o||`m/44'/60'/${t}'/${n}/${r}`);return{...Tm(Ce(s.privateKey),i),getHdKey:()=>s,source:"hd"}}function WA(e,{passphrase:t,...r}={}){let n=H4(e,t);return Hz(xs.fromMasterSeed(n),r)}var YEe=Na({...Wf,name:"Cartesi Devnet",testnet:!0}),ZEe=async(e)=>{if(e.rpcUrl)return e.rpcUrl;try{let t=De(e);return`http://${await px({projectName:t})}/anvil`}catch{return await _r({message:"RPC URL",default:`http://127.0.0.1:${ed}/anvil`})}},Xn=async(e)=>{let t=await ZEe(e);return q6({chain:YEe,mode:"anvil",transport:Hn(t),pollingInterval:200}).extend(Gf).extend(W6)},jz=(e)=>{let{address:t,max:r=20,mnemonic:n}=e;for(let o=0;o<r;o++){let i=WA(n,{addressIndex:o});if(Ne(i.address,t))return o}return};var qz=async(e)=>({address:e.token&&J(e.token)?de(e.token):await Ui({message:"Token address",default:Ig}),name:"TestMultiToken"}),zz=()=>new re("erc1155-single").description("Deposits an ERC1155 token to the application").configureHelp({showGlobalOptions:!0}).argument("[token-id]","token ID").argument("[amount]","amount to send").option("--token <address>","ERC1155 token address").option("--base-layer-data <hex>","base layer data","0x").option("--exec-layer-data <hex>","exec layer data","0x").action(async(e,t,r,n)=>{let{from:o}=n.optsWithGlobals(),i=await Xn(n.optsWithGlobals()),s=await qz({token:r.token}),a=e?BigInt(e):await Hi({decimals:0,message:"Token ID"}),c=De(n.optsWithGlobals()),u=await Jn({...n.optsWithGlobals(),projectName:c}),l=o&&J(o)?de(o):(await i.getAddresses())[0],p=t?BigInt(t):await Hi({message:`Amount of token ID ${a}`,decimals:0});if(p<=BigInt(0)){console.error(U.red("Amount of tokens to be deposited, must be greater than zero."));return}let f=x5,d=oe(r.baseLayerData)?r.baseLayerData:"0x",h=oe(r.execLayerData)?r.execLayerData:"0x",m=Xe();if(await i.readContract({abi:f,address:s.address,functionName:"balanceOf",args:[l,a]})<p){m.fail("Insufficient balance");return}if(await i.readContract({abi:f,address:s.address,functionName:"isApprovedForAll",args:[l,ml]})===!1){m.start("Approving ERC1155Portal...");let{request:v}=await i.simulateContract({abi:f,account:l,address:s.address,functionName:"setApprovalForAll",args:[ml,!0]}),D=await i.writeContract(v);await i.waitForTransactionReceipt({hash:D}),m.succeed("Approved ERC1155Portal")}let{request:x}=await i.simulateContract({abi:m5,account:l,address:ml,functionName:"depositSingleErc1155Token",args:[s.address,u,a,p,d,h]}),b=`${U.cyan(p)} units of token id ${a}`;m.start(`Depositing ${b} to ${U.cyan(u)}...`);let w=await i.writeContract(x);await i.waitForTransactionReceipt({hash:w}),m.succeed(`Deposited ${b} to ${U.cyan(u)}`)}),Gz=()=>new re("erc1155-batch").description("Deposits multiple ERC1155 tokens to the application").configureHelp({showGlobalOptions:!0}).argument("[token-ids]","token IDs separated by comma").argument("[amounts]","amounts separated by comma").option("--token <address>","ERC1155 token address").option("--base-layer-data <hex>","base layer data","0x").option("--exec-layer-data <hex>","exec layer data","0x").action(async(e,t,r,n)=>{let{from:o}=n.optsWithGlobals(),i=await Xn(n.optsWithGlobals()),s=await qz({token:r.token}),a;if(e)a=e.split(",").map((w)=>BigInt(w.trim()));else a=(await _r({message:"Token IDs (comma separated)"})).split(",").map((v)=>BigInt(v.trim()));let c;if(t)c=t.split(",").map((w)=>BigInt(w.trim()));else c=(await _r({message:"Amounts (comma separated)"})).split(",").map((v)=>BigInt(v.trim()));if(a.length!==c.length){console.error(U.red("Token IDs and amounts must have the same length."));return}for(let w=0;w<c.length;w++)if(c[w]<=BigInt(0)){console.error(U.red(`Amount of token Id: ${a[w]} to be deposited, must be greater than zero.`));return}let u=De(n.optsWithGlobals()),l=await Jn({...n.optsWithGlobals(),projectName:u}),p=o&&J(o)?de(o):(await i.getAddresses())[0],f=x5,d=oe(r.baseLayerData)?r.baseLayerData:"0x",h=oe(r.execLayerData)?r.execLayerData:"0x",m=Xe();for(let w=0;w<a.length;w++)if(await i.readContract({abi:f,address:s.address,functionName:"balanceOf",args:[p,a[w]]})<c[w]){m.fail(`Insufficient balance for token ID ${a[w]}`);return}if(await i.readContract({abi:f,address:s.address,functionName:"isApprovedForAll",args:[p,dl]})===!1){m.start("Approving ERC1155Portal...");let{request:w}=await i.simulateContract({abi:f,account:p,address:s.address,functionName:"setApprovalForAll",args:[dl,!0]}),v=await i.writeContract(w);await i.waitForTransactionReceipt({hash:v}),m.succeed("Approved ERC1155Portal")}let{request:g}=await i.simulateContract({abi:d5,account:p,address:dl,functionName:"depositBatchErc1155Token",args:[s.address,l,a,c,d,h]}),x=a.map((w,v)=>`${U.cyan(c[v])} units of token id ${w}`).join(", ");m.start(`Depositing tokens to ${U.cyan(l)}...`);let b=await i.writeContract(g);await i.waitForTransactionReceipt({hash:b}),m.succeed(`Deposited ${x} to ${U.cyan(l)}`)});var JEe=async(e,t)=>{let r={abi:ze,address:t},n=await e.readContract({...r,functionName:"symbol"}),o=await e.readContract({...r,functionName:"name"}),i=await e.readContract({...r,functionName:"decimals"});return{address:t,name:o,symbol:n,decimals:i}},XEe=async(e)=>{let{testClient:t}=e,r=e.token&&J(e.token)?de(e.token):await Ui({message:"Token address",default:Dg});return JEe(t,r)},Vz=()=>new re("erc20").description("Deposit ERC-20 to the application").configureHelp({showGlobalOptions:!0}).argument("[amount]","amount to send").option("--token <address>","token address").option("--exec-layer-data <hex>","exec layer data","0x").action(async(e,t,r)=>{let{from:n}=r.optsWithGlobals(),o=De(r.optsWithGlobals()),i=await Xn(r.optsWithGlobals()),s=n&&J(n)?de(n):(await i.getAddresses())[0],a=await XEe({testClient:i,token:t.token}),c=await Jn({...r.optsWithGlobals(),projectName:o}),{decimals:u,symbol:l}=a,p=e?Ai(e,u):await Hi({message:`Amount (${l})`,decimals:u}),f=oe(t.execLayerData)?t.execLayerData:"0x",d=Xe();if(await i.readContract({abi:ze,address:a.address,functionName:"balanceOf",args:[s]})<p){d.fail("Insufficient balance");return}let m=await i.readContract({abi:ze,address:a.address,functionName:"allowance",args:[s,hl]}),y=`${U.cyan(Gr(p,u))} ${l}`;if(m<p){d.start(`Approving ${y}...`);let{request:b}=await i.simulateContract({abi:ze,account:s,address:a.address,functionName:"approve",args:[hl,p]}),w=await i.writeContract(b);await i.waitForTransactionReceipt({hash:w}),d.succeed(`Approved ${y}`)}let{request:g}=await i.simulateContract({abi:h5,account:s,address:hl,functionName:"depositErc20Tokens",args:[a.address,c,p,f]});d.start(`Depositing ${y} to ${U.cyan(c)}...`);let x=await i.writeContract(g);await i.waitForTransactionReceipt({hash:x}),d.succeed(`Deposited ${y} to ${U.cyan(c)}`)});var QEe=async(e,t)=>{let r={abi:fy,address:t},n=await e.readContract({...r,functionName:"symbol"}),o=await e.readContract({...r,functionName:"name"});return{address:t,name:o,symbol:n}},e6e=async(e)=>{let{testClient:t}=e,r=e.token&&J(e.token)?de(e.token):await Ui({message:"Token address",default:td});return QEe(t,r)},Wz=()=>new re("erc721").description("Deposit ERC-721 to the application").configureHelp({showGlobalOptions:!0}).argument("[token-id]","token ID").option("--token <address>","token address").option("--base-layer-data <hex>","base layer data","0x").option("--exec-layer-data <hex>","exec layer data","0x").action(async(e,t,r)=>{let{from:n}=r.optsWithGlobals(),o=e?BigInt(e):await Hi({decimals:0,message:"Token ID"}),i=De(r.optsWithGlobals()),s=await Xn(r.optsWithGlobals()),a=n&&J(n)?de(n):(await s.getAddresses())[0],c=await e6e({testClient:s,token:t.token}),u=c.address===td?LF:fy,l=await Jn({...r.optsWithGlobals(),projectName:i}),{symbol:p}=c,f=oe(t.baseLayerData)?t.baseLayerData:"0x",d=oe(t.execLayerData)?t.execLayerData:"0x",h=Xe();try{if(await s.readContract({abi:u,address:c.address,args:[o],functionName:"ownerOf"})!==a){h.fail("Insufficient balance");return}}catch(b){if(b instanceof B){let w=b.walk((v)=>v instanceof go);if(w instanceof go){if((w.data?.errorName??"")==="ERC721NonexistentToken"){h.fail(`Token ${e} does not exist`);return}}h.fail("Failed to check ownership")}}let m=await s.readContract({abi:u,address:c.address,args:[o],functionName:"getApproved"}),y=`${U.cyan(e)} ${p}`;if(m!==yl){h.start(`Approving ${y}...`);let{request:b}=await s.simulateContract({abi:u,account:a,address:c.address,functionName:"approve",args:[yl,o]}),w=await s.writeContract(b);await s.waitForTransactionReceipt({hash:w}),h.succeed(`Approved ${y}`)}let{request:g}=await s.simulateContract({abi:y5,account:a,address:yl,functionName:"depositErc721Token",args:[c.address,l,o,f,d]});h.start(`Depositing ${y} to ${U.cyan(l)}...`);let x=await s.writeContract(g);await s.waitForTransactionReceipt({hash:x}),h.succeed(`Deposited ${y} to ${U.cyan(l)}`)});var Kz=()=>new re("ether").description("Deposit ether to the application").configureHelp({showGlobalOptions:!0}).argument("[amount]","amount, in ETH units").option("--exec-layer-data <hex>","exec layer data","0x").action(async(e,t,r)=>{let{from:n}=r.optsWithGlobals(),o=De(r.optsWithGlobals()),i=await Xn(r.optsWithGlobals()),s=n&&J(n)?de(n):(await i.getAddresses())[0],a=await Jn({...r.optsWithGlobals(),projectName:o}),{decimals:c,symbol:u}=i.chain.nativeCurrency,l=e?Ai(e,c):await Hi({message:`Amount (${u})`,decimals:c}),p=oe(t.execLayerData)?t.execLayerData:"0x",f=Xe(),d=`${U.cyan(Gr(l,c))} ${u}`;if(await i.getBalance({address:s})<l){f.fail("Insufficient balance");return}let{request:m}=await i.simulateContract({abi:g5,account:s,address:Eg,args:[a,p],functionName:"depositEther",value:l});f.start(`Depositing ${d} to ${U.cyan(a)}...`);let y=await i.writeContract(m);await i.waitForTransactionReceipt({hash:y}),f.succeed(`Deposited ${d} to ${U.cyan(a)}`)});var Yz=()=>{let e=new re("deposit").description("Deposits an asset to the application").configureHelp({showGlobalOptions:!0}).option("--from <address>","input sender address").option("--application <address>","application address").option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("--rpc-url <url>","RPC URL of the Cartesi Devnet").action(async(t,r)=>{let o=r.commands.map((s)=>({name:s.name(),value:s,description:s.description()}));(await uw({choices:o,message:"Select type of asset to deposit"})).parseAsync(r.args)});return e.addCommand(Kz()),e.addCommand(Vz()),e.addCommand(Wz()),e.addCommand(zz()),e.addCommand(Gz()),e};var Us=ot(cd(),1);var Zz="25.0.0",Jz="2.24.0",Xz="0.13.0",t6e=async(e)=>{try{e.start("Checking Docker Engine version...");let{stdout:t}=await We("docker",["version","--format","{{json .Client.Version}}"]),r=Us.default.coerce(t);if(r!==null&&!Us.default.gte(r,Zz))throw Error(`Unsupported Docker version. Minimum required version is ${Zz}. Installed version is ${r}.`);e.succeed(`Docker Engine ${U.cyan(r)}`)}catch(t){if(t instanceof Error&&t.code==="ENOENT")throw Error("Docker not found");throw t}return!0},r6e=async(e)=>{try{e.start("Checking Docker Compose version...");let{stdout:t}=await We("docker",["compose","version","--short"]),r=Us.default.coerce(t);if(r!==null&&!Us.default.gte(r,Jz))throw Error(`Unsupported Docker Compose version. Minimum required version is ${Jz}. Installed version is ${r}.`);e.succeed(`Docker Compose ${U.cyan(t)}`)}catch(t){if(t instanceof Error&&t.exitCode===125)throw Error("Docker Compose is required but not installed or the command execution failed. Please refer to the Docker Compose documentation for installation instructions: https://docs.docker.com/compose/install/");throw t}return!0},n6e=async(e)=>{try{e.start("Checking Docker Buildx version...");let{stdout:t}=await We("docker",["buildx","version"]),r=Us.default.coerce(t);if(r!==null&&!Us.default.gte(r,Xz))throw Error(`Unsupported Docker Buildx version. Minimum required version is ${Xz}. Installed version is ${r}.`);e.succeed(`Docker Buildx ${U.cyan(r)}`),e.start("Checking Docker RISC-V support...");let{stdout:n}=await We("docker",["buildx","ls","--format","{{.Platforms}}"]);if(!n.split(",").map((i)=>i.trim()).includes("linux/riscv64"))throw Error("Your system does not support riscv64 architecture. Run `docker run --privileged --rm tonistiigi/binfmt:riscv` to enable riscv64 support.");e.succeed(`Docker RISC-V support ${U.cyan("linux/riscv64")}`)}catch(t){if(t instanceof Error&&t.exitCode===125)throw Error("Docker Buildx is required but not installed. Please refer to the Docker Desktop documentation for installation instructions: https://docs.docker.com/desktop/");throw t}return!0},o6e=async(e)=>{e.start("Checking Cartesi Machine version...");let t=await P9({image:`${Qf}:${La}`});if(t===null)throw Error("Could not determine the Cartesi Machine version. Check that Docker is running.");if(!Us.default.satisfies(t.format(),Vg))throw Error(`Unsupported Cartesi Machine version. Required version is ${Vg.raw}. Installed version is ${t.format()}.`);return e.succeed(`Cartesi Machine ${U.cyan(t.format())}`),!0},Qz=()=>new re("doctor").action(async()=>{let e=Xe();try{await t6e(e),await r6e(e),await n6e(e),await o6e(e),e.succeed("Your system is ready.")}catch(t){e.fail(t.message),process.exit(1)}});var eG=async(e)=>{let t=await px(e);return Ii({transport:Hn(`http://${t}/anvil`)})},ap=async(e)=>{let{application:t,io:r={getApplicationAddress:Vl,getServiceState:hx},projectName:n}=e;if(await r.getServiceState({projectName:n,service:"rollups_node"})!=="running")throw Error(`${U.cyan(n)} is not running, use ${U.cyan("cartesi run")}`);if(t){if(!J(t))throw Error(`Invalid application address ${t}`);return de(t)}let i=await r.getApplicationAddress({projectName:n});if(!i)throw Error(`No application deployed for the current machine, use ${U.cyan("--application")}`);return i},cp=(e,t)=>e.option("--application <address>","application address").option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").addOption(new $e("--account-index <index>",t).argParser(fH)).option("-y, --yes","skip the confirmation prompt").option("--json","print the result as JSON").option("--no-wait","return after broadcast without waiting for the receipt").option("--wait-timeout <duration>","maximum time to wait for the receipt (e.g. 30s, 5m)");var i6e=(e)=>{let{accountIndex:t,guardian:r,host:n,node:o}=e;if(Ne(r,Ln))throw Error("The application was deployed without a withdrawal config and cannot be foreclosed");let i=n?JU(n):void 0,s=t===void 0?{}:{warning:"--account-index is ignored when signing with a private key"};if(n?.kind==="private_key"){let{address:u}=Tm(n.privateKey);if(!Ne(u,r))throw Error(`The private key's address ${u} isn't the guardian ${r}`);return{...s,env:i}}let a=n??o;if(!a)throw Error("No signer to foreclose with");if(a.kind==="private_key")return s;if(t!==void 0)return{accountIndex:t,env:i};let c=jz({address:r,mnemonic:a.mnemonic});if(c===void 0)throw Error(`Guardian ${r} isn't one of the first 20 accounts of the mnemonic in use. If it belongs to another mnemonic, set CARTESI_AUTH_MNEMONIC; if its index is higher, pass --account-index; if it's a raw private key, set CARTESI_AUTH_PRIVATE_KEY`);return{accountIndex:c,env:i}},tG=()=>cp(new re("foreclose").description("Forecloses the application, so users can withdraw their funds").addHelpText("after",`
702
+ Signs as the application guardian. By default it uses the rollups node signer, looking up the guardian in its mnemonic.
703
+ For a guardian outside it, set the signer for this command only:
704
+ CARTESI_AUTH_MNEMONIC="<mnemonic>" cartesi foreclose
705
+ CARTESI_AUTH_PRIVATE_KEY=<0x-private-key> cartesi foreclose
706
+ Set CARTESI_AUTH_KIND to mnemonic or private_key when both are set.`).configureHelp({showGlobalOptions:!0}),"index of the guardian in the mnemonic (default: looked up from the application guardian; ignored for private-key signers)").action(async(e)=>{let t=De(e),r=await ap({application:e.application,projectName:t}),{guardian:n}=await lx({application:r,projectName:t}),o=ZU(fx()),{accountIndex:i,env:s,warning:a}=i6e({accountIndex:e.accountIndex,guardian:n,host:o,node:o?void 0:await YU({projectName:t})});if(a)console.warn(U.yellow(a));try{await Ka({accountIndex:i,command:["cartesi-rollups-cli","foreclose",r,...Wa(e)],env:s,projectName:t})}catch(c){Gl(c)}});var rG=()=>new re("hash").description("Converts the binary generated by the build command to hexadecimal and prints out the result to console.").option("--json","Format output as json.").action(async({json:e},t)=>{let r=await Ya();if(r)if(!e)console.log(`${U.green("?")} Cartesi machine templateHash ${U.cyan(r)}
707
+ `);else process.stdout.write(JSON.stringify({hash:r}));else t.error("Cartesi machine snapshot not found, run 'build'")});var nG=()=>new re("logs").description("Show logs of a local environment.").option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("-f, --follow","Follow log output").option("--since <string>","Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)").option("-n, --tail <string>","Number of lines to show from the end of the logs","all").option("--until <string>","Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)").configureHelp({showGlobalOptions:!0}).action(async(e)=>{let{follow:t,since:r,tail:n,until:o}=e,i=De(e),s=[];if(t)s.push("--follow");if(r)s.push("--since",r);if(n)s.push("--tail",n);if(o)s.push("--until",o);let a=await em({projectName:i,service:"rollups_node"});if(!a)throw Error("service rollups_node not found");await We("docker",["container","logs",...s,a.ID],{stdio:"inherit"})});var oG=ot(Kr(),1);var s6e=async(e)=>{let{application:t,inputFile:r,inputIndex:n,io:o={getNodeInput:eH},projectName:i}=e;if(r){let s=(await oG.default.readFile(r,"utf-8")).trim();if(!oe(s)||s.length<=2)throw Error(`${r} must contain the 0x-prefixed hexadecimal input bytes`);return s}try{return await o.getNodeInput({application:t,inputIndex:n,projectName:i})}catch(s){throw Error(`Input ${n} not found in the node, use ${U.cyan("--input-file")} with the InputAdded.input bytes`,{cause:s})}},iG=()=>cp(new re("refund").description("Refunds a deposit that was not finalized before the application was foreclosed").configureHelp({showGlobalOptions:!0}).argument("<input-index>","index of the deposit input",dH).option("--input-file <path>","file with the 0x-prefixed InputAdded.input bytes (default: read from the node)"),"index of the account in the node mnemonic paying for gas").action(async(e,t)=>{let r=De(t),n=await ap({application:t.application,projectName:r}),o=await s6e({application:n,inputFile:t.inputFile,inputIndex:e,projectName:r}),i=await cx({content:`${o}
708
+ `,projectName:r});try{await Ka({accountIndex:t.accountIndex,command:["cartesi-rollups-cli","refund",n,e.toString(),"--input-file",i,...Wa(t)],projectName:r})}catch(s){Gl(s)}finally{await Xd({path:i,projectName:r})}});import a6e from"node:net";import c6e from"node:os";class KA extends Error{constructor(e){super(`${e} is locked`)}}var up={old:new Set,young:new Set},u6e=15000,cG=new Set,pw=1024,fw=65535,Em,l6e=()=>{let e=c6e.networkInterfaces(),t=new Set([void 0,"0.0.0.0"]);for(let r of Object.values(e))for(let n of r)t.add(n.address);return t},sG=(e)=>new Promise((t,r)=>{let n=a6e.createServer();n.unref(),n.on("error",r),n.listen(e,()=>{let{port:o}=n.address();n.close(()=>{t(o)})})}),aG=async(e,t)=>{if(e.host||e.port===0)return sG(e);for(let r of t)try{await sG({port:e.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return e.port},p6e=(e)=>up.old.has(e)||up.young.has(e)||cG.has(e),f6e=function*(e){if(e)yield*e;yield 0};async function YA(e){let t,r=new Set;if(e){if(e.port)t=typeof e.port==="number"?[e.port]:e.port;if(e.exclude){let s=e.exclude;if(typeof s[Symbol.iterator]!=="function")throw TypeError("The `exclude` option must be an iterable.");for(let a of s){if(typeof a!=="number")throw TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");if(!Number.isSafeInteger(a))throw TypeError(`Number ${a} in the exclude option is not a safe integer and can't be used`)}r=new Set(s)}}let{reserve:n,...o}=e??{};if(Em===void 0){if(Em=setTimeout(()=>{Em=void 0,up.old=up.young,up.young=new Set},u6e),Em.unref)Em.unref()}let i=l6e();for(let s of f6e(t))try{if(r.has(s))continue;let a=await aG({...o,port:s},i);while(p6e(a)){if(s!==0)throw new KA(s);a=await aG({...o,port:s},i)}if(n)cG.add(a);else up.young.add(a);return a}catch(a){if(!["EADDRINUSE","EACCES"].includes(a.code)&&!(a instanceof KA))throw a}throw Error("No available ports found")}function uG(e,t){if(!Number.isInteger(e)||!Number.isInteger(t))throw TypeError("`from` and `to` must be integer numbers");if(e<pw||e>fw)throw RangeError(`'from' must be between ${pw} and ${fw}`);if(t<pw||t>fw)throw RangeError(`'to' must be between ${pw} and ${fw}`);if(e>t)throw RangeError("`to` must be greater than or equal to `from`");return function*(n,o){for(let i=n;i<=o;i++)yield i}(e,t)}import d6e from"node:fs";var m6e=(e)=>e.split(","),h6e=5000,y6e=(e)=>{let t=ux.includes(e.status),r=t?U.red:U.yellow;if(console.warn(r(t?`application ${e.name} is ${e.status} and stopped processing inputs`:`application ${e.name} is ${e.status}`)),e.reason)console.warn(r(`reason: ${e.reason}`));console.warn(U.yellow(`run ${U.cyan("cartesi logs")} for details, or rebuild to deploy a new application`))},g6e=async(e)=>{let{build:t,epochLength:r,log:n,projectName:o,prt:i,sdk:s,resolveWithdrawalConfig:a,claimStagingPeriod:c}=e,{deployment:u,salt:l}=e,p=u?.status,f,d=async(h)=>{let m=u?.address;if(!m)return;let g=(await Qd({projectName:o})).find((x)=>x.address===m);if(!g||g.status===p)return;if(p=g.status,g.status!=="OK")f=g,h()};while(!0){if(f)y6e(f),f=void 0;let h=new AbortController,m=setInterval(()=>{d(()=>h.abort()).catch(()=>{})},h6e);try{switch(await Oz({choices:[{name:"View logs",value:"l"},{name:"Build and redeploy",value:"b"},{name:"Quit",value:"q"}]},{signal:h.signal})){case"l":{try{await n?.parseAsync(["--project-name",o,"--follow"],{from:"user"})}catch(g){if(g instanceof qt){if(g.exitCode===130)break;throw g}}break}case"b":{await t?.parseAsync([],{from:"user"});let g=await Ya({sdk:s});if(g){let x=a();if(u)await b6e({projectName:o});u=await lG({consensus:u?.consensus,epochLength:r,hash:g,projectName:o,prt:i,salt:M(l++,{size:32}),withdrawalConfig:x,claimStagingPeriod:c}),p=u?.status,f=void 0}break}case"q":return}}catch(y){if(y instanceof mm)continue;if(y instanceof np)return;throw y}finally{clearInterval(m)}}},b6e=async(e)=>{let{projectName:t}=e,r=Xe(`${U.cyan(t)} undeploying...`).start();await cH({application:t,force:!0,projectName:t}),r.succeed(`${U.cyan(t)} undeployed`)},lG=async(e)=>{let{consensus:t,epochLength:r,hash:n,projectName:o,prt:i,salt:s,withdrawalConfig:a,claimStagingPeriod:c}=e,u=Xe(`deploying ${U.cyan(n)} as ${U.cyan(o)}`),l=await aH({consensus:t,epochLength:r,name:o,projectName:o,prt:i,salt:s,snapshotPath:"/var/lib/cartesi-rollups-node/snapshots/image",withdrawalConfig:a,claimStagingPeriod:c});return u.succeed(`${U.cyan(o)} machine hash is ${U.cyan(n)}`),u.succeed(`${U.cyan(o)} contract deployed at ${U.cyan(l.address)}`),l},x6e=async(e)=>{if(!e.forkUrl)return;let t=e.forkUrl,r=Ii({transport:Hn(t)}),n=e.forkBlockNumber?BigInt(e.forkBlockNumber):await r.getBlockNumber(),o=await r.getChainId();return{blockNumber:n,chainId:o,url:t}},pG=()=>new re("run").description("Run a local cartesi node for the application.").addOption(new $e("--prt","deploy application with PRT consensus").default(!1)).addOption(new $e("--block-time <number>","interval between blocks (in seconds)").argParser(Number).default(2)).addOption(new $e("--cpus <number>","number of cpu limits for the rollups-node").argParser(Number)).addOption(new $e("--default-block <string>","default block to be used when fetching new blocks.").choices(["latest","safe","pending","finalized"]).default("latest")).option("--dry-run","show the docker compose configuration",!1).option("--list-supported-variables","Returns JSON formatted information about the environment variables allowed and which service will use them.",!1).option("--fork-url <url>","RPC URL to fork from").addOption(new $e("--fork-block-number <number>","block number to fork from").argParser(Number)).addOption(new $e("--memory <number>","memory limit for the rollups-node in MB").argParser(Number)).addOption(new $e("--epoch-length <number>","length of an epoch (in blocks)").argParser(Number).default(720)).option("-p, --port <number>","port to listen on",Number).addOption(new $e("--claim-staging-period <number>","claim staging period (in blocks). Number of blocks between a claim being submitted and accepted").argParser(Number).default(0)).option("-c, --config <config>","Path to the configuration file (.toml)",(e,t)=>t.concat([e]),["cartesi.toml"]).addOption(new $e("--runtime-version <version>","version for Cartesi Rollups Runtime to use").default(La).hideHelp()).option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("--services <string>",`optional services to start, comma separated list from [${nH.join(", ")}]`,m6e,[]).option("-v, --verbose","verbose output",!1).action(async(e,t)=>{let{prt:r,blockTime:n,cpus:o,defaultBlock:i,dryRun:s,epochLength:a,memory:c,runtimeVersion:u,services:l,verbose:p,listSupportedVariables:f,claimStagingPeriod:d,config:h}=e,m=Xe();if(f){let C={rollupsNode:$S};process.stdout.write(JSON.stringify(C,null,2));return}if(i!=="finalized")console.warn(U.yellow(`WARNING: default block is set to '${i}', production configuration will likely use 'finalized'`));let y=De(e),g=Ns(h),x=e.port||await YA({port:uG(ed,ed+10)}),b=await x6e(e);if(b)await mx(b,{includePRT:r});let w=bn("image"),v=()=>sq(Ns(h),w,{fork:b!==void 0}),D=d6e.existsSync(w)?v():void 0,O=process.stdin.isTTY,{cmd:T,config:A}=await oH({blockTime:n,cpus:o,defaultBlock:i,detach:O,dryRun:s,forkConfig:b,memory:c,port:x,projectName:y,prt:r,runtimeVersion:u,services:l,verbose:p}),E=`${Ri}:${x}`;if(s&&A){process.stdout.write(A);return}m.succeed(`${U.cyan(y)} starting at ${U.cyan(`${E}`)}`),await iH({name:y,port:x,projectName:y,services:l});let R,S=0,k=await Ya({sdk:g.sdk});if(k)R=await lG({epochLength:a,hash:k,projectName:y,prt:r,salt:M(S++,{size:32}),claimStagingPeriod:d,withdrawalConfig:D});else console.warn(U.yellow("machine snapshot not found, waiting for build"));let I=async()=>{m.start(`${U.cyan(y)} stopping...`);try{await sH({projectName:y}),m.succeed(`${U.cyan(y)} stopped`)}catch(C){m.fail(C instanceof Error?C.message:"Unknown error")}process.exit(0)};if(O){process.on("SIGINT",()=>{}),process.on("SIGTERM",()=>{});let C=t.parent?.commands.find((N)=>N.name()==="logs"),P=t.parent?.commands.find((N)=>N.name()==="build");await g6e({build:P,deployment:R,epochLength:a,log:C,projectName:y,prt:r,salt:S,sdk:g.sdk,claimStagingPeriod:d,resolveWithdrawalConfig:v}),await I()}else{process.on("SIGINT",I),process.on("SIGTERM",I);try{await T}catch(C){if(C instanceof qt){if(C.exitCode===130)return;throw C}}}});var w6e=async(e,t)=>{let{encoding:r}=t;if(e){if(r==="hex"){if(!oe(e))throw Error("input encoded as hex must start with 0x");return e}if(r==="string")return zt(e);if(r==="abi"||r==="abi-packed"){let n=t.abiParams;if(!n)throw Error("Undefined input-abi-params");let o=Xs(n),i=e.split(",").map((s,a)=>{if(a>=o.length)throw Error(`Too many values, expected ${o.length} values based on --input-abi-params '${n}', parsing value at index ${a} from input '${e}'`);let c=o[a];switch(c.type){case"string":return s;case"bool":if(s==="true")return!0;if(s==="false")return!1;throw Error(`Invalid boolean value: ${s}`);case"uint":case"uint8":case"uint16":case"uint32":case"uint64":case"uint128":case"uint256":case"int":case"int8":case"int16":case"int32":case"int64":case"int128":case"int256":try{return BigInt(s)}catch{throw Error(`Invalid uint value: ${s}`)}case"bytes":if(oe(s))return s;throw Error(`Invalid bytes value: ${s}`);case"address":if(J(s))return de(s);throw Error(`Invalid address value: ${s}`);default:throw Error(`Unsupported type ${c.type}`)}});if(i.length!==o.length)throw Error(`Not enough values, expected ${o.length} values based on --input-abi-params '${n}', parsed ${i.length} values from input '${e}'`);if(r==="abi")return ct(o,i);else if(r==="abi-packed"){let s=o.map((a)=>a.type);return Vf(s,i)}}if(oe(e))return e;return zt(e)}return},fG=()=>new re("send").description("Send input to the application").argument("[input]","input payload").option("--from <address>","input sender address").option("--application <address>","application address").addOption(new $e("--encoding <encoding>","input encoding").choices(["hex","string","abi","abi-packed"])).option("--abi-params <abi-params>","input abi params").option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("--rpc-url <url>","RPC URL of the Cartesi Devnet").action(async(t,r)=>{let{application:n,from:o}=r,i=De(r),s=await Xn(r),a=o&&J(o)?de(o):(await s.getAddresses())[0],c=await Jn({application:n,projectName:i}),u=await w6e(t,r)||await GA({abiParams:r.abiParams,encoding:r.encoding,message:"Input"}),{request:l}=await s.simulateContract({address:gl,abi:b5,account:a,args:[c,u],functionName:"addInput"}),p=await s.writeContract(l),f=Xe("Sending input...").start();await s.waitForTransactionReceipt({hash:p}),f.succeed(`Input sent: ${p}`)});var ZA=ot(Kr(),1);import T6e from"node:path";var dG=()=>new re("shell").option("--command <command>","shell command to run","/bin/sh").option("-c, --config <config>","path to the configuration file",(e,t)=>t.concat([e]),["cartesi.toml"]).option("--run-as-root","run as root user",!1).action(async(e)=>{let{command:t,runAsRoot:r}=e,n=Ns(e.config),o=T6e.resolve(bn());for(let[i,s]of Object.entries(n.drives)){let a=`${i}.${s.format}`,c=bn(a);if(!ZA.default.existsSync(c))throw Error(`drive '${i}' not built, run 'build'`)}for(let[i,s]of Object.entries(n.nvrams)){if(!pl(s))continue;let a=bn(ll(i));if(!ZA.default.existsSync(a))throw Error(`nvram '${i}' not built, run 'build'`)}n.machine.entrypoint=t,n.machine.user=r?"root":void 0;try{await Vx(n,void 0,{interactive:!0},{cwd:o,stdio:"inherit",tty:!0})}catch(i){if(i instanceof qt){if(i.exitCode===130)return;throw i}}});var mG=ot(Iw(),1);var E6e=(e)=>{if(e==="OK")return U.green(e);return ux.includes(e)?U.red(e):U.yellow(e)},hG=()=>new re("status").description("Shows the status of a local environment.").configureHelp({showGlobalOptions:!0}).option("--project-name <string>","name of project (used by docker compose and cartesi-rollups-node)").option("--json","output in JSON format").action(async(e)=>{let{json:t}=e,r=De(e),n=await hx({projectName:r,service:"rollups_node"}),o=await Qd({projectName:r});if(t)process.stdout.write(JSON.stringify({status:n,deployments:o}));else if(console.log(`${U.cyan(r)} is ${n==="running"?U.green("running"):U.red("not running")}`),n==="running")if(o.length===0)console.log(U.red("no applications deployed"));else{let i=new mG.default({head:["Machine","Address","Status","Enabled"],style:{border:[],head:[]}});i.push(...o.map((a)=>[a.templateHash,a.address,E6e(a.status),a.enabled?U.green("yes"):U.red("no")])),console.log(i.toString());let s=o.filter((a)=>a.status!=="OK");for(let a of s)if(a.reason)console.log(`${U.cyan(a.name)}: ${a.reason}`);if(s.length>0)console.log(U.yellow(`run ${U.cyan("cartesi logs")} for details`))}});var xG=ot(Kr(),1);import{dirname as v6e}from"node:path/posix";var S6e="/var/lib/cartesi-rollups-node/snapshots/image",A6e=(e)=>["cartesi-rollups-machine-tool","replay","--template",S6e,"--application",e.application,"--to-epoch",e.epochIndex.toString(),"--store",e.store],C6e=(e)=>{let{account:t,driveConfig:r,outDir:n,snapshot:o}=e;return["cartesi-rollups-machine-tool","prove","accounts-drive","--snapshot",o,"--accounts-drive-start-index",Ce(r.accountsDriveStartIndex),"--log2-max-num-of-accounts",Ce(r.log2MaxNumOfAccounts),"--log2-leaves-per-account",Ce(r.log2LeavesPerAccount),"--account",t,"--out-drive-root-proof",`${n}/drive-root-proof.json`,"--out-withdraw-proof",`${n}/withdraw-proof.json`]},yG=(e)=>{let t=e.trim().split(`
709
+ `).pop()??"",r=JSON.parse(t);if(typeof r!=="object"||r===null)throw Error(`Unexpected machine tool output: ${e}`);return r},JA=(e,t)=>{let r=e[t];if(typeof r!=="string"||!ul(r))throw Error(`Invalid ${t} in machine tool output: ${r}`);return r},dw=(e,t)=>{let r=e[t];if(typeof r!=="string"||r.length===0)throw Error(`Missing ${t} in machine tool output`);return r},D6e=(e)=>{let t=yG(e),r=t.processed_inputs;if(typeof r!=="number")throw Error("Missing processed_inputs in machine tool output");return{machineRoot:JA(t,"machine_root"),processedInputs:r,store:dw(t,"store")}},I6e=(e)=>{let t=yG(e);return{accountIndex:BigInt(dw(t,"account_index")),accountsDriveMerkleRoot:JA(t,"accounts_drive_merkle_root"),driveRootProofFile:dw(t,"drive_root_proof_file"),machineRoot:JA(t,"machine_root"),withdrawProofFile:dw(t,"withdraw_proof_file")}},gG=async(e)=>{let{projectName:t,store:r}=e,n=v6e(r);await wt({command:["mkdir","-p",n],projectName:t});let o=await wt({command:A6e(e),projectName:t,workdir:n});return D6e(o)},bG=async(e)=>{let{outDir:t,projectName:r}=e;await wt({command:["mkdir","-p",t],projectName:r});let n=await wt({command:C6e(e),projectName:r,workdir:t});return I6e(n)};var wG="/tmp/cartesi-withdraw",O6e=(e,t)=>`${wG}/${e}/epoch-${t}`,k6e=(e,t)=>`${wG}/${e}/${t}`,TG={execNodeCommand:wt,getLastAcceptedEpoch:tH,nodePathExists:KU,proveAccountsDrive:bG,removeNodePath:Xd,replayMachine:gG},R6e={retries:15,minTimeout:1000,maxTimeout:2000,factor:1.2},P6e=async(e)=>{let{application:t,projectName:r}=e,n=await eG({projectName:r}),[o,[i],s]=await Promise.all([n.readContract({abi:Sg,address:t,functionName:"isForeclosed"}),n.readContract({abi:Sg,address:t,functionName:"getAccountsDriveMerkleRoot"}),n.readContract({abi:Sg,address:t,functionName:"getOutputsMerkleRootValidator"})]),a=await n.readContract({abi:FF,address:s,args:[t],functionName:"getLastFinalizedMachineMerkleRoot"});return{driveRootProven:i,finalizedMachineRoot:a,foreclosed:o}},mw=(e,t)=>e.toLowerCase()===t.toLowerCase(),_6e=async(e)=>{let{application:t,finalizedMachineRoot:r,io:n,projectName:o,retry:i}=e,s={};try{return await Id(async()=>{let a=await n.getLastAcceptedEpoch({application:t,projectName:o});if(s=a??{},!a?.machineHash||!mw(a.machineHash,r))throw Error("node is behind the chain");return a.index},i)}catch{throw Error(`The node hasn't processed the last finalized epoch yet (node epoch ${s.index??"none"} root ${s.machineHash??"none"}, chain root ${r}); try again shortly`)}},B6e=async(e)=>{let{application:t,finalizedMachineRoot:r,io:n=TG,projectName:o,retry:i=R6e}=e;if(mw(r,Ba))throw Error("No finalized epoch, there are no funds to withdraw");let s=Xe("Looking up the last finalized epoch...").start(),a;try{a=await _6e({application:t,finalizedMachineRoot:r,io:n,projectName:o,retry:i})}catch(l){throw s.fail(),l}let c=O6e(t,a);if(await n.nodePathExists({path:c,projectName:o}))return s.succeed(`Using the machine replayed up to epoch ${U.cyan(a)}`),{store:c};let u=`${c}.tmp`;s.text=`Replaying the inputs up to epoch ${U.cyan(a)}, this may take a while...`;try{await n.removeNodePath({path:u,projectName:o});let l=await n.replayMachine({application:t,epochIndex:a,projectName:o,store:u});if(!mw(l.machineRoot,r))throw Error(`Replayed machine root ${l.machineRoot} does not match the finalized machine root ${r} of epoch ${a}`);await n.execNodeCommand({command:["mv",u,c],projectName:o}),s.succeed(`Replayed ${U.cyan(l.processedInputs)} inputs up to epoch ${U.cyan(a)}`)}catch(l){throw s.fail("Failed to replay the application"),await n.removeNodePath({path:u,projectName:o}),l}return{store:c}},N6e=async(e)=>{let{account:t,application:r,driveConfig:n,finalizedMachineRoot:o,io:i=TG,projectName:s,store:a}=e,c=Xe(`Generating the proofs of ${U.cyan(t)}...`).start(),u=await i.proveAccountsDrive({account:t,driveConfig:n,outDir:k6e(r,t),projectName:s,snapshot:a}).catch((l)=>{throw c.fail(`Failed to generate the proofs of ${t}`),l});if(!mw(u.machineRoot,o))throw c.fail(),await i.removeNodePath({path:a,projectName:s}),Error(`Proof machine root ${u.machineRoot} does not match the finalized machine root ${o}. Removed the cached snapshot; run the command again to replay it`);return c.succeed(`Generated the proofs of ${U.cyan(t)} (account index ${U.cyan(u.accountIndex)})`),u},F6e=async(e)=>{let{account:t,accountIndex:r,application:n,driveRootProven:o,finalizedMachineRoot:i,projectName:s,tx:a}=e,c=await lx({application:n,projectName:s}),{store:u}=await B6e({application:n,finalizedMachineRoot:i,projectName:s}),l=await N6e({account:t,application:n,driveConfig:c,finalizedMachineRoot:i,projectName:s,store:u});if(!o)await Ka({accountIndex:r,command:["cartesi-rollups-cli","prove-drive-root",n,"--proof-file",l.driveRootProofFile,...Wa({...a,json:!1,wait:!0})],projectName:s,stdout:"stderr"});return l.withdrawProofFile},EG=()=>cp(new re("withdraw").description("Withdraws the funds of an account from a foreclosed application").configureHelp({showGlobalOptions:!0}).addOption(new $e("--account <address>","account to withdraw the funds of").argParser(pH)).addOption(new $e("--proof-file <path>","withdraw proof generated elsewhere, instead of generating it").conflicts("account")),"index of the account in the node mnemonic paying for gas").action(async(e)=>{let{accountIndex:t,proofFile:r}=e,n=De(e),o=await ap({application:e.application,projectName:n}),{driveRootProven:i,finalizedMachineRoot:s,foreclosed:a}=await P6e({application:o,projectName:n});if(!a)throw Error(`Application ${U.cyan(o)} is not foreclosed, use ${U.cyan("cartesi foreclose")} first`);let c,u;try{if(r){if(!i)throw Error(`The accounts drive root of ${o} isn't proven yet. ${U.cyan("--proof-file")} only carries the account proof; run ${U.cyan("cartesi withdraw --account <address>")} once so the CLI proves the drive root, then ${U.cyan("--proof-file")} will work`);u=await cx({content:await xG.default.readFile(r,"utf-8"),projectName:n}),c=u}else{let l=e.account??await Ui({message:"Account to withdraw the funds of"});c=await F6e({account:l,accountIndex:t,application:o,driveRootProven:i,finalizedMachineRoot:s,projectName:n,tx:e})}await Ka({accountIndex:t,command:["cartesi-rollups-cli","withdraw",o,"--proof-file",c,...Wa(e)],projectName:n})}catch(l){Gl(l)}finally{if(u)await Xd({path:u,projectName:n})}});var M6e=String.raw` .
710
+ / \
711
+ / \
712
+ \---/---\ /----\
713
+ \ X \
714
+ \----/ \---/---\
715
+ \ / CARTESI
716
+ \ / CLI
717
+ '`,L6e=new re().name("cartesi").version(oC.version).addHelpText("before",M6e).addCommand(hH()).addCommand(cq()).addCommand(lq()).addCommand(Hq()).addCommand(qq(),{hidden:!0}).addCommand(Yz()).addCommand(Qz()).addCommand(tG()).addCommand(nG()).addCommand(rG()).addCommand(iG()).addCommand(pG()).addCommand(fG()).addCommand(dG()).addCommand(hG()).addCommand(EG());process.on("uncaughtException",(e)=>{console.error(e),process.exit(1)});L6e.parse();
718
+
719
+ //# debugId=ACFADA9E4CB0F46D64756E2164756E21
720
+ //# sourceMappingURL=index.js.map