@dcl/vesting-dashboard 3.5.2-16060301920.commit-19f00cd → 3.6.0

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 (90) hide show
  1. package/assets/{add-c08adc0e.js → add-88487baf.js} +1 -1
  2. package/assets/{all-wallets-2a56fdfd.js → all-wallets-08b7990a.js} +1 -1
  3. package/assets/{app-store-da9c80fc.js → app-store-3e1fa7e2.js} +1 -1
  4. package/assets/{apple-f02fda7c.js → apple-53795bdf.js} +1 -1
  5. package/assets/{arrow-bottom-74d2c273.js → arrow-bottom-7bb18b6e.js} +1 -1
  6. package/assets/{arrow-bottom-circle-cd6d3810.js → arrow-bottom-circle-91e1b83a.js} +1 -1
  7. package/assets/{arrow-left-fce04d7d.js → arrow-left-34856cb6.js} +1 -1
  8. package/assets/{arrow-right-9d8342cc.js → arrow-right-2f839bf5.js} +1 -1
  9. package/assets/{arrow-top-01a87a07.js → arrow-top-6eb1af03.js} +1 -1
  10. package/assets/{bank-fd1d03ae.js → bank-a72514f9.js} +1 -1
  11. package/assets/{basic-4bd75c12.js → basic-2b462812.js} +1 -1
  12. package/assets/{browser-9c02f01f.js → browser-36e4d8e0.js} +1 -1
  13. package/assets/{card-49bc08a4.js → card-ae0c3d86.js} +1 -1
  14. package/assets/{checkmark-029608ab.js → checkmark-260688d2.js} +1 -1
  15. package/assets/{checkmark-bold-ecc7e4f6.js → checkmark-bold-98c16a0e.js} +1 -1
  16. package/assets/{chevron-bottom-2b428154.js → chevron-bottom-c356b3b6.js} +1 -1
  17. package/assets/{chevron-left-90ed61cf.js → chevron-left-8cc6f138.js} +1 -1
  18. package/assets/{chevron-right-7c821860.js → chevron-right-3d237749.js} +1 -1
  19. package/assets/{chevron-top-3d95f11a.js → chevron-top-e7bd38cd.js} +1 -1
  20. package/assets/{chrome-store-5a22713f.js → chrome-store-91b44962.js} +1 -1
  21. package/assets/{clock-d1a052f4.js → clock-4ef29f75.js} +1 -1
  22. package/assets/{close-31d55d62.js → close-5eae79ec.js} +1 -1
  23. package/assets/{coinPlaceholder-134fe1d0.js → coinPlaceholder-0ff9f4ac.js} +1 -1
  24. package/assets/{compass-4ac3881d.js → compass-e6212ea8.js} +1 -1
  25. package/assets/{copy-3ce752e8.js → copy-5567fde3.js} +1 -1
  26. package/assets/{core-f5e3f11a.js → core-22337b12.js} +3 -3
  27. package/assets/{cursor-1a5c116f.js → cursor-9367d57e.js} +1 -1
  28. package/assets/{cursor-transparent-8446a811.js → cursor-transparent-a263c84d.js} +1 -1
  29. package/assets/{desktop-8e0cdd17.js → desktop-1ad14786.js} +1 -1
  30. package/assets/{disconnect-89f3c151.js → disconnect-17eb72da.js} +1 -1
  31. package/assets/{discord-5e171d91.js → discord-fd5b2cc8.js} +1 -1
  32. package/assets/{etherscan-e5da137a.js → etherscan-723b0747.js} +1 -1
  33. package/assets/{exclamation-triangle-ff9f2a46.js → exclamation-triangle-dd914d1e.js} +1 -1
  34. package/assets/{extension-315957ae.js → extension-27033058.js} +1 -1
  35. package/assets/{external-link-44309326.js → external-link-a79c2579.js} +1 -1
  36. package/assets/{facebook-1cf0b4b8.js → facebook-8bb728e5.js} +1 -1
  37. package/assets/{farcaster-215b1536.js → farcaster-1fc087b8.js} +1 -1
  38. package/assets/{filters-8cbdc04e.js → filters-8da8f13b.js} +1 -1
  39. package/assets/{fortmatic-77630451.js → fortmatic-1f08eb72.js} +1 -1
  40. package/assets/{github-01b19bf7.js → github-d13b602e.js} +1 -1
  41. package/assets/{google-cba03f8d.js → google-19773a0b.js} +1 -1
  42. package/assets/{help-circle-72ebe183.js → help-circle-5cf40796.js} +1 -1
  43. package/assets/{id-9562a05c.js → id-3ecde540.js} +1 -1
  44. package/assets/{image-a4f8645b.js → image-032ffded.js} +1 -1
  45. package/assets/{index-4acb66cd.js → index-095dd156.js} +1 -1
  46. package/assets/{index-fc25cd20.js → index-1c46ee85.js} +2 -2
  47. package/assets/{index-8a83ce69.js → index-5b6da6fa.js} +1 -1
  48. package/assets/{index-6a75d29a.css → index-5cda5db0.css} +7 -7
  49. package/assets/{index-23cd0f55.js → index-64c7df79.js} +6 -6
  50. package/assets/{index-dfb5c925.js → index-a1c902b9.js} +1 -1
  51. package/assets/{index-c3d52160.js → index-b7ec26b4.js} +1 -1
  52. package/assets/{index.es-d9174431.js → index.es-b772857d.js} +3 -3
  53. package/assets/{info-circle-07ea8fe3.js → info-circle-4d9b4ae1.js} +1 -1
  54. package/assets/{info-d1d382ad.js → info-fcc588e6.js} +1 -1
  55. package/assets/{lightbulb-bb330403.js → lightbulb-d8f933f2.js} +1 -1
  56. package/assets/{mail-84d8e8e1.js → mail-a81715bb.js} +1 -1
  57. package/assets/{mobile-e2b09bb7.js → mobile-dc149ffe.js} +1 -1
  58. package/assets/{more-3f40c7df.js → more-d5ee7f6b.js} +1 -1
  59. package/assets/{network-placeholder-71c396aa.js → network-placeholder-feac434d.js} +1 -1
  60. package/assets/{nftPlaceholder-d89385d8.js → nftPlaceholder-044d55dc.js} +1 -1
  61. package/assets/{off-2724934c.js → off-846e08e9.js} +1 -1
  62. package/assets/{play-store-1abafce5.js → play-store-7ed2ff02.js} +1 -1
  63. package/assets/{plus-6ad83a15.js → plus-ffeb5fae.js} +1 -1
  64. package/assets/{qr-code-ca4014d4.js → qr-code-c68eba82.js} +1 -1
  65. package/assets/{recycle-horizontal-a7953996.js → recycle-horizontal-a810739d.js} +1 -1
  66. package/assets/{refresh-ba92c07d.js → refresh-5500f1b1.js} +1 -1
  67. package/assets/{reown-logo-1c881aeb.js → reown-logo-8561c0cb.js} +1 -1
  68. package/assets/{search-e44b04b5.js → search-30f20334.js} +1 -1
  69. package/assets/{secp256k1-c8041f84.js → secp256k1-4d114413.js} +1 -1
  70. package/assets/{secp256k1-e555dfeb.js → secp256k1-726c671c.js} +1 -1
  71. package/assets/{send-7181ced0.js → send-3f36a15e.js} +1 -1
  72. package/assets/{swapHorizontal-acbca5b3.js → swapHorizontal-d2f10b1b.js} +1 -1
  73. package/assets/{swapHorizontalBold-47299b30.js → swapHorizontalBold-9400b7b7.js} +1 -1
  74. package/assets/{swapHorizontalMedium-c35a984b.js → swapHorizontalMedium-f16ab582.js} +1 -1
  75. package/assets/{swapHorizontalRoundedBold-cbf29e59.js → swapHorizontalRoundedBold-e2b32898.js} +1 -1
  76. package/assets/{swapVertical-f4e5432e.js → swapVertical-9b617cf6.js} +1 -1
  77. package/assets/{telegram-f120d2fa.js → telegram-e89b4f9e.js} +1 -1
  78. package/assets/{three-dots-afde7907.js → three-dots-31ebb7fb.js} +1 -1
  79. package/assets/{twitch-a1f9688c.js → twitch-a760d77b.js} +1 -1
  80. package/assets/{twitterIcon-ff394218.js → twitterIcon-41d0cc80.js} +1 -1
  81. package/assets/{verify-822d6b22.js → verify-abb0184b.js} +1 -1
  82. package/assets/{verify-filled-6087cf80.js → verify-filled-9e15e3d5.js} +1 -1
  83. package/assets/{w3m-modal-a28c18e8.js → w3m-modal-94dd92e8.js} +1 -1
  84. package/assets/{wallet-095d2cfd.js → wallet-4969b511.js} +1 -1
  85. package/assets/{wallet-placeholder-82b67b5f.js → wallet-placeholder-e0c98987.js} +1 -1
  86. package/assets/{walletconnect-9023b42a.js → walletconnect-e274eb33.js} +1 -1
  87. package/assets/{warning-circle-209b10bc.js → warning-circle-5f26dde6.js} +1 -1
  88. package/assets/{x-2ab98c1d.js → x-aa0b95d6.js} +1 -1
  89. package/index.html +4 -4
  90. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import{m as o}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const i=o`<svg fill="none" viewBox="0 0 14 15">
1
+ import{m as o}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const i=o`<svg fill="none" viewBox="0 0 14 15">
2
2
  <path
3
3
  fill="currentColor"
4
4
  d="M6 10.49a1 1 0 1 0 2 0v-2a1 1 0 0 0-2 0v2ZM7 4.49a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"
@@ -1,3 +1,3 @@
1
- import{m as C}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const r=C`<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+ import{m as C}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const r=C`<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path d="M9.125 6.875C9.125 6.57833 9.21298 6.28832 9.3778 6.04165C9.54262 5.79497 9.77689 5.60271 10.051 5.48918C10.3251 5.37565 10.6267 5.34594 10.9176 5.40382C11.2086 5.4617 11.4759 5.60456 11.6857 5.81434C11.8954 6.02412 12.0383 6.29139 12.0962 6.58236C12.1541 6.87334 12.1244 7.17494 12.0108 7.44903C11.8973 7.72311 11.705 7.95738 11.4584 8.1222C11.2117 8.28703 10.9217 8.375 10.625 8.375C10.2272 8.375 9.84565 8.21696 9.56434 7.93566C9.28304 7.65436 9.125 7.27282 9.125 6.875ZM21.125 11C21.125 13.0025 20.5312 14.9601 19.4186 16.6251C18.3061 18.2902 16.7248 19.5879 14.8747 20.3543C13.0246 21.1206 10.9888 21.3211 9.02471 20.9305C7.06066 20.5398 5.25656 19.5755 3.84055 18.1595C2.42454 16.7435 1.46023 14.9393 1.06955 12.9753C0.678878 11.0112 0.879387 8.97543 1.64572 7.12533C2.41206 5.27523 3.70981 3.69392 5.37486 2.58137C7.0399 1.46882 8.99747 0.875 11 0.875C13.6844 0.877978 16.258 1.94567 18.1562 3.84383C20.0543 5.74199 21.122 8.3156 21.125 11ZM18.875 11C18.875 9.44247 18.4131 7.91992 17.5478 6.62488C16.6825 5.32985 15.4526 4.32049 14.0136 3.72445C12.5747 3.12841 10.9913 2.97246 9.46367 3.27632C7.93607 3.58017 6.53288 4.3302 5.43154 5.43153C4.3302 6.53287 3.58018 7.93606 3.27632 9.46366C2.97246 10.9913 3.12841 12.5747 3.72445 14.0136C4.32049 15.4526 5.32985 16.6825 6.62489 17.5478C7.91993 18.4131 9.44248 18.875 11 18.875C13.0879 18.8728 15.0896 18.0424 16.566 16.566C18.0424 15.0896 18.8728 13.0879 18.875 11ZM12.125 14.4387V11.375C12.125 10.8777 11.9275 10.4008 11.5758 10.0492C11.2242 9.69754 10.7473 9.5 10.25 9.5C9.98433 9.4996 9.72708 9.59325 9.52383 9.76435C9.32058 9.93544 9.18444 10.173 9.13952 10.4348C9.09461 10.6967 9.14381 10.966 9.27843 11.195C9.41304 11.4241 9.62438 11.5981 9.875 11.6863V14.75C9.875 15.2473 10.0725 15.7242 10.4242 16.0758C10.7758 16.4275 11.2527 16.625 11.75 16.625C12.0157 16.6254 12.2729 16.5318 12.4762 16.3607C12.6794 16.1896 12.8156 15.952 12.8605 15.6902C12.9054 15.4283 12.8562 15.159 12.7216 14.93C12.587 14.7009 12.3756 14.5269 12.125 14.4387Z" fill="currentColor"/>
3
3
  </svg>`;export{r as infoSvg};
@@ -1,3 +1,3 @@
1
- import{m as C}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const t=C`<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+ import{m as C}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const t=C`<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path fill-rule="evenodd" clip-rule="evenodd" d="M5.00177 1.78569C3.8179 1.78569 2.85819 2.74508 2.85819 3.92855C2.85819 4.52287 3.09928 5.05956 3.49077 5.4485L3.5005 5.45817C3.64381 5.60054 3.76515 5.72108 3.85631 5.81845C3.93747 5.90512 4.05255 6.03218 4.12889 6.1805C4.16999 6.26034 4.19 6.30843 4.21768 6.39385C4.22145 6.40546 4.22499 6.41703 4.22833 6.42855H5.77521C5.77854 6.41703 5.78208 6.40547 5.78585 6.39385C5.81353 6.30843 5.83354 6.26034 5.87464 6.1805C5.95098 6.03218 6.06606 5.90512 6.14722 5.81845C6.23839 5.72108 6.35973 5.60053 6.50304 5.45816L6.51276 5.4485C6.90425 5.05956 7.14534 4.52287 7.14534 3.92855C7.14534 2.74508 6.18563 1.78569 5.00177 1.78569ZM5.71629 7.85712H4.28724C4.28724 8.21403 4.28876 8.40985 4.30703 8.54571C4.30727 8.54748 4.30751 8.54921 4.30774 8.55091C4.30944 8.55115 4.31118 8.55138 4.31295 8.55162C4.44884 8.56989 4.64474 8.5714 5.00177 8.5714C5.3588 8.5714 5.55469 8.56989 5.69059 8.55162C5.69236 8.55138 5.69409 8.55115 5.69579 8.55091C5.69603 8.54921 5.69627 8.54748 5.6965 8.54571C5.71477 8.40985 5.71629 8.21403 5.71629 7.85712ZM2.85819 7.14283C2.85819 6.9948 2.85796 6.91114 2.8548 6.85032C2.85461 6.84656 2.85441 6.84309 2.85421 6.83988C2.84393 6.8282 2.83047 6.81334 2.81301 6.79469C2.74172 6.71856 2.63908 6.61643 2.48342 6.46178C1.83307 5.81566 1.42914 4.91859 1.42914 3.92855C1.42914 1.9561 3.02866 0.357117 5.00177 0.357117C6.97487 0.357117 8.57439 1.9561 8.57439 3.92855C8.57439 4.91859 8.17047 5.81566 7.52012 6.46178C7.36445 6.61643 7.26182 6.71856 7.19053 6.79469C7.17306 6.81334 7.1596 6.8282 7.14932 6.83988C7.14912 6.84309 7.14892 6.84656 7.14873 6.85032C7.14557 6.91114 7.14534 6.9948 7.14534 7.14283V7.85712C7.14534 7.87009 7.14535 7.88304 7.14535 7.89598C7.14541 8.19889 7.14547 8.49326 7.11281 8.73606C7.076 9.00978 6.98631 9.32212 6.72678 9.58156C6.46726 9.841 6.15481 9.93065 5.881 9.96745C5.63813 10.0001 5.34365 10 5.04064 9.99998C5.0277 9.99998 5.01474 9.99998 5.00177 9.99998C4.98879 9.99998 4.97583 9.99998 4.96289 9.99998C4.65988 10 4.36541 10.0001 4.12253 9.96745C3.84872 9.93065 3.53628 9.841 3.27675 9.58156C3.01722 9.32212 2.92753 9.00978 2.89072 8.73606C2.85807 8.49326 2.85812 8.19889 2.85818 7.89598C2.85819 7.88304 2.85819 7.87008 2.85819 7.85712V7.14283ZM7.1243 6.86977C7.12366 6.87069 7.1233 6.87116 7.12327 6.87119C7.12323 6.87123 7.12356 6.87076 7.1243 6.86977ZM2.88027 6.8712C2.88025 6.87119 2.87988 6.8707 2.87921 6.86975C2.87995 6.87072 2.88028 6.8712 2.88027 6.8712Z" fill="#949E9E"/>
3
3
  </svg>`;export{t as lightbulbSvg};
@@ -1,4 +1,4 @@
1
- import{m as c}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const r=c`<svg fill="none" viewBox="0 0 16 16">
1
+ import{m as c}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const r=c`<svg fill="none" viewBox="0 0 16 16">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1,4 +1,4 @@
1
- import{m as o}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const i=o`<svg fill="none" viewBox="0 0 20 20">
1
+ import{m as o}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const i=o`<svg fill="none" viewBox="0 0 20 20">
2
2
  <path fill="currentColor" d="M10.81 5.81a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" />
3
3
  <path
4
4
  fill="currentColor"
@@ -1,4 +1,4 @@
1
- import{m as o}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const t=o`<svg fill="none" viewBox="0 0 41 40">
1
+ import{m as o}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const t=o`<svg fill="none" viewBox="0 0 41 40">
2
2
  <path
3
3
  style="fill: var(--wui-color-fg-100);"
4
4
  fill-opacity=".05"
@@ -1,4 +1,4 @@
1
- import{m as l}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const r=l`<svg fill="none" viewBox="0 0 22 20">
1
+ import{m as l}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const r=l`<svg fill="none" viewBox="0 0 22 20">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1,4 +1,4 @@
1
- import{m as c}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const e=c`<svg fill="none" viewBox="0 0 20 20">
1
+ import{m as c}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const e=c`<svg fill="none" viewBox="0 0 20 20">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1,4 +1,4 @@
1
- import{m as o}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const i=o`<svg fill="none" viewBox="0 0 16 16">
1
+ import{m as o}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const i=o`<svg fill="none" viewBox="0 0 16 16">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1,4 +1,4 @@
1
- import{m as a}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const i=a` <svg
1
+ import{m as a}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const i=a` <svg
2
2
  width="36"
3
3
  height="36"
4
4
  fill="none"
@@ -1,4 +1,4 @@
1
- import{m as o}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const r=o`<svg
1
+ import{m as o}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const r=o`<svg
2
2
  width="13"
3
3
  height="12"
4
4
  viewBox="0 0 13 12"
@@ -1,4 +1,4 @@
1
- import{m as a}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const r=a`<svg fill="none" viewBox="0 0 20 20">
1
+ import{m as a}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const r=a`<svg fill="none" viewBox="0 0 20 20">
2
2
  <path
3
3
  fill="currentColor"
4
4
  d="M3 6a3 3 0 0 1 3-3h1a1 1 0 1 0 0-2H6a5 5 0 0 0-5 5v1a1 1 0 0 0 2 0V6ZM13 1a1 1 0 1 0 0 2h1a3 3 0 0 1 3 3v1a1 1 0 1 0 2 0V6a5 5 0 0 0-5-5h-1ZM3 13a1 1 0 1 0-2 0v1a5 5 0 0 0 5 5h1a1 1 0 1 0 0-2H6a3 3 0 0 1-3-3v-1ZM19 13a1 1 0 1 0-2 0v1a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1.01a5 5 0 0 0 5-5v-1ZM5.3 6.36c-.04.2-.04.43-.04.89s0 .7.05.89c.14.52.54.92 1.06 1.06.19.05.42.05.89.05.46 0 .7 0 .88-.05A1.5 1.5 0 0 0 9.2 8.14c.06-.2.06-.43.06-.89s0-.7-.06-.89A1.5 1.5 0 0 0 8.14 5.3c-.19-.05-.42-.05-.88-.05-.47 0-.7 0-.9.05a1.5 1.5 0 0 0-1.05 1.06ZM10.8 6.36c-.04.2-.04.43-.04.89s0 .7.05.89c.14.52.54.92 1.06 1.06.19.05.42.05.89.05.46 0 .7 0 .88-.05a1.5 1.5 0 0 0 1.06-1.06c.06-.2.06-.43.06-.89s0-.7-.06-.89a1.5 1.5 0 0 0-1.06-1.06c-.19-.05-.42-.05-.88-.05-.47 0-.7 0-.9.05a1.5 1.5 0 0 0-1.05 1.06ZM5.26 12.75c0-.46 0-.7.05-.89a1.5 1.5 0 0 1 1.06-1.06c.19-.05.42-.05.89-.05.46 0 .7 0 .88.05.52.14.93.54 1.06 1.06.06.2.06.43.06.89s0 .7-.06.89a1.5 1.5 0 0 1-1.06 1.06c-.19.05-.42.05-.88.05-.47 0-.7 0-.9-.05a1.5 1.5 0 0 1-1.05-1.06c-.05-.2-.05-.43-.05-.89ZM10.8 11.86c-.04.2-.04.43-.04.89s0 .7.05.89c.14.52.54.92 1.06 1.06.19.05.42.05.89.05.46 0 .7 0 .88-.05a1.5 1.5 0 0 0 1.06-1.06c.06-.2.06-.43.06-.89s0-.7-.06-.89a1.5 1.5 0 0 0-1.06-1.06c-.19-.05-.42-.05-.88-.05-.47 0-.7 0-.9.05a1.5 1.5 0 0 0-1.05 1.06Z"
@@ -1,4 +1,4 @@
1
- import{m as C}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const t=C`<svg
1
+ import{m as C}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const t=C`<svg
2
2
  fill="none"
3
3
  viewBox="0 0 21 20"
4
4
  >
@@ -1,4 +1,4 @@
1
- import{m as l}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const i=l`<svg fill="none" viewBox="0 0 14 16">
1
+ import{m as l}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const i=l`<svg fill="none" viewBox="0 0 14 16">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1,4 +1,4 @@
1
- import{m as C}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const i=C`<svg width="60" height="16" viewBox="0 0 60 16" fill="none"">
1
+ import{m as C}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const i=C`<svg width="60" height="16" viewBox="0 0 60 16" fill="none"">
2
2
  <path d="M9.3335 4.66667C9.3335 2.08934 11.4229 0 14.0002 0H20.6669C23.2442 0 25.3335 2.08934 25.3335 4.66667V11.3333C25.3335 13.9106 23.2442 16 20.6669 16H14.0002C11.4229 16 9.3335 13.9106 9.3335 11.3333V4.66667Z" fill="#363636"/>
3
3
  <path d="M15.6055 11.0003L17.9448 4.66699H18.6316L16.2923 11.0003H15.6055Z" fill="#F6F6F6"/>
4
4
  <path d="M0 4.33333C0 1.9401 1.9401 0 4.33333 0C6.72657 0 8.66669 1.9401 8.66669 4.33333V11.6667C8.66669 14.0599 6.72657 16 4.33333 16C1.9401 16 0 14.0599 0 11.6667V4.33333Z" fill="#363636"/>
@@ -1,4 +1,4 @@
1
- import{m as l}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const i=l`<svg fill="none" viewBox="0 0 20 20">
1
+ import{m as l}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const i=l`<svg fill="none" viewBox="0 0 20 20">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1 +1 @@
1
- import{N as xe,R as Mt,S as qt,T as pe,U as Ee,V as Ke,W as Rt,X as De,Y as $,Z as We,_ as Ge,$ as $e,a0 as ve}from"./index.es-d9174431.js";import"./index-23cd0f55.js";function Xe(t,n,e,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(n,e,r);const i=BigInt(32),o=BigInt(4294967295),c=Number(e>>i&o),f=Number(e&o),s=r?4:0,a=r?0:4;t.setUint32(n+s,c,r),t.setUint32(n+a,f,r)}function Qe(t,n,e){return t&n^~t&e}function Je(t,n,e){return t&n^t&e^n&e}class Fe extends xe{constructor(n,e,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=n,this.outputLen=e,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(n),this.view=Mt(this.buffer)}update(n){qt(this),n=pe(n),Ee(n);const{view:e,buffer:r,blockLen:i}=this,o=n.length;for(let c=0;c<o;){const f=Math.min(i-this.pos,o-c);if(f===i){const s=Mt(n);for(;i<=o-c;c+=i)this.process(s,c);continue}r.set(n.subarray(c,c+f),this.pos),this.pos+=f,c+=f,this.pos===i&&(this.process(e,0),this.pos=0)}return this.length+=n.length,this.roundClean(),this}digestInto(n){qt(this),Ke(n,this),this.finished=!0;const{buffer:e,view:r,blockLen:i,isLE:o}=this;let{pos:c}=this;e[c++]=128,Rt(this.buffer.subarray(c)),this.padOffset>i-c&&(this.process(r,0),c=0);for(let l=c;l<i;l++)e[l]=0;Xe(r,i-8,BigInt(this.length*8),o),this.process(r,0);const f=Mt(n),s=this.outputLen;if(s%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const a=s/4,d=this.get();if(a>d.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<a;l++)f.setUint32(4*l,d[l],o)}digest(){const{buffer:n,outputLen:e}=this;this.digestInto(n);const r=n.slice(0,e);return this.destroy(),r}_cloneInto(n){n||(n=new this.constructor),n.set(...this.get());const{blockLen:e,buffer:r,length:i,finished:o,destroyed:c,pos:f}=this;return n.destroyed=c,n.finished=o,n.length=i,n.pos=f,i%e&&n.buffer.set(r),n}clone(){return this._cloneInto()}}const et=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),tn=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]),nt=new Uint32Array(64);class en extends Fe{constructor(n=32){super(64,n,8,!1),this.A=et[0]|0,this.B=et[1]|0,this.C=et[2]|0,this.D=et[3]|0,this.E=et[4]|0,this.F=et[5]|0,this.G=et[6]|0,this.H=et[7]|0}get(){const{A:n,B:e,C:r,D:i,E:o,F:c,G:f,H:s}=this;return[n,e,r,i,o,c,f,s]}set(n,e,r,i,o,c,f,s){this.A=n|0,this.B=e|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=c|0,this.G=f|0,this.H=s|0}process(n,e){for(let l=0;l<16;l++,e+=4)nt[l]=n.getUint32(e,!1);for(let l=16;l<64;l++){const x=nt[l-15],b=nt[l-2],_=$(x,7)^$(x,18)^x>>>3,g=$(b,17)^$(b,19)^b>>>10;nt[l]=g+nt[l-7]+_+nt[l-16]|0}let{A:r,B:i,C:o,D:c,E:f,F:s,G:a,H:d}=this;for(let l=0;l<64;l++){const x=$(f,6)^$(f,11)^$(f,25),b=d+x+Qe(f,s,a)+tn[l]+nt[l]|0,g=($(r,2)^$(r,13)^$(r,22))+Je(r,i,o)|0;d=a,a=s,s=f,f=c+b|0,c=o,o=i,i=r,r=b+g|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,c=c+this.D|0,f=f+this.E|0,s=s+this.F|0,a=a+this.G|0,d=d+this.H|0,this.set(r,i,o,c,f,s,a,d)}roundClean(){Rt(nt)}destroy(){this.set(0,0,0,0,0,0,0,0),Rt(this.buffer)}}const Ut=De(()=>new en);class Be extends xe{constructor(n,e){super(),this.finished=!1,this.destroyed=!1,We(n);const r=pe(e);if(this.iHash=n.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,o=new Uint8Array(i);o.set(r.length>i?n.create().update(r).digest():r);for(let c=0;c<o.length;c++)o[c]^=54;this.iHash.update(o),this.oHash=n.create();for(let c=0;c<o.length;c++)o[c]^=106;this.oHash.update(o),Rt(o)}update(n){return qt(this),this.iHash.update(n),this}digestInto(n){qt(this),Ee(n,this.outputLen),this.finished=!0,this.iHash.digestInto(n),this.oHash.update(n),this.oHash.digestInto(n),this.destroy()}digest(){const n=new Uint8Array(this.oHash.outputLen);return this.digestInto(n),n}_cloneInto(n){n||(n=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:r,finished:i,destroyed:o,blockLen:c,outputLen:f}=this;return n=n,n.finished=i,n.destroyed=o,n.blockLen=c,n.outputLen=f,n.oHash=e._cloneInto(n.oHash),n.iHash=r._cloneInto(n.iHash),n}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Se=(t,n,e)=>new Be(t,n).update(e).digest();Se.create=(t,n)=>new Be(t,n);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const re=BigInt(0),Qt=BigInt(1);function _t(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function st(t){if(!_t(t))throw new Error("Uint8Array expected")}function pt(t,n){if(typeof n!="boolean")throw new Error(t+" boolean expected, got "+n)}function Nt(t){const n=t.toString(16);return n.length&1?"0"+n:n}function Ae(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?re:BigInt("0x"+t)}const _e=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",nn=Array.from({length:256},(t,n)=>n.toString(16).padStart(2,"0"));function Et(t){if(st(t),_e)return t.toHex();let n="";for(let e=0;e<t.length;e++)n+=nn[t[e]];return n}const J={_0:48,_9:57,A:65,F:70,a:97,f:102};function ae(t){if(t>=J._0&&t<=J._9)return t-J._0;if(t>=J.A&&t<=J.F)return t-(J.A-10);if(t>=J.a&&t<=J.f)return t-(J.a-10)}function Ht(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(_e)return Uint8Array.fromHex(t);const n=t.length,e=n/2;if(n%2)throw new Error("hex string expected, got unpadded hex of length "+n);const r=new Uint8Array(e);for(let i=0,o=0;i<e;i++,o+=2){const c=ae(t.charCodeAt(o)),f=ae(t.charCodeAt(o+1));if(c===void 0||f===void 0){const s=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+s+'" at index '+o)}r[i]=c*16+f}return r}function X(t){return Ae(Et(t))}function Ie(t){return st(t),Ae(Et(Uint8Array.from(t).reverse()))}function lt(t,n){return Ht(t.toString(16).padStart(n*2,"0"))}function Oe(t,n){return lt(t,n).reverse()}function V(t,n,e){let r;if(typeof n=="string")try{r=Ht(n)}catch(o){throw new Error(t+" must be hex string or Uint8Array, cause: "+o)}else if(_t(n))r=Uint8Array.from(n);else throw new Error(t+" must be hex string or Uint8Array");const i=r.length;if(typeof e=="number"&&i!==e)throw new Error(t+" of length "+e+" expected, got "+i);return r}function D(...t){let n=0;for(let r=0;r<t.length;r++){const i=t[r];st(i),n+=i.length}const e=new Uint8Array(n);for(let r=0,i=0;r<t.length;r++){const o=t[r];e.set(o,i),i+=o.length}return e}function oe(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}const jt=t=>typeof t=="bigint"&&re<=t;function vt(t,n,e){return jt(t)&&jt(n)&&jt(e)&&n<=t&&t<e}function ut(t,n,e,r){if(!vt(n,e,r))throw new Error("expected valid "+t+": "+e+" <= n < "+r+", got "+n)}function rn(t){let n;for(n=0;t>re;t>>=Qt,n+=1);return n}const Ct=t=>(Qt<<BigInt(t))-Qt,Yt=t=>new Uint8Array(t),ue=t=>Uint8Array.from(t);function on(t,n,e){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof n!="number"||n<2)throw new Error("qByteLen must be a number");if(typeof e!="function")throw new Error("hmacFn must be a function");let r=Yt(t),i=Yt(t),o=0;const c=()=>{r.fill(1),i.fill(0),o=0},f=(...l)=>e(i,r,...l),s=(l=Yt(0))=>{i=f(ue([0]),l),r=f(),l.length!==0&&(i=f(ue([1]),l),r=f())},a=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let l=0;const x=[];for(;l<n;){r=f();const b=r.slice();x.push(b),l+=r.length}return D(...x)};return(l,x)=>{c(),s(l);let b;for(;!(b=x(a()));)s();return c(),b}}const sn={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||_t(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,n)=>n.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function It(t,n,e={}){const r=(i,o,c)=>{const f=sn[o];if(typeof f!="function")throw new Error("invalid validator function");const s=t[i];if(!(c&&s===void 0)&&!f(s,t))throw new Error("param "+String(i)+" is invalid. Expected "+o+", got "+s)};for(const[i,o]of Object.entries(n))r(i,o,!1);for(const[i,o]of Object.entries(e))r(i,o,!0);return t}function le(t){const n=new WeakMap;return(e,...r)=>{const i=n.get(e);if(i!==void 0)return i;const o=t(e,...r);return n.set(e,o),o}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Y=BigInt(0),M=BigInt(1),at=BigInt(2),cn=BigInt(3),Ne=BigInt(4),qe=BigInt(5),Re=BigInt(8);function Z(t,n){const e=t%n;return e>=Y?e:n+e}function K(t,n,e){let r=t;for(;n-- >Y;)r*=r,r%=e;return r}function Jt(t,n){if(t===Y)throw new Error("invert: expected non-zero number");if(n<=Y)throw new Error("invert: expected positive modulus, got "+n);let e=Z(t,n),r=n,i=Y,o=M;for(;e!==Y;){const f=r/e,s=r%e,a=i-o*f;r=e,e=s,i=o,o=a}if(r!==M)throw new Error("invert: does not exist");return Z(i,n)}function Ue(t,n){const e=(t.ORDER+M)/Ne,r=t.pow(n,e);if(!t.eql(t.sqr(r),n))throw new Error("Cannot find square root");return r}function fn(t,n){const e=(t.ORDER-qe)/Re,r=t.mul(n,at),i=t.pow(r,e),o=t.mul(n,i),c=t.mul(t.mul(o,at),i),f=t.mul(o,t.sub(c,t.ONE));if(!t.eql(t.sqr(f),n))throw new Error("Cannot find square root");return f}function an(t){if(t<BigInt(3))throw new Error("sqrt is not defined for small field");let n=t-M,e=0;for(;n%at===Y;)n/=at,e++;let r=at;const i=se(t);for(;de(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(e===1)return Ue;let o=i.pow(r,n);const c=(n+M)/at;return function(s,a){if(s.is0(a))return a;if(de(s,a)!==1)throw new Error("Cannot find square root");let d=e,l=s.mul(s.ONE,o),x=s.pow(a,n),b=s.pow(a,c);for(;!s.eql(x,s.ONE);){if(s.is0(x))return s.ZERO;let _=1,g=s.sqr(x);for(;!s.eql(g,s.ONE);)if(_++,g=s.sqr(g),_===d)throw new Error("Cannot find square root");const T=M<<BigInt(d-_-1),I=s.pow(l,T);d=_,l=s.sqr(I),x=s.mul(x,l),b=s.mul(b,I)}return b}}function un(t){return t%Ne===cn?Ue:t%Re===qe?fn:an(t)}const ln=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function He(t){const n={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},e=ln.reduce((r,i)=>(r[i]="function",r),n);return It(t,e)}function dn(t,n,e){if(e<Y)throw new Error("invalid exponent, negatives unsupported");if(e===Y)return t.ONE;if(e===M)return n;let r=t.ONE,i=n;for(;e>Y;)e&M&&(r=t.mul(r,i)),i=t.sqr(i),e>>=M;return r}function Zt(t,n,e=!1){const r=new Array(n.length).fill(e?t.ZERO:void 0),i=n.reduce((c,f,s)=>t.is0(f)?c:(r[s]=c,t.mul(c,f)),t.ONE),o=t.inv(i);return n.reduceRight((c,f,s)=>t.is0(f)?c:(r[s]=t.mul(c,r[s]),t.mul(c,f)),o),r}function de(t,n){const e=(t.ORDER-M)/at,r=t.pow(n,e),i=t.eql(r,t.ONE),o=t.eql(r,t.ZERO),c=t.eql(r,t.neg(t.ONE));if(!i&&!o&&!c)throw new Error("invalid Legendre symbol result");return i?1:o?0:-1}function Le(t,n){n!==void 0&&Ge(n);const e=n!==void 0?n:t.toString(2).length,r=Math.ceil(e/8);return{nBitLength:e,nByteLength:r}}function se(t,n,e=!1,r={}){if(t<=Y)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:o}=Le(t,n);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const f=Object.freeze({ORDER:t,isLE:e,BITS:i,BYTES:o,MASK:Ct(i),ZERO:Y,ONE:M,create:s=>Z(s,t),isValid:s=>{if(typeof s!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof s);return Y<=s&&s<t},is0:s=>s===Y,isOdd:s=>(s&M)===M,neg:s=>Z(-s,t),eql:(s,a)=>s===a,sqr:s=>Z(s*s,t),add:(s,a)=>Z(s+a,t),sub:(s,a)=>Z(s-a,t),mul:(s,a)=>Z(s*a,t),pow:(s,a)=>dn(f,s,a),div:(s,a)=>Z(s*Jt(a,t),t),sqrN:s=>s*s,addN:(s,a)=>s+a,subN:(s,a)=>s-a,mulN:(s,a)=>s*a,inv:s=>Jt(s,t),sqrt:r.sqrt||(s=>(c||(c=un(t)),c(f,s))),toBytes:s=>e?Oe(s,o):lt(s,o),fromBytes:s=>{if(s.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+s.length);return e?Ie(s):X(s)},invertBatch:s=>Zt(f,s),cmov:(s,a,d)=>d?a:s});return Object.freeze(f)}function Te(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const n=t.toString(2).length;return Math.ceil(n/8)}function ke(t){const n=Te(t);return n+Math.ceil(n/2)}function hn(t,n,e=!1){const r=t.length,i=Te(n),o=ke(n);if(r<16||r<o||r>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+r);const c=e?Ie(t):X(t),f=Z(c,n-M)+M;return e?Oe(f,i):lt(f,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const he=BigInt(0),Ft=BigInt(1);function Kt(t,n){const e=n.negate();return t?e:n}function Ce(t,n){if(!Number.isSafeInteger(t)||t<=0||t>n)throw new Error("invalid window size, expected [1.."+n+"], got W="+t)}function Dt(t,n){Ce(t,n);const e=Math.ceil(n/t)+1,r=2**(t-1),i=2**t,o=Ct(t),c=BigInt(t);return{windows:e,windowSize:r,mask:o,maxNumber:i,shiftBy:c}}function we(t,n,e){const{windowSize:r,mask:i,maxNumber:o,shiftBy:c}=e;let f=Number(t&i),s=t>>c;f>r&&(f-=o,s+=Ft);const a=n*r,d=a+Math.abs(f)-1,l=f===0,x=f<0,b=n%2!==0;return{nextN:s,offset:d,isZero:l,isNeg:x,isNegF:b,offsetF:a}}function wn(t,n){if(!Array.isArray(t))throw new Error("array expected");t.forEach((e,r)=>{if(!(e instanceof n))throw new Error("invalid point at index "+r)})}function gn(t,n){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((e,r)=>{if(!n.isValid(e))throw new Error("invalid scalar at index "+r)})}const Wt=new WeakMap,Ze=new WeakMap;function Gt(t){return Ze.get(t)||1}function mn(t,n){return{constTimeNegate:Kt,hasPrecomputes(e){return Gt(e)!==1},unsafeLadder(e,r,i=t.ZERO){let o=e;for(;r>he;)r&Ft&&(i=i.add(o)),o=o.double(),r>>=Ft;return i},precomputeWindow(e,r){const{windows:i,windowSize:o}=Dt(r,n),c=[];let f=e,s=f;for(let a=0;a<i;a++){s=f,c.push(s);for(let d=1;d<o;d++)s=s.add(f),c.push(s);f=s.double()}return c},wNAF(e,r,i){let o=t.ZERO,c=t.BASE;const f=Dt(e,n);for(let s=0;s<f.windows;s++){const{nextN:a,offset:d,isZero:l,isNeg:x,isNegF:b,offsetF:_}=we(i,s,f);i=a,l?c=c.add(Kt(b,r[_])):o=o.add(Kt(x,r[d]))}return{p:o,f:c}},wNAFUnsafe(e,r,i,o=t.ZERO){const c=Dt(e,n);for(let f=0;f<c.windows&&i!==he;f++){const{nextN:s,offset:a,isZero:d,isNeg:l}=we(i,f,c);if(i=s,!d){const x=r[a];o=o.add(l?x.negate():x)}}return o},getPrecomputes(e,r,i){let o=Wt.get(r);return o||(o=this.precomputeWindow(r,e),e!==1&&Wt.set(r,i(o))),o},wNAFCached(e,r,i){const o=Gt(e);return this.wNAF(o,this.getPrecomputes(o,e,i),r)},wNAFCachedUnsafe(e,r,i,o){const c=Gt(e);return c===1?this.unsafeLadder(e,r,o):this.wNAFUnsafe(c,this.getPrecomputes(c,e,i),r,o)},setWindowSize(e,r){Ce(r,n),Ze.set(e,r),Wt.delete(e)}}}function bn(t,n,e,r){wn(e,t),gn(r,n);const i=e.length,o=r.length;if(i!==o)throw new Error("arrays of points and scalars must have equal length");const c=t.ZERO,f=rn(BigInt(i));let s=1;f>12?s=f-3:f>4?s=f-2:f>0&&(s=2);const a=Ct(s),d=new Array(Number(a)+1).fill(c),l=Math.floor((n.BITS-1)/s)*s;let x=c;for(let b=l;b>=0;b-=s){d.fill(c);for(let g=0;g<o;g++){const T=r[g],I=Number(T>>BigInt(b)&a);d[I]=d[I].add(e[g])}let _=c;for(let g=d.length-1,T=c;g>0;g--)T=T.add(d[g]),_=_.add(T);if(x=x.add(_),b!==0)for(let g=0;g<s;g++)x=x.double()}return x}function Ve(t){return He(t.Fp),It(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Le(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function ge(t){t.lowS!==void 0&&pt("lowS",t.lowS),t.prehash!==void 0&&pt("prehash",t.prehash)}function yn(t){const n=Ve(t);It(n,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:e,Fp:r,a:i}=n;if(e){if(!r.eql(i,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...n})}class xn extends Error{constructor(n=""){super(n)}}const F={Err:xn,_tlv:{encode:(t,n)=>{const{Err:e}=F;if(t<0||t>256)throw new e("tlv.encode: wrong tag");if(n.length&1)throw new e("tlv.encode: unpadded data");const r=n.length/2,i=Nt(r);if(i.length/2&128)throw new e("tlv.encode: long form length too big");const o=r>127?Nt(i.length/2|128):"";return Nt(t)+o+i+n},decode(t,n){const{Err:e}=F;let r=0;if(t<0||t>256)throw new e("tlv.encode: wrong tag");if(n.length<2||n[r++]!==t)throw new e("tlv.decode: wrong tlv");const i=n[r++],o=!!(i&128);let c=0;if(!o)c=i;else{const s=i&127;if(!s)throw new e("tlv.decode(long): indefinite length not supported");if(s>4)throw new e("tlv.decode(long): byte length is too big");const a=n.subarray(r,r+s);if(a.length!==s)throw new e("tlv.decode: length bytes not complete");if(a[0]===0)throw new e("tlv.decode(long): zero leftmost byte");for(const d of a)c=c<<8|d;if(r+=s,c<128)throw new e("tlv.decode(long): not minimal encoding")}const f=n.subarray(r,r+c);if(f.length!==c)throw new e("tlv.decode: wrong value length");return{v:f,l:n.subarray(r+c)}}},_int:{encode(t){const{Err:n}=F;if(t<G)throw new n("integer: negative integers are not allowed");let e=Nt(t);if(Number.parseInt(e[0],16)&8&&(e="00"+e),e.length&1)throw new n("unexpected DER parsing assertion: unpadded hex");return e},decode(t){const{Err:n}=F;if(t[0]&128)throw new n("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new n("invalid signature integer: unnecessary leading zero");return X(t)}},toSig(t){const{Err:n,_int:e,_tlv:r}=F,i=V("signature",t),{v:o,l:c}=r.decode(48,i);if(c.length)throw new n("invalid signature: left bytes after parsing");const{v:f,l:s}=r.decode(2,o),{v:a,l:d}=r.decode(2,s);if(d.length)throw new n("invalid signature: left bytes after parsing");return{r:e.decode(f),s:e.decode(a)}},hexFromSig(t){const{_tlv:n,_int:e}=F,r=n.encode(2,e.encode(t.r)),i=n.encode(2,e.encode(t.s)),o=r+i;return n.encode(48,o)}};function $t(t,n){return Et(lt(t,n))}const G=BigInt(0),k=BigInt(1),rt=BigInt(2),xt=BigInt(3),te=BigInt(4);function pn(t){const n=yn(t),{Fp:e}=n,r=se(n.n,n.nBitLength),i=n.toBytes||((y,u,m)=>{const p=u.toAffine();return D(Uint8Array.from([4]),e.toBytes(p.x),e.toBytes(p.y))}),o=n.fromBytes||(y=>{const u=y.subarray(1),m=e.fromBytes(u.subarray(0,e.BYTES)),p=e.fromBytes(u.subarray(e.BYTES,2*e.BYTES));return{x:m,y:p}});function c(y){const{a:u,b:m}=n,p=e.sqr(y),v=e.mul(p,y);return e.add(e.add(v,e.mul(y,u)),m)}function f(y,u){const m=e.sqr(u),p=c(y);return e.eql(m,p)}if(!f(n.Gx,n.Gy))throw new Error("bad curve params: generator point");const s=e.mul(e.pow(n.a,xt),te),a=e.mul(e.sqr(n.b),BigInt(27));if(e.is0(e.add(s,a)))throw new Error("bad curve params: a or b");function d(y){return vt(y,k,n.n)}function l(y){const{allowedPrivateKeyLengths:u,nByteLength:m,wrapPrivateKey:p,n:v}=n;if(u&&typeof y!="bigint"){if(_t(y)&&(y=Et(y)),typeof y!="string"||!u.includes(y.length))throw new Error("invalid private key");y=y.padStart(m*2,"0")}let O;try{O=typeof y=="bigint"?y:X(V("private key",y,m))}catch{throw new Error("invalid private key, expected hex or "+m+" bytes, got "+typeof y)}return p&&(O=Z(O,v)),ut("private key",O,k,v),O}function x(y){if(!(y instanceof g))throw new Error("ProjectivePoint expected")}const b=le((y,u)=>{const{px:m,py:p,pz:v}=y;if(e.eql(v,e.ONE))return{x:m,y:p};const O=y.is0();u==null&&(u=O?e.ONE:e.inv(v));const H=e.mul(m,u),L=e.mul(p,u),B=e.mul(v,u);if(O)return{x:e.ZERO,y:e.ZERO};if(!e.eql(B,e.ONE))throw new Error("invZ was invalid");return{x:H,y:L}}),_=le(y=>{if(y.is0()){if(n.allowInfinityPoint&&!e.is0(y.py))return;throw new Error("bad point: ZERO")}const{x:u,y:m}=y.toAffine();if(!e.isValid(u)||!e.isValid(m))throw new Error("bad point: x or y not FE");if(!f(u,m))throw new Error("bad point: equation left != right");if(!y.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class g{constructor(u,m,p){if(u==null||!e.isValid(u))throw new Error("x required");if(m==null||!e.isValid(m)||e.is0(m))throw new Error("y required");if(p==null||!e.isValid(p))throw new Error("z required");this.px=u,this.py=m,this.pz=p,Object.freeze(this)}static fromAffine(u){const{x:m,y:p}=u||{};if(!u||!e.isValid(m)||!e.isValid(p))throw new Error("invalid affine point");if(u instanceof g)throw new Error("projective point not allowed");const v=O=>e.eql(O,e.ZERO);return v(m)&&v(p)?g.ZERO:new g(m,p,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(u){const m=Zt(e,u.map(p=>p.pz));return u.map((p,v)=>p.toAffine(m[v])).map(g.fromAffine)}static fromHex(u){const m=g.fromAffine(o(V("pointHex",u)));return m.assertValidity(),m}static fromPrivateKey(u){return g.BASE.multiply(l(u))}static msm(u,m){return bn(g,r,u,m)}_setWindowSize(u){U.setWindowSize(this,u)}assertValidity(){_(this)}hasEvenY(){const{y:u}=this.toAffine();if(e.isOdd)return!e.isOdd(u);throw new Error("Field doesn't support isOdd")}equals(u){x(u);const{px:m,py:p,pz:v}=this,{px:O,py:H,pz:L}=u,B=e.eql(e.mul(m,L),e.mul(O,v)),R=e.eql(e.mul(p,L),e.mul(H,v));return B&&R}negate(){return new g(this.px,e.neg(this.py),this.pz)}double(){const{a:u,b:m}=n,p=e.mul(m,xt),{px:v,py:O,pz:H}=this;let L=e.ZERO,B=e.ZERO,R=e.ZERO,S=e.mul(v,v),z=e.mul(O,O),w=e.mul(H,H),h=e.mul(v,O);return h=e.add(h,h),R=e.mul(v,H),R=e.add(R,R),L=e.mul(u,R),B=e.mul(p,w),B=e.add(L,B),L=e.sub(z,B),B=e.add(z,B),B=e.mul(L,B),L=e.mul(h,L),R=e.mul(p,R),w=e.mul(u,w),h=e.sub(S,w),h=e.mul(u,h),h=e.add(h,R),R=e.add(S,S),S=e.add(R,S),S=e.add(S,w),S=e.mul(S,h),B=e.add(B,S),w=e.mul(O,H),w=e.add(w,w),S=e.mul(w,h),L=e.sub(L,S),R=e.mul(w,z),R=e.add(R,R),R=e.add(R,R),new g(L,B,R)}add(u){x(u);const{px:m,py:p,pz:v}=this,{px:O,py:H,pz:L}=u;let B=e.ZERO,R=e.ZERO,S=e.ZERO;const z=n.a,w=e.mul(n.b,xt);let h=e.mul(m,O),E=e.mul(p,H),q=e.mul(v,L),A=e.add(m,p),N=e.add(O,H);A=e.mul(A,N),N=e.add(h,E),A=e.sub(A,N),N=e.add(m,v);let C=e.add(O,L);return N=e.mul(N,C),C=e.add(h,q),N=e.sub(N,C),C=e.add(p,v),B=e.add(H,L),C=e.mul(C,B),B=e.add(E,q),C=e.sub(C,B),S=e.mul(z,N),B=e.mul(w,q),S=e.add(B,S),B=e.sub(E,S),S=e.add(E,S),R=e.mul(B,S),E=e.add(h,h),E=e.add(E,h),q=e.mul(z,q),N=e.mul(w,N),E=e.add(E,q),q=e.sub(h,q),q=e.mul(z,q),N=e.add(N,q),h=e.mul(E,N),R=e.add(R,h),h=e.mul(C,N),B=e.mul(A,B),B=e.sub(B,h),h=e.mul(A,E),S=e.mul(C,S),S=e.add(S,h),new g(B,R,S)}subtract(u){return this.add(u.negate())}is0(){return this.equals(g.ZERO)}wNAF(u){return U.wNAFCached(this,u,g.normalizeZ)}multiplyUnsafe(u){const{endo:m,n:p}=n;ut("scalar",u,G,p);const v=g.ZERO;if(u===G)return v;if(this.is0()||u===k)return this;if(!m||U.hasPrecomputes(this))return U.wNAFCachedUnsafe(this,u,g.normalizeZ);let{k1neg:O,k1:H,k2neg:L,k2:B}=m.splitScalar(u),R=v,S=v,z=this;for(;H>G||B>G;)H&k&&(R=R.add(z)),B&k&&(S=S.add(z)),z=z.double(),H>>=k,B>>=k;return O&&(R=R.negate()),L&&(S=S.negate()),S=new g(e.mul(S.px,m.beta),S.py,S.pz),R.add(S)}multiply(u){const{endo:m,n:p}=n;ut("scalar",u,k,p);let v,O;if(m){const{k1neg:H,k1:L,k2neg:B,k2:R}=m.splitScalar(u);let{p:S,f:z}=this.wNAF(L),{p:w,f:h}=this.wNAF(R);S=U.constTimeNegate(H,S),w=U.constTimeNegate(B,w),w=new g(e.mul(w.px,m.beta),w.py,w.pz),v=S.add(w),O=z.add(h)}else{const{p:H,f:L}=this.wNAF(u);v=H,O=L}return g.normalizeZ([v,O])[0]}multiplyAndAddUnsafe(u,m,p){const v=g.BASE,O=(L,B)=>B===G||B===k||!L.equals(v)?L.multiplyUnsafe(B):L.multiply(B),H=O(this,m).add(O(u,p));return H.is0()?void 0:H}toAffine(u){return b(this,u)}isTorsionFree(){const{h:u,isTorsionFree:m}=n;if(u===k)return!0;if(m)return m(g,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:u,clearCofactor:m}=n;return u===k?this:m?m(g,this):this.multiplyUnsafe(n.h)}toRawBytes(u=!0){return pt("isCompressed",u),this.assertValidity(),i(g,this,u)}toHex(u=!0){return pt("isCompressed",u),Et(this.toRawBytes(u))}}g.BASE=new g(n.Gx,n.Gy,e.ONE),g.ZERO=new g(e.ZERO,e.ONE,e.ZERO);const{endo:T,nBitLength:I}=n,U=mn(g,T?Math.ceil(I/2):I);return{CURVE:n,ProjectivePoint:g,normPrivateKeyToScalar:l,weierstrassEquation:c,isWithinCurveOrder:d}}function En(t){const n=Ve(t);return It(n,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...n})}function vn(t){const n=En(t),{Fp:e,n:r,nByteLength:i,nBitLength:o}=n,c=e.BYTES+1,f=2*e.BYTES+1;function s(w){return Z(w,r)}function a(w){return Jt(w,r)}const{ProjectivePoint:d,normPrivateKeyToScalar:l,weierstrassEquation:x,isWithinCurveOrder:b}=pn({...n,toBytes(w,h,E){const q=h.toAffine(),A=e.toBytes(q.x),N=D;return pt("isCompressed",E),E?N(Uint8Array.from([h.hasEvenY()?2:3]),A):N(Uint8Array.from([4]),A,e.toBytes(q.y))},fromBytes(w){const h=w.length,E=w[0],q=w.subarray(1);if(h===c&&(E===2||E===3)){const A=X(q);if(!vt(A,k,e.ORDER))throw new Error("Point is not on curve");const N=x(A);let C;try{C=e.sqrt(N)}catch(W){const j=W instanceof Error?": "+W.message:"";throw new Error("Point is not on curve"+j)}const P=(C&k)===k;return(E&1)===1!==P&&(C=e.neg(C)),{x:A,y:C}}else if(h===f&&E===4){const A=e.fromBytes(q.subarray(0,e.BYTES)),N=e.fromBytes(q.subarray(e.BYTES,2*e.BYTES));return{x:A,y:N}}else{const A=c,N=f;throw new Error("invalid Point, expected length of "+A+", or uncompressed "+N+", got "+h)}}});function _(w){const h=r>>k;return w>h}function g(w){return _(w)?s(-w):w}const T=(w,h,E)=>X(w.slice(h,E));class I{constructor(h,E,q){ut("r",h,k,r),ut("s",E,k,r),this.r=h,this.s=E,q!=null&&(this.recovery=q),Object.freeze(this)}static fromCompact(h){const E=i;return h=V("compactSignature",h,E*2),new I(T(h,0,E),T(h,E,2*E))}static fromDER(h){const{r:E,s:q}=F.toSig(V("DER",h));return new I(E,q)}assertValidity(){}addRecoveryBit(h){return new I(this.r,this.s,h)}recoverPublicKey(h){const{r:E,s:q,recovery:A}=this,N=v(V("msgHash",h));if(A==null||![0,1,2,3].includes(A))throw new Error("recovery id invalid");const C=A===2||A===3?E+n.n:E;if(C>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");const P=A&1?"03":"02",Q=d.fromHex(P+$t(C,e.BYTES)),W=a(C),j=s(-N*W),dt=s(q*W),tt=d.BASE.multiplyAndAddUnsafe(Q,j,dt);if(!tt)throw new Error("point at infinify");return tt.assertValidity(),tt}hasHighS(){return _(this.s)}normalizeS(){return this.hasHighS()?new I(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return Ht(this.toDERHex())}toDERHex(){return F.hexFromSig(this)}toCompactRawBytes(){return Ht(this.toCompactHex())}toCompactHex(){const h=i;return $t(this.r,h)+$t(this.s,h)}}const U={isValidPrivateKey(w){try{return l(w),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const w=ke(n.n);return hn(n.randomBytes(w),n.n)},precompute(w=8,h=d.BASE){return h._setWindowSize(w),h.multiply(BigInt(3)),h}};function y(w,h=!0){return d.fromPrivateKey(w).toRawBytes(h)}function u(w){if(typeof w=="bigint")return!1;if(w instanceof d)return!0;const E=V("key",w).length,q=e.BYTES,A=q+1,N=2*q+1;if(!(n.allowedPrivateKeyLengths||i===A))return E===A||E===N}function m(w,h,E=!0){if(u(w)===!0)throw new Error("first arg must be private key");if(u(h)===!1)throw new Error("second arg must be public key");return d.fromHex(h).multiply(l(w)).toRawBytes(E)}const p=n.bits2int||function(w){if(w.length>8192)throw new Error("input is too large");const h=X(w),E=w.length*8-o;return E>0?h>>BigInt(E):h},v=n.bits2int_modN||function(w){return s(p(w))},O=Ct(o);function H(w){return ut("num < 2^"+o,w,G,O),lt(w,i)}function L(w,h,E=B){if(["recovered","canonical"].some(ct=>ct in E))throw new Error("sign() legacy options not supported");const{hash:q,randomBytes:A}=n;let{lowS:N,prehash:C,extraEntropy:P}=E;N==null&&(N=!0),w=V("msgHash",w),ge(E),C&&(w=V("prehashed msgHash",q(w)));const Q=v(w),W=l(h),j=[H(W),H(Q)];if(P!=null&&P!==!1){const ct=P===!0?A(e.BYTES):P;j.push(V("extraEntropy",ct))}const dt=D(...j),tt=Q;function zt(ct){const ht=p(ct);if(!b(ht))return;const Pt=a(ht),mt=d.BASE.multiply(ht).toAffine(),ft=s(mt.x);if(ft===G)return;const bt=s(Pt*s(tt+ft*W));if(bt===G)return;let yt=(mt.x===ft?0:2)|Number(mt.y&k),wt=bt;return N&&_(bt)&&(wt=g(bt),yt^=1),new I(ft,wt,yt)}return{seed:dt,k2sig:zt}}const B={lowS:n.lowS,prehash:!1},R={lowS:n.lowS,prehash:!1};function S(w,h,E=B){const{seed:q,k2sig:A}=L(w,h,E),N=n;return on(N.hash.outputLen,N.nByteLength,N.hmac)(q,A)}d.BASE._setWindowSize(8);function z(w,h,E,q=R){var yt;const A=w;h=V("msgHash",h),E=V("publicKey",E);const{lowS:N,prehash:C,format:P}=q;if(ge(q),"strict"in q)throw new Error("options.strict was renamed to lowS");if(P!==void 0&&P!=="compact"&&P!=="der")throw new Error("format must be compact or der");const Q=typeof A=="string"||_t(A),W=!Q&&!P&&typeof A=="object"&&A!==null&&typeof A.r=="bigint"&&typeof A.s=="bigint";if(!Q&&!W)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let j,dt;try{if(W&&(j=new I(A.r,A.s)),Q){try{P!=="compact"&&(j=I.fromDER(A))}catch(wt){if(!(wt instanceof F.Err))throw wt}!j&&P!=="der"&&(j=I.fromCompact(A))}dt=d.fromHex(E)}catch{return!1}if(!j||N&&j.hasHighS())return!1;C&&(h=n.hash(h));const{r:tt,s:zt}=j,ct=v(h),ht=a(zt),Pt=s(ct*ht),mt=s(tt*ht),ft=(yt=d.BASE.multiplyAndAddUnsafe(dt,Pt,mt))==null?void 0:yt.toAffine();return ft?s(ft.x)===tt:!1}return{CURVE:n,getPublicKey:y,getSharedSecret:m,sign:S,verify:z,ProjectivePoint:d,Signature:I,utils:U}}function Bn(t,n){const e=t.ORDER;let r=G;for(let _=e-k;_%rt===G;_/=rt)r+=k;const i=r,o=rt<<i-k-k,c=o*rt,f=(e-k)/c,s=(f-k)/rt,a=c-k,d=o,l=t.pow(n,f),x=t.pow(n,(f+k)/rt);let b=(_,g)=>{let T=l,I=t.pow(g,a),U=t.sqr(I);U=t.mul(U,g);let y=t.mul(_,U);y=t.pow(y,s),y=t.mul(y,I),I=t.mul(y,g),U=t.mul(y,_);let u=t.mul(U,I);y=t.pow(u,d);let m=t.eql(y,t.ONE);I=t.mul(U,x),y=t.mul(u,T),U=t.cmov(I,U,m),u=t.cmov(y,u,m);for(let p=i;p>k;p--){let v=p-rt;v=rt<<v-k;let O=t.pow(u,v);const H=t.eql(O,t.ONE);I=t.mul(U,T),T=t.mul(T,T),O=t.mul(u,T),U=t.cmov(I,U,H),u=t.cmov(O,u,H)}return{isValid:m,value:U}};if(t.ORDER%te===xt){const _=(t.ORDER-xt)/te,g=t.sqrt(t.neg(n));b=(T,I)=>{let U=t.sqr(I);const y=t.mul(T,I);U=t.mul(U,y);let u=t.pow(U,_);u=t.mul(u,y);const m=t.mul(u,g),p=t.mul(t.sqr(u),I),v=t.eql(p,T);let O=t.cmov(m,u,v);return{isValid:v,value:O}}}return b}function Sn(t,n){if(He(t),!t.isValid(n.A)||!t.isValid(n.B)||!t.isValid(n.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const e=Bn(t,n.Z);if(!t.isOdd)throw new Error("Fp.isOdd is not implemented!");return r=>{let i,o,c,f,s,a,d,l;i=t.sqr(r),i=t.mul(i,n.Z),o=t.sqr(i),o=t.add(o,i),c=t.add(o,t.ONE),c=t.mul(c,n.B),f=t.cmov(n.Z,t.neg(o),!t.eql(o,t.ZERO)),f=t.mul(f,n.A),o=t.sqr(c),a=t.sqr(f),s=t.mul(a,n.A),o=t.add(o,s),o=t.mul(o,c),a=t.mul(a,f),s=t.mul(a,n.B),o=t.add(o,s),d=t.mul(i,c);const{isValid:x,value:b}=e(o,a);l=t.mul(i,r),l=t.mul(l,b),d=t.cmov(d,c,x),l=t.cmov(l,b,x);const _=t.isOdd(r)===t.isOdd(l);l=t.cmov(t.neg(l),l,_);const g=Zt(t,[f],!0)[0];return d=t.mul(d,g),{x:d,y:l}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function An(t){return{hash:t,hmac:(n,...e)=>Se(t,n,$e(...e)),randomBytes:ve}}function _n(t,n){const e=r=>vn({...t,...An(r)});return{...e(n),create:e}}const In=X;function ot(t,n){if(Bt(t),Bt(n),t<0||t>=1<<8*n)throw new Error("invalid I2OSP input: "+t);const e=Array.from({length:n}).fill(0);for(let r=n-1;r>=0;r--)e[r]=t&255,t>>>=8;return new Uint8Array(e)}function On(t,n){const e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t[r]^n[r];return e}function Bt(t){if(!Number.isSafeInteger(t))throw new Error("number expected")}function Nn(t,n,e,r){st(t),st(n),Bt(e),n.length>255&&(n=r(D(oe("H2C-OVERSIZE-DST-"),n)));const{outputLen:i,blockLen:o}=r,c=Math.ceil(e/i);if(e>65535||c>255)throw new Error("expand_message_xmd: invalid lenInBytes");const f=D(n,ot(n.length,1)),s=ot(0,o),a=ot(e,2),d=new Array(c),l=r(D(s,t,a,ot(0,1),f));d[0]=r(D(l,ot(1,1),f));for(let b=1;b<=c;b++){const _=[On(l,d[b-1]),ot(b+1,1),f];d[b]=r(D(..._))}return D(...d).slice(0,e)}function qn(t,n,e,r,i){if(st(t),st(n),Bt(e),n.length>255){const o=Math.ceil(2*r/8);n=i.create({dkLen:o}).update(oe("H2C-OVERSIZE-DST-")).update(n).digest()}if(e>65535||n.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:e}).update(t).update(ot(e,2)).update(n).update(ot(n.length,1)).digest()}function me(t,n,e){It(e,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:r,k:i,m:o,hash:c,expand:f,DST:s}=e;st(t),Bt(n);const a=typeof s=="string"?oe(s):s,d=r.toString(2).length,l=Math.ceil((d+i)/8),x=n*o*l;let b;if(f==="xmd")b=Nn(t,a,x,c);else if(f==="xof")b=qn(t,a,x,i,c);else if(f==="_internal_pass")b=t;else throw new Error('expand must be "xmd" or "xof"');const _=new Array(n);for(let g=0;g<n;g++){const T=new Array(o);for(let I=0;I<o;I++){const U=l*(I+g*o),y=b.subarray(U,U+l);T[I]=Z(In(y),r)}_[g]=T}return _}function Rn(t,n){const e=n.map(r=>Array.from(r).reverse());return(r,i)=>{const[o,c,f,s]=e.map(l=>l.reduce((x,b)=>t.add(t.mul(x,r),b))),[a,d]=Zt(t,[c,s],!0);return r=t.mul(o,a),i=t.mul(i,t.mul(f,d)),{x:r,y:i}}}function Un(t,n,e){if(typeof n!="function")throw new Error("mapToCurve() must be defined");function r(o){return t.fromAffine(n(o))}function i(o){const c=o.clearCofactor();return c.equals(t.ZERO)?t.ZERO:(c.assertValidity(),c)}return{defaults:e,hashToCurve(o,c){const f=me(o,2,{...e,DST:e.DST,...c}),s=r(f[0]),a=r(f[1]);return i(s.add(a))},encodeToCurve(o,c){const f=me(o,1,{...e,DST:e.encodeDST,...c});return i(r(f[0]))},mapToCurve(o){if(!Array.isArray(o))throw new Error("expected array of bigints");for(const c of o)if(typeof c!="bigint")throw new Error("expected array of bigints");return i(r(o))}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ot=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Lt=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ie=BigInt(0),St=BigInt(1),Tt=BigInt(2),be=(t,n)=>(t+n/Tt)/n;function ze(t){const n=Ot,e=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),c=BigInt(23),f=BigInt(44),s=BigInt(88),a=t*t*t%n,d=a*a*t%n,l=K(d,e,n)*d%n,x=K(l,e,n)*d%n,b=K(x,Tt,n)*a%n,_=K(b,i,n)*b%n,g=K(_,o,n)*_%n,T=K(g,f,n)*g%n,I=K(T,s,n)*T%n,U=K(I,f,n)*g%n,y=K(U,e,n)*d%n,u=K(y,c,n)*_%n,m=K(u,r,n)*a%n,p=K(m,Tt,n);if(!it.eql(it.sqr(p),t))throw new Error("Cannot find square root");return p}const it=se(Ot,void 0,void 0,{sqrt:ze}),Vt=_n({a:ie,b:BigInt(7),Fp:it,n:Lt,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const n=Lt,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-St*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=e,c=BigInt("0x100000000000000000000000000000000"),f=be(o*t,n),s=be(-r*t,n);let a=Z(t-f*e-s*i,n),d=Z(-f*r-s*o,n);const l=a>c,x=d>c;if(l&&(a=n-a),x&&(d=n-d),a>c||d>c)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:l,k1:a,k2neg:x,k2:d}}}},Ut),ye={};function kt(t,...n){let e=ye[t];if(e===void 0){const r=Ut(Uint8Array.from(t,i=>i.charCodeAt(0)));e=D(r,r),ye[t]=e}return Ut(D(e,...n))}const ce=t=>t.toRawBytes(!0).slice(1),ee=t=>lt(t,32),Xt=t=>Z(t,Ot),At=t=>Z(t,Lt),fe=(()=>Vt.ProjectivePoint)(),Hn=(t,n,e)=>fe.BASE.multiplyAndAddUnsafe(t,n,e);function ne(t){let n=Vt.utils.normPrivateKeyToScalar(t),e=fe.fromPrivateKey(n);return{scalar:e.hasEvenY()?n:At(-n),bytes:ce(e)}}function Pe(t){ut("x",t,St,Ot);const n=Xt(t*t),e=Xt(n*t+BigInt(7));let r=ze(e);r%Tt!==ie&&(r=Xt(-r));const i=new fe(t,r,St);return i.assertValidity(),i}const gt=X;function Me(...t){return At(gt(kt("BIP0340/challenge",...t)))}function Ln(t){return ne(t).bytes}function Tn(t,n,e=ve(32)){const r=V("message",t),{bytes:i,scalar:o}=ne(n),c=V("auxRand",e,32),f=ee(o^gt(kt("BIP0340/aux",c))),s=kt("BIP0340/nonce",f,i,r),a=At(gt(s));if(a===ie)throw new Error("sign failed: k is zero");const{bytes:d,scalar:l}=ne(a),x=Me(d,i,r),b=new Uint8Array(64);if(b.set(d,0),b.set(ee(At(l+x*o)),32),!je(b,r,i))throw new Error("sign: Invalid signature produced");return b}function je(t,n,e){const r=V("signature",t,64),i=V("message",n),o=V("publicKey",e,32);try{const c=Pe(gt(o)),f=gt(r.subarray(0,32));if(!vt(f,St,Ot))return!1;const s=gt(r.subarray(32,64));if(!vt(s,St,Lt))return!1;const a=Me(ee(f),ce(c),i),d=Hn(c,s,At(-a));return!(!d||!d.hasEvenY()||d.toAffine().x!==f)}catch{return!1}}const zn=(()=>({getPublicKey:Ln,sign:Tn,verify:je,utils:{randomPrivateKey:Vt.utils.randomPrivateKey,lift_x:Pe,pointToBytes:ce,numberToBytesBE:lt,bytesToNumberBE:X,taggedHash:kt,mod:Z}}))(),kn=(()=>Rn(it,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(t=>t.map(n=>BigInt(n)))))(),Cn=(()=>Sn(it,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:it.create(BigInt("-11"))}))(),Ye=(()=>Un(Vt.ProjectivePoint,t=>{const{x:n,y:e}=Cn(it.create(t[0]));return kn(n,e)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:it.ORDER,m:1,k:128,expand:"xmd",hash:Ut}))(),Pn=(()=>Ye.hashToCurve)(),Mn=(()=>Ye.encodeToCurve)();export{Mn as encodeToCurve,Pn as hashToCurve,zn as schnorr,Vt as secp256k1,Ye as secp256k1_hasher};
1
+ import{N as xe,R as Mt,S as qt,T as pe,U as Ee,V as Ke,W as Rt,X as De,Y as $,Z as We,_ as Ge,$ as $e,a0 as ve}from"./index.es-b772857d.js";import"./index-64c7df79.js";function Xe(t,n,e,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(n,e,r);const i=BigInt(32),o=BigInt(4294967295),c=Number(e>>i&o),f=Number(e&o),s=r?4:0,a=r?0:4;t.setUint32(n+s,c,r),t.setUint32(n+a,f,r)}function Qe(t,n,e){return t&n^~t&e}function Je(t,n,e){return t&n^t&e^n&e}class Fe extends xe{constructor(n,e,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=n,this.outputLen=e,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(n),this.view=Mt(this.buffer)}update(n){qt(this),n=pe(n),Ee(n);const{view:e,buffer:r,blockLen:i}=this,o=n.length;for(let c=0;c<o;){const f=Math.min(i-this.pos,o-c);if(f===i){const s=Mt(n);for(;i<=o-c;c+=i)this.process(s,c);continue}r.set(n.subarray(c,c+f),this.pos),this.pos+=f,c+=f,this.pos===i&&(this.process(e,0),this.pos=0)}return this.length+=n.length,this.roundClean(),this}digestInto(n){qt(this),Ke(n,this),this.finished=!0;const{buffer:e,view:r,blockLen:i,isLE:o}=this;let{pos:c}=this;e[c++]=128,Rt(this.buffer.subarray(c)),this.padOffset>i-c&&(this.process(r,0),c=0);for(let l=c;l<i;l++)e[l]=0;Xe(r,i-8,BigInt(this.length*8),o),this.process(r,0);const f=Mt(n),s=this.outputLen;if(s%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const a=s/4,d=this.get();if(a>d.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<a;l++)f.setUint32(4*l,d[l],o)}digest(){const{buffer:n,outputLen:e}=this;this.digestInto(n);const r=n.slice(0,e);return this.destroy(),r}_cloneInto(n){n||(n=new this.constructor),n.set(...this.get());const{blockLen:e,buffer:r,length:i,finished:o,destroyed:c,pos:f}=this;return n.destroyed=c,n.finished=o,n.length=i,n.pos=f,i%e&&n.buffer.set(r),n}clone(){return this._cloneInto()}}const et=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),tn=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]),nt=new Uint32Array(64);class en extends Fe{constructor(n=32){super(64,n,8,!1),this.A=et[0]|0,this.B=et[1]|0,this.C=et[2]|0,this.D=et[3]|0,this.E=et[4]|0,this.F=et[5]|0,this.G=et[6]|0,this.H=et[7]|0}get(){const{A:n,B:e,C:r,D:i,E:o,F:c,G:f,H:s}=this;return[n,e,r,i,o,c,f,s]}set(n,e,r,i,o,c,f,s){this.A=n|0,this.B=e|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=c|0,this.G=f|0,this.H=s|0}process(n,e){for(let l=0;l<16;l++,e+=4)nt[l]=n.getUint32(e,!1);for(let l=16;l<64;l++){const x=nt[l-15],b=nt[l-2],_=$(x,7)^$(x,18)^x>>>3,g=$(b,17)^$(b,19)^b>>>10;nt[l]=g+nt[l-7]+_+nt[l-16]|0}let{A:r,B:i,C:o,D:c,E:f,F:s,G:a,H:d}=this;for(let l=0;l<64;l++){const x=$(f,6)^$(f,11)^$(f,25),b=d+x+Qe(f,s,a)+tn[l]+nt[l]|0,g=($(r,2)^$(r,13)^$(r,22))+Je(r,i,o)|0;d=a,a=s,s=f,f=c+b|0,c=o,o=i,i=r,r=b+g|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,c=c+this.D|0,f=f+this.E|0,s=s+this.F|0,a=a+this.G|0,d=d+this.H|0,this.set(r,i,o,c,f,s,a,d)}roundClean(){Rt(nt)}destroy(){this.set(0,0,0,0,0,0,0,0),Rt(this.buffer)}}const Ut=De(()=>new en);class Be extends xe{constructor(n,e){super(),this.finished=!1,this.destroyed=!1,We(n);const r=pe(e);if(this.iHash=n.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,o=new Uint8Array(i);o.set(r.length>i?n.create().update(r).digest():r);for(let c=0;c<o.length;c++)o[c]^=54;this.iHash.update(o),this.oHash=n.create();for(let c=0;c<o.length;c++)o[c]^=106;this.oHash.update(o),Rt(o)}update(n){return qt(this),this.iHash.update(n),this}digestInto(n){qt(this),Ee(n,this.outputLen),this.finished=!0,this.iHash.digestInto(n),this.oHash.update(n),this.oHash.digestInto(n),this.destroy()}digest(){const n=new Uint8Array(this.oHash.outputLen);return this.digestInto(n),n}_cloneInto(n){n||(n=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:r,finished:i,destroyed:o,blockLen:c,outputLen:f}=this;return n=n,n.finished=i,n.destroyed=o,n.blockLen=c,n.outputLen=f,n.oHash=e._cloneInto(n.oHash),n.iHash=r._cloneInto(n.iHash),n}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Se=(t,n,e)=>new Be(t,n).update(e).digest();Se.create=(t,n)=>new Be(t,n);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const re=BigInt(0),Qt=BigInt(1);function _t(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function st(t){if(!_t(t))throw new Error("Uint8Array expected")}function pt(t,n){if(typeof n!="boolean")throw new Error(t+" boolean expected, got "+n)}function Nt(t){const n=t.toString(16);return n.length&1?"0"+n:n}function Ae(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?re:BigInt("0x"+t)}const _e=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",nn=Array.from({length:256},(t,n)=>n.toString(16).padStart(2,"0"));function Et(t){if(st(t),_e)return t.toHex();let n="";for(let e=0;e<t.length;e++)n+=nn[t[e]];return n}const J={_0:48,_9:57,A:65,F:70,a:97,f:102};function ae(t){if(t>=J._0&&t<=J._9)return t-J._0;if(t>=J.A&&t<=J.F)return t-(J.A-10);if(t>=J.a&&t<=J.f)return t-(J.a-10)}function Ht(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(_e)return Uint8Array.fromHex(t);const n=t.length,e=n/2;if(n%2)throw new Error("hex string expected, got unpadded hex of length "+n);const r=new Uint8Array(e);for(let i=0,o=0;i<e;i++,o+=2){const c=ae(t.charCodeAt(o)),f=ae(t.charCodeAt(o+1));if(c===void 0||f===void 0){const s=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+s+'" at index '+o)}r[i]=c*16+f}return r}function X(t){return Ae(Et(t))}function Ie(t){return st(t),Ae(Et(Uint8Array.from(t).reverse()))}function lt(t,n){return Ht(t.toString(16).padStart(n*2,"0"))}function Oe(t,n){return lt(t,n).reverse()}function V(t,n,e){let r;if(typeof n=="string")try{r=Ht(n)}catch(o){throw new Error(t+" must be hex string or Uint8Array, cause: "+o)}else if(_t(n))r=Uint8Array.from(n);else throw new Error(t+" must be hex string or Uint8Array");const i=r.length;if(typeof e=="number"&&i!==e)throw new Error(t+" of length "+e+" expected, got "+i);return r}function D(...t){let n=0;for(let r=0;r<t.length;r++){const i=t[r];st(i),n+=i.length}const e=new Uint8Array(n);for(let r=0,i=0;r<t.length;r++){const o=t[r];e.set(o,i),i+=o.length}return e}function oe(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}const jt=t=>typeof t=="bigint"&&re<=t;function vt(t,n,e){return jt(t)&&jt(n)&&jt(e)&&n<=t&&t<e}function ut(t,n,e,r){if(!vt(n,e,r))throw new Error("expected valid "+t+": "+e+" <= n < "+r+", got "+n)}function rn(t){let n;for(n=0;t>re;t>>=Qt,n+=1);return n}const Ct=t=>(Qt<<BigInt(t))-Qt,Yt=t=>new Uint8Array(t),ue=t=>Uint8Array.from(t);function on(t,n,e){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof n!="number"||n<2)throw new Error("qByteLen must be a number");if(typeof e!="function")throw new Error("hmacFn must be a function");let r=Yt(t),i=Yt(t),o=0;const c=()=>{r.fill(1),i.fill(0),o=0},f=(...l)=>e(i,r,...l),s=(l=Yt(0))=>{i=f(ue([0]),l),r=f(),l.length!==0&&(i=f(ue([1]),l),r=f())},a=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let l=0;const x=[];for(;l<n;){r=f();const b=r.slice();x.push(b),l+=r.length}return D(...x)};return(l,x)=>{c(),s(l);let b;for(;!(b=x(a()));)s();return c(),b}}const sn={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||_t(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,n)=>n.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function It(t,n,e={}){const r=(i,o,c)=>{const f=sn[o];if(typeof f!="function")throw new Error("invalid validator function");const s=t[i];if(!(c&&s===void 0)&&!f(s,t))throw new Error("param "+String(i)+" is invalid. Expected "+o+", got "+s)};for(const[i,o]of Object.entries(n))r(i,o,!1);for(const[i,o]of Object.entries(e))r(i,o,!0);return t}function le(t){const n=new WeakMap;return(e,...r)=>{const i=n.get(e);if(i!==void 0)return i;const o=t(e,...r);return n.set(e,o),o}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Y=BigInt(0),M=BigInt(1),at=BigInt(2),cn=BigInt(3),Ne=BigInt(4),qe=BigInt(5),Re=BigInt(8);function Z(t,n){const e=t%n;return e>=Y?e:n+e}function K(t,n,e){let r=t;for(;n-- >Y;)r*=r,r%=e;return r}function Jt(t,n){if(t===Y)throw new Error("invert: expected non-zero number");if(n<=Y)throw new Error("invert: expected positive modulus, got "+n);let e=Z(t,n),r=n,i=Y,o=M;for(;e!==Y;){const f=r/e,s=r%e,a=i-o*f;r=e,e=s,i=o,o=a}if(r!==M)throw new Error("invert: does not exist");return Z(i,n)}function Ue(t,n){const e=(t.ORDER+M)/Ne,r=t.pow(n,e);if(!t.eql(t.sqr(r),n))throw new Error("Cannot find square root");return r}function fn(t,n){const e=(t.ORDER-qe)/Re,r=t.mul(n,at),i=t.pow(r,e),o=t.mul(n,i),c=t.mul(t.mul(o,at),i),f=t.mul(o,t.sub(c,t.ONE));if(!t.eql(t.sqr(f),n))throw new Error("Cannot find square root");return f}function an(t){if(t<BigInt(3))throw new Error("sqrt is not defined for small field");let n=t-M,e=0;for(;n%at===Y;)n/=at,e++;let r=at;const i=se(t);for(;de(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(e===1)return Ue;let o=i.pow(r,n);const c=(n+M)/at;return function(s,a){if(s.is0(a))return a;if(de(s,a)!==1)throw new Error("Cannot find square root");let d=e,l=s.mul(s.ONE,o),x=s.pow(a,n),b=s.pow(a,c);for(;!s.eql(x,s.ONE);){if(s.is0(x))return s.ZERO;let _=1,g=s.sqr(x);for(;!s.eql(g,s.ONE);)if(_++,g=s.sqr(g),_===d)throw new Error("Cannot find square root");const T=M<<BigInt(d-_-1),I=s.pow(l,T);d=_,l=s.sqr(I),x=s.mul(x,l),b=s.mul(b,I)}return b}}function un(t){return t%Ne===cn?Ue:t%Re===qe?fn:an(t)}const ln=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function He(t){const n={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},e=ln.reduce((r,i)=>(r[i]="function",r),n);return It(t,e)}function dn(t,n,e){if(e<Y)throw new Error("invalid exponent, negatives unsupported");if(e===Y)return t.ONE;if(e===M)return n;let r=t.ONE,i=n;for(;e>Y;)e&M&&(r=t.mul(r,i)),i=t.sqr(i),e>>=M;return r}function Zt(t,n,e=!1){const r=new Array(n.length).fill(e?t.ZERO:void 0),i=n.reduce((c,f,s)=>t.is0(f)?c:(r[s]=c,t.mul(c,f)),t.ONE),o=t.inv(i);return n.reduceRight((c,f,s)=>t.is0(f)?c:(r[s]=t.mul(c,r[s]),t.mul(c,f)),o),r}function de(t,n){const e=(t.ORDER-M)/at,r=t.pow(n,e),i=t.eql(r,t.ONE),o=t.eql(r,t.ZERO),c=t.eql(r,t.neg(t.ONE));if(!i&&!o&&!c)throw new Error("invalid Legendre symbol result");return i?1:o?0:-1}function Le(t,n){n!==void 0&&Ge(n);const e=n!==void 0?n:t.toString(2).length,r=Math.ceil(e/8);return{nBitLength:e,nByteLength:r}}function se(t,n,e=!1,r={}){if(t<=Y)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:o}=Le(t,n);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const f=Object.freeze({ORDER:t,isLE:e,BITS:i,BYTES:o,MASK:Ct(i),ZERO:Y,ONE:M,create:s=>Z(s,t),isValid:s=>{if(typeof s!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof s);return Y<=s&&s<t},is0:s=>s===Y,isOdd:s=>(s&M)===M,neg:s=>Z(-s,t),eql:(s,a)=>s===a,sqr:s=>Z(s*s,t),add:(s,a)=>Z(s+a,t),sub:(s,a)=>Z(s-a,t),mul:(s,a)=>Z(s*a,t),pow:(s,a)=>dn(f,s,a),div:(s,a)=>Z(s*Jt(a,t),t),sqrN:s=>s*s,addN:(s,a)=>s+a,subN:(s,a)=>s-a,mulN:(s,a)=>s*a,inv:s=>Jt(s,t),sqrt:r.sqrt||(s=>(c||(c=un(t)),c(f,s))),toBytes:s=>e?Oe(s,o):lt(s,o),fromBytes:s=>{if(s.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+s.length);return e?Ie(s):X(s)},invertBatch:s=>Zt(f,s),cmov:(s,a,d)=>d?a:s});return Object.freeze(f)}function Te(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const n=t.toString(2).length;return Math.ceil(n/8)}function ke(t){const n=Te(t);return n+Math.ceil(n/2)}function hn(t,n,e=!1){const r=t.length,i=Te(n),o=ke(n);if(r<16||r<o||r>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+r);const c=e?Ie(t):X(t),f=Z(c,n-M)+M;return e?Oe(f,i):lt(f,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const he=BigInt(0),Ft=BigInt(1);function Kt(t,n){const e=n.negate();return t?e:n}function Ce(t,n){if(!Number.isSafeInteger(t)||t<=0||t>n)throw new Error("invalid window size, expected [1.."+n+"], got W="+t)}function Dt(t,n){Ce(t,n);const e=Math.ceil(n/t)+1,r=2**(t-1),i=2**t,o=Ct(t),c=BigInt(t);return{windows:e,windowSize:r,mask:o,maxNumber:i,shiftBy:c}}function we(t,n,e){const{windowSize:r,mask:i,maxNumber:o,shiftBy:c}=e;let f=Number(t&i),s=t>>c;f>r&&(f-=o,s+=Ft);const a=n*r,d=a+Math.abs(f)-1,l=f===0,x=f<0,b=n%2!==0;return{nextN:s,offset:d,isZero:l,isNeg:x,isNegF:b,offsetF:a}}function wn(t,n){if(!Array.isArray(t))throw new Error("array expected");t.forEach((e,r)=>{if(!(e instanceof n))throw new Error("invalid point at index "+r)})}function gn(t,n){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((e,r)=>{if(!n.isValid(e))throw new Error("invalid scalar at index "+r)})}const Wt=new WeakMap,Ze=new WeakMap;function Gt(t){return Ze.get(t)||1}function mn(t,n){return{constTimeNegate:Kt,hasPrecomputes(e){return Gt(e)!==1},unsafeLadder(e,r,i=t.ZERO){let o=e;for(;r>he;)r&Ft&&(i=i.add(o)),o=o.double(),r>>=Ft;return i},precomputeWindow(e,r){const{windows:i,windowSize:o}=Dt(r,n),c=[];let f=e,s=f;for(let a=0;a<i;a++){s=f,c.push(s);for(let d=1;d<o;d++)s=s.add(f),c.push(s);f=s.double()}return c},wNAF(e,r,i){let o=t.ZERO,c=t.BASE;const f=Dt(e,n);for(let s=0;s<f.windows;s++){const{nextN:a,offset:d,isZero:l,isNeg:x,isNegF:b,offsetF:_}=we(i,s,f);i=a,l?c=c.add(Kt(b,r[_])):o=o.add(Kt(x,r[d]))}return{p:o,f:c}},wNAFUnsafe(e,r,i,o=t.ZERO){const c=Dt(e,n);for(let f=0;f<c.windows&&i!==he;f++){const{nextN:s,offset:a,isZero:d,isNeg:l}=we(i,f,c);if(i=s,!d){const x=r[a];o=o.add(l?x.negate():x)}}return o},getPrecomputes(e,r,i){let o=Wt.get(r);return o||(o=this.precomputeWindow(r,e),e!==1&&Wt.set(r,i(o))),o},wNAFCached(e,r,i){const o=Gt(e);return this.wNAF(o,this.getPrecomputes(o,e,i),r)},wNAFCachedUnsafe(e,r,i,o){const c=Gt(e);return c===1?this.unsafeLadder(e,r,o):this.wNAFUnsafe(c,this.getPrecomputes(c,e,i),r,o)},setWindowSize(e,r){Ce(r,n),Ze.set(e,r),Wt.delete(e)}}}function bn(t,n,e,r){wn(e,t),gn(r,n);const i=e.length,o=r.length;if(i!==o)throw new Error("arrays of points and scalars must have equal length");const c=t.ZERO,f=rn(BigInt(i));let s=1;f>12?s=f-3:f>4?s=f-2:f>0&&(s=2);const a=Ct(s),d=new Array(Number(a)+1).fill(c),l=Math.floor((n.BITS-1)/s)*s;let x=c;for(let b=l;b>=0;b-=s){d.fill(c);for(let g=0;g<o;g++){const T=r[g],I=Number(T>>BigInt(b)&a);d[I]=d[I].add(e[g])}let _=c;for(let g=d.length-1,T=c;g>0;g--)T=T.add(d[g]),_=_.add(T);if(x=x.add(_),b!==0)for(let g=0;g<s;g++)x=x.double()}return x}function Ve(t){return He(t.Fp),It(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Le(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function ge(t){t.lowS!==void 0&&pt("lowS",t.lowS),t.prehash!==void 0&&pt("prehash",t.prehash)}function yn(t){const n=Ve(t);It(n,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:e,Fp:r,a:i}=n;if(e){if(!r.eql(i,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...n})}class xn extends Error{constructor(n=""){super(n)}}const F={Err:xn,_tlv:{encode:(t,n)=>{const{Err:e}=F;if(t<0||t>256)throw new e("tlv.encode: wrong tag");if(n.length&1)throw new e("tlv.encode: unpadded data");const r=n.length/2,i=Nt(r);if(i.length/2&128)throw new e("tlv.encode: long form length too big");const o=r>127?Nt(i.length/2|128):"";return Nt(t)+o+i+n},decode(t,n){const{Err:e}=F;let r=0;if(t<0||t>256)throw new e("tlv.encode: wrong tag");if(n.length<2||n[r++]!==t)throw new e("tlv.decode: wrong tlv");const i=n[r++],o=!!(i&128);let c=0;if(!o)c=i;else{const s=i&127;if(!s)throw new e("tlv.decode(long): indefinite length not supported");if(s>4)throw new e("tlv.decode(long): byte length is too big");const a=n.subarray(r,r+s);if(a.length!==s)throw new e("tlv.decode: length bytes not complete");if(a[0]===0)throw new e("tlv.decode(long): zero leftmost byte");for(const d of a)c=c<<8|d;if(r+=s,c<128)throw new e("tlv.decode(long): not minimal encoding")}const f=n.subarray(r,r+c);if(f.length!==c)throw new e("tlv.decode: wrong value length");return{v:f,l:n.subarray(r+c)}}},_int:{encode(t){const{Err:n}=F;if(t<G)throw new n("integer: negative integers are not allowed");let e=Nt(t);if(Number.parseInt(e[0],16)&8&&(e="00"+e),e.length&1)throw new n("unexpected DER parsing assertion: unpadded hex");return e},decode(t){const{Err:n}=F;if(t[0]&128)throw new n("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new n("invalid signature integer: unnecessary leading zero");return X(t)}},toSig(t){const{Err:n,_int:e,_tlv:r}=F,i=V("signature",t),{v:o,l:c}=r.decode(48,i);if(c.length)throw new n("invalid signature: left bytes after parsing");const{v:f,l:s}=r.decode(2,o),{v:a,l:d}=r.decode(2,s);if(d.length)throw new n("invalid signature: left bytes after parsing");return{r:e.decode(f),s:e.decode(a)}},hexFromSig(t){const{_tlv:n,_int:e}=F,r=n.encode(2,e.encode(t.r)),i=n.encode(2,e.encode(t.s)),o=r+i;return n.encode(48,o)}};function $t(t,n){return Et(lt(t,n))}const G=BigInt(0),k=BigInt(1),rt=BigInt(2),xt=BigInt(3),te=BigInt(4);function pn(t){const n=yn(t),{Fp:e}=n,r=se(n.n,n.nBitLength),i=n.toBytes||((y,u,m)=>{const p=u.toAffine();return D(Uint8Array.from([4]),e.toBytes(p.x),e.toBytes(p.y))}),o=n.fromBytes||(y=>{const u=y.subarray(1),m=e.fromBytes(u.subarray(0,e.BYTES)),p=e.fromBytes(u.subarray(e.BYTES,2*e.BYTES));return{x:m,y:p}});function c(y){const{a:u,b:m}=n,p=e.sqr(y),v=e.mul(p,y);return e.add(e.add(v,e.mul(y,u)),m)}function f(y,u){const m=e.sqr(u),p=c(y);return e.eql(m,p)}if(!f(n.Gx,n.Gy))throw new Error("bad curve params: generator point");const s=e.mul(e.pow(n.a,xt),te),a=e.mul(e.sqr(n.b),BigInt(27));if(e.is0(e.add(s,a)))throw new Error("bad curve params: a or b");function d(y){return vt(y,k,n.n)}function l(y){const{allowedPrivateKeyLengths:u,nByteLength:m,wrapPrivateKey:p,n:v}=n;if(u&&typeof y!="bigint"){if(_t(y)&&(y=Et(y)),typeof y!="string"||!u.includes(y.length))throw new Error("invalid private key");y=y.padStart(m*2,"0")}let O;try{O=typeof y=="bigint"?y:X(V("private key",y,m))}catch{throw new Error("invalid private key, expected hex or "+m+" bytes, got "+typeof y)}return p&&(O=Z(O,v)),ut("private key",O,k,v),O}function x(y){if(!(y instanceof g))throw new Error("ProjectivePoint expected")}const b=le((y,u)=>{const{px:m,py:p,pz:v}=y;if(e.eql(v,e.ONE))return{x:m,y:p};const O=y.is0();u==null&&(u=O?e.ONE:e.inv(v));const H=e.mul(m,u),L=e.mul(p,u),B=e.mul(v,u);if(O)return{x:e.ZERO,y:e.ZERO};if(!e.eql(B,e.ONE))throw new Error("invZ was invalid");return{x:H,y:L}}),_=le(y=>{if(y.is0()){if(n.allowInfinityPoint&&!e.is0(y.py))return;throw new Error("bad point: ZERO")}const{x:u,y:m}=y.toAffine();if(!e.isValid(u)||!e.isValid(m))throw new Error("bad point: x or y not FE");if(!f(u,m))throw new Error("bad point: equation left != right");if(!y.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class g{constructor(u,m,p){if(u==null||!e.isValid(u))throw new Error("x required");if(m==null||!e.isValid(m)||e.is0(m))throw new Error("y required");if(p==null||!e.isValid(p))throw new Error("z required");this.px=u,this.py=m,this.pz=p,Object.freeze(this)}static fromAffine(u){const{x:m,y:p}=u||{};if(!u||!e.isValid(m)||!e.isValid(p))throw new Error("invalid affine point");if(u instanceof g)throw new Error("projective point not allowed");const v=O=>e.eql(O,e.ZERO);return v(m)&&v(p)?g.ZERO:new g(m,p,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(u){const m=Zt(e,u.map(p=>p.pz));return u.map((p,v)=>p.toAffine(m[v])).map(g.fromAffine)}static fromHex(u){const m=g.fromAffine(o(V("pointHex",u)));return m.assertValidity(),m}static fromPrivateKey(u){return g.BASE.multiply(l(u))}static msm(u,m){return bn(g,r,u,m)}_setWindowSize(u){U.setWindowSize(this,u)}assertValidity(){_(this)}hasEvenY(){const{y:u}=this.toAffine();if(e.isOdd)return!e.isOdd(u);throw new Error("Field doesn't support isOdd")}equals(u){x(u);const{px:m,py:p,pz:v}=this,{px:O,py:H,pz:L}=u,B=e.eql(e.mul(m,L),e.mul(O,v)),R=e.eql(e.mul(p,L),e.mul(H,v));return B&&R}negate(){return new g(this.px,e.neg(this.py),this.pz)}double(){const{a:u,b:m}=n,p=e.mul(m,xt),{px:v,py:O,pz:H}=this;let L=e.ZERO,B=e.ZERO,R=e.ZERO,S=e.mul(v,v),z=e.mul(O,O),w=e.mul(H,H),h=e.mul(v,O);return h=e.add(h,h),R=e.mul(v,H),R=e.add(R,R),L=e.mul(u,R),B=e.mul(p,w),B=e.add(L,B),L=e.sub(z,B),B=e.add(z,B),B=e.mul(L,B),L=e.mul(h,L),R=e.mul(p,R),w=e.mul(u,w),h=e.sub(S,w),h=e.mul(u,h),h=e.add(h,R),R=e.add(S,S),S=e.add(R,S),S=e.add(S,w),S=e.mul(S,h),B=e.add(B,S),w=e.mul(O,H),w=e.add(w,w),S=e.mul(w,h),L=e.sub(L,S),R=e.mul(w,z),R=e.add(R,R),R=e.add(R,R),new g(L,B,R)}add(u){x(u);const{px:m,py:p,pz:v}=this,{px:O,py:H,pz:L}=u;let B=e.ZERO,R=e.ZERO,S=e.ZERO;const z=n.a,w=e.mul(n.b,xt);let h=e.mul(m,O),E=e.mul(p,H),q=e.mul(v,L),A=e.add(m,p),N=e.add(O,H);A=e.mul(A,N),N=e.add(h,E),A=e.sub(A,N),N=e.add(m,v);let C=e.add(O,L);return N=e.mul(N,C),C=e.add(h,q),N=e.sub(N,C),C=e.add(p,v),B=e.add(H,L),C=e.mul(C,B),B=e.add(E,q),C=e.sub(C,B),S=e.mul(z,N),B=e.mul(w,q),S=e.add(B,S),B=e.sub(E,S),S=e.add(E,S),R=e.mul(B,S),E=e.add(h,h),E=e.add(E,h),q=e.mul(z,q),N=e.mul(w,N),E=e.add(E,q),q=e.sub(h,q),q=e.mul(z,q),N=e.add(N,q),h=e.mul(E,N),R=e.add(R,h),h=e.mul(C,N),B=e.mul(A,B),B=e.sub(B,h),h=e.mul(A,E),S=e.mul(C,S),S=e.add(S,h),new g(B,R,S)}subtract(u){return this.add(u.negate())}is0(){return this.equals(g.ZERO)}wNAF(u){return U.wNAFCached(this,u,g.normalizeZ)}multiplyUnsafe(u){const{endo:m,n:p}=n;ut("scalar",u,G,p);const v=g.ZERO;if(u===G)return v;if(this.is0()||u===k)return this;if(!m||U.hasPrecomputes(this))return U.wNAFCachedUnsafe(this,u,g.normalizeZ);let{k1neg:O,k1:H,k2neg:L,k2:B}=m.splitScalar(u),R=v,S=v,z=this;for(;H>G||B>G;)H&k&&(R=R.add(z)),B&k&&(S=S.add(z)),z=z.double(),H>>=k,B>>=k;return O&&(R=R.negate()),L&&(S=S.negate()),S=new g(e.mul(S.px,m.beta),S.py,S.pz),R.add(S)}multiply(u){const{endo:m,n:p}=n;ut("scalar",u,k,p);let v,O;if(m){const{k1neg:H,k1:L,k2neg:B,k2:R}=m.splitScalar(u);let{p:S,f:z}=this.wNAF(L),{p:w,f:h}=this.wNAF(R);S=U.constTimeNegate(H,S),w=U.constTimeNegate(B,w),w=new g(e.mul(w.px,m.beta),w.py,w.pz),v=S.add(w),O=z.add(h)}else{const{p:H,f:L}=this.wNAF(u);v=H,O=L}return g.normalizeZ([v,O])[0]}multiplyAndAddUnsafe(u,m,p){const v=g.BASE,O=(L,B)=>B===G||B===k||!L.equals(v)?L.multiplyUnsafe(B):L.multiply(B),H=O(this,m).add(O(u,p));return H.is0()?void 0:H}toAffine(u){return b(this,u)}isTorsionFree(){const{h:u,isTorsionFree:m}=n;if(u===k)return!0;if(m)return m(g,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:u,clearCofactor:m}=n;return u===k?this:m?m(g,this):this.multiplyUnsafe(n.h)}toRawBytes(u=!0){return pt("isCompressed",u),this.assertValidity(),i(g,this,u)}toHex(u=!0){return pt("isCompressed",u),Et(this.toRawBytes(u))}}g.BASE=new g(n.Gx,n.Gy,e.ONE),g.ZERO=new g(e.ZERO,e.ONE,e.ZERO);const{endo:T,nBitLength:I}=n,U=mn(g,T?Math.ceil(I/2):I);return{CURVE:n,ProjectivePoint:g,normPrivateKeyToScalar:l,weierstrassEquation:c,isWithinCurveOrder:d}}function En(t){const n=Ve(t);return It(n,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...n})}function vn(t){const n=En(t),{Fp:e,n:r,nByteLength:i,nBitLength:o}=n,c=e.BYTES+1,f=2*e.BYTES+1;function s(w){return Z(w,r)}function a(w){return Jt(w,r)}const{ProjectivePoint:d,normPrivateKeyToScalar:l,weierstrassEquation:x,isWithinCurveOrder:b}=pn({...n,toBytes(w,h,E){const q=h.toAffine(),A=e.toBytes(q.x),N=D;return pt("isCompressed",E),E?N(Uint8Array.from([h.hasEvenY()?2:3]),A):N(Uint8Array.from([4]),A,e.toBytes(q.y))},fromBytes(w){const h=w.length,E=w[0],q=w.subarray(1);if(h===c&&(E===2||E===3)){const A=X(q);if(!vt(A,k,e.ORDER))throw new Error("Point is not on curve");const N=x(A);let C;try{C=e.sqrt(N)}catch(W){const j=W instanceof Error?": "+W.message:"";throw new Error("Point is not on curve"+j)}const P=(C&k)===k;return(E&1)===1!==P&&(C=e.neg(C)),{x:A,y:C}}else if(h===f&&E===4){const A=e.fromBytes(q.subarray(0,e.BYTES)),N=e.fromBytes(q.subarray(e.BYTES,2*e.BYTES));return{x:A,y:N}}else{const A=c,N=f;throw new Error("invalid Point, expected length of "+A+", or uncompressed "+N+", got "+h)}}});function _(w){const h=r>>k;return w>h}function g(w){return _(w)?s(-w):w}const T=(w,h,E)=>X(w.slice(h,E));class I{constructor(h,E,q){ut("r",h,k,r),ut("s",E,k,r),this.r=h,this.s=E,q!=null&&(this.recovery=q),Object.freeze(this)}static fromCompact(h){const E=i;return h=V("compactSignature",h,E*2),new I(T(h,0,E),T(h,E,2*E))}static fromDER(h){const{r:E,s:q}=F.toSig(V("DER",h));return new I(E,q)}assertValidity(){}addRecoveryBit(h){return new I(this.r,this.s,h)}recoverPublicKey(h){const{r:E,s:q,recovery:A}=this,N=v(V("msgHash",h));if(A==null||![0,1,2,3].includes(A))throw new Error("recovery id invalid");const C=A===2||A===3?E+n.n:E;if(C>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");const P=A&1?"03":"02",Q=d.fromHex(P+$t(C,e.BYTES)),W=a(C),j=s(-N*W),dt=s(q*W),tt=d.BASE.multiplyAndAddUnsafe(Q,j,dt);if(!tt)throw new Error("point at infinify");return tt.assertValidity(),tt}hasHighS(){return _(this.s)}normalizeS(){return this.hasHighS()?new I(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return Ht(this.toDERHex())}toDERHex(){return F.hexFromSig(this)}toCompactRawBytes(){return Ht(this.toCompactHex())}toCompactHex(){const h=i;return $t(this.r,h)+$t(this.s,h)}}const U={isValidPrivateKey(w){try{return l(w),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const w=ke(n.n);return hn(n.randomBytes(w),n.n)},precompute(w=8,h=d.BASE){return h._setWindowSize(w),h.multiply(BigInt(3)),h}};function y(w,h=!0){return d.fromPrivateKey(w).toRawBytes(h)}function u(w){if(typeof w=="bigint")return!1;if(w instanceof d)return!0;const E=V("key",w).length,q=e.BYTES,A=q+1,N=2*q+1;if(!(n.allowedPrivateKeyLengths||i===A))return E===A||E===N}function m(w,h,E=!0){if(u(w)===!0)throw new Error("first arg must be private key");if(u(h)===!1)throw new Error("second arg must be public key");return d.fromHex(h).multiply(l(w)).toRawBytes(E)}const p=n.bits2int||function(w){if(w.length>8192)throw new Error("input is too large");const h=X(w),E=w.length*8-o;return E>0?h>>BigInt(E):h},v=n.bits2int_modN||function(w){return s(p(w))},O=Ct(o);function H(w){return ut("num < 2^"+o,w,G,O),lt(w,i)}function L(w,h,E=B){if(["recovered","canonical"].some(ct=>ct in E))throw new Error("sign() legacy options not supported");const{hash:q,randomBytes:A}=n;let{lowS:N,prehash:C,extraEntropy:P}=E;N==null&&(N=!0),w=V("msgHash",w),ge(E),C&&(w=V("prehashed msgHash",q(w)));const Q=v(w),W=l(h),j=[H(W),H(Q)];if(P!=null&&P!==!1){const ct=P===!0?A(e.BYTES):P;j.push(V("extraEntropy",ct))}const dt=D(...j),tt=Q;function zt(ct){const ht=p(ct);if(!b(ht))return;const Pt=a(ht),mt=d.BASE.multiply(ht).toAffine(),ft=s(mt.x);if(ft===G)return;const bt=s(Pt*s(tt+ft*W));if(bt===G)return;let yt=(mt.x===ft?0:2)|Number(mt.y&k),wt=bt;return N&&_(bt)&&(wt=g(bt),yt^=1),new I(ft,wt,yt)}return{seed:dt,k2sig:zt}}const B={lowS:n.lowS,prehash:!1},R={lowS:n.lowS,prehash:!1};function S(w,h,E=B){const{seed:q,k2sig:A}=L(w,h,E),N=n;return on(N.hash.outputLen,N.nByteLength,N.hmac)(q,A)}d.BASE._setWindowSize(8);function z(w,h,E,q=R){var yt;const A=w;h=V("msgHash",h),E=V("publicKey",E);const{lowS:N,prehash:C,format:P}=q;if(ge(q),"strict"in q)throw new Error("options.strict was renamed to lowS");if(P!==void 0&&P!=="compact"&&P!=="der")throw new Error("format must be compact or der");const Q=typeof A=="string"||_t(A),W=!Q&&!P&&typeof A=="object"&&A!==null&&typeof A.r=="bigint"&&typeof A.s=="bigint";if(!Q&&!W)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let j,dt;try{if(W&&(j=new I(A.r,A.s)),Q){try{P!=="compact"&&(j=I.fromDER(A))}catch(wt){if(!(wt instanceof F.Err))throw wt}!j&&P!=="der"&&(j=I.fromCompact(A))}dt=d.fromHex(E)}catch{return!1}if(!j||N&&j.hasHighS())return!1;C&&(h=n.hash(h));const{r:tt,s:zt}=j,ct=v(h),ht=a(zt),Pt=s(ct*ht),mt=s(tt*ht),ft=(yt=d.BASE.multiplyAndAddUnsafe(dt,Pt,mt))==null?void 0:yt.toAffine();return ft?s(ft.x)===tt:!1}return{CURVE:n,getPublicKey:y,getSharedSecret:m,sign:S,verify:z,ProjectivePoint:d,Signature:I,utils:U}}function Bn(t,n){const e=t.ORDER;let r=G;for(let _=e-k;_%rt===G;_/=rt)r+=k;const i=r,o=rt<<i-k-k,c=o*rt,f=(e-k)/c,s=(f-k)/rt,a=c-k,d=o,l=t.pow(n,f),x=t.pow(n,(f+k)/rt);let b=(_,g)=>{let T=l,I=t.pow(g,a),U=t.sqr(I);U=t.mul(U,g);let y=t.mul(_,U);y=t.pow(y,s),y=t.mul(y,I),I=t.mul(y,g),U=t.mul(y,_);let u=t.mul(U,I);y=t.pow(u,d);let m=t.eql(y,t.ONE);I=t.mul(U,x),y=t.mul(u,T),U=t.cmov(I,U,m),u=t.cmov(y,u,m);for(let p=i;p>k;p--){let v=p-rt;v=rt<<v-k;let O=t.pow(u,v);const H=t.eql(O,t.ONE);I=t.mul(U,T),T=t.mul(T,T),O=t.mul(u,T),U=t.cmov(I,U,H),u=t.cmov(O,u,H)}return{isValid:m,value:U}};if(t.ORDER%te===xt){const _=(t.ORDER-xt)/te,g=t.sqrt(t.neg(n));b=(T,I)=>{let U=t.sqr(I);const y=t.mul(T,I);U=t.mul(U,y);let u=t.pow(U,_);u=t.mul(u,y);const m=t.mul(u,g),p=t.mul(t.sqr(u),I),v=t.eql(p,T);let O=t.cmov(m,u,v);return{isValid:v,value:O}}}return b}function Sn(t,n){if(He(t),!t.isValid(n.A)||!t.isValid(n.B)||!t.isValid(n.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const e=Bn(t,n.Z);if(!t.isOdd)throw new Error("Fp.isOdd is not implemented!");return r=>{let i,o,c,f,s,a,d,l;i=t.sqr(r),i=t.mul(i,n.Z),o=t.sqr(i),o=t.add(o,i),c=t.add(o,t.ONE),c=t.mul(c,n.B),f=t.cmov(n.Z,t.neg(o),!t.eql(o,t.ZERO)),f=t.mul(f,n.A),o=t.sqr(c),a=t.sqr(f),s=t.mul(a,n.A),o=t.add(o,s),o=t.mul(o,c),a=t.mul(a,f),s=t.mul(a,n.B),o=t.add(o,s),d=t.mul(i,c);const{isValid:x,value:b}=e(o,a);l=t.mul(i,r),l=t.mul(l,b),d=t.cmov(d,c,x),l=t.cmov(l,b,x);const _=t.isOdd(r)===t.isOdd(l);l=t.cmov(t.neg(l),l,_);const g=Zt(t,[f],!0)[0];return d=t.mul(d,g),{x:d,y:l}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function An(t){return{hash:t,hmac:(n,...e)=>Se(t,n,$e(...e)),randomBytes:ve}}function _n(t,n){const e=r=>vn({...t,...An(r)});return{...e(n),create:e}}const In=X;function ot(t,n){if(Bt(t),Bt(n),t<0||t>=1<<8*n)throw new Error("invalid I2OSP input: "+t);const e=Array.from({length:n}).fill(0);for(let r=n-1;r>=0;r--)e[r]=t&255,t>>>=8;return new Uint8Array(e)}function On(t,n){const e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t[r]^n[r];return e}function Bt(t){if(!Number.isSafeInteger(t))throw new Error("number expected")}function Nn(t,n,e,r){st(t),st(n),Bt(e),n.length>255&&(n=r(D(oe("H2C-OVERSIZE-DST-"),n)));const{outputLen:i,blockLen:o}=r,c=Math.ceil(e/i);if(e>65535||c>255)throw new Error("expand_message_xmd: invalid lenInBytes");const f=D(n,ot(n.length,1)),s=ot(0,o),a=ot(e,2),d=new Array(c),l=r(D(s,t,a,ot(0,1),f));d[0]=r(D(l,ot(1,1),f));for(let b=1;b<=c;b++){const _=[On(l,d[b-1]),ot(b+1,1),f];d[b]=r(D(..._))}return D(...d).slice(0,e)}function qn(t,n,e,r,i){if(st(t),st(n),Bt(e),n.length>255){const o=Math.ceil(2*r/8);n=i.create({dkLen:o}).update(oe("H2C-OVERSIZE-DST-")).update(n).digest()}if(e>65535||n.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:e}).update(t).update(ot(e,2)).update(n).update(ot(n.length,1)).digest()}function me(t,n,e){It(e,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:r,k:i,m:o,hash:c,expand:f,DST:s}=e;st(t),Bt(n);const a=typeof s=="string"?oe(s):s,d=r.toString(2).length,l=Math.ceil((d+i)/8),x=n*o*l;let b;if(f==="xmd")b=Nn(t,a,x,c);else if(f==="xof")b=qn(t,a,x,i,c);else if(f==="_internal_pass")b=t;else throw new Error('expand must be "xmd" or "xof"');const _=new Array(n);for(let g=0;g<n;g++){const T=new Array(o);for(let I=0;I<o;I++){const U=l*(I+g*o),y=b.subarray(U,U+l);T[I]=Z(In(y),r)}_[g]=T}return _}function Rn(t,n){const e=n.map(r=>Array.from(r).reverse());return(r,i)=>{const[o,c,f,s]=e.map(l=>l.reduce((x,b)=>t.add(t.mul(x,r),b))),[a,d]=Zt(t,[c,s],!0);return r=t.mul(o,a),i=t.mul(i,t.mul(f,d)),{x:r,y:i}}}function Un(t,n,e){if(typeof n!="function")throw new Error("mapToCurve() must be defined");function r(o){return t.fromAffine(n(o))}function i(o){const c=o.clearCofactor();return c.equals(t.ZERO)?t.ZERO:(c.assertValidity(),c)}return{defaults:e,hashToCurve(o,c){const f=me(o,2,{...e,DST:e.DST,...c}),s=r(f[0]),a=r(f[1]);return i(s.add(a))},encodeToCurve(o,c){const f=me(o,1,{...e,DST:e.encodeDST,...c});return i(r(f[0]))},mapToCurve(o){if(!Array.isArray(o))throw new Error("expected array of bigints");for(const c of o)if(typeof c!="bigint")throw new Error("expected array of bigints");return i(r(o))}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ot=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Lt=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ie=BigInt(0),St=BigInt(1),Tt=BigInt(2),be=(t,n)=>(t+n/Tt)/n;function ze(t){const n=Ot,e=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),c=BigInt(23),f=BigInt(44),s=BigInt(88),a=t*t*t%n,d=a*a*t%n,l=K(d,e,n)*d%n,x=K(l,e,n)*d%n,b=K(x,Tt,n)*a%n,_=K(b,i,n)*b%n,g=K(_,o,n)*_%n,T=K(g,f,n)*g%n,I=K(T,s,n)*T%n,U=K(I,f,n)*g%n,y=K(U,e,n)*d%n,u=K(y,c,n)*_%n,m=K(u,r,n)*a%n,p=K(m,Tt,n);if(!it.eql(it.sqr(p),t))throw new Error("Cannot find square root");return p}const it=se(Ot,void 0,void 0,{sqrt:ze}),Vt=_n({a:ie,b:BigInt(7),Fp:it,n:Lt,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const n=Lt,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-St*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=e,c=BigInt("0x100000000000000000000000000000000"),f=be(o*t,n),s=be(-r*t,n);let a=Z(t-f*e-s*i,n),d=Z(-f*r-s*o,n);const l=a>c,x=d>c;if(l&&(a=n-a),x&&(d=n-d),a>c||d>c)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:l,k1:a,k2neg:x,k2:d}}}},Ut),ye={};function kt(t,...n){let e=ye[t];if(e===void 0){const r=Ut(Uint8Array.from(t,i=>i.charCodeAt(0)));e=D(r,r),ye[t]=e}return Ut(D(e,...n))}const ce=t=>t.toRawBytes(!0).slice(1),ee=t=>lt(t,32),Xt=t=>Z(t,Ot),At=t=>Z(t,Lt),fe=(()=>Vt.ProjectivePoint)(),Hn=(t,n,e)=>fe.BASE.multiplyAndAddUnsafe(t,n,e);function ne(t){let n=Vt.utils.normPrivateKeyToScalar(t),e=fe.fromPrivateKey(n);return{scalar:e.hasEvenY()?n:At(-n),bytes:ce(e)}}function Pe(t){ut("x",t,St,Ot);const n=Xt(t*t),e=Xt(n*t+BigInt(7));let r=ze(e);r%Tt!==ie&&(r=Xt(-r));const i=new fe(t,r,St);return i.assertValidity(),i}const gt=X;function Me(...t){return At(gt(kt("BIP0340/challenge",...t)))}function Ln(t){return ne(t).bytes}function Tn(t,n,e=ve(32)){const r=V("message",t),{bytes:i,scalar:o}=ne(n),c=V("auxRand",e,32),f=ee(o^gt(kt("BIP0340/aux",c))),s=kt("BIP0340/nonce",f,i,r),a=At(gt(s));if(a===ie)throw new Error("sign failed: k is zero");const{bytes:d,scalar:l}=ne(a),x=Me(d,i,r),b=new Uint8Array(64);if(b.set(d,0),b.set(ee(At(l+x*o)),32),!je(b,r,i))throw new Error("sign: Invalid signature produced");return b}function je(t,n,e){const r=V("signature",t,64),i=V("message",n),o=V("publicKey",e,32);try{const c=Pe(gt(o)),f=gt(r.subarray(0,32));if(!vt(f,St,Ot))return!1;const s=gt(r.subarray(32,64));if(!vt(s,St,Lt))return!1;const a=Me(ee(f),ce(c),i),d=Hn(c,s,At(-a));return!(!d||!d.hasEvenY()||d.toAffine().x!==f)}catch{return!1}}const zn=(()=>({getPublicKey:Ln,sign:Tn,verify:je,utils:{randomPrivateKey:Vt.utils.randomPrivateKey,lift_x:Pe,pointToBytes:ce,numberToBytesBE:lt,bytesToNumberBE:X,taggedHash:kt,mod:Z}}))(),kn=(()=>Rn(it,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(t=>t.map(n=>BigInt(n)))))(),Cn=(()=>Sn(it,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:it.create(BigInt("-11"))}))(),Ye=(()=>Un(Vt.ProjectivePoint,t=>{const{x:n,y:e}=Cn(it.create(t[0]));return kn(n,e)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:it.ORDER,m:1,k:128,expand:"xmd",hash:Ut}))(),Pn=(()=>Ye.hashToCurve)(),Mn=(()=>Ye.encodeToCurve)();export{Mn as encodeToCurve,Pn as hashToCurve,zn as schnorr,Vt as secp256k1,Ye as secp256k1_hasher};
@@ -1 +1 @@
1
- import{H as me,G as Pt,I as Nt,J as ye,K as Ve,L as Ze,N as W,P as ze,Q as Me,U as Pe,V as pe}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";function je(t,n,e,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(n,e,r);const o=BigInt(32),i=BigInt(4294967295),c=Number(e>>o&i),f=Number(e&i),s=r?4:0,u=r?0:4;t.setUint32(n+s,c,r),t.setUint32(n+u,f,r)}function Ke(t,n,e){return t&n^~t&e}function De(t,n,e){return t&n^t&e^n&e}class Ye extends me{constructor(n,e,r,o){super(),this.blockLen=n,this.outputLen=e,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(n),this.view=Pt(this.buffer)}update(n){Nt(this);const{view:e,buffer:r,blockLen:o}=this;n=ye(n);const i=n.length;for(let c=0;c<i;){const f=Math.min(o-this.pos,i-c);if(f===o){const s=Pt(n);for(;o<=i-c;c+=o)this.process(s,c);continue}r.set(n.subarray(c,c+f),this.pos),this.pos+=f,c+=f,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=n.length,this.roundClean(),this}digestInto(n){Nt(this),Ve(n,this),this.finished=!0;const{buffer:e,view:r,blockLen:o,isLE:i}=this;let{pos:c}=this;e[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>o-c&&(this.process(r,0),c=0);for(let l=c;l<o;l++)e[l]=0;je(r,o-8,BigInt(this.length*8),i),this.process(r,0);const f=Pt(n),s=this.outputLen;if(s%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=s/4,g=this.get();if(u>g.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<u;l++)f.setUint32(4*l,g[l],i)}digest(){const{buffer:n,outputLen:e}=this;this.digestInto(n);const r=n.slice(0,e);return this.destroy(),r}_cloneInto(n){n||(n=new this.constructor),n.set(...this.get());const{blockLen:e,buffer:r,length:o,finished:i,destroyed:c,pos:f}=this;return n.length=o,n.pos=f,n.finished=i,n.destroyed=c,o%e&&n.buffer.set(r),n}}const Ge=new Uint32Array([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]),et=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),nt=new Uint32Array(64);class We extends Ye{constructor(){super(64,32,8,!1),this.A=et[0]|0,this.B=et[1]|0,this.C=et[2]|0,this.D=et[3]|0,this.E=et[4]|0,this.F=et[5]|0,this.G=et[6]|0,this.H=et[7]|0}get(){const{A:n,B:e,C:r,D:o,E:i,F:c,G:f,H:s}=this;return[n,e,r,o,i,c,f,s]}set(n,e,r,o,i,c,f,s){this.A=n|0,this.B=e|0,this.C=r|0,this.D=o|0,this.E=i|0,this.F=c|0,this.G=f|0,this.H=s|0}process(n,e){for(let l=0;l<16;l++,e+=4)nt[l]=n.getUint32(e,!1);for(let l=16;l<64;l++){const d=nt[l-15],w=nt[l-2],B=W(d,7)^W(d,18)^d>>>3,y=W(w,17)^W(w,19)^w>>>10;nt[l]=y+nt[l-7]+B+nt[l-16]|0}let{A:r,B:o,C:i,D:c,E:f,F:s,G:u,H:g}=this;for(let l=0;l<64;l++){const d=W(f,6)^W(f,11)^W(f,25),w=g+d+Ke(f,s,u)+Ge[l]+nt[l]|0,y=(W(r,2)^W(r,13)^W(r,22))+De(r,o,i)|0;g=u,u=s,s=f,f=c+w|0,c=i,i=o,o=r,r=w+y|0}r=r+this.A|0,o=o+this.B|0,i=i+this.C|0,c=c+this.D|0,f=f+this.E|0,s=s+this.F|0,u=u+this.G|0,g=g+this.H|0,this.set(r,o,i,c,f,s,u,g)}roundClean(){nt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Ut=Ze(()=>new We);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ct=BigInt(0),kt=BigInt(1),$e=BigInt(2);function lt(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function X(t){if(!lt(t))throw new Error("Uint8Array expected")}function mt(t,n){if(typeof n!="boolean")throw new Error(t+" boolean expected, got "+n)}const Xe=Array.from({length:256},(t,n)=>n.toString(16).padStart(2,"0"));function yt(t){X(t);let n="";for(let e=0;e<t.length;e++)n+=Xe[t[e]];return n}function wt(t){const n=t.toString(16);return n.length&1?"0"+n:n}function ee(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?Ct:BigInt("0x"+t)}const J={_0:48,_9:57,A:65,F:70,a:97,f:102};function ce(t){if(t>=J._0&&t<=J._9)return t-J._0;if(t>=J.A&&t<=J.F)return t-(J.A-10);if(t>=J.a&&t<=J.f)return t-(J.a-10)}function pt(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const n=t.length,e=n/2;if(n%2)throw new Error("hex string expected, got unpadded hex of length "+n);const r=new Uint8Array(e);for(let o=0,i=0;o<e;o++,i+=2){const c=ce(t.charCodeAt(i)),f=ce(t.charCodeAt(i+1));if(c===void 0||f===void 0){const s=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+s+'" at index '+i)}r[o]=c*16+f}return r}function $(t){return ee(yt(t))}function ne(t){return X(t),ee(yt(Uint8Array.from(t).reverse()))}function st(t,n){return pt(t.toString(16).padStart(n*2,"0"))}function re(t,n){return st(t,n).reverse()}function Qe(t){return pt(wt(t))}function Z(t,n,e){let r;if(typeof n=="string")try{r=pt(n)}catch(i){throw new Error(t+" must be hex string or Uint8Array, cause: "+i)}else if(lt(n))r=Uint8Array.from(n);else throw new Error(t+" must be hex string or Uint8Array");const o=r.length;if(typeof e=="number"&&o!==e)throw new Error(t+" of length "+e+" expected, got "+o);return r}function K(...t){let n=0;for(let r=0;r<t.length;r++){const o=t[r];X(o),n+=o.length}const e=new Uint8Array(n);for(let r=0,o=0;r<t.length;r++){const i=t[r];e.set(i,o),o+=i.length}return e}function Je(t,n){if(t.length!==n.length)return!1;let e=0;for(let r=0;r<t.length;r++)e|=t[r]^n[r];return e===0}function Vt(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}const jt=t=>typeof t=="bigint"&&Ct<=t;function xt(t,n,e){return jt(t)&&jt(n)&&jt(e)&&n<=t&&t<e}function it(t,n,e,r){if(!xt(n,e,r))throw new Error("expected valid "+t+": "+e+" <= n < "+r+", got "+n)}function xe(t){let n;for(n=0;t>Ct;t>>=kt,n+=1);return n}function Fe(t,n){return t>>BigInt(n)&kt}function tn(t,n,e){return t|(e?kt:Ct)<<BigInt(n)}const oe=t=>($e<<BigInt(t-1))-kt,Kt=t=>new Uint8Array(t),fe=t=>Uint8Array.from(t);function Ee(t,n,e){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof n!="number"||n<2)throw new Error("qByteLen must be a number");if(typeof e!="function")throw new Error("hmacFn must be a function");let r=Kt(t),o=Kt(t),i=0;const c=()=>{r.fill(1),o.fill(0),i=0},f=(...l)=>e(o,r,...l),s=(l=Kt())=>{o=f(fe([0]),l),r=f(),l.length!==0&&(o=f(fe([1]),l),r=f())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let l=0;const d=[];for(;l<n;){r=f();const w=r.slice();d.push(w),l+=r.length}return K(...d)};return(l,d)=>{c(),s(l);let w;for(;!(w=d(u()));)s();return c(),w}}const en={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||lt(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,n)=>n.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Et(t,n,e={}){const r=(o,i,c)=>{const f=en[i];if(typeof f!="function")throw new Error("invalid validator function");const s=t[o];if(!(c&&s===void 0)&&!f(s,t))throw new Error("param "+String(o)+" is invalid. Expected "+i+", got "+s)};for(const[o,i]of Object.entries(n))r(o,i,!1);for(const[o,i]of Object.entries(e))r(o,i,!0);return t}const nn=()=>{throw new Error("not implemented")};function Xt(t){const n=new WeakMap;return(e,...r)=>{const o=n.get(e);if(o!==void 0)return o;const i=t(e,...r);return n.set(e,i),i}}const rn=Object.freeze(Object.defineProperty({__proto__:null,aInRange:it,abool:mt,abytes:X,bitGet:Fe,bitLen:xe,bitMask:oe,bitSet:tn,bytesToHex:yt,bytesToNumberBE:$,bytesToNumberLE:ne,concatBytes:K,createHmacDrbg:Ee,ensureBytes:Z,equalBytes:Je,hexToBytes:pt,hexToNumber:ee,inRange:xt,isBytes:lt,memoized:Xt,notImplemented:nn,numberToBytesBE:st,numberToBytesLE:re,numberToHexUnpadded:wt,numberToVarBytesBE:Qe,utf8ToBytes:Vt,validateObject:Et},Symbol.toStringTag,{value:"Module"}));class Be extends me{constructor(n,e){super(),this.finished=!1,this.destroyed=!1,ze(n);const r=ye(e);if(this.iHash=n.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,i=new Uint8Array(o);i.set(r.length>o?n.create().update(r).digest():r);for(let c=0;c<i.length;c++)i[c]^=54;this.iHash.update(i),this.oHash=n.create();for(let c=0;c<i.length;c++)i[c]^=106;this.oHash.update(i),i.fill(0)}update(n){return Nt(this),this.iHash.update(n),this}digestInto(n){Nt(this),Me(n,this.outputLen),this.finished=!0,this.iHash.digestInto(n),this.oHash.update(n),this.oHash.digestInto(n),this.destroy()}digest(){const n=new Uint8Array(this.oHash.outputLen);return this.digestInto(n),n}_cloneInto(n){n||(n=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:r,finished:o,destroyed:i,blockLen:c,outputLen:f}=this;return n=n,n.finished=o,n.destroyed=i,n.blockLen=c,n.outputLen=f,n.oHash=e._cloneInto(n.oHash),n.iHash=r._cloneInto(n.iHash),n}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const ve=(t,n,e)=>new Be(t,n).update(e).digest();ve.create=(t,n)=>new Be(t,n);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const k=BigInt(0),H=BigInt(1),ut=BigInt(2),on=BigInt(3),Qt=BigInt(4),ae=BigInt(5),ue=BigInt(8);function C(t,n){const e=t%n;return e>=k?e:n+e}function sn(t,n,e){if(n<k)throw new Error("invalid exponent, negatives unsupported");if(e<=k)throw new Error("invalid modulus");if(e===H)return k;let r=H;for(;n>k;)n&H&&(r=r*t%e),t=t*t%e,n>>=H;return r}function D(t,n,e){let r=t;for(;n-- >k;)r*=r,r%=e;return r}function Jt(t,n){if(t===k)throw new Error("invert: expected non-zero number");if(n<=k)throw new Error("invert: expected positive modulus, got "+n);let e=C(t,n),r=n,o=k,i=H;for(;e!==k;){const f=r/e,s=r%e,u=o-i*f;r=e,e=s,o=i,i=u}if(r!==H)throw new Error("invert: does not exist");return C(o,n)}function cn(t){const n=(t-H)/ut;let e,r,o;for(e=t-H,r=0;e%ut===k;e/=ut,r++);for(o=ut;o<t&&sn(o,n,t)!==t-H;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const c=(t+H)/Qt;return function(s,u){const g=s.pow(u,c);if(!s.eql(s.sqr(g),u))throw new Error("Cannot find square root");return g}}const i=(e+H)/ut;return function(f,s){if(f.pow(s,n)===f.neg(f.ONE))throw new Error("Cannot find square root");let u=r,g=f.pow(f.mul(f.ONE,o),e),l=f.pow(s,i),d=f.pow(s,e);for(;!f.eql(d,f.ONE);){if(f.eql(d,f.ZERO))return f.ZERO;let w=1;for(let y=f.sqr(d);w<u&&!f.eql(y,f.ONE);w++)y=f.sqr(y);const B=f.pow(g,H<<BigInt(u-w-1));g=f.sqr(B),l=f.mul(l,B),d=f.mul(d,g),u=w}return l}}function fn(t){if(t%Qt===on){const n=(t+H)/Qt;return function(r,o){const i=r.pow(o,n);if(!r.eql(r.sqr(i),o))throw new Error("Cannot find square root");return i}}if(t%ue===ae){const n=(t-ae)/ue;return function(r,o){const i=r.mul(o,ut),c=r.pow(i,n),f=r.mul(o,c),s=r.mul(r.mul(f,ut),c),u=r.mul(f,r.sub(s,r.ONE));if(!r.eql(r.sqr(u),o))throw new Error("Cannot find square root");return u}}return cn(t)}const an=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Se(t){const n={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},e=an.reduce((r,o)=>(r[o]="function",r),n);return Et(t,e)}function un(t,n,e){if(e<k)throw new Error("invalid exponent, negatives unsupported");if(e===k)return t.ONE;if(e===H)return n;let r=t.ONE,o=n;for(;e>k;)e&H&&(r=t.mul(r,o)),o=t.sqr(o),e>>=H;return r}function ln(t,n){const e=new Array(n.length),r=n.reduce((i,c,f)=>t.is0(c)?i:(e[f]=i,t.mul(i,c)),t.ONE),o=t.inv(r);return n.reduceRight((i,c,f)=>t.is0(c)?i:(e[f]=t.mul(i,e[f]),t.mul(i,c)),o),e}function Ae(t,n){const e=n!==void 0?n:t.toString(2).length,r=Math.ceil(e/8);return{nBitLength:e,nByteLength:r}}function Ie(t,n,e=!1,r={}){if(t<=k)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:o,nByteLength:i}=Ae(t,n);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const f=Object.freeze({ORDER:t,isLE:e,BITS:o,BYTES:i,MASK:oe(o),ZERO:k,ONE:H,create:s=>C(s,t),isValid:s=>{if(typeof s!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof s);return k<=s&&s<t},is0:s=>s===k,isOdd:s=>(s&H)===H,neg:s=>C(-s,t),eql:(s,u)=>s===u,sqr:s=>C(s*s,t),add:(s,u)=>C(s+u,t),sub:(s,u)=>C(s-u,t),mul:(s,u)=>C(s*u,t),pow:(s,u)=>un(f,s,u),div:(s,u)=>C(s*Jt(u,t),t),sqrN:s=>s*s,addN:(s,u)=>s+u,subN:(s,u)=>s-u,mulN:(s,u)=>s*u,inv:s=>Jt(s,t),sqrt:r.sqrt||(s=>(c||(c=fn(t)),c(f,s))),invertBatch:s=>ln(f,s),cmov:(s,u,g)=>g?u:s,toBytes:s=>e?re(s,i):st(s,i),fromBytes:s=>{if(s.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+s.length);return e?ne(s):$(s)}});return Object.freeze(f)}function _e(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const n=t.toString(2).length;return Math.ceil(n/8)}function qe(t){const n=_e(t);return n+Math.ceil(n/2)}function dn(t,n,e=!1){const r=t.length,o=_e(n),i=qe(n);if(r<16||r<i||r>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+r);const c=e?ne(t):$(t),f=C(c,n-H)+H;return e?re(f,o):st(f,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const le=BigInt(0),Ot=BigInt(1);function Dt(t,n){const e=n.negate();return t?e:n}function Oe(t,n){if(!Number.isSafeInteger(t)||t<=0||t>n)throw new Error("invalid window size, expected [1.."+n+"], got W="+t)}function Yt(t,n){Oe(t,n);const e=Math.ceil(n/t)+1,r=2**(t-1);return{windows:e,windowSize:r}}function hn(t,n){if(!Array.isArray(t))throw new Error("array expected");t.forEach((e,r)=>{if(!(e instanceof n))throw new Error("invalid point at index "+r)})}function gn(t,n){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((e,r)=>{if(!n.isValid(e))throw new Error("invalid scalar at index "+r)})}const Gt=new WeakMap,Ne=new WeakMap;function Wt(t){return Ne.get(t)||1}function wn(t,n){return{constTimeNegate:Dt,hasPrecomputes(e){return Wt(e)!==1},unsafeLadder(e,r,o=t.ZERO){let i=e;for(;r>le;)r&Ot&&(o=o.add(i)),i=i.double(),r>>=Ot;return o},precomputeWindow(e,r){const{windows:o,windowSize:i}=Yt(r,n),c=[];let f=e,s=f;for(let u=0;u<o;u++){s=f,c.push(s);for(let g=1;g<i;g++)s=s.add(f),c.push(s);f=s.double()}return c},wNAF(e,r,o){const{windows:i,windowSize:c}=Yt(e,n);let f=t.ZERO,s=t.BASE;const u=BigInt(2**e-1),g=2**e,l=BigInt(e);for(let d=0;d<i;d++){const w=d*c;let B=Number(o&u);o>>=l,B>c&&(B-=g,o+=Ot);const y=w,a=w+Math.abs(B)-1,h=d%2!==0,b=B<0;B===0?s=s.add(Dt(h,r[y])):f=f.add(Dt(b,r[a]))}return{p:f,f:s}},wNAFUnsafe(e,r,o,i=t.ZERO){const{windows:c,windowSize:f}=Yt(e,n),s=BigInt(2**e-1),u=2**e,g=BigInt(e);for(let l=0;l<c;l++){const d=l*f;if(o===le)break;let w=Number(o&s);if(o>>=g,w>f&&(w-=u,o+=Ot),w===0)continue;let B=r[d+Math.abs(w)-1];w<0&&(B=B.negate()),i=i.add(B)}return i},getPrecomputes(e,r,o){let i=Gt.get(r);return i||(i=this.precomputeWindow(r,e),e!==1&&Gt.set(r,o(i))),i},wNAFCached(e,r,o){const i=Wt(e);return this.wNAF(i,this.getPrecomputes(i,e,o),r)},wNAFCachedUnsafe(e,r,o,i){const c=Wt(e);return c===1?this.unsafeLadder(e,r,i):this.wNAFUnsafe(c,this.getPrecomputes(c,e,o),r,i)},setWindowSize(e,r){Oe(r,n),Ne.set(e,r),Gt.delete(e)}}}function bn(t,n,e,r){if(hn(e,t),gn(r,n),e.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const o=t.ZERO,i=xe(BigInt(e.length)),c=i>12?i-3:i>4?i-2:i?2:1,f=(1<<c)-1,s=new Array(f+1).fill(o),u=Math.floor((n.BITS-1)/c)*c;let g=o;for(let l=u;l>=0;l-=c){s.fill(o);for(let w=0;w<r.length;w++){const B=r[w],y=Number(B>>BigInt(l)&BigInt(f));s[y]=s[y].add(e[w])}let d=o;for(let w=s.length-1,B=o;w>0;w--)B=B.add(s[w]),d=d.add(B);if(g=g.add(d),l!==0)for(let w=0;w<c;w++)g=g.double()}return g}function Ue(t){return Se(t.Fp),Et(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ae(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function de(t){t.lowS!==void 0&&mt("lowS",t.lowS),t.prehash!==void 0&&mt("prehash",t.prehash)}function mn(t){const n=Ue(t);Et(n,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:e,Fp:r,a:o}=n;if(e){if(!r.eql(o,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...n})}const{bytesToNumberBE:yn,hexToBytes:pn}=rn;class xn extends Error{constructor(n=""){super(n)}}const F={Err:xn,_tlv:{encode:(t,n)=>{const{Err:e}=F;if(t<0||t>256)throw new e("tlv.encode: wrong tag");if(n.length&1)throw new e("tlv.encode: unpadded data");const r=n.length/2,o=wt(r);if(o.length/2&128)throw new e("tlv.encode: long form length too big");const i=r>127?wt(o.length/2|128):"";return wt(t)+i+o+n},decode(t,n){const{Err:e}=F;let r=0;if(t<0||t>256)throw new e("tlv.encode: wrong tag");if(n.length<2||n[r++]!==t)throw new e("tlv.decode: wrong tlv");const o=n[r++],i=!!(o&128);let c=0;if(!i)c=o;else{const s=o&127;if(!s)throw new e("tlv.decode(long): indefinite length not supported");if(s>4)throw new e("tlv.decode(long): byte length is too big");const u=n.subarray(r,r+s);if(u.length!==s)throw new e("tlv.decode: length bytes not complete");if(u[0]===0)throw new e("tlv.decode(long): zero leftmost byte");for(const g of u)c=c<<8|g;if(r+=s,c<128)throw new e("tlv.decode(long): not minimal encoding")}const f=n.subarray(r,r+c);if(f.length!==c)throw new e("tlv.decode: wrong value length");return{v:f,l:n.subarray(r+c)}}},_int:{encode(t){const{Err:n}=F;if(t<G)throw new n("integer: negative integers are not allowed");let e=wt(t);if(Number.parseInt(e[0],16)&8&&(e="00"+e),e.length&1)throw new n("unexpected DER parsing assertion: unpadded hex");return e},decode(t){const{Err:n}=F;if(t[0]&128)throw new n("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new n("invalid signature integer: unnecessary leading zero");return yn(t)}},toSig(t){const{Err:n,_int:e,_tlv:r}=F,o=typeof t=="string"?pn(t):t;X(o);const{v:i,l:c}=r.decode(48,o);if(c.length)throw new n("invalid signature: left bytes after parsing");const{v:f,l:s}=r.decode(2,i),{v:u,l:g}=r.decode(2,s);if(g.length)throw new n("invalid signature: left bytes after parsing");return{r:e.decode(f),s:e.decode(u)}},hexFromSig(t){const{_tlv:n,_int:e}=F,r=n.encode(2,e.encode(t.r)),o=n.encode(2,e.encode(t.s)),i=r+o;return n.encode(48,i)}},G=BigInt(0),L=BigInt(1),rt=BigInt(2),Lt=BigInt(3),he=BigInt(4);function En(t){const n=mn(t),{Fp:e}=n,r=Ie(n.n,n.nBitLength),o=n.toBytes||((y,a,h)=>{const b=a.toAffine();return K(Uint8Array.from([4]),e.toBytes(b.x),e.toBytes(b.y))}),i=n.fromBytes||(y=>{const a=y.subarray(1),h=e.fromBytes(a.subarray(0,e.BYTES)),b=e.fromBytes(a.subarray(e.BYTES,2*e.BYTES));return{x:h,y:b}});function c(y){const{a,b:h}=n,b=e.sqr(y),p=e.mul(b,y);return e.add(e.add(p,e.mul(y,a)),h)}if(!e.eql(e.sqr(n.Gy),c(n.Gx)))throw new Error("bad generator point: equation left != right");function f(y){return xt(y,L,n.n)}function s(y){const{allowedPrivateKeyLengths:a,nByteLength:h,wrapPrivateKey:b,n:p}=n;if(a&&typeof y!="bigint"){if(lt(y)&&(y=yt(y)),typeof y!="string"||!a.includes(y.length))throw new Error("invalid private key");y=y.padStart(h*2,"0")}let v;try{v=typeof y=="bigint"?y:$(Z("private key",y,h))}catch{throw new Error("invalid private key, expected hex or "+h+" bytes, got "+typeof y)}return b&&(v=C(v,p)),it("private key",v,L,p),v}function u(y){if(!(y instanceof d))throw new Error("ProjectivePoint expected")}const g=Xt((y,a)=>{const{px:h,py:b,pz:p}=y;if(e.eql(p,e.ONE))return{x:h,y:b};const v=y.is0();a==null&&(a=v?e.ONE:e.inv(p));const O=e.mul(h,a),_=e.mul(b,a),S=e.mul(p,a);if(v)return{x:e.ZERO,y:e.ZERO};if(!e.eql(S,e.ONE))throw new Error("invZ was invalid");return{x:O,y:_}}),l=Xt(y=>{if(y.is0()){if(n.allowInfinityPoint&&!e.is0(y.py))return;throw new Error("bad point: ZERO")}const{x:a,y:h}=y.toAffine();if(!e.isValid(a)||!e.isValid(h))throw new Error("bad point: x or y not FE");const b=e.sqr(h),p=c(a);if(!e.eql(b,p))throw new Error("bad point: equation left != right");if(!y.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class d{constructor(a,h,b){if(this.px=a,this.py=h,this.pz=b,a==null||!e.isValid(a))throw new Error("x required");if(h==null||!e.isValid(h))throw new Error("y required");if(b==null||!e.isValid(b))throw new Error("z required");Object.freeze(this)}static fromAffine(a){const{x:h,y:b}=a||{};if(!a||!e.isValid(h)||!e.isValid(b))throw new Error("invalid affine point");if(a instanceof d)throw new Error("projective point not allowed");const p=v=>e.eql(v,e.ZERO);return p(h)&&p(b)?d.ZERO:new d(h,b,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(a){const h=e.invertBatch(a.map(b=>b.pz));return a.map((b,p)=>b.toAffine(h[p])).map(d.fromAffine)}static fromHex(a){const h=d.fromAffine(i(Z("pointHex",a)));return h.assertValidity(),h}static fromPrivateKey(a){return d.BASE.multiply(s(a))}static msm(a,h){return bn(d,r,a,h)}_setWindowSize(a){B.setWindowSize(this,a)}assertValidity(){l(this)}hasEvenY(){const{y:a}=this.toAffine();if(e.isOdd)return!e.isOdd(a);throw new Error("Field doesn't support isOdd")}equals(a){u(a);const{px:h,py:b,pz:p}=this,{px:v,py:O,pz:_}=a,S=e.eql(e.mul(h,_),e.mul(v,p)),I=e.eql(e.mul(b,_),e.mul(O,p));return S&&I}negate(){return new d(this.px,e.neg(this.py),this.pz)}double(){const{a,b:h}=n,b=e.mul(h,Lt),{px:p,py:v,pz:O}=this;let _=e.ZERO,S=e.ZERO,I=e.ZERO,A=e.mul(p,p),V=e.mul(v,v),T=e.mul(O,O),U=e.mul(p,v);return U=e.add(U,U),I=e.mul(p,O),I=e.add(I,I),_=e.mul(a,I),S=e.mul(b,T),S=e.add(_,S),_=e.sub(V,S),S=e.add(V,S),S=e.mul(_,S),_=e.mul(U,_),I=e.mul(b,I),T=e.mul(a,T),U=e.sub(A,T),U=e.mul(a,U),U=e.add(U,I),I=e.add(A,A),A=e.add(I,A),A=e.add(A,T),A=e.mul(A,U),S=e.add(S,A),T=e.mul(v,O),T=e.add(T,T),A=e.mul(T,U),_=e.sub(_,A),I=e.mul(T,V),I=e.add(I,I),I=e.add(I,I),new d(_,S,I)}add(a){u(a);const{px:h,py:b,pz:p}=this,{px:v,py:O,pz:_}=a;let S=e.ZERO,I=e.ZERO,A=e.ZERO;const V=n.a,T=e.mul(n.b,Lt);let U=e.mul(h,v),j=e.mul(b,O),m=e.mul(p,_),x=e.add(h,b),E=e.add(v,O);x=e.mul(x,E),E=e.add(U,j),x=e.sub(x,E),E=e.add(h,p);let q=e.add(v,_);return E=e.mul(E,q),q=e.add(U,m),E=e.sub(E,q),q=e.add(b,p),S=e.add(O,_),q=e.mul(q,S),S=e.add(j,m),q=e.sub(q,S),A=e.mul(V,E),S=e.mul(T,m),A=e.add(S,A),S=e.sub(j,A),A=e.add(j,A),I=e.mul(S,A),j=e.add(U,U),j=e.add(j,U),m=e.mul(V,m),E=e.mul(T,E),j=e.add(j,m),m=e.sub(U,m),m=e.mul(V,m),E=e.add(E,m),U=e.mul(j,E),I=e.add(I,U),U=e.mul(q,E),S=e.mul(x,S),S=e.sub(S,U),U=e.mul(x,j),A=e.mul(q,A),A=e.add(A,U),new d(S,I,A)}subtract(a){return this.add(a.negate())}is0(){return this.equals(d.ZERO)}wNAF(a){return B.wNAFCached(this,a,d.normalizeZ)}multiplyUnsafe(a){const{endo:h,n:b}=n;it("scalar",a,G,b);const p=d.ZERO;if(a===G)return p;if(this.is0()||a===L)return this;if(!h||B.hasPrecomputes(this))return B.wNAFCachedUnsafe(this,a,d.normalizeZ);let{k1neg:v,k1:O,k2neg:_,k2:S}=h.splitScalar(a),I=p,A=p,V=this;for(;O>G||S>G;)O&L&&(I=I.add(V)),S&L&&(A=A.add(V)),V=V.double(),O>>=L,S>>=L;return v&&(I=I.negate()),_&&(A=A.negate()),A=new d(e.mul(A.px,h.beta),A.py,A.pz),I.add(A)}multiply(a){const{endo:h,n:b}=n;it("scalar",a,L,b);let p,v;if(h){const{k1neg:O,k1:_,k2neg:S,k2:I}=h.splitScalar(a);let{p:A,f:V}=this.wNAF(_),{p:T,f:U}=this.wNAF(I);A=B.constTimeNegate(O,A),T=B.constTimeNegate(S,T),T=new d(e.mul(T.px,h.beta),T.py,T.pz),p=A.add(T),v=V.add(U)}else{const{p:O,f:_}=this.wNAF(a);p=O,v=_}return d.normalizeZ([p,v])[0]}multiplyAndAddUnsafe(a,h,b){const p=d.BASE,v=(_,S)=>S===G||S===L||!_.equals(p)?_.multiplyUnsafe(S):_.multiply(S),O=v(this,h).add(v(a,b));return O.is0()?void 0:O}toAffine(a){return g(this,a)}isTorsionFree(){const{h:a,isTorsionFree:h}=n;if(a===L)return!0;if(h)return h(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:a,clearCofactor:h}=n;return a===L?this:h?h(d,this):this.multiplyUnsafe(n.h)}toRawBytes(a=!0){return mt("isCompressed",a),this.assertValidity(),o(d,this,a)}toHex(a=!0){return mt("isCompressed",a),yt(this.toRawBytes(a))}}d.BASE=new d(n.Gx,n.Gy,e.ONE),d.ZERO=new d(e.ZERO,e.ONE,e.ZERO);const w=n.nBitLength,B=wn(d,n.endo?Math.ceil(w/2):w);return{CURVE:n,ProjectivePoint:d,normPrivateKeyToScalar:s,weierstrassEquation:c,isWithinCurveOrder:f}}function Bn(t){const n=Ue(t);return Et(n,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...n})}function vn(t){const n=Bn(t),{Fp:e,n:r}=n,o=e.BYTES+1,i=2*e.BYTES+1;function c(m){return C(m,r)}function f(m){return Jt(m,r)}const{ProjectivePoint:s,normPrivateKeyToScalar:u,weierstrassEquation:g,isWithinCurveOrder:l}=En({...n,toBytes(m,x,E){const q=x.toAffine(),N=e.toBytes(q.x),R=K;return mt("isCompressed",E),E?R(Uint8Array.from([x.hasEvenY()?2:3]),N):R(Uint8Array.from([4]),N,e.toBytes(q.y))},fromBytes(m){const x=m.length,E=m[0],q=m.subarray(1);if(x===o&&(E===2||E===3)){const N=$(q);if(!xt(N,L,e.ORDER))throw new Error("Point is not on curve");const R=g(N);let M;try{M=e.sqrt(R)}catch(Y){const P=Y instanceof Error?": "+Y.message:"";throw new Error("Point is not on curve"+P)}const z=(M&L)===L;return(E&1)===1!==z&&(M=e.neg(M)),{x:N,y:M}}else if(x===i&&E===4){const N=e.fromBytes(q.subarray(0,e.BYTES)),R=e.fromBytes(q.subarray(e.BYTES,2*e.BYTES));return{x:N,y:R}}else{const N=o,R=i;throw new Error("invalid Point, expected length of "+N+", or uncompressed "+R+", got "+x)}}}),d=m=>yt(st(m,n.nByteLength));function w(m){const x=r>>L;return m>x}function B(m){return w(m)?c(-m):m}const y=(m,x,E)=>$(m.slice(x,E));class a{constructor(x,E,q){this.r=x,this.s=E,this.recovery=q,this.assertValidity()}static fromCompact(x){const E=n.nByteLength;return x=Z("compactSignature",x,E*2),new a(y(x,0,E),y(x,E,2*E))}static fromDER(x){const{r:E,s:q}=F.toSig(Z("DER",x));return new a(E,q)}assertValidity(){it("r",this.r,L,r),it("s",this.s,L,r)}addRecoveryBit(x){return new a(this.r,this.s,x)}recoverPublicKey(x){const{r:E,s:q,recovery:N}=this,R=_(Z("msgHash",x));if(N==null||![0,1,2,3].includes(N))throw new Error("recovery id invalid");const M=N===2||N===3?E+n.n:E;if(M>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");const z=N&1?"03":"02",Q=s.fromHex(z+d(M)),Y=f(M),P=c(-R*Y),dt=c(q*Y),tt=s.BASE.multiplyAndAddUnsafe(Q,P,dt);if(!tt)throw new Error("point at infinify");return tt.assertValidity(),tt}hasHighS(){return w(this.s)}normalizeS(){return this.hasHighS()?new a(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return pt(this.toDERHex())}toDERHex(){return F.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return pt(this.toCompactHex())}toCompactHex(){return d(this.r)+d(this.s)}}const h={isValidPrivateKey(m){try{return u(m),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const m=qe(n.n);return dn(n.randomBytes(m),n.n)},precompute(m=8,x=s.BASE){return x._setWindowSize(m),x.multiply(BigInt(3)),x}};function b(m,x=!0){return s.fromPrivateKey(m).toRawBytes(x)}function p(m){const x=lt(m),E=typeof m=="string",q=(x||E)&&m.length;return x?q===o||q===i:E?q===2*o||q===2*i:m instanceof s}function v(m,x,E=!0){if(p(m))throw new Error("first arg must be private key");if(!p(x))throw new Error("second arg must be public key");return s.fromHex(x).multiply(u(m)).toRawBytes(E)}const O=n.bits2int||function(m){if(m.length>8192)throw new Error("input is too large");const x=$(m),E=m.length*8-n.nBitLength;return E>0?x>>BigInt(E):x},_=n.bits2int_modN||function(m){return c(O(m))},S=oe(n.nBitLength);function I(m){return it("num < 2^"+n.nBitLength,m,G,S),st(m,n.nByteLength)}function A(m,x,E=V){if(["recovered","canonical"].some(ft=>ft in E))throw new Error("sign() legacy options not supported");const{hash:q,randomBytes:N}=n;let{lowS:R,prehash:M,extraEntropy:z}=E;R==null&&(R=!0),m=Z("msgHash",m),de(E),M&&(m=Z("prehashed msgHash",q(m)));const Q=_(m),Y=u(x),P=[I(Y),I(Q)];if(z!=null&&z!==!1){const ft=z===!0?N(e.BYTES):z;P.push(Z("extraEntropy",ft))}const dt=K(...P),tt=Q;function zt(ft){const ht=O(ft);if(!l(ht))return;const Mt=f(ht),Bt=s.BASE.multiply(ht).toAffine(),at=c(Bt.x);if(at===G)return;const vt=c(Mt*c(tt+at*Y));if(vt===G)return;let St=(Bt.x===at?0:2)|Number(Bt.y&L),gt=vt;return R&&w(vt)&&(gt=B(vt),St^=1),new a(at,gt,St)}return{seed:dt,k2sig:zt}}const V={lowS:n.lowS,prehash:!1},T={lowS:n.lowS,prehash:!1};function U(m,x,E=V){const{seed:q,k2sig:N}=A(m,x,E),R=n;return Ee(R.hash.outputLen,R.nByteLength,R.hmac)(q,N)}s.BASE._setWindowSize(8);function j(m,x,E,q=T){var St;const N=m;x=Z("msgHash",x),E=Z("publicKey",E);const{lowS:R,prehash:M,format:z}=q;if(de(q),"strict"in q)throw new Error("options.strict was renamed to lowS");if(z!==void 0&&z!=="compact"&&z!=="der")throw new Error("format must be compact or der");const Q=typeof N=="string"||lt(N),Y=!Q&&!z&&typeof N=="object"&&N!==null&&typeof N.r=="bigint"&&typeof N.s=="bigint";if(!Q&&!Y)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let P,dt;try{if(Y&&(P=new a(N.r,N.s)),Q){try{z!=="compact"&&(P=a.fromDER(N))}catch(gt){if(!(gt instanceof F.Err))throw gt}!P&&z!=="der"&&(P=a.fromCompact(N))}dt=s.fromHex(E)}catch{return!1}if(!P||R&&P.hasHighS())return!1;M&&(x=n.hash(x));const{r:tt,s:zt}=P,ft=_(x),ht=f(zt),Mt=c(ft*ht),Bt=c(tt*ht),at=(St=s.BASE.multiplyAndAddUnsafe(dt,Mt,Bt))==null?void 0:St.toAffine();return at?c(at.x)===tt:!1}return{CURVE:n,getPublicKey:b,getSharedSecret:v,sign:U,verify:j,ProjectivePoint:s,Signature:a,utils:h}}function Sn(t,n){const e=t.ORDER;let r=G;for(let B=e-L;B%rt===G;B/=rt)r+=L;const o=r,i=rt<<o-L-L,c=i*rt,f=(e-L)/c,s=(f-L)/rt,u=c-L,g=i,l=t.pow(n,f),d=t.pow(n,(f+L)/rt);let w=(B,y)=>{let a=l,h=t.pow(y,u),b=t.sqr(h);b=t.mul(b,y);let p=t.mul(B,b);p=t.pow(p,s),p=t.mul(p,h),h=t.mul(p,y),b=t.mul(p,B);let v=t.mul(b,h);p=t.pow(v,g);let O=t.eql(p,t.ONE);h=t.mul(b,d),p=t.mul(v,a),b=t.cmov(h,b,O),v=t.cmov(p,v,O);for(let _=o;_>L;_--){let S=_-rt;S=rt<<S-L;let I=t.pow(v,S);const A=t.eql(I,t.ONE);h=t.mul(b,a),a=t.mul(a,a),I=t.mul(v,a),b=t.cmov(h,b,A),v=t.cmov(I,v,A)}return{isValid:O,value:b}};if(t.ORDER%he===Lt){const B=(t.ORDER-Lt)/he,y=t.sqrt(t.neg(n));w=(a,h)=>{let b=t.sqr(h);const p=t.mul(a,h);b=t.mul(b,p);let v=t.pow(b,B);v=t.mul(v,p);const O=t.mul(v,y),_=t.mul(t.sqr(v),h),S=t.eql(_,a);let I=t.cmov(O,v,S);return{isValid:S,value:I}}}return w}function An(t,n){if(Se(t),!t.isValid(n.A)||!t.isValid(n.B)||!t.isValid(n.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const e=Sn(t,n.Z);if(!t.isOdd)throw new Error("Fp.isOdd is not implemented!");return r=>{let o,i,c,f,s,u,g,l;o=t.sqr(r),o=t.mul(o,n.Z),i=t.sqr(o),i=t.add(i,o),c=t.add(i,t.ONE),c=t.mul(c,n.B),f=t.cmov(n.Z,t.neg(i),!t.eql(i,t.ZERO)),f=t.mul(f,n.A),i=t.sqr(c),u=t.sqr(f),s=t.mul(u,n.A),i=t.add(i,s),i=t.mul(i,c),u=t.mul(u,f),s=t.mul(u,n.B),i=t.add(i,s),g=t.mul(o,c);const{isValid:d,value:w}=e(i,u);l=t.mul(o,r),l=t.mul(l,w),g=t.cmov(g,c,d),l=t.cmov(l,w,d);const B=t.isOdd(r)===t.isOdd(l);return l=t.cmov(t.neg(l),l,B),g=t.div(g,f),{x:g,y:l}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function In(t){return{hash:t,hmac:(n,...e)=>ve(t,n,Pe(...e)),randomBytes:pe}}function _n(t,n){const e=r=>vn({...t,...In(r)});return{...e(n),create:e}}const qn=$;function ot(t,n){if(At(t),At(n),t<0||t>=1<<8*n)throw new Error("invalid I2OSP input: "+t);const e=Array.from({length:n}).fill(0);for(let r=n-1;r>=0;r--)e[r]=t&255,t>>>=8;return new Uint8Array(e)}function On(t,n){const e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t[r]^n[r];return e}function At(t){if(!Number.isSafeInteger(t))throw new Error("number expected")}function Nn(t,n,e,r){X(t),X(n),At(e),n.length>255&&(n=r(K(Vt("H2C-OVERSIZE-DST-"),n)));const{outputLen:o,blockLen:i}=r,c=Math.ceil(e/o);if(e>65535||c>255)throw new Error("expand_message_xmd: invalid lenInBytes");const f=K(n,ot(n.length,1)),s=ot(0,i),u=ot(e,2),g=new Array(c),l=r(K(s,t,u,ot(0,1),f));g[0]=r(K(l,ot(1,1),f));for(let w=1;w<=c;w++){const B=[On(l,g[w-1]),ot(w+1,1),f];g[w]=r(K(...B))}return K(...g).slice(0,e)}function Un(t,n,e,r,o){if(X(t),X(n),At(e),n.length>255){const i=Math.ceil(2*r/8);n=o.create({dkLen:i}).update(Vt("H2C-OVERSIZE-DST-")).update(n).digest()}if(e>65535||n.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return o.create({dkLen:e}).update(t).update(ot(e,2)).update(n).update(ot(n.length,1)).digest()}function ge(t,n,e){Et(e,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:r,k:o,m:i,hash:c,expand:f,DST:s}=e;X(t),At(n);const u=typeof s=="string"?Vt(s):s,g=r.toString(2).length,l=Math.ceil((g+o)/8),d=n*i*l;let w;if(f==="xmd")w=Nn(t,u,d,c);else if(f==="xof")w=Un(t,u,d,o,c);else if(f==="_internal_pass")w=t;else throw new Error('expand must be "xmd" or "xof"');const B=new Array(n);for(let y=0;y<n;y++){const a=new Array(i);for(let h=0;h<i;h++){const b=l*(h+y*i),p=w.subarray(b,b+l);a[h]=C(qn(p),r)}B[y]=a}return B}function Ln(t,n){const e=n.map(r=>Array.from(r).reverse());return(r,o)=>{const[i,c,f,s]=e.map(u=>u.reduce((g,l)=>t.add(t.mul(g,r),l)));return r=t.div(i,c),o=t.mul(o,t.div(f,s)),{x:r,y:o}}}function Tn(t,n,e){if(typeof n!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(r,o){const i=ge(r,2,{...e,DST:e.DST,...o}),c=t.fromAffine(n(i[0])),f=t.fromAffine(n(i[1])),s=c.add(f).clearCofactor();return s.assertValidity(),s},encodeToCurve(r,o){const i=ge(r,1,{...e,DST:e.encodeDST,...o}),c=t.fromAffine(n(i[0])).clearCofactor();return c.assertValidity(),c},mapToCurve(r){if(!Array.isArray(r))throw new Error("mapToCurve: expected array of bigints");for(const i of r)if(typeof i!="bigint")throw new Error("mapToCurve: expected array of bigints");const o=t.fromAffine(n(r)).clearCofactor();return o.assertValidity(),o}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const qt=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Tt=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),It=BigInt(1),Ht=BigInt(2),we=(t,n)=>(t+n/Ht)/n;function Le(t){const n=qt,e=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),c=BigInt(23),f=BigInt(44),s=BigInt(88),u=t*t*t%n,g=u*u*t%n,l=D(g,e,n)*g%n,d=D(l,e,n)*g%n,w=D(d,Ht,n)*u%n,B=D(w,o,n)*w%n,y=D(B,i,n)*B%n,a=D(y,f,n)*y%n,h=D(a,s,n)*a%n,b=D(h,f,n)*y%n,p=D(b,e,n)*g%n,v=D(p,c,n)*B%n,O=D(v,r,n)*u%n,_=D(O,Ht,n);if(!ct.eql(ct.sqr(_),t))throw new Error("Cannot find square root");return _}const ct=Ie(qt,void 0,void 0,{sqrt:Le}),Zt=_n({a:BigInt(0),b:BigInt(7),Fp:ct,n:Tt,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const n=Tt,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-It*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=e,c=BigInt("0x100000000000000000000000000000000"),f=we(i*t,n),s=we(-r*t,n);let u=C(t-f*e-s*o,n),g=C(-f*r-s*i,n);const l=u>c,d=g>c;if(l&&(u=n-u),d&&(g=n-g),u>c||g>c)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:l,k1:u,k2neg:d,k2:g}}}},Ut),Te=BigInt(0),be={};function Rt(t,...n){let e=be[t];if(e===void 0){const r=Ut(Uint8Array.from(t,o=>o.charCodeAt(0)));e=K(r,r),be[t]=e}return Ut(K(e,...n))}const ie=t=>t.toRawBytes(!0).slice(1),Ft=t=>st(t,32),$t=t=>C(t,qt),_t=t=>C(t,Tt),se=Zt.ProjectivePoint,Hn=(t,n,e)=>se.BASE.multiplyAndAddUnsafe(t,n,e);function te(t){let n=Zt.utils.normPrivateKeyToScalar(t),e=se.fromPrivateKey(n);return{scalar:e.hasEvenY()?n:_t(-n),bytes:ie(e)}}function He(t){it("x",t,It,qt);const n=$t(t*t),e=$t(n*t+BigInt(7));let r=Le(e);r%Ht!==Te&&(r=$t(-r));const o=new se(t,r,It);return o.assertValidity(),o}const bt=$;function Re(...t){return _t(bt(Rt("BIP0340/challenge",...t)))}function Rn(t){return te(t).bytes}function Cn(t,n,e=pe(32)){const r=Z("message",t),{bytes:o,scalar:i}=te(n),c=Z("auxRand",e,32),f=Ft(i^bt(Rt("BIP0340/aux",c))),s=Rt("BIP0340/nonce",f,o,r),u=_t(bt(s));if(u===Te)throw new Error("sign failed: k is zero");const{bytes:g,scalar:l}=te(u),d=Re(g,o,r),w=new Uint8Array(64);if(w.set(g,0),w.set(Ft(_t(l+d*i)),32),!Ce(w,r,o))throw new Error("sign: Invalid signature produced");return w}function Ce(t,n,e){const r=Z("signature",t,64),o=Z("message",n),i=Z("publicKey",e,32);try{const c=He(bt(i)),f=bt(r.subarray(0,32));if(!xt(f,It,qt))return!1;const s=bt(r.subarray(32,64));if(!xt(s,It,Tt))return!1;const u=Re(Ft(f),ie(c),o),g=Hn(c,s,_t(-u));return!(!g||!g.hasEvenY()||g.toAffine().x!==f)}catch{return!1}}const Pn=(()=>({getPublicKey:Rn,sign:Cn,verify:Ce,utils:{randomPrivateKey:Zt.utils.randomPrivateKey,lift_x:He,pointToBytes:ie,numberToBytesBE:st,bytesToNumberBE:$,taggedHash:Rt,mod:C}}))(),kn=(()=>Ln(ct,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(t=>t.map(n=>BigInt(n)))))(),Vn=(()=>An(ct,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:ct.create(BigInt("-11"))}))(),ke=(()=>Tn(Zt.ProjectivePoint,t=>{const{x:n,y:e}=Vn(ct.create(t[0]));return kn(n,e)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:ct.ORDER,m:1,k:128,expand:"xmd",hash:Ut}))(),jn=(()=>ke.hashToCurve)(),Kn=(()=>ke.encodeToCurve)();export{Kn as encodeToCurve,jn as hashToCurve,Pn as schnorr,Zt as secp256k1};
1
+ import{H as me,G as Pt,I as Nt,J as ye,K as Ve,L as Ze,N as W,P as ze,Q as Me,U as Pe,V as pe}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";function je(t,n,e,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(n,e,r);const o=BigInt(32),i=BigInt(4294967295),c=Number(e>>o&i),f=Number(e&i),s=r?4:0,u=r?0:4;t.setUint32(n+s,c,r),t.setUint32(n+u,f,r)}function Ke(t,n,e){return t&n^~t&e}function De(t,n,e){return t&n^t&e^n&e}class Ye extends me{constructor(n,e,r,o){super(),this.blockLen=n,this.outputLen=e,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(n),this.view=Pt(this.buffer)}update(n){Nt(this);const{view:e,buffer:r,blockLen:o}=this;n=ye(n);const i=n.length;for(let c=0;c<i;){const f=Math.min(o-this.pos,i-c);if(f===o){const s=Pt(n);for(;o<=i-c;c+=o)this.process(s,c);continue}r.set(n.subarray(c,c+f),this.pos),this.pos+=f,c+=f,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=n.length,this.roundClean(),this}digestInto(n){Nt(this),Ve(n,this),this.finished=!0;const{buffer:e,view:r,blockLen:o,isLE:i}=this;let{pos:c}=this;e[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>o-c&&(this.process(r,0),c=0);for(let l=c;l<o;l++)e[l]=0;je(r,o-8,BigInt(this.length*8),i),this.process(r,0);const f=Pt(n),s=this.outputLen;if(s%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=s/4,g=this.get();if(u>g.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<u;l++)f.setUint32(4*l,g[l],i)}digest(){const{buffer:n,outputLen:e}=this;this.digestInto(n);const r=n.slice(0,e);return this.destroy(),r}_cloneInto(n){n||(n=new this.constructor),n.set(...this.get());const{blockLen:e,buffer:r,length:o,finished:i,destroyed:c,pos:f}=this;return n.length=o,n.pos=f,n.finished=i,n.destroyed=c,o%e&&n.buffer.set(r),n}}const Ge=new Uint32Array([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]),et=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),nt=new Uint32Array(64);class We extends Ye{constructor(){super(64,32,8,!1),this.A=et[0]|0,this.B=et[1]|0,this.C=et[2]|0,this.D=et[3]|0,this.E=et[4]|0,this.F=et[5]|0,this.G=et[6]|0,this.H=et[7]|0}get(){const{A:n,B:e,C:r,D:o,E:i,F:c,G:f,H:s}=this;return[n,e,r,o,i,c,f,s]}set(n,e,r,o,i,c,f,s){this.A=n|0,this.B=e|0,this.C=r|0,this.D=o|0,this.E=i|0,this.F=c|0,this.G=f|0,this.H=s|0}process(n,e){for(let l=0;l<16;l++,e+=4)nt[l]=n.getUint32(e,!1);for(let l=16;l<64;l++){const d=nt[l-15],w=nt[l-2],B=W(d,7)^W(d,18)^d>>>3,y=W(w,17)^W(w,19)^w>>>10;nt[l]=y+nt[l-7]+B+nt[l-16]|0}let{A:r,B:o,C:i,D:c,E:f,F:s,G:u,H:g}=this;for(let l=0;l<64;l++){const d=W(f,6)^W(f,11)^W(f,25),w=g+d+Ke(f,s,u)+Ge[l]+nt[l]|0,y=(W(r,2)^W(r,13)^W(r,22))+De(r,o,i)|0;g=u,u=s,s=f,f=c+w|0,c=i,i=o,o=r,r=w+y|0}r=r+this.A|0,o=o+this.B|0,i=i+this.C|0,c=c+this.D|0,f=f+this.E|0,s=s+this.F|0,u=u+this.G|0,g=g+this.H|0,this.set(r,o,i,c,f,s,u,g)}roundClean(){nt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Ut=Ze(()=>new We);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ct=BigInt(0),kt=BigInt(1),$e=BigInt(2);function lt(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function X(t){if(!lt(t))throw new Error("Uint8Array expected")}function mt(t,n){if(typeof n!="boolean")throw new Error(t+" boolean expected, got "+n)}const Xe=Array.from({length:256},(t,n)=>n.toString(16).padStart(2,"0"));function yt(t){X(t);let n="";for(let e=0;e<t.length;e++)n+=Xe[t[e]];return n}function wt(t){const n=t.toString(16);return n.length&1?"0"+n:n}function ee(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?Ct:BigInt("0x"+t)}const J={_0:48,_9:57,A:65,F:70,a:97,f:102};function ce(t){if(t>=J._0&&t<=J._9)return t-J._0;if(t>=J.A&&t<=J.F)return t-(J.A-10);if(t>=J.a&&t<=J.f)return t-(J.a-10)}function pt(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const n=t.length,e=n/2;if(n%2)throw new Error("hex string expected, got unpadded hex of length "+n);const r=new Uint8Array(e);for(let o=0,i=0;o<e;o++,i+=2){const c=ce(t.charCodeAt(i)),f=ce(t.charCodeAt(i+1));if(c===void 0||f===void 0){const s=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+s+'" at index '+i)}r[o]=c*16+f}return r}function $(t){return ee(yt(t))}function ne(t){return X(t),ee(yt(Uint8Array.from(t).reverse()))}function st(t,n){return pt(t.toString(16).padStart(n*2,"0"))}function re(t,n){return st(t,n).reverse()}function Qe(t){return pt(wt(t))}function Z(t,n,e){let r;if(typeof n=="string")try{r=pt(n)}catch(i){throw new Error(t+" must be hex string or Uint8Array, cause: "+i)}else if(lt(n))r=Uint8Array.from(n);else throw new Error(t+" must be hex string or Uint8Array");const o=r.length;if(typeof e=="number"&&o!==e)throw new Error(t+" of length "+e+" expected, got "+o);return r}function K(...t){let n=0;for(let r=0;r<t.length;r++){const o=t[r];X(o),n+=o.length}const e=new Uint8Array(n);for(let r=0,o=0;r<t.length;r++){const i=t[r];e.set(i,o),o+=i.length}return e}function Je(t,n){if(t.length!==n.length)return!1;let e=0;for(let r=0;r<t.length;r++)e|=t[r]^n[r];return e===0}function Vt(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}const jt=t=>typeof t=="bigint"&&Ct<=t;function xt(t,n,e){return jt(t)&&jt(n)&&jt(e)&&n<=t&&t<e}function it(t,n,e,r){if(!xt(n,e,r))throw new Error("expected valid "+t+": "+e+" <= n < "+r+", got "+n)}function xe(t){let n;for(n=0;t>Ct;t>>=kt,n+=1);return n}function Fe(t,n){return t>>BigInt(n)&kt}function tn(t,n,e){return t|(e?kt:Ct)<<BigInt(n)}const oe=t=>($e<<BigInt(t-1))-kt,Kt=t=>new Uint8Array(t),fe=t=>Uint8Array.from(t);function Ee(t,n,e){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof n!="number"||n<2)throw new Error("qByteLen must be a number");if(typeof e!="function")throw new Error("hmacFn must be a function");let r=Kt(t),o=Kt(t),i=0;const c=()=>{r.fill(1),o.fill(0),i=0},f=(...l)=>e(o,r,...l),s=(l=Kt())=>{o=f(fe([0]),l),r=f(),l.length!==0&&(o=f(fe([1]),l),r=f())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let l=0;const d=[];for(;l<n;){r=f();const w=r.slice();d.push(w),l+=r.length}return K(...d)};return(l,d)=>{c(),s(l);let w;for(;!(w=d(u()));)s();return c(),w}}const en={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||lt(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,n)=>n.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Et(t,n,e={}){const r=(o,i,c)=>{const f=en[i];if(typeof f!="function")throw new Error("invalid validator function");const s=t[o];if(!(c&&s===void 0)&&!f(s,t))throw new Error("param "+String(o)+" is invalid. Expected "+i+", got "+s)};for(const[o,i]of Object.entries(n))r(o,i,!1);for(const[o,i]of Object.entries(e))r(o,i,!0);return t}const nn=()=>{throw new Error("not implemented")};function Xt(t){const n=new WeakMap;return(e,...r)=>{const o=n.get(e);if(o!==void 0)return o;const i=t(e,...r);return n.set(e,i),i}}const rn=Object.freeze(Object.defineProperty({__proto__:null,aInRange:it,abool:mt,abytes:X,bitGet:Fe,bitLen:xe,bitMask:oe,bitSet:tn,bytesToHex:yt,bytesToNumberBE:$,bytesToNumberLE:ne,concatBytes:K,createHmacDrbg:Ee,ensureBytes:Z,equalBytes:Je,hexToBytes:pt,hexToNumber:ee,inRange:xt,isBytes:lt,memoized:Xt,notImplemented:nn,numberToBytesBE:st,numberToBytesLE:re,numberToHexUnpadded:wt,numberToVarBytesBE:Qe,utf8ToBytes:Vt,validateObject:Et},Symbol.toStringTag,{value:"Module"}));class Be extends me{constructor(n,e){super(),this.finished=!1,this.destroyed=!1,ze(n);const r=ye(e);if(this.iHash=n.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,i=new Uint8Array(o);i.set(r.length>o?n.create().update(r).digest():r);for(let c=0;c<i.length;c++)i[c]^=54;this.iHash.update(i),this.oHash=n.create();for(let c=0;c<i.length;c++)i[c]^=106;this.oHash.update(i),i.fill(0)}update(n){return Nt(this),this.iHash.update(n),this}digestInto(n){Nt(this),Me(n,this.outputLen),this.finished=!0,this.iHash.digestInto(n),this.oHash.update(n),this.oHash.digestInto(n),this.destroy()}digest(){const n=new Uint8Array(this.oHash.outputLen);return this.digestInto(n),n}_cloneInto(n){n||(n=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:r,finished:o,destroyed:i,blockLen:c,outputLen:f}=this;return n=n,n.finished=o,n.destroyed=i,n.blockLen=c,n.outputLen=f,n.oHash=e._cloneInto(n.oHash),n.iHash=r._cloneInto(n.iHash),n}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const ve=(t,n,e)=>new Be(t,n).update(e).digest();ve.create=(t,n)=>new Be(t,n);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const k=BigInt(0),H=BigInt(1),ut=BigInt(2),on=BigInt(3),Qt=BigInt(4),ae=BigInt(5),ue=BigInt(8);function C(t,n){const e=t%n;return e>=k?e:n+e}function sn(t,n,e){if(n<k)throw new Error("invalid exponent, negatives unsupported");if(e<=k)throw new Error("invalid modulus");if(e===H)return k;let r=H;for(;n>k;)n&H&&(r=r*t%e),t=t*t%e,n>>=H;return r}function D(t,n,e){let r=t;for(;n-- >k;)r*=r,r%=e;return r}function Jt(t,n){if(t===k)throw new Error("invert: expected non-zero number");if(n<=k)throw new Error("invert: expected positive modulus, got "+n);let e=C(t,n),r=n,o=k,i=H;for(;e!==k;){const f=r/e,s=r%e,u=o-i*f;r=e,e=s,o=i,i=u}if(r!==H)throw new Error("invert: does not exist");return C(o,n)}function cn(t){const n=(t-H)/ut;let e,r,o;for(e=t-H,r=0;e%ut===k;e/=ut,r++);for(o=ut;o<t&&sn(o,n,t)!==t-H;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const c=(t+H)/Qt;return function(s,u){const g=s.pow(u,c);if(!s.eql(s.sqr(g),u))throw new Error("Cannot find square root");return g}}const i=(e+H)/ut;return function(f,s){if(f.pow(s,n)===f.neg(f.ONE))throw new Error("Cannot find square root");let u=r,g=f.pow(f.mul(f.ONE,o),e),l=f.pow(s,i),d=f.pow(s,e);for(;!f.eql(d,f.ONE);){if(f.eql(d,f.ZERO))return f.ZERO;let w=1;for(let y=f.sqr(d);w<u&&!f.eql(y,f.ONE);w++)y=f.sqr(y);const B=f.pow(g,H<<BigInt(u-w-1));g=f.sqr(B),l=f.mul(l,B),d=f.mul(d,g),u=w}return l}}function fn(t){if(t%Qt===on){const n=(t+H)/Qt;return function(r,o){const i=r.pow(o,n);if(!r.eql(r.sqr(i),o))throw new Error("Cannot find square root");return i}}if(t%ue===ae){const n=(t-ae)/ue;return function(r,o){const i=r.mul(o,ut),c=r.pow(i,n),f=r.mul(o,c),s=r.mul(r.mul(f,ut),c),u=r.mul(f,r.sub(s,r.ONE));if(!r.eql(r.sqr(u),o))throw new Error("Cannot find square root");return u}}return cn(t)}const an=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Se(t){const n={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},e=an.reduce((r,o)=>(r[o]="function",r),n);return Et(t,e)}function un(t,n,e){if(e<k)throw new Error("invalid exponent, negatives unsupported");if(e===k)return t.ONE;if(e===H)return n;let r=t.ONE,o=n;for(;e>k;)e&H&&(r=t.mul(r,o)),o=t.sqr(o),e>>=H;return r}function ln(t,n){const e=new Array(n.length),r=n.reduce((i,c,f)=>t.is0(c)?i:(e[f]=i,t.mul(i,c)),t.ONE),o=t.inv(r);return n.reduceRight((i,c,f)=>t.is0(c)?i:(e[f]=t.mul(i,e[f]),t.mul(i,c)),o),e}function Ae(t,n){const e=n!==void 0?n:t.toString(2).length,r=Math.ceil(e/8);return{nBitLength:e,nByteLength:r}}function Ie(t,n,e=!1,r={}){if(t<=k)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:o,nByteLength:i}=Ae(t,n);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const f=Object.freeze({ORDER:t,isLE:e,BITS:o,BYTES:i,MASK:oe(o),ZERO:k,ONE:H,create:s=>C(s,t),isValid:s=>{if(typeof s!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof s);return k<=s&&s<t},is0:s=>s===k,isOdd:s=>(s&H)===H,neg:s=>C(-s,t),eql:(s,u)=>s===u,sqr:s=>C(s*s,t),add:(s,u)=>C(s+u,t),sub:(s,u)=>C(s-u,t),mul:(s,u)=>C(s*u,t),pow:(s,u)=>un(f,s,u),div:(s,u)=>C(s*Jt(u,t),t),sqrN:s=>s*s,addN:(s,u)=>s+u,subN:(s,u)=>s-u,mulN:(s,u)=>s*u,inv:s=>Jt(s,t),sqrt:r.sqrt||(s=>(c||(c=fn(t)),c(f,s))),invertBatch:s=>ln(f,s),cmov:(s,u,g)=>g?u:s,toBytes:s=>e?re(s,i):st(s,i),fromBytes:s=>{if(s.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+s.length);return e?ne(s):$(s)}});return Object.freeze(f)}function _e(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const n=t.toString(2).length;return Math.ceil(n/8)}function qe(t){const n=_e(t);return n+Math.ceil(n/2)}function dn(t,n,e=!1){const r=t.length,o=_e(n),i=qe(n);if(r<16||r<i||r>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+r);const c=e?ne(t):$(t),f=C(c,n-H)+H;return e?re(f,o):st(f,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const le=BigInt(0),Ot=BigInt(1);function Dt(t,n){const e=n.negate();return t?e:n}function Oe(t,n){if(!Number.isSafeInteger(t)||t<=0||t>n)throw new Error("invalid window size, expected [1.."+n+"], got W="+t)}function Yt(t,n){Oe(t,n);const e=Math.ceil(n/t)+1,r=2**(t-1);return{windows:e,windowSize:r}}function hn(t,n){if(!Array.isArray(t))throw new Error("array expected");t.forEach((e,r)=>{if(!(e instanceof n))throw new Error("invalid point at index "+r)})}function gn(t,n){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((e,r)=>{if(!n.isValid(e))throw new Error("invalid scalar at index "+r)})}const Gt=new WeakMap,Ne=new WeakMap;function Wt(t){return Ne.get(t)||1}function wn(t,n){return{constTimeNegate:Dt,hasPrecomputes(e){return Wt(e)!==1},unsafeLadder(e,r,o=t.ZERO){let i=e;for(;r>le;)r&Ot&&(o=o.add(i)),i=i.double(),r>>=Ot;return o},precomputeWindow(e,r){const{windows:o,windowSize:i}=Yt(r,n),c=[];let f=e,s=f;for(let u=0;u<o;u++){s=f,c.push(s);for(let g=1;g<i;g++)s=s.add(f),c.push(s);f=s.double()}return c},wNAF(e,r,o){const{windows:i,windowSize:c}=Yt(e,n);let f=t.ZERO,s=t.BASE;const u=BigInt(2**e-1),g=2**e,l=BigInt(e);for(let d=0;d<i;d++){const w=d*c;let B=Number(o&u);o>>=l,B>c&&(B-=g,o+=Ot);const y=w,a=w+Math.abs(B)-1,h=d%2!==0,b=B<0;B===0?s=s.add(Dt(h,r[y])):f=f.add(Dt(b,r[a]))}return{p:f,f:s}},wNAFUnsafe(e,r,o,i=t.ZERO){const{windows:c,windowSize:f}=Yt(e,n),s=BigInt(2**e-1),u=2**e,g=BigInt(e);for(let l=0;l<c;l++){const d=l*f;if(o===le)break;let w=Number(o&s);if(o>>=g,w>f&&(w-=u,o+=Ot),w===0)continue;let B=r[d+Math.abs(w)-1];w<0&&(B=B.negate()),i=i.add(B)}return i},getPrecomputes(e,r,o){let i=Gt.get(r);return i||(i=this.precomputeWindow(r,e),e!==1&&Gt.set(r,o(i))),i},wNAFCached(e,r,o){const i=Wt(e);return this.wNAF(i,this.getPrecomputes(i,e,o),r)},wNAFCachedUnsafe(e,r,o,i){const c=Wt(e);return c===1?this.unsafeLadder(e,r,i):this.wNAFUnsafe(c,this.getPrecomputes(c,e,o),r,i)},setWindowSize(e,r){Oe(r,n),Ne.set(e,r),Gt.delete(e)}}}function bn(t,n,e,r){if(hn(e,t),gn(r,n),e.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const o=t.ZERO,i=xe(BigInt(e.length)),c=i>12?i-3:i>4?i-2:i?2:1,f=(1<<c)-1,s=new Array(f+1).fill(o),u=Math.floor((n.BITS-1)/c)*c;let g=o;for(let l=u;l>=0;l-=c){s.fill(o);for(let w=0;w<r.length;w++){const B=r[w],y=Number(B>>BigInt(l)&BigInt(f));s[y]=s[y].add(e[w])}let d=o;for(let w=s.length-1,B=o;w>0;w--)B=B.add(s[w]),d=d.add(B);if(g=g.add(d),l!==0)for(let w=0;w<c;w++)g=g.double()}return g}function Ue(t){return Se(t.Fp),Et(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ae(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function de(t){t.lowS!==void 0&&mt("lowS",t.lowS),t.prehash!==void 0&&mt("prehash",t.prehash)}function mn(t){const n=Ue(t);Et(n,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:e,Fp:r,a:o}=n;if(e){if(!r.eql(o,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...n})}const{bytesToNumberBE:yn,hexToBytes:pn}=rn;class xn extends Error{constructor(n=""){super(n)}}const F={Err:xn,_tlv:{encode:(t,n)=>{const{Err:e}=F;if(t<0||t>256)throw new e("tlv.encode: wrong tag");if(n.length&1)throw new e("tlv.encode: unpadded data");const r=n.length/2,o=wt(r);if(o.length/2&128)throw new e("tlv.encode: long form length too big");const i=r>127?wt(o.length/2|128):"";return wt(t)+i+o+n},decode(t,n){const{Err:e}=F;let r=0;if(t<0||t>256)throw new e("tlv.encode: wrong tag");if(n.length<2||n[r++]!==t)throw new e("tlv.decode: wrong tlv");const o=n[r++],i=!!(o&128);let c=0;if(!i)c=o;else{const s=o&127;if(!s)throw new e("tlv.decode(long): indefinite length not supported");if(s>4)throw new e("tlv.decode(long): byte length is too big");const u=n.subarray(r,r+s);if(u.length!==s)throw new e("tlv.decode: length bytes not complete");if(u[0]===0)throw new e("tlv.decode(long): zero leftmost byte");for(const g of u)c=c<<8|g;if(r+=s,c<128)throw new e("tlv.decode(long): not minimal encoding")}const f=n.subarray(r,r+c);if(f.length!==c)throw new e("tlv.decode: wrong value length");return{v:f,l:n.subarray(r+c)}}},_int:{encode(t){const{Err:n}=F;if(t<G)throw new n("integer: negative integers are not allowed");let e=wt(t);if(Number.parseInt(e[0],16)&8&&(e="00"+e),e.length&1)throw new n("unexpected DER parsing assertion: unpadded hex");return e},decode(t){const{Err:n}=F;if(t[0]&128)throw new n("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new n("invalid signature integer: unnecessary leading zero");return yn(t)}},toSig(t){const{Err:n,_int:e,_tlv:r}=F,o=typeof t=="string"?pn(t):t;X(o);const{v:i,l:c}=r.decode(48,o);if(c.length)throw new n("invalid signature: left bytes after parsing");const{v:f,l:s}=r.decode(2,i),{v:u,l:g}=r.decode(2,s);if(g.length)throw new n("invalid signature: left bytes after parsing");return{r:e.decode(f),s:e.decode(u)}},hexFromSig(t){const{_tlv:n,_int:e}=F,r=n.encode(2,e.encode(t.r)),o=n.encode(2,e.encode(t.s)),i=r+o;return n.encode(48,i)}},G=BigInt(0),L=BigInt(1),rt=BigInt(2),Lt=BigInt(3),he=BigInt(4);function En(t){const n=mn(t),{Fp:e}=n,r=Ie(n.n,n.nBitLength),o=n.toBytes||((y,a,h)=>{const b=a.toAffine();return K(Uint8Array.from([4]),e.toBytes(b.x),e.toBytes(b.y))}),i=n.fromBytes||(y=>{const a=y.subarray(1),h=e.fromBytes(a.subarray(0,e.BYTES)),b=e.fromBytes(a.subarray(e.BYTES,2*e.BYTES));return{x:h,y:b}});function c(y){const{a,b:h}=n,b=e.sqr(y),p=e.mul(b,y);return e.add(e.add(p,e.mul(y,a)),h)}if(!e.eql(e.sqr(n.Gy),c(n.Gx)))throw new Error("bad generator point: equation left != right");function f(y){return xt(y,L,n.n)}function s(y){const{allowedPrivateKeyLengths:a,nByteLength:h,wrapPrivateKey:b,n:p}=n;if(a&&typeof y!="bigint"){if(lt(y)&&(y=yt(y)),typeof y!="string"||!a.includes(y.length))throw new Error("invalid private key");y=y.padStart(h*2,"0")}let v;try{v=typeof y=="bigint"?y:$(Z("private key",y,h))}catch{throw new Error("invalid private key, expected hex or "+h+" bytes, got "+typeof y)}return b&&(v=C(v,p)),it("private key",v,L,p),v}function u(y){if(!(y instanceof d))throw new Error("ProjectivePoint expected")}const g=Xt((y,a)=>{const{px:h,py:b,pz:p}=y;if(e.eql(p,e.ONE))return{x:h,y:b};const v=y.is0();a==null&&(a=v?e.ONE:e.inv(p));const O=e.mul(h,a),_=e.mul(b,a),S=e.mul(p,a);if(v)return{x:e.ZERO,y:e.ZERO};if(!e.eql(S,e.ONE))throw new Error("invZ was invalid");return{x:O,y:_}}),l=Xt(y=>{if(y.is0()){if(n.allowInfinityPoint&&!e.is0(y.py))return;throw new Error("bad point: ZERO")}const{x:a,y:h}=y.toAffine();if(!e.isValid(a)||!e.isValid(h))throw new Error("bad point: x or y not FE");const b=e.sqr(h),p=c(a);if(!e.eql(b,p))throw new Error("bad point: equation left != right");if(!y.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class d{constructor(a,h,b){if(this.px=a,this.py=h,this.pz=b,a==null||!e.isValid(a))throw new Error("x required");if(h==null||!e.isValid(h))throw new Error("y required");if(b==null||!e.isValid(b))throw new Error("z required");Object.freeze(this)}static fromAffine(a){const{x:h,y:b}=a||{};if(!a||!e.isValid(h)||!e.isValid(b))throw new Error("invalid affine point");if(a instanceof d)throw new Error("projective point not allowed");const p=v=>e.eql(v,e.ZERO);return p(h)&&p(b)?d.ZERO:new d(h,b,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(a){const h=e.invertBatch(a.map(b=>b.pz));return a.map((b,p)=>b.toAffine(h[p])).map(d.fromAffine)}static fromHex(a){const h=d.fromAffine(i(Z("pointHex",a)));return h.assertValidity(),h}static fromPrivateKey(a){return d.BASE.multiply(s(a))}static msm(a,h){return bn(d,r,a,h)}_setWindowSize(a){B.setWindowSize(this,a)}assertValidity(){l(this)}hasEvenY(){const{y:a}=this.toAffine();if(e.isOdd)return!e.isOdd(a);throw new Error("Field doesn't support isOdd")}equals(a){u(a);const{px:h,py:b,pz:p}=this,{px:v,py:O,pz:_}=a,S=e.eql(e.mul(h,_),e.mul(v,p)),I=e.eql(e.mul(b,_),e.mul(O,p));return S&&I}negate(){return new d(this.px,e.neg(this.py),this.pz)}double(){const{a,b:h}=n,b=e.mul(h,Lt),{px:p,py:v,pz:O}=this;let _=e.ZERO,S=e.ZERO,I=e.ZERO,A=e.mul(p,p),V=e.mul(v,v),T=e.mul(O,O),U=e.mul(p,v);return U=e.add(U,U),I=e.mul(p,O),I=e.add(I,I),_=e.mul(a,I),S=e.mul(b,T),S=e.add(_,S),_=e.sub(V,S),S=e.add(V,S),S=e.mul(_,S),_=e.mul(U,_),I=e.mul(b,I),T=e.mul(a,T),U=e.sub(A,T),U=e.mul(a,U),U=e.add(U,I),I=e.add(A,A),A=e.add(I,A),A=e.add(A,T),A=e.mul(A,U),S=e.add(S,A),T=e.mul(v,O),T=e.add(T,T),A=e.mul(T,U),_=e.sub(_,A),I=e.mul(T,V),I=e.add(I,I),I=e.add(I,I),new d(_,S,I)}add(a){u(a);const{px:h,py:b,pz:p}=this,{px:v,py:O,pz:_}=a;let S=e.ZERO,I=e.ZERO,A=e.ZERO;const V=n.a,T=e.mul(n.b,Lt);let U=e.mul(h,v),j=e.mul(b,O),m=e.mul(p,_),x=e.add(h,b),E=e.add(v,O);x=e.mul(x,E),E=e.add(U,j),x=e.sub(x,E),E=e.add(h,p);let q=e.add(v,_);return E=e.mul(E,q),q=e.add(U,m),E=e.sub(E,q),q=e.add(b,p),S=e.add(O,_),q=e.mul(q,S),S=e.add(j,m),q=e.sub(q,S),A=e.mul(V,E),S=e.mul(T,m),A=e.add(S,A),S=e.sub(j,A),A=e.add(j,A),I=e.mul(S,A),j=e.add(U,U),j=e.add(j,U),m=e.mul(V,m),E=e.mul(T,E),j=e.add(j,m),m=e.sub(U,m),m=e.mul(V,m),E=e.add(E,m),U=e.mul(j,E),I=e.add(I,U),U=e.mul(q,E),S=e.mul(x,S),S=e.sub(S,U),U=e.mul(x,j),A=e.mul(q,A),A=e.add(A,U),new d(S,I,A)}subtract(a){return this.add(a.negate())}is0(){return this.equals(d.ZERO)}wNAF(a){return B.wNAFCached(this,a,d.normalizeZ)}multiplyUnsafe(a){const{endo:h,n:b}=n;it("scalar",a,G,b);const p=d.ZERO;if(a===G)return p;if(this.is0()||a===L)return this;if(!h||B.hasPrecomputes(this))return B.wNAFCachedUnsafe(this,a,d.normalizeZ);let{k1neg:v,k1:O,k2neg:_,k2:S}=h.splitScalar(a),I=p,A=p,V=this;for(;O>G||S>G;)O&L&&(I=I.add(V)),S&L&&(A=A.add(V)),V=V.double(),O>>=L,S>>=L;return v&&(I=I.negate()),_&&(A=A.negate()),A=new d(e.mul(A.px,h.beta),A.py,A.pz),I.add(A)}multiply(a){const{endo:h,n:b}=n;it("scalar",a,L,b);let p,v;if(h){const{k1neg:O,k1:_,k2neg:S,k2:I}=h.splitScalar(a);let{p:A,f:V}=this.wNAF(_),{p:T,f:U}=this.wNAF(I);A=B.constTimeNegate(O,A),T=B.constTimeNegate(S,T),T=new d(e.mul(T.px,h.beta),T.py,T.pz),p=A.add(T),v=V.add(U)}else{const{p:O,f:_}=this.wNAF(a);p=O,v=_}return d.normalizeZ([p,v])[0]}multiplyAndAddUnsafe(a,h,b){const p=d.BASE,v=(_,S)=>S===G||S===L||!_.equals(p)?_.multiplyUnsafe(S):_.multiply(S),O=v(this,h).add(v(a,b));return O.is0()?void 0:O}toAffine(a){return g(this,a)}isTorsionFree(){const{h:a,isTorsionFree:h}=n;if(a===L)return!0;if(h)return h(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:a,clearCofactor:h}=n;return a===L?this:h?h(d,this):this.multiplyUnsafe(n.h)}toRawBytes(a=!0){return mt("isCompressed",a),this.assertValidity(),o(d,this,a)}toHex(a=!0){return mt("isCompressed",a),yt(this.toRawBytes(a))}}d.BASE=new d(n.Gx,n.Gy,e.ONE),d.ZERO=new d(e.ZERO,e.ONE,e.ZERO);const w=n.nBitLength,B=wn(d,n.endo?Math.ceil(w/2):w);return{CURVE:n,ProjectivePoint:d,normPrivateKeyToScalar:s,weierstrassEquation:c,isWithinCurveOrder:f}}function Bn(t){const n=Ue(t);return Et(n,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...n})}function vn(t){const n=Bn(t),{Fp:e,n:r}=n,o=e.BYTES+1,i=2*e.BYTES+1;function c(m){return C(m,r)}function f(m){return Jt(m,r)}const{ProjectivePoint:s,normPrivateKeyToScalar:u,weierstrassEquation:g,isWithinCurveOrder:l}=En({...n,toBytes(m,x,E){const q=x.toAffine(),N=e.toBytes(q.x),R=K;return mt("isCompressed",E),E?R(Uint8Array.from([x.hasEvenY()?2:3]),N):R(Uint8Array.from([4]),N,e.toBytes(q.y))},fromBytes(m){const x=m.length,E=m[0],q=m.subarray(1);if(x===o&&(E===2||E===3)){const N=$(q);if(!xt(N,L,e.ORDER))throw new Error("Point is not on curve");const R=g(N);let M;try{M=e.sqrt(R)}catch(Y){const P=Y instanceof Error?": "+Y.message:"";throw new Error("Point is not on curve"+P)}const z=(M&L)===L;return(E&1)===1!==z&&(M=e.neg(M)),{x:N,y:M}}else if(x===i&&E===4){const N=e.fromBytes(q.subarray(0,e.BYTES)),R=e.fromBytes(q.subarray(e.BYTES,2*e.BYTES));return{x:N,y:R}}else{const N=o,R=i;throw new Error("invalid Point, expected length of "+N+", or uncompressed "+R+", got "+x)}}}),d=m=>yt(st(m,n.nByteLength));function w(m){const x=r>>L;return m>x}function B(m){return w(m)?c(-m):m}const y=(m,x,E)=>$(m.slice(x,E));class a{constructor(x,E,q){this.r=x,this.s=E,this.recovery=q,this.assertValidity()}static fromCompact(x){const E=n.nByteLength;return x=Z("compactSignature",x,E*2),new a(y(x,0,E),y(x,E,2*E))}static fromDER(x){const{r:E,s:q}=F.toSig(Z("DER",x));return new a(E,q)}assertValidity(){it("r",this.r,L,r),it("s",this.s,L,r)}addRecoveryBit(x){return new a(this.r,this.s,x)}recoverPublicKey(x){const{r:E,s:q,recovery:N}=this,R=_(Z("msgHash",x));if(N==null||![0,1,2,3].includes(N))throw new Error("recovery id invalid");const M=N===2||N===3?E+n.n:E;if(M>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");const z=N&1?"03":"02",Q=s.fromHex(z+d(M)),Y=f(M),P=c(-R*Y),dt=c(q*Y),tt=s.BASE.multiplyAndAddUnsafe(Q,P,dt);if(!tt)throw new Error("point at infinify");return tt.assertValidity(),tt}hasHighS(){return w(this.s)}normalizeS(){return this.hasHighS()?new a(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return pt(this.toDERHex())}toDERHex(){return F.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return pt(this.toCompactHex())}toCompactHex(){return d(this.r)+d(this.s)}}const h={isValidPrivateKey(m){try{return u(m),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const m=qe(n.n);return dn(n.randomBytes(m),n.n)},precompute(m=8,x=s.BASE){return x._setWindowSize(m),x.multiply(BigInt(3)),x}};function b(m,x=!0){return s.fromPrivateKey(m).toRawBytes(x)}function p(m){const x=lt(m),E=typeof m=="string",q=(x||E)&&m.length;return x?q===o||q===i:E?q===2*o||q===2*i:m instanceof s}function v(m,x,E=!0){if(p(m))throw new Error("first arg must be private key");if(!p(x))throw new Error("second arg must be public key");return s.fromHex(x).multiply(u(m)).toRawBytes(E)}const O=n.bits2int||function(m){if(m.length>8192)throw new Error("input is too large");const x=$(m),E=m.length*8-n.nBitLength;return E>0?x>>BigInt(E):x},_=n.bits2int_modN||function(m){return c(O(m))},S=oe(n.nBitLength);function I(m){return it("num < 2^"+n.nBitLength,m,G,S),st(m,n.nByteLength)}function A(m,x,E=V){if(["recovered","canonical"].some(ft=>ft in E))throw new Error("sign() legacy options not supported");const{hash:q,randomBytes:N}=n;let{lowS:R,prehash:M,extraEntropy:z}=E;R==null&&(R=!0),m=Z("msgHash",m),de(E),M&&(m=Z("prehashed msgHash",q(m)));const Q=_(m),Y=u(x),P=[I(Y),I(Q)];if(z!=null&&z!==!1){const ft=z===!0?N(e.BYTES):z;P.push(Z("extraEntropy",ft))}const dt=K(...P),tt=Q;function zt(ft){const ht=O(ft);if(!l(ht))return;const Mt=f(ht),Bt=s.BASE.multiply(ht).toAffine(),at=c(Bt.x);if(at===G)return;const vt=c(Mt*c(tt+at*Y));if(vt===G)return;let St=(Bt.x===at?0:2)|Number(Bt.y&L),gt=vt;return R&&w(vt)&&(gt=B(vt),St^=1),new a(at,gt,St)}return{seed:dt,k2sig:zt}}const V={lowS:n.lowS,prehash:!1},T={lowS:n.lowS,prehash:!1};function U(m,x,E=V){const{seed:q,k2sig:N}=A(m,x,E),R=n;return Ee(R.hash.outputLen,R.nByteLength,R.hmac)(q,N)}s.BASE._setWindowSize(8);function j(m,x,E,q=T){var St;const N=m;x=Z("msgHash",x),E=Z("publicKey",E);const{lowS:R,prehash:M,format:z}=q;if(de(q),"strict"in q)throw new Error("options.strict was renamed to lowS");if(z!==void 0&&z!=="compact"&&z!=="der")throw new Error("format must be compact or der");const Q=typeof N=="string"||lt(N),Y=!Q&&!z&&typeof N=="object"&&N!==null&&typeof N.r=="bigint"&&typeof N.s=="bigint";if(!Q&&!Y)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let P,dt;try{if(Y&&(P=new a(N.r,N.s)),Q){try{z!=="compact"&&(P=a.fromDER(N))}catch(gt){if(!(gt instanceof F.Err))throw gt}!P&&z!=="der"&&(P=a.fromCompact(N))}dt=s.fromHex(E)}catch{return!1}if(!P||R&&P.hasHighS())return!1;M&&(x=n.hash(x));const{r:tt,s:zt}=P,ft=_(x),ht=f(zt),Mt=c(ft*ht),Bt=c(tt*ht),at=(St=s.BASE.multiplyAndAddUnsafe(dt,Mt,Bt))==null?void 0:St.toAffine();return at?c(at.x)===tt:!1}return{CURVE:n,getPublicKey:b,getSharedSecret:v,sign:U,verify:j,ProjectivePoint:s,Signature:a,utils:h}}function Sn(t,n){const e=t.ORDER;let r=G;for(let B=e-L;B%rt===G;B/=rt)r+=L;const o=r,i=rt<<o-L-L,c=i*rt,f=(e-L)/c,s=(f-L)/rt,u=c-L,g=i,l=t.pow(n,f),d=t.pow(n,(f+L)/rt);let w=(B,y)=>{let a=l,h=t.pow(y,u),b=t.sqr(h);b=t.mul(b,y);let p=t.mul(B,b);p=t.pow(p,s),p=t.mul(p,h),h=t.mul(p,y),b=t.mul(p,B);let v=t.mul(b,h);p=t.pow(v,g);let O=t.eql(p,t.ONE);h=t.mul(b,d),p=t.mul(v,a),b=t.cmov(h,b,O),v=t.cmov(p,v,O);for(let _=o;_>L;_--){let S=_-rt;S=rt<<S-L;let I=t.pow(v,S);const A=t.eql(I,t.ONE);h=t.mul(b,a),a=t.mul(a,a),I=t.mul(v,a),b=t.cmov(h,b,A),v=t.cmov(I,v,A)}return{isValid:O,value:b}};if(t.ORDER%he===Lt){const B=(t.ORDER-Lt)/he,y=t.sqrt(t.neg(n));w=(a,h)=>{let b=t.sqr(h);const p=t.mul(a,h);b=t.mul(b,p);let v=t.pow(b,B);v=t.mul(v,p);const O=t.mul(v,y),_=t.mul(t.sqr(v),h),S=t.eql(_,a);let I=t.cmov(O,v,S);return{isValid:S,value:I}}}return w}function An(t,n){if(Se(t),!t.isValid(n.A)||!t.isValid(n.B)||!t.isValid(n.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const e=Sn(t,n.Z);if(!t.isOdd)throw new Error("Fp.isOdd is not implemented!");return r=>{let o,i,c,f,s,u,g,l;o=t.sqr(r),o=t.mul(o,n.Z),i=t.sqr(o),i=t.add(i,o),c=t.add(i,t.ONE),c=t.mul(c,n.B),f=t.cmov(n.Z,t.neg(i),!t.eql(i,t.ZERO)),f=t.mul(f,n.A),i=t.sqr(c),u=t.sqr(f),s=t.mul(u,n.A),i=t.add(i,s),i=t.mul(i,c),u=t.mul(u,f),s=t.mul(u,n.B),i=t.add(i,s),g=t.mul(o,c);const{isValid:d,value:w}=e(i,u);l=t.mul(o,r),l=t.mul(l,w),g=t.cmov(g,c,d),l=t.cmov(l,w,d);const B=t.isOdd(r)===t.isOdd(l);return l=t.cmov(t.neg(l),l,B),g=t.div(g,f),{x:g,y:l}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function In(t){return{hash:t,hmac:(n,...e)=>ve(t,n,Pe(...e)),randomBytes:pe}}function _n(t,n){const e=r=>vn({...t,...In(r)});return{...e(n),create:e}}const qn=$;function ot(t,n){if(At(t),At(n),t<0||t>=1<<8*n)throw new Error("invalid I2OSP input: "+t);const e=Array.from({length:n}).fill(0);for(let r=n-1;r>=0;r--)e[r]=t&255,t>>>=8;return new Uint8Array(e)}function On(t,n){const e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t[r]^n[r];return e}function At(t){if(!Number.isSafeInteger(t))throw new Error("number expected")}function Nn(t,n,e,r){X(t),X(n),At(e),n.length>255&&(n=r(K(Vt("H2C-OVERSIZE-DST-"),n)));const{outputLen:o,blockLen:i}=r,c=Math.ceil(e/o);if(e>65535||c>255)throw new Error("expand_message_xmd: invalid lenInBytes");const f=K(n,ot(n.length,1)),s=ot(0,i),u=ot(e,2),g=new Array(c),l=r(K(s,t,u,ot(0,1),f));g[0]=r(K(l,ot(1,1),f));for(let w=1;w<=c;w++){const B=[On(l,g[w-1]),ot(w+1,1),f];g[w]=r(K(...B))}return K(...g).slice(0,e)}function Un(t,n,e,r,o){if(X(t),X(n),At(e),n.length>255){const i=Math.ceil(2*r/8);n=o.create({dkLen:i}).update(Vt("H2C-OVERSIZE-DST-")).update(n).digest()}if(e>65535||n.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return o.create({dkLen:e}).update(t).update(ot(e,2)).update(n).update(ot(n.length,1)).digest()}function ge(t,n,e){Et(e,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:r,k:o,m:i,hash:c,expand:f,DST:s}=e;X(t),At(n);const u=typeof s=="string"?Vt(s):s,g=r.toString(2).length,l=Math.ceil((g+o)/8),d=n*i*l;let w;if(f==="xmd")w=Nn(t,u,d,c);else if(f==="xof")w=Un(t,u,d,o,c);else if(f==="_internal_pass")w=t;else throw new Error('expand must be "xmd" or "xof"');const B=new Array(n);for(let y=0;y<n;y++){const a=new Array(i);for(let h=0;h<i;h++){const b=l*(h+y*i),p=w.subarray(b,b+l);a[h]=C(qn(p),r)}B[y]=a}return B}function Ln(t,n){const e=n.map(r=>Array.from(r).reverse());return(r,o)=>{const[i,c,f,s]=e.map(u=>u.reduce((g,l)=>t.add(t.mul(g,r),l)));return r=t.div(i,c),o=t.mul(o,t.div(f,s)),{x:r,y:o}}}function Tn(t,n,e){if(typeof n!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(r,o){const i=ge(r,2,{...e,DST:e.DST,...o}),c=t.fromAffine(n(i[0])),f=t.fromAffine(n(i[1])),s=c.add(f).clearCofactor();return s.assertValidity(),s},encodeToCurve(r,o){const i=ge(r,1,{...e,DST:e.encodeDST,...o}),c=t.fromAffine(n(i[0])).clearCofactor();return c.assertValidity(),c},mapToCurve(r){if(!Array.isArray(r))throw new Error("mapToCurve: expected array of bigints");for(const i of r)if(typeof i!="bigint")throw new Error("mapToCurve: expected array of bigints");const o=t.fromAffine(n(r)).clearCofactor();return o.assertValidity(),o}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const qt=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Tt=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),It=BigInt(1),Ht=BigInt(2),we=(t,n)=>(t+n/Ht)/n;function Le(t){const n=qt,e=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),c=BigInt(23),f=BigInt(44),s=BigInt(88),u=t*t*t%n,g=u*u*t%n,l=D(g,e,n)*g%n,d=D(l,e,n)*g%n,w=D(d,Ht,n)*u%n,B=D(w,o,n)*w%n,y=D(B,i,n)*B%n,a=D(y,f,n)*y%n,h=D(a,s,n)*a%n,b=D(h,f,n)*y%n,p=D(b,e,n)*g%n,v=D(p,c,n)*B%n,O=D(v,r,n)*u%n,_=D(O,Ht,n);if(!ct.eql(ct.sqr(_),t))throw new Error("Cannot find square root");return _}const ct=Ie(qt,void 0,void 0,{sqrt:Le}),Zt=_n({a:BigInt(0),b:BigInt(7),Fp:ct,n:Tt,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const n=Tt,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-It*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=e,c=BigInt("0x100000000000000000000000000000000"),f=we(i*t,n),s=we(-r*t,n);let u=C(t-f*e-s*o,n),g=C(-f*r-s*i,n);const l=u>c,d=g>c;if(l&&(u=n-u),d&&(g=n-g),u>c||g>c)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:l,k1:u,k2neg:d,k2:g}}}},Ut),Te=BigInt(0),be={};function Rt(t,...n){let e=be[t];if(e===void 0){const r=Ut(Uint8Array.from(t,o=>o.charCodeAt(0)));e=K(r,r),be[t]=e}return Ut(K(e,...n))}const ie=t=>t.toRawBytes(!0).slice(1),Ft=t=>st(t,32),$t=t=>C(t,qt),_t=t=>C(t,Tt),se=Zt.ProjectivePoint,Hn=(t,n,e)=>se.BASE.multiplyAndAddUnsafe(t,n,e);function te(t){let n=Zt.utils.normPrivateKeyToScalar(t),e=se.fromPrivateKey(n);return{scalar:e.hasEvenY()?n:_t(-n),bytes:ie(e)}}function He(t){it("x",t,It,qt);const n=$t(t*t),e=$t(n*t+BigInt(7));let r=Le(e);r%Ht!==Te&&(r=$t(-r));const o=new se(t,r,It);return o.assertValidity(),o}const bt=$;function Re(...t){return _t(bt(Rt("BIP0340/challenge",...t)))}function Rn(t){return te(t).bytes}function Cn(t,n,e=pe(32)){const r=Z("message",t),{bytes:o,scalar:i}=te(n),c=Z("auxRand",e,32),f=Ft(i^bt(Rt("BIP0340/aux",c))),s=Rt("BIP0340/nonce",f,o,r),u=_t(bt(s));if(u===Te)throw new Error("sign failed: k is zero");const{bytes:g,scalar:l}=te(u),d=Re(g,o,r),w=new Uint8Array(64);if(w.set(g,0),w.set(Ft(_t(l+d*i)),32),!Ce(w,r,o))throw new Error("sign: Invalid signature produced");return w}function Ce(t,n,e){const r=Z("signature",t,64),o=Z("message",n),i=Z("publicKey",e,32);try{const c=He(bt(i)),f=bt(r.subarray(0,32));if(!xt(f,It,qt))return!1;const s=bt(r.subarray(32,64));if(!xt(s,It,Tt))return!1;const u=Re(Ft(f),ie(c),o),g=Hn(c,s,_t(-u));return!(!g||!g.hasEvenY()||g.toAffine().x!==f)}catch{return!1}}const Pn=(()=>({getPublicKey:Rn,sign:Cn,verify:Ce,utils:{randomPrivateKey:Zt.utils.randomPrivateKey,lift_x:He,pointToBytes:ie,numberToBytesBE:st,bytesToNumberBE:$,taggedHash:Rt,mod:C}}))(),kn=(()=>Ln(ct,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(t=>t.map(n=>BigInt(n)))))(),Vn=(()=>An(ct,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:ct.create(BigInt("-11"))}))(),ke=(()=>Tn(Zt.ProjectivePoint,t=>{const{x:n,y:e}=Vn(ct.create(t[0]));return kn(n,e)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:ct.ORDER,m:1,k:128,expand:"xmd",hash:Ut}))(),jn=(()=>ke.hashToCurve)(),Kn=(()=>ke.encodeToCurve)();export{Kn as encodeToCurve,jn as hashToCurve,Pn as schnorr,Zt as secp256k1};
@@ -1,4 +1,4 @@
1
- import{m as C}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const i=C`<svg fill="none" viewBox="0 0 21 20">
1
+ import{m as C}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const i=C`<svg fill="none" viewBox="0 0 21 20">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1,4 +1,4 @@
1
- import{m as l}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const e=l`<svg fill="none" viewBox="0 0 20 20">
1
+ import{m as l}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const e=l`<svg fill="none" viewBox="0 0 20 20">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1,4 +1,4 @@
1
- import{m as C}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const i=C`<svg width="10" height="10" viewBox="0 0 10 10">
1
+ import{m as C}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const i=C`<svg width="10" height="10" viewBox="0 0 10 10">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1,4 +1,4 @@
1
- import{m as C}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const l=C`<svg
1
+ import{m as C}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const l=C`<svg
2
2
  width="14"
3
3
  height="14"
4
4
  viewBox="0 0 14 14"
@@ -1,4 +1,4 @@
1
- import{m as C}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const e=C`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
1
+ import{m as C}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const e=C`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1,4 +1,4 @@
1
- import{m as l}from"./core-f5e3f11a.js";import"./index-23cd0f55.js";import"./index.es-d9174431.js";const r=l`<svg fill="none" viewBox="0 0 14 14">
1
+ import{m as l}from"./core-22337b12.js";import"./index-64c7df79.js";import"./index.es-b772857d.js";const r=l`<svg fill="none" viewBox="0 0 14 14">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"